commit 0cba7f5ee01472c2ebd603d86c7231a024ee0f9d Author: Forrest Date: Thu Oct 1 17:22:18 2026 -0400 init diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f28239b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,4 @@ +root = true + +[*] +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8ad74f7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Normalize EOL for all files that Git considers text files. +* text=auto eol=lf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..34655f3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Godot 4+ specific ignores +.godot/ +/android/ + +# Conformance traces are generated by tools/make_traces.sh. +/tests/traces/* +!/tests/traces/.gdignore diff --git a/assets/card.glb b/assets/card.glb new file mode 100644 index 0000000..225e171 Binary files /dev/null and b/assets/card.glb differ diff --git a/assets/card.glb.import b/assets/card.glb.import new file mode 100644 index 0000000..384d1f3 --- /dev/null +++ b/assets/card.glb.import @@ -0,0 +1,45 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://clev2vv7vrkql" +path="res://.godot/imported/card.glb-69784d7fc4830a6c6fb879d254ac9632.scn" + +[deps] + +source_file="res://assets/card.glb" +dest_files=["res://.godot/imported/card.glb-69784d7fc4830a6c6fb879d254ac9632.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/root_script=null +mesh_library/use_node_names_as_mesh_names=false +array_mesh/deduplicate_surfaces=true +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_name_suffixes=true +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +materials/extract=0 +materials/extract_format=0 +materials/extract_path="" +_subresources={} +gltf/naming_version=2 +gltf/embedded_image_handling=0 +gltf/texture_map_mode=1 diff --git a/assets/cards/additional-core.png b/assets/cards/additional-core.png new file mode 100644 index 0000000..07d111f Binary files /dev/null and b/assets/cards/additional-core.png differ diff --git a/assets/cards/additional-core.png.import b/assets/cards/additional-core.png.import new file mode 100644 index 0000000..2528b04 --- /dev/null +++ b/assets/cards/additional-core.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1dqj64mnd3yc" +path.bptc="res://.godot/imported/additional-core.png-b96bfc023396ba7ecd02ce39948642c8.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/additional-core.png" +dest_files=["res://.godot/imported/additional-core.png-b96bfc023396ba7ecd02ce39948642c8.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/backup-machine.png b/assets/cards/backup-machine.png new file mode 100644 index 0000000..c75e876 Binary files /dev/null and b/assets/cards/backup-machine.png differ diff --git a/assets/cards/backup-machine.png.import b/assets/cards/backup-machine.png.import new file mode 100644 index 0000000..700f648 --- /dev/null +++ b/assets/cards/backup-machine.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c545nqrpf12mr" +path.bptc="res://.godot/imported/backup-machine.png-042fc6f595c9d56608cd09dcab32259f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/backup-machine.png" +dest_files=["res://.godot/imported/backup-machine.png-042fc6f595c9d56608cd09dcab32259f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/backup-server.png b/assets/cards/backup-server.png new file mode 100644 index 0000000..7b133ce Binary files /dev/null and b/assets/cards/backup-server.png differ diff --git a/assets/cards/backup-server.png.import b/assets/cards/backup-server.png.import new file mode 100644 index 0000000..b32b2b2 --- /dev/null +++ b/assets/cards/backup-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://btryng0ntv3bw" +path.bptc="res://.godot/imported/backup-server.png-3516da3a573c34e6da5be8b9a1823208.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/backup-server.png" +dest_files=["res://.godot/imported/backup-server.png-3516da3a573c34e6da5be8b9a1823208.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/beta-version-1-0.png b/assets/cards/beta-version-1-0.png new file mode 100644 index 0000000..69cd012 Binary files /dev/null and b/assets/cards/beta-version-1-0.png differ diff --git a/assets/cards/beta-version-1-0.png.import b/assets/cards/beta-version-1-0.png.import new file mode 100644 index 0000000..5efbd20 --- /dev/null +++ b/assets/cards/beta-version-1-0.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ceoem5a7q6405" +path.bptc="res://.godot/imported/beta-version-1-0.png-2fa600648fac13222ea3def5c6953ee1.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/beta-version-1-0.png" +dest_files=["res://.godot/imported/beta-version-1-0.png-2fa600648fac13222ea3def5c6953ee1.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/bit-rot.png b/assets/cards/bit-rot.png new file mode 100644 index 0000000..69a87c6 Binary files /dev/null and b/assets/cards/bit-rot.png differ diff --git a/assets/cards/bit-rot.png.import b/assets/cards/bit-rot.png.import new file mode 100644 index 0000000..fcea957 --- /dev/null +++ b/assets/cards/bit-rot.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c7s8niu38oyxj" +path.bptc="res://.godot/imported/bit-rot.png-5c5c34b999fd5b5816ebf01e16b35507.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/bit-rot.png" +dest_files=["res://.godot/imported/bit-rot.png-5c5c34b999fd5b5816ebf01e16b35507.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/bloatware.png b/assets/cards/bloatware.png new file mode 100644 index 0000000..eba43f2 Binary files /dev/null and b/assets/cards/bloatware.png differ diff --git a/assets/cards/bloatware.png.import b/assets/cards/bloatware.png.import new file mode 100644 index 0000000..85d1c67 --- /dev/null +++ b/assets/cards/bloatware.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bgjdxsedbcu1m" +path.bptc="res://.godot/imported/bloatware.png-9ba85b13acf62b6fb5f79147563e0724.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/bloatware.png" +dest_files=["res://.godot/imported/bloatware.png-9ba85b13acf62b6fb5f79147563e0724.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/botnet.png b/assets/cards/botnet.png new file mode 100644 index 0000000..3647f9c Binary files /dev/null and b/assets/cards/botnet.png differ diff --git a/assets/cards/botnet.png.import b/assets/cards/botnet.png.import new file mode 100644 index 0000000..ac65cb1 --- /dev/null +++ b/assets/cards/botnet.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d2nh6ggwttpt0" +path.bptc="res://.godot/imported/botnet.png-0593bbcef6e6606531be691d46ce2ced.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/botnet.png" +dest_files=["res://.godot/imported/botnet.png-0593bbcef6e6606531be691d46ce2ced.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/broken-bits.png b/assets/cards/broken-bits.png new file mode 100644 index 0000000..d12a0b1 Binary files /dev/null and b/assets/cards/broken-bits.png differ diff --git a/assets/cards/broken-bits.png.import b/assets/cards/broken-bits.png.import new file mode 100644 index 0000000..dbfdcc3 --- /dev/null +++ b/assets/cards/broken-bits.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ci8dfr0yioi8r" +path.bptc="res://.godot/imported/broken-bits.png-2625db1970e8d0470d82e0f830aa7e13.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/broken-bits.png" +dest_files=["res://.godot/imported/broken-bits.png-2625db1970e8d0470d82e0f830aa7e13.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/bug-injector.png b/assets/cards/bug-injector.png new file mode 100644 index 0000000..b52def9 Binary files /dev/null and b/assets/cards/bug-injector.png differ diff --git a/assets/cards/bug-injector.png.import b/assets/cards/bug-injector.png.import new file mode 100644 index 0000000..bae7196 --- /dev/null +++ b/assets/cards/bug-injector.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://8gvfphkbtl41" +path.bptc="res://.godot/imported/bug-injector.png-811f8d0099c2c0f447a5f87ede453441.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/bug-injector.png" +dest_files=["res://.godot/imported/bug-injector.png-811f8d0099c2c0f447a5f87ede453441.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/cache-server.png b/assets/cards/cache-server.png new file mode 100644 index 0000000..71d7716 Binary files /dev/null and b/assets/cards/cache-server.png differ diff --git a/assets/cards/cache-server.png.import b/assets/cards/cache-server.png.import new file mode 100644 index 0000000..003b3e1 --- /dev/null +++ b/assets/cards/cache-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6nqnmdn5dhs1" +path.bptc="res://.godot/imported/cache-server.png-86a8b410eda86f3555ac8626b7f04dfd.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/cache-server.png" +dest_files=["res://.godot/imported/cache-server.png-86a8b410eda86f3555ac8626b7f04dfd.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/callable-server.png b/assets/cards/callable-server.png new file mode 100644 index 0000000..6cf9df7 Binary files /dev/null and b/assets/cards/callable-server.png differ diff --git a/assets/cards/callable-server.png.import b/assets/cards/callable-server.png.import new file mode 100644 index 0000000..211832b --- /dev/null +++ b/assets/cards/callable-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c3ao3k51u3obn" +path.bptc="res://.godot/imported/callable-server.png-cf76dc70d431cc7a2a140be1fc7cbf04.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/callable-server.png" +dest_files=["res://.godot/imported/callable-server.png-cf76dc70d431cc7a2a140be1fc7cbf04.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/carbon-nanobots.png b/assets/cards/carbon-nanobots.png new file mode 100644 index 0000000..c85059e Binary files /dev/null and b/assets/cards/carbon-nanobots.png differ diff --git a/assets/cards/carbon-nanobots.png.import b/assets/cards/carbon-nanobots.png.import new file mode 100644 index 0000000..a5d8282 --- /dev/null +++ b/assets/cards/carbon-nanobots.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cltorspfmxj73" +path.bptc="res://.godot/imported/carbon-nanobots.png-558a317b9097bbf305c2be6872fd161f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/carbon-nanobots.png" +dest_files=["res://.godot/imported/carbon-nanobots.png-558a317b9097bbf305c2be6872fd161f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/card-back.png b/assets/cards/card-back.png new file mode 100644 index 0000000..fae2ea9 Binary files /dev/null and b/assets/cards/card-back.png differ diff --git a/assets/cards/card-back.png.import b/assets/cards/card-back.png.import new file mode 100644 index 0000000..d9f4eff --- /dev/null +++ b/assets/cards/card-back.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ba71hnwp0y4sh" +path.bptc="res://.godot/imported/card-back.png-f02cd42a17df5338829f2e41fc5227db.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/card-back.png" +dest_files=["res://.godot/imported/card-back.png-f02cd42a17df5338829f2e41fc5227db.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/checksum.png b/assets/cards/checksum.png new file mode 100644 index 0000000..5c542c0 Binary files /dev/null and b/assets/cards/checksum.png differ diff --git a/assets/cards/checksum.png.import b/assets/cards/checksum.png.import new file mode 100644 index 0000000..5ca8602 --- /dev/null +++ b/assets/cards/checksum.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://buydm4or6iwvb" +path.bptc="res://.godot/imported/checksum.png-f773db0d2a5ed60467b45eafa17b3b95.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/checksum.png" +dest_files=["res://.godot/imported/checksum.png-f773db0d2a5ed60467b45eafa17b3b95.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/cloud-compute.png b/assets/cards/cloud-compute.png new file mode 100644 index 0000000..719f203 Binary files /dev/null and b/assets/cards/cloud-compute.png differ diff --git a/assets/cards/cloud-compute.png.import b/assets/cards/cloud-compute.png.import new file mode 100644 index 0000000..36aba5a --- /dev/null +++ b/assets/cards/cloud-compute.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0i5ca3vpgnbq" +path.bptc="res://.godot/imported/cloud-compute.png-4d44d31645e321b1dc37db8eff912dee.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/cloud-compute.png" +dest_files=["res://.godot/imported/cloud-compute.png-4d44d31645e321b1dc37db8eff912dee.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/cluster-server.png b/assets/cards/cluster-server.png new file mode 100644 index 0000000..8003bb9 Binary files /dev/null and b/assets/cards/cluster-server.png differ diff --git a/assets/cards/cluster-server.png.import b/assets/cards/cluster-server.png.import new file mode 100644 index 0000000..3a8fbba --- /dev/null +++ b/assets/cards/cluster-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://5sdiooye7yy2" +path.bptc="res://.godot/imported/cluster-server.png-def756069e45c162132de8162f7ff150.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/cluster-server.png" +dest_files=["res://.godot/imported/cluster-server.png-def756069e45c162132de8162f7ff150.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/code-zero.png b/assets/cards/code-zero.png new file mode 100644 index 0000000..55f4a8e Binary files /dev/null and b/assets/cards/code-zero.png differ diff --git a/assets/cards/code-zero.png.import b/assets/cards/code-zero.png.import new file mode 100644 index 0000000..235ea9a --- /dev/null +++ b/assets/cards/code-zero.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://5hopxnaov0v4" +path.bptc="res://.godot/imported/code-zero.png-5b1fa73355089b5929c3b80ce52dc5a3.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/code-zero.png" +dest_files=["res://.godot/imported/code-zero.png-5b1fa73355089b5929c3b80ce52dc5a3.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/compatibility-layer.png b/assets/cards/compatibility-layer.png new file mode 100644 index 0000000..11c26a2 Binary files /dev/null and b/assets/cards/compatibility-layer.png differ diff --git a/assets/cards/compatibility-layer.png.import b/assets/cards/compatibility-layer.png.import new file mode 100644 index 0000000..0f192bd --- /dev/null +++ b/assets/cards/compatibility-layer.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b17nq2ha411lb" +path.bptc="res://.godot/imported/compatibility-layer.png-51d481638bca285747f3a65aca9ea0fa.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/compatibility-layer.png" +dest_files=["res://.godot/imported/compatibility-layer.png-51d481638bca285747f3a65aca9ea0fa.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/cooling-system.png b/assets/cards/cooling-system.png new file mode 100644 index 0000000..9d2e2c0 Binary files /dev/null and b/assets/cards/cooling-system.png differ diff --git a/assets/cards/cooling-system.png.import b/assets/cards/cooling-system.png.import new file mode 100644 index 0000000..1382f85 --- /dev/null +++ b/assets/cards/cooling-system.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpfy8ba75w2gg" +path.bptc="res://.godot/imported/cooling-system.png-979848a2cb580438966cd1bab92d5f68.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/cooling-system.png" +dest_files=["res://.godot/imported/cooling-system.png-979848a2cb580438966cd1bab92d5f68.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/corrupt-driver.png b/assets/cards/corrupt-driver.png new file mode 100644 index 0000000..64b99e7 Binary files /dev/null and b/assets/cards/corrupt-driver.png differ diff --git a/assets/cards/corrupt-driver.png.import b/assets/cards/corrupt-driver.png.import new file mode 100644 index 0000000..0e8cf54 --- /dev/null +++ b/assets/cards/corrupt-driver.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://biprleuuprcjn" +path.bptc="res://.godot/imported/corrupt-driver.png-c9ab1039ddc425cf78fd97b6d4c5d445.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/corrupt-driver.png" +dest_files=["res://.godot/imported/corrupt-driver.png-c9ab1039ddc425cf78fd97b6d4c5d445.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/data-leaker.png b/assets/cards/data-leaker.png new file mode 100644 index 0000000..0e5ea5d Binary files /dev/null and b/assets/cards/data-leaker.png differ diff --git a/assets/cards/data-leaker.png.import b/assets/cards/data-leaker.png.import new file mode 100644 index 0000000..9e06ef3 --- /dev/null +++ b/assets/cards/data-leaker.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cm6e831thsep4" +path.bptc="res://.godot/imported/data-leaker.png-527c239ec008779c225b412c3d567a5f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/data-leaker.png" +dest_files=["res://.godot/imported/data-leaker.png-527c239ec008779c225b412c3d567a5f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/dead-pixel.png b/assets/cards/dead-pixel.png new file mode 100644 index 0000000..1e84ff6 Binary files /dev/null and b/assets/cards/dead-pixel.png differ diff --git a/assets/cards/dead-pixel.png.import b/assets/cards/dead-pixel.png.import new file mode 100644 index 0000000..d49f815 --- /dev/null +++ b/assets/cards/dead-pixel.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bbigdmgb1qlf6" +path.bptc="res://.godot/imported/dead-pixel.png-2856eff6705bd4dbe00bbb20e45b04b2.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/dead-pixel.png" +dest_files=["res://.godot/imported/dead-pixel.png-2856eff6705bd4dbe00bbb20e45b04b2.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/dedicated-gpu.png b/assets/cards/dedicated-gpu.png new file mode 100644 index 0000000..aeb52a8 Binary files /dev/null and b/assets/cards/dedicated-gpu.png differ diff --git a/assets/cards/dedicated-gpu.png.import b/assets/cards/dedicated-gpu.png.import new file mode 100644 index 0000000..8c65b6e --- /dev/null +++ b/assets/cards/dedicated-gpu.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bp5hofo18s38r" +path.bptc="res://.godot/imported/dedicated-gpu.png-ffb90afa0cfff66aa1d3131564c083db.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/dedicated-gpu.png" +dest_files=["res://.godot/imported/dedicated-gpu.png-ffb90afa0cfff66aa1d3131564c083db.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/desynchronization.png b/assets/cards/desynchronization.png new file mode 100644 index 0000000..7c50367 Binary files /dev/null and b/assets/cards/desynchronization.png differ diff --git a/assets/cards/desynchronization.png.import b/assets/cards/desynchronization.png.import new file mode 100644 index 0000000..87133b0 --- /dev/null +++ b/assets/cards/desynchronization.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5lxj3mlpxorc" +path.bptc="res://.godot/imported/desynchronization.png-533b8ff45c7c553e95147c851b1fa2cb.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/desynchronization.png" +dest_files=["res://.godot/imported/desynchronization.png-533b8ff45c7c553e95147c851b1fa2cb.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/diagnostic-module.png b/assets/cards/diagnostic-module.png new file mode 100644 index 0000000..92ac8f4 Binary files /dev/null and b/assets/cards/diagnostic-module.png differ diff --git a/assets/cards/diagnostic-module.png.import b/assets/cards/diagnostic-module.png.import new file mode 100644 index 0000000..4a91ac6 --- /dev/null +++ b/assets/cards/diagnostic-module.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://resfkmr0jsm8" +path.bptc="res://.godot/imported/diagnostic-module.png-6c792592987efe3a7cbb063c795afb0e.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/diagnostic-module.png" +dest_files=["res://.godot/imported/diagnostic-module.png-6c792592987efe3a7cbb063c795afb0e.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/drive-by-download.png b/assets/cards/drive-by-download.png new file mode 100644 index 0000000..7527ccd Binary files /dev/null and b/assets/cards/drive-by-download.png differ diff --git a/assets/cards/drive-by-download.png.import b/assets/cards/drive-by-download.png.import new file mode 100644 index 0000000..27d950b --- /dev/null +++ b/assets/cards/drive-by-download.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bi6ueqfkyno4p" +path.bptc="res://.godot/imported/drive-by-download.png-890064cd305485c394fcfcabc870deb2.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/drive-by-download.png" +dest_files=["res://.godot/imported/drive-by-download.png-890064cd305485c394fcfcabc870deb2.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/duplicate-server.png b/assets/cards/duplicate-server.png new file mode 100644 index 0000000..5a13c31 Binary files /dev/null and b/assets/cards/duplicate-server.png differ diff --git a/assets/cards/duplicate-server.png.import b/assets/cards/duplicate-server.png.import new file mode 100644 index 0000000..ff92f7a --- /dev/null +++ b/assets/cards/duplicate-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1d83v7jb1whg" +path.bptc="res://.godot/imported/duplicate-server.png-b691fb898b33a45c9aef31e27ff7ade5.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/duplicate-server.png" +dest_files=["res://.godot/imported/duplicate-server.png-b691fb898b33a45c9aef31e27ff7ade5.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/ecc-memory.png b/assets/cards/ecc-memory.png new file mode 100644 index 0000000..aba28da Binary files /dev/null and b/assets/cards/ecc-memory.png differ diff --git a/assets/cards/ecc-memory.png.import b/assets/cards/ecc-memory.png.import new file mode 100644 index 0000000..b0c9ff5 --- /dev/null +++ b/assets/cards/ecc-memory.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://0q2oavskoplt" +path.bptc="res://.godot/imported/ecc-memory.png-3a79e1b820a236311809ec6fc5658ee4.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/ecc-memory.png" +dest_files=["res://.godot/imported/ecc-memory.png-3a79e1b820a236311809ec6fc5658ee4.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/error-correction.png b/assets/cards/error-correction.png new file mode 100644 index 0000000..6d70382 Binary files /dev/null and b/assets/cards/error-correction.png differ diff --git a/assets/cards/error-correction.png.import b/assets/cards/error-correction.png.import new file mode 100644 index 0000000..b37ec4f --- /dev/null +++ b/assets/cards/error-correction.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bap3ur6iook3g" +path.bptc="res://.godot/imported/error-correction.png-39df5eb3d56bb92d986159cc8241dcb8.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/error-correction.png" +dest_files=["res://.godot/imported/error-correction.png-39df5eb3d56bb92d986159cc8241dcb8.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-data-siphon.png b/assets/cards/execute-data-siphon.png new file mode 100644 index 0000000..587c84a Binary files /dev/null and b/assets/cards/execute-data-siphon.png differ diff --git a/assets/cards/execute-data-siphon.png.import b/assets/cards/execute-data-siphon.png.import new file mode 100644 index 0000000..a3a960c --- /dev/null +++ b/assets/cards/execute-data-siphon.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://u4imm7ka5ef3" +path.bptc="res://.godot/imported/execute-data-siphon.png-08dc2ccc66c60041786fa0316d712924.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-data-siphon.png" +dest_files=["res://.godot/imported/execute-data-siphon.png-08dc2ccc66c60041786fa0316d712924.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-defragment.png b/assets/cards/execute-defragment.png new file mode 100644 index 0000000..f188652 Binary files /dev/null and b/assets/cards/execute-defragment.png differ diff --git a/assets/cards/execute-defragment.png.import b/assets/cards/execute-defragment.png.import new file mode 100644 index 0000000..baf55bd --- /dev/null +++ b/assets/cards/execute-defragment.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b5tas22u2cvq6" +path.bptc="res://.godot/imported/execute-defragment.png-36c22d88e8606cfa7894061249d07270.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-defragment.png" +dest_files=["res://.godot/imported/execute-defragment.png-36c22d88e8606cfa7894061249d07270.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-disconnect.png b/assets/cards/execute-disconnect.png new file mode 100644 index 0000000..4e1869c Binary files /dev/null and b/assets/cards/execute-disconnect.png differ diff --git a/assets/cards/execute-disconnect.png.import b/assets/cards/execute-disconnect.png.import new file mode 100644 index 0000000..bf248bc --- /dev/null +++ b/assets/cards/execute-disconnect.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bu61k8lgfcjk7" +path.bptc="res://.godot/imported/execute-disconnect.png-5d1aec03826ba59adba3d8c10c19ab05.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-disconnect.png" +dest_files=["res://.godot/imported/execute-disconnect.png-5d1aec03826ba59adba3d8c10c19ab05.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-emergency-shutdown.png b/assets/cards/execute-emergency-shutdown.png new file mode 100644 index 0000000..dc5e858 Binary files /dev/null and b/assets/cards/execute-emergency-shutdown.png differ diff --git a/assets/cards/execute-emergency-shutdown.png.import b/assets/cards/execute-emergency-shutdown.png.import new file mode 100644 index 0000000..98d6ddd --- /dev/null +++ b/assets/cards/execute-emergency-shutdown.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjislfj6q4k3i" +path.bptc="res://.godot/imported/execute-emergency-shutdown.png-7ae8aa549b02671a5fbc64b77eab4f1c.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-emergency-shutdown.png" +dest_files=["res://.godot/imported/execute-emergency-shutdown.png-7ae8aa549b02671a5fbc64b77eab4f1c.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-force-reboot.png b/assets/cards/execute-force-reboot.png new file mode 100644 index 0000000..f787555 Binary files /dev/null and b/assets/cards/execute-force-reboot.png differ diff --git a/assets/cards/execute-force-reboot.png.import b/assets/cards/execute-force-reboot.png.import new file mode 100644 index 0000000..528190b --- /dev/null +++ b/assets/cards/execute-force-reboot.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c641v0c014g4m" +path.bptc="res://.godot/imported/execute-force-reboot.png-8f596627e2778d95572bd2ce55520f6b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-force-reboot.png" +dest_files=["res://.godot/imported/execute-force-reboot.png-8f596627e2778d95572bd2ce55520f6b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-fork.png b/assets/cards/execute-fork.png new file mode 100644 index 0000000..5c1f192 Binary files /dev/null and b/assets/cards/execute-fork.png differ diff --git a/assets/cards/execute-fork.png.import b/assets/cards/execute-fork.png.import new file mode 100644 index 0000000..8543fc7 --- /dev/null +++ b/assets/cards/execute-fork.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dt008oj81fj4l" +path.bptc="res://.godot/imported/execute-fork.png-a99c6265de1b1705c2643d6ebd50c2cd.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-fork.png" +dest_files=["res://.godot/imported/execute-fork.png-a99c6265de1b1705c2643d6ebd50c2cd.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-fuzz.png b/assets/cards/execute-fuzz.png new file mode 100644 index 0000000..63cee05 Binary files /dev/null and b/assets/cards/execute-fuzz.png differ diff --git a/assets/cards/execute-fuzz.png.import b/assets/cards/execute-fuzz.png.import new file mode 100644 index 0000000..afe3e8d --- /dev/null +++ b/assets/cards/execute-fuzz.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bsvpmfsi3h43q" +path.bptc="res://.godot/imported/execute-fuzz.png-553b679bfaadd513137fa14983e6650f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-fuzz.png" +dest_files=["res://.godot/imported/execute-fuzz.png-553b679bfaadd513137fa14983e6650f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-hard-reset.png b/assets/cards/execute-hard-reset.png new file mode 100644 index 0000000..4e98123 Binary files /dev/null and b/assets/cards/execute-hard-reset.png differ diff --git a/assets/cards/execute-hard-reset.png.import b/assets/cards/execute-hard-reset.png.import new file mode 100644 index 0000000..6110112 --- /dev/null +++ b/assets/cards/execute-hard-reset.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://8h2udi5xcc2f" +path.bptc="res://.godot/imported/execute-hard-reset.png-0bba63d6905ae7857bd660cf2780a4e1.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-hard-reset.png" +dest_files=["res://.godot/imported/execute-hard-reset.png-0bba63d6905ae7857bd660cf2780a4e1.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-kill-process.png b/assets/cards/execute-kill-process.png new file mode 100644 index 0000000..f6b4f8c Binary files /dev/null and b/assets/cards/execute-kill-process.png differ diff --git a/assets/cards/execute-kill-process.png.import b/assets/cards/execute-kill-process.png.import new file mode 100644 index 0000000..7a4a496 --- /dev/null +++ b/assets/cards/execute-kill-process.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://o7fbu5u15x8n" +path.bptc="res://.godot/imported/execute-kill-process.png-6508dfee2aae05fc8445f754cff8740d.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-kill-process.png" +dest_files=["res://.godot/imported/execute-kill-process.png-6508dfee2aae05fc8445f754cff8740d.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-lag-spike.png b/assets/cards/execute-lag-spike.png new file mode 100644 index 0000000..9f1416f Binary files /dev/null and b/assets/cards/execute-lag-spike.png differ diff --git a/assets/cards/execute-lag-spike.png.import b/assets/cards/execute-lag-spike.png.import new file mode 100644 index 0000000..d940f12 --- /dev/null +++ b/assets/cards/execute-lag-spike.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1g8kihx8lqnq" +path.bptc="res://.godot/imported/execute-lag-spike.png-376619535e340c791f8d2f680593d2bb.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-lag-spike.png" +dest_files=["res://.godot/imported/execute-lag-spike.png-376619535e340c791f8d2f680593d2bb.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-memory-dump.png b/assets/cards/execute-memory-dump.png new file mode 100644 index 0000000..bc3f54b Binary files /dev/null and b/assets/cards/execute-memory-dump.png differ diff --git a/assets/cards/execute-memory-dump.png.import b/assets/cards/execute-memory-dump.png.import new file mode 100644 index 0000000..059c566 --- /dev/null +++ b/assets/cards/execute-memory-dump.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dtvgrkm1flfim" +path.bptc="res://.godot/imported/execute-memory-dump.png-a7c10e7fa8fa8cd00463c81550e0a92b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-memory-dump.png" +dest_files=["res://.godot/imported/execute-memory-dump.png-a7c10e7fa8fa8cd00463c81550e0a92b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-override.png b/assets/cards/execute-override.png new file mode 100644 index 0000000..1a129b5 Binary files /dev/null and b/assets/cards/execute-override.png differ diff --git a/assets/cards/execute-override.png.import b/assets/cards/execute-override.png.import new file mode 100644 index 0000000..ca2060e --- /dev/null +++ b/assets/cards/execute-override.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://buocg3bb8eion" +path.bptc="res://.godot/imported/execute-override.png-9940010ec50f01bcd1a46f4c5fa806b7.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-override.png" +dest_files=["res://.godot/imported/execute-override.png-9940010ec50f01bcd1a46f4c5fa806b7.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-packet-flood.png b/assets/cards/execute-packet-flood.png new file mode 100644 index 0000000..93764a5 Binary files /dev/null and b/assets/cards/execute-packet-flood.png differ diff --git a/assets/cards/execute-packet-flood.png.import b/assets/cards/execute-packet-flood.png.import new file mode 100644 index 0000000..a1f9aa0 --- /dev/null +++ b/assets/cards/execute-packet-flood.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dpdmko2mg15ue" +path.bptc="res://.godot/imported/execute-packet-flood.png-e83bf63337f739ea5c0b0da6ae5c9ad4.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-packet-flood.png" +dest_files=["res://.godot/imported/execute-packet-flood.png-e83bf63337f739ea5c0b0da6ae5c9ad4.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-ping-sweep.png b/assets/cards/execute-ping-sweep.png new file mode 100644 index 0000000..c7f1703 Binary files /dev/null and b/assets/cards/execute-ping-sweep.png differ diff --git a/assets/cards/execute-ping-sweep.png.import b/assets/cards/execute-ping-sweep.png.import new file mode 100644 index 0000000..19acd63 --- /dev/null +++ b/assets/cards/execute-ping-sweep.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dstmsje8555m5" +path.bptc="res://.godot/imported/execute-ping-sweep.png-c8cb55f0c1e0ed9693e1951c60dd028d.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-ping-sweep.png" +dest_files=["res://.godot/imported/execute-ping-sweep.png-c8cb55f0c1e0ed9693e1951c60dd028d.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-port-scan.png b/assets/cards/execute-port-scan.png new file mode 100644 index 0000000..1396602 Binary files /dev/null and b/assets/cards/execute-port-scan.png differ diff --git a/assets/cards/execute-port-scan.png.import b/assets/cards/execute-port-scan.png.import new file mode 100644 index 0000000..4a31bf1 --- /dev/null +++ b/assets/cards/execute-port-scan.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://6btn3aw75mac" +path.bptc="res://.godot/imported/execute-port-scan.png-03367726f43a63a55e4033d65f263f04.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-port-scan.png" +dest_files=["res://.godot/imported/execute-port-scan.png-03367726f43a63a55e4033d65f263f04.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-process-clone.png b/assets/cards/execute-process-clone.png new file mode 100644 index 0000000..933ce6d Binary files /dev/null and b/assets/cards/execute-process-clone.png differ diff --git a/assets/cards/execute-process-clone.png.import b/assets/cards/execute-process-clone.png.import new file mode 100644 index 0000000..ddcd643 --- /dev/null +++ b/assets/cards/execute-process-clone.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bkm0077j4ft1o" +path.bptc="res://.godot/imported/execute-process-clone.png-88456032752913ef426c01c2d5ebafbb.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-process-clone.png" +dest_files=["res://.godot/imported/execute-process-clone.png-88456032752913ef426c01c2d5ebafbb.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-purge.png b/assets/cards/execute-purge.png new file mode 100644 index 0000000..0589a57 Binary files /dev/null and b/assets/cards/execute-purge.png differ diff --git a/assets/cards/execute-purge.png.import b/assets/cards/execute-purge.png.import new file mode 100644 index 0000000..2fbcdc8 --- /dev/null +++ b/assets/cards/execute-purge.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://u1y2hpsg4u73" +path.bptc="res://.godot/imported/execute-purge.png-b23038c35c6045a26afbabd1b52006bf.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-purge.png" +dest_files=["res://.godot/imported/execute-purge.png-b23038c35c6045a26afbabd1b52006bf.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-quarantine.png b/assets/cards/execute-quarantine.png new file mode 100644 index 0000000..a7ceabf Binary files /dev/null and b/assets/cards/execute-quarantine.png differ diff --git a/assets/cards/execute-quarantine.png.import b/assets/cards/execute-quarantine.png.import new file mode 100644 index 0000000..4d116f9 --- /dev/null +++ b/assets/cards/execute-quarantine.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cnsjnbsqsdjcd" +path.bptc="res://.godot/imported/execute-quarantine.png-164a009b28ad33bec2c3ec6217b5a617.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-quarantine.png" +dest_files=["res://.godot/imported/execute-quarantine.png-164a009b28ad33bec2c3ec6217b5a617.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-remote-access.png b/assets/cards/execute-remote-access.png new file mode 100644 index 0000000..eebdb3b Binary files /dev/null and b/assets/cards/execute-remote-access.png differ diff --git a/assets/cards/execute-remote-access.png.import b/assets/cards/execute-remote-access.png.import new file mode 100644 index 0000000..03d39e1 --- /dev/null +++ b/assets/cards/execute-remote-access.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://my13pu3g38jt" +path.bptc="res://.godot/imported/execute-remote-access.png-e27d046c8bdb05779364acee8076121c.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-remote-access.png" +dest_files=["res://.godot/imported/execute-remote-access.png-e27d046c8bdb05779364acee8076121c.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-rollback.png b/assets/cards/execute-rollback.png new file mode 100644 index 0000000..76fec9f Binary files /dev/null and b/assets/cards/execute-rollback.png differ diff --git a/assets/cards/execute-rollback.png.import b/assets/cards/execute-rollback.png.import new file mode 100644 index 0000000..0f1ef1e --- /dev/null +++ b/assets/cards/execute-rollback.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://g5npraoyshpy" +path.bptc="res://.godot/imported/execute-rollback.png-38ea42c18db659beb0128e7771ff8cd6.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-rollback.png" +dest_files=["res://.godot/imported/execute-rollback.png-38ea42c18db659beb0128e7771ff8cd6.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-root-access.png b/assets/cards/execute-root-access.png new file mode 100644 index 0000000..9b337ea Binary files /dev/null and b/assets/cards/execute-root-access.png differ diff --git a/assets/cards/execute-root-access.png.import b/assets/cards/execute-root-access.png.import new file mode 100644 index 0000000..864cbd9 --- /dev/null +++ b/assets/cards/execute-root-access.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dnrxiccfub8ub" +path.bptc="res://.godot/imported/execute-root-access.png-0221d7274a66f58060794e8e2814a19c.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-root-access.png" +dest_files=["res://.godot/imported/execute-root-access.png-0221d7274a66f58060794e8e2814a19c.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-sabotage.png b/assets/cards/execute-sabotage.png new file mode 100644 index 0000000..e3669ef Binary files /dev/null and b/assets/cards/execute-sabotage.png differ diff --git a/assets/cards/execute-sabotage.png.import b/assets/cards/execute-sabotage.png.import new file mode 100644 index 0000000..45b4941 --- /dev/null +++ b/assets/cards/execute-sabotage.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cv56nb8ehsky4" +path.bptc="res://.godot/imported/execute-sabotage.png-b2b5aeebf9addd35c02fd7d87d0764eb.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-sabotage.png" +dest_files=["res://.godot/imported/execute-sabotage.png-b2b5aeebf9addd35c02fd7d87d0764eb.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-segfault.png b/assets/cards/execute-segfault.png new file mode 100644 index 0000000..ca4e92b Binary files /dev/null and b/assets/cards/execute-segfault.png differ diff --git a/assets/cards/execute-segfault.png.import b/assets/cards/execute-segfault.png.import new file mode 100644 index 0000000..fa510da --- /dev/null +++ b/assets/cards/execute-segfault.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b3l07e2r5s1hk" +path.bptc="res://.godot/imported/execute-segfault.png-04044c48c7fdcfd9121c2e827a73e390.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-segfault.png" +dest_files=["res://.godot/imported/execute-segfault.png-04044c48c7fdcfd9121c2e827a73e390.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-snapshot-restore.png b/assets/cards/execute-snapshot-restore.png new file mode 100644 index 0000000..d409b46 Binary files /dev/null and b/assets/cards/execute-snapshot-restore.png differ diff --git a/assets/cards/execute-snapshot-restore.png.import b/assets/cards/execute-snapshot-restore.png.import new file mode 100644 index 0000000..cf16e12 --- /dev/null +++ b/assets/cards/execute-snapshot-restore.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cggodbpswp5ix" +path.bptc="res://.godot/imported/execute-snapshot-restore.png-e953f58484e3328a0b6d03626e63fabc.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-snapshot-restore.png" +dest_files=["res://.godot/imported/execute-snapshot-restore.png-e953f58484e3328a0b6d03626e63fabc.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-snapshot.png b/assets/cards/execute-snapshot.png new file mode 100644 index 0000000..ea86a83 Binary files /dev/null and b/assets/cards/execute-snapshot.png differ diff --git a/assets/cards/execute-snapshot.png.import b/assets/cards/execute-snapshot.png.import new file mode 100644 index 0000000..1aa1953 --- /dev/null +++ b/assets/cards/execute-snapshot.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cccbhwoir133e" +path.bptc="res://.godot/imported/execute-snapshot.png-7678f484cf07f0757eb23578f22449f8.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-snapshot.png" +dest_files=["res://.godot/imported/execute-snapshot.png-7678f484cf07f0757eb23578f22449f8.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/execute-trace-route.png b/assets/cards/execute-trace-route.png new file mode 100644 index 0000000..2a1f4db Binary files /dev/null and b/assets/cards/execute-trace-route.png differ diff --git a/assets/cards/execute-trace-route.png.import b/assets/cards/execute-trace-route.png.import new file mode 100644 index 0000000..25c5859 --- /dev/null +++ b/assets/cards/execute-trace-route.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://duh6jo5eomj08" +path.bptc="res://.godot/imported/execute-trace-route.png-802476cfc3e45980df5fd4e3c8cd37f9.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/execute-trace-route.png" +dest_files=["res://.godot/imported/execute-trace-route.png-802476cfc3e45980df5fd4e3c8cd37f9.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/exploit-kit.png b/assets/cards/exploit-kit.png new file mode 100644 index 0000000..660427f Binary files /dev/null and b/assets/cards/exploit-kit.png differ diff --git a/assets/cards/exploit-kit.png.import b/assets/cards/exploit-kit.png.import new file mode 100644 index 0000000..9475bca --- /dev/null +++ b/assets/cards/exploit-kit.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cy8l6wperuq2u" +path.bptc="res://.godot/imported/exploit-kit.png-4ebe7d1064841c886861421eb7ca100c.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/exploit-kit.png" +dest_files=["res://.godot/imported/exploit-kit.png-4ebe7d1064841c886861421eb7ca100c.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/failover.png b/assets/cards/failover.png new file mode 100644 index 0000000..f0f1bc6 Binary files /dev/null and b/assets/cards/failover.png differ diff --git a/assets/cards/failover.png.import b/assets/cards/failover.png.import new file mode 100644 index 0000000..8dda091 --- /dev/null +++ b/assets/cards/failover.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6e8f4w562huf" +path.bptc="res://.godot/imported/failover.png-1920b452f47dda50576d22909bd8bad0.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/failover.png" +dest_files=["res://.godot/imported/failover.png-1920b452f47dda50576d22909bd8bad0.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/false-positive.png b/assets/cards/false-positive.png new file mode 100644 index 0000000..98f4e42 Binary files /dev/null and b/assets/cards/false-positive.png differ diff --git a/assets/cards/false-positive.png.import b/assets/cards/false-positive.png.import new file mode 100644 index 0000000..c2202ef --- /dev/null +++ b/assets/cards/false-positive.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://csrtxfl55uo60" +path.bptc="res://.godot/imported/false-positive.png-559a69ec9669169e62b451374a1552cf.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/false-positive.png" +dest_files=["res://.godot/imported/false-positive.png-559a69ec9669169e62b451374a1552cf.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/firewall-appliance.png b/assets/cards/firewall-appliance.png new file mode 100644 index 0000000..5f64775 Binary files /dev/null and b/assets/cards/firewall-appliance.png differ diff --git a/assets/cards/firewall-appliance.png.import b/assets/cards/firewall-appliance.png.import new file mode 100644 index 0000000..9cd327d --- /dev/null +++ b/assets/cards/firewall-appliance.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://djkjmy5wtond1" +path.bptc="res://.godot/imported/firewall-appliance.png-edba84fc562cb9f328f78536038b37c8.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/firewall-appliance.png" +dest_files=["res://.godot/imported/firewall-appliance.png-edba84fc562cb9f328f78536038b37c8.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/fragmentation.png b/assets/cards/fragmentation.png new file mode 100644 index 0000000..0035d92 Binary files /dev/null and b/assets/cards/fragmentation.png differ diff --git a/assets/cards/fragmentation.png.import b/assets/cards/fragmentation.png.import new file mode 100644 index 0000000..e1eb6b4 --- /dev/null +++ b/assets/cards/fragmentation.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b04q3fyh57d4u" +path.bptc="res://.godot/imported/fragmentation.png-a835bad5dd0b585504a60f2295f5dcaa.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/fragmentation.png" +dest_files=["res://.godot/imported/fragmentation.png-a835bad5dd0b585504a60f2295f5dcaa.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/fuzzer.png b/assets/cards/fuzzer.png new file mode 100644 index 0000000..32c64d0 Binary files /dev/null and b/assets/cards/fuzzer.png differ diff --git a/assets/cards/fuzzer.png.import b/assets/cards/fuzzer.png.import new file mode 100644 index 0000000..9f9e292 --- /dev/null +++ b/assets/cards/fuzzer.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dw70jog7xpycf" +path.bptc="res://.godot/imported/fuzzer.png-a30e226dad6a7e9cfcf6d1d546de366c.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/fuzzer.png" +dest_files=["res://.godot/imported/fuzzer.png-a30e226dad6a7e9cfcf6d1d546de366c.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/garbage-collection.png b/assets/cards/garbage-collection.png new file mode 100644 index 0000000..ad5ab2e Binary files /dev/null and b/assets/cards/garbage-collection.png differ diff --git a/assets/cards/garbage-collection.png.import b/assets/cards/garbage-collection.png.import new file mode 100644 index 0000000..dc94de9 --- /dev/null +++ b/assets/cards/garbage-collection.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ckkot3ftnsikh" +path.bptc="res://.godot/imported/garbage-collection.png-7cf23919af83bdf933a48f9feeec1086.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/garbage-collection.png" +dest_files=["res://.godot/imported/garbage-collection.png-7cf23919af83bdf933a48f9feeec1086.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/ghost-process.png b/assets/cards/ghost-process.png new file mode 100644 index 0000000..f5671c5 Binary files /dev/null and b/assets/cards/ghost-process.png differ diff --git a/assets/cards/ghost-process.png.import b/assets/cards/ghost-process.png.import new file mode 100644 index 0000000..e21ff71 --- /dev/null +++ b/assets/cards/ghost-process.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drtq4ylf3wnxu" +path.bptc="res://.godot/imported/ghost-process.png-cebb9799a0a286dd7cc11f926ee4f54b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/ghost-process.png" +dest_files=["res://.godot/imported/ghost-process.png-cebb9799a0a286dd7cc11f926ee4f54b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/hardware-sandbox.png b/assets/cards/hardware-sandbox.png new file mode 100644 index 0000000..0854f76 Binary files /dev/null and b/assets/cards/hardware-sandbox.png differ diff --git a/assets/cards/hardware-sandbox.png.import b/assets/cards/hardware-sandbox.png.import new file mode 100644 index 0000000..0a08abf --- /dev/null +++ b/assets/cards/hardware-sandbox.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hb8v6u3b3ns0" +path.bptc="res://.godot/imported/hardware-sandbox.png-a6d33af82efb2c21bf9576dcaa4ff524.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/hardware-sandbox.png" +dest_files=["res://.godot/imported/hardware-sandbox.png-a6d33af82efb2c21bf9576dcaa4ff524.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/heap-corruption.png b/assets/cards/heap-corruption.png new file mode 100644 index 0000000..e3ea7fe Binary files /dev/null and b/assets/cards/heap-corruption.png differ diff --git a/assets/cards/heap-corruption.png.import b/assets/cards/heap-corruption.png.import new file mode 100644 index 0000000..ae58800 --- /dev/null +++ b/assets/cards/heap-corruption.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1wkiaqy3cgyb" +path.bptc="res://.godot/imported/heap-corruption.png-e2cd696736a18fa8f199cdb9f9def0c7.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/heap-corruption.png" +dest_files=["res://.godot/imported/heap-corruption.png-e2cd696736a18fa8f199cdb9f9def0c7.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/heat-sink.png b/assets/cards/heat-sink.png new file mode 100644 index 0000000..d68b4cb Binary files /dev/null and b/assets/cards/heat-sink.png differ diff --git a/assets/cards/heat-sink.png.import b/assets/cards/heat-sink.png.import new file mode 100644 index 0000000..9cc2f51 --- /dev/null +++ b/assets/cards/heat-sink.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ofha52ruuhqo" +path.bptc="res://.godot/imported/heat-sink.png-fd70339baa85cedd8b9cbc6f1da80797.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/heat-sink.png" +dest_files=["res://.godot/imported/heat-sink.png-fd70339baa85cedd8b9cbc6f1da80797.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/heisenbug.png b/assets/cards/heisenbug.png new file mode 100644 index 0000000..1f41f15 Binary files /dev/null and b/assets/cards/heisenbug.png differ diff --git a/assets/cards/heisenbug.png.import b/assets/cards/heisenbug.png.import new file mode 100644 index 0000000..c29a7c9 --- /dev/null +++ b/assets/cards/heisenbug.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://vpfgenrkjeiq" +path.bptc="res://.godot/imported/heisenbug.png-58a1c2fe79f1cd0e5e9a8934208c389a.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/heisenbug.png" +dest_files=["res://.godot/imported/heisenbug.png-58a1c2fe79f1cd0e5e9a8934208c389a.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/high-bandwidth-server.png b/assets/cards/high-bandwidth-server.png new file mode 100644 index 0000000..def61c8 Binary files /dev/null and b/assets/cards/high-bandwidth-server.png differ diff --git a/assets/cards/high-bandwidth-server.png.import b/assets/cards/high-bandwidth-server.png.import new file mode 100644 index 0000000..8358bb2 --- /dev/null +++ b/assets/cards/high-bandwidth-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://js72ley6sfam" +path.bptc="res://.godot/imported/high-bandwidth-server.png-80984cb3fa08bbc96e49e9c2130d4e94.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/high-bandwidth-server.png" +dest_files=["res://.godot/imported/high-bandwidth-server.png-80984cb3fa08bbc96e49e9c2130d4e94.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/honeypot.png b/assets/cards/honeypot.png new file mode 100644 index 0000000..ae26464 Binary files /dev/null and b/assets/cards/honeypot.png differ diff --git a/assets/cards/honeypot.png.import b/assets/cards/honeypot.png.import new file mode 100644 index 0000000..0bf6b99 --- /dev/null +++ b/assets/cards/honeypot.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c6jnnb73gwq50" +path.bptc="res://.godot/imported/honeypot.png-63f565cca14585f8938787460cd916c0.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/honeypot.png" +dest_files=["res://.godot/imported/honeypot.png-63f565cca14585f8938787460cd916c0.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/hot-patch.png b/assets/cards/hot-patch.png new file mode 100644 index 0000000..4007a28 Binary files /dev/null and b/assets/cards/hot-patch.png differ diff --git a/assets/cards/hot-patch.png.import b/assets/cards/hot-patch.png.import new file mode 100644 index 0000000..fe8f4ad --- /dev/null +++ b/assets/cards/hot-patch.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5w0lybrm7g8j" +path.bptc="res://.godot/imported/hot-patch.png-cabd8d980e2d7c35dceb228df15531dc.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/hot-patch.png" +dest_files=["res://.godot/imported/hot-patch.png-cabd8d980e2d7c35dceb228df15531dc.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/hot-swap-bay.png b/assets/cards/hot-swap-bay.png new file mode 100644 index 0000000..ece1048 Binary files /dev/null and b/assets/cards/hot-swap-bay.png differ diff --git a/assets/cards/hot-swap-bay.png.import b/assets/cards/hot-swap-bay.png.import new file mode 100644 index 0000000..ebed6b4 --- /dev/null +++ b/assets/cards/hot-swap-bay.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ckeswyolkciql" +path.bptc="res://.godot/imported/hot-swap-bay.png-00ce00404aa977ac22a224f5c349e9ea.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/hot-swap-bay.png" +dest_files=["res://.godot/imported/hot-swap-bay.png-00ce00404aa977ac22a224f5c349e9ea.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/hotfix.png b/assets/cards/hotfix.png new file mode 100644 index 0000000..9925023 Binary files /dev/null and b/assets/cards/hotfix.png differ diff --git a/assets/cards/hotfix.png.import b/assets/cards/hotfix.png.import new file mode 100644 index 0000000..4cb3d30 --- /dev/null +++ b/assets/cards/hotfix.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b06tpy8mds4s" +path.bptc="res://.godot/imported/hotfix.png-e512b2c85d8a9f110e24eede438cdbbe.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/hotfix.png" +dest_files=["res://.godot/imported/hotfix.png-e512b2c85d8a9f110e24eede438cdbbe.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/infinite-loop.png b/assets/cards/infinite-loop.png new file mode 100644 index 0000000..ffd052c Binary files /dev/null and b/assets/cards/infinite-loop.png differ diff --git a/assets/cards/infinite-loop.png.import b/assets/cards/infinite-loop.png.import new file mode 100644 index 0000000..bfec090 --- /dev/null +++ b/assets/cards/infinite-loop.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmns1i1xrgyyh" +path.bptc="res://.godot/imported/infinite-loop.png-fcb6db1501df21458229323f99e74a83.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/infinite-loop.png" +dest_files=["res://.godot/imported/infinite-loop.png-fcb6db1501df21458229323f99e74a83.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/keylogger.png b/assets/cards/keylogger.png new file mode 100644 index 0000000..aac1a8d Binary files /dev/null and b/assets/cards/keylogger.png differ diff --git a/assets/cards/keylogger.png.import b/assets/cards/keylogger.png.import new file mode 100644 index 0000000..f89d466 --- /dev/null +++ b/assets/cards/keylogger.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://esotph7p3afh" +path.bptc="res://.godot/imported/keylogger.png-3a66662b429492806ef5f5c3a4419e8f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/keylogger.png" +dest_files=["res://.godot/imported/keylogger.png-3a66662b429492806ef5f5c3a4419e8f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/latency-spike.png b/assets/cards/latency-spike.png new file mode 100644 index 0000000..7e15719 Binary files /dev/null and b/assets/cards/latency-spike.png differ diff --git a/assets/cards/latency-spike.png.import b/assets/cards/latency-spike.png.import new file mode 100644 index 0000000..7bdc2de --- /dev/null +++ b/assets/cards/latency-spike.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b4g3d0rhywwuv" +path.bptc="res://.godot/imported/latency-spike.png-d66ca962e776c58c8ebc5b2c93cc104f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/latency-spike.png" +dest_files=["res://.godot/imported/latency-spike.png-d66ca962e776c58c8ebc5b2c93cc104f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/load-balancer.png b/assets/cards/load-balancer.png new file mode 100644 index 0000000..e891c49 Binary files /dev/null and b/assets/cards/load-balancer.png differ diff --git a/assets/cards/load-balancer.png.import b/assets/cards/load-balancer.png.import new file mode 100644 index 0000000..a3ecbde --- /dev/null +++ b/assets/cards/load-balancer.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1fx4rgijqex3" +path.bptc="res://.godot/imported/load-balancer.png-dc5ccff3a248687c5492e275048b6be4.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/load-balancer.png" +dest_files=["res://.godot/imported/load-balancer.png-dc5ccff3a248687c5492e275048b6be4.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/long-term-support.png b/assets/cards/long-term-support.png new file mode 100644 index 0000000..c0fe3b4 Binary files /dev/null and b/assets/cards/long-term-support.png differ diff --git a/assets/cards/long-term-support.png.import b/assets/cards/long-term-support.png.import new file mode 100644 index 0000000..f185d03 --- /dev/null +++ b/assets/cards/long-term-support.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bmmajtsy7o8ct" +path.bptc="res://.godot/imported/long-term-support.png-1cb7fd804cd15b79a0806bf2dacb053e.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/long-term-support.png" +dest_files=["res://.godot/imported/long-term-support.png-1cb7fd804cd15b79a0806bf2dacb053e.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/memory-parasite.png b/assets/cards/memory-parasite.png new file mode 100644 index 0000000..881853e Binary files /dev/null and b/assets/cards/memory-parasite.png differ diff --git a/assets/cards/memory-parasite.png.import b/assets/cards/memory-parasite.png.import new file mode 100644 index 0000000..7881ec9 --- /dev/null +++ b/assets/cards/memory-parasite.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b562orpgicgis" +path.bptc="res://.godot/imported/memory-parasite.png-092dbf9d1272bf99967315bcada59183.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/memory-parasite.png" +dest_files=["res://.godot/imported/memory-parasite.png-092dbf9d1272bf99967315bcada59183.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/mirror-site.png b/assets/cards/mirror-site.png new file mode 100644 index 0000000..bcda9b8 Binary files /dev/null and b/assets/cards/mirror-site.png differ diff --git a/assets/cards/mirror-site.png.import b/assets/cards/mirror-site.png.import new file mode 100644 index 0000000..b86b531 --- /dev/null +++ b/assets/cards/mirror-site.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bu8elyonatuek" +path.bptc="res://.godot/imported/mirror-site.png-b2141775728236044523e9e4c3a9344d.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/mirror-site.png" +dest_files=["res://.godot/imported/mirror-site.png-b2141775728236044523e9e4c3a9344d.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/multicore-server.png b/assets/cards/multicore-server.png new file mode 100644 index 0000000..1801310 Binary files /dev/null and b/assets/cards/multicore-server.png differ diff --git a/assets/cards/multicore-server.png.import b/assets/cards/multicore-server.png.import new file mode 100644 index 0000000..1a969f3 --- /dev/null +++ b/assets/cards/multicore-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bj2ndd3vgojwi" +path.bptc="res://.godot/imported/multicore-server.png-818e35832f9f937e2ec8e1b70186ca83.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/multicore-server.png" +dest_files=["res://.godot/imported/multicore-server.png-818e35832f9f937e2ec8e1b70186ca83.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/network-interface-upgrade.png b/assets/cards/network-interface-upgrade.png new file mode 100644 index 0000000..a3fa153 Binary files /dev/null and b/assets/cards/network-interface-upgrade.png differ diff --git a/assets/cards/network-interface-upgrade.png.import b/assets/cards/network-interface-upgrade.png.import new file mode 100644 index 0000000..69f4f90 --- /dev/null +++ b/assets/cards/network-interface-upgrade.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwn1elg4ppiws" +path.bptc="res://.godot/imported/network-interface-upgrade.png-55b685d7fb5495ffd0a936d89db53558.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/network-interface-upgrade.png" +dest_files=["res://.godot/imported/network-interface-upgrade.png-55b685d7fb5495ffd0a936d89db53558.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/network-throttle.png b/assets/cards/network-throttle.png new file mode 100644 index 0000000..08d61fe Binary files /dev/null and b/assets/cards/network-throttle.png differ diff --git a/assets/cards/network-throttle.png.import b/assets/cards/network-throttle.png.import new file mode 100644 index 0000000..f43cef2 --- /dev/null +++ b/assets/cards/network-throttle.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://to2gqhyeyq4c" +path.bptc="res://.godot/imported/network-throttle.png-1ae7501bdd791bd8fd2d0d575437733b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/network-throttle.png" +dest_files=["res://.godot/imported/network-throttle.png-1ae7501bdd791bd8fd2d0d575437733b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/null-pointer.png b/assets/cards/null-pointer.png new file mode 100644 index 0000000..868705f Binary files /dev/null and b/assets/cards/null-pointer.png differ diff --git a/assets/cards/null-pointer.png.import b/assets/cards/null-pointer.png.import new file mode 100644 index 0000000..c7e076f --- /dev/null +++ b/assets/cards/null-pointer.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://chqol4pufqvio" +path.bptc="res://.godot/imported/null-pointer.png-b65ef9e1a1326b1c6508e1f38e826939.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/null-pointer.png" +dest_files=["res://.godot/imported/null-pointer.png-b65ef9e1a1326b1c6508e1f38e826939.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/off-by-one.png b/assets/cards/off-by-one.png new file mode 100644 index 0000000..071b1be Binary files /dev/null and b/assets/cards/off-by-one.png differ diff --git a/assets/cards/off-by-one.png.import b/assets/cards/off-by-one.png.import new file mode 100644 index 0000000..7a89fba --- /dev/null +++ b/assets/cards/off-by-one.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b20fe2dk4biot" +path.bptc="res://.godot/imported/off-by-one.png-cde22c99c8e8dd8436cfa3b4db353f65.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/off-by-one.png" +dest_files=["res://.godot/imported/off-by-one.png-cde22c99c8e8dd8436cfa3b4db353f65.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/overclocked-cpu.png b/assets/cards/overclocked-cpu.png new file mode 100644 index 0000000..f9ce37b Binary files /dev/null and b/assets/cards/overclocked-cpu.png differ diff --git a/assets/cards/overclocked-cpu.png.import b/assets/cards/overclocked-cpu.png.import new file mode 100644 index 0000000..148d8b8 --- /dev/null +++ b/assets/cards/overclocked-cpu.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dw4iy5f6hi3at" +path.bptc="res://.godot/imported/overclocked-cpu.png-ea4ac471a41df8f69d3cc5f5704458a4.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/overclocked-cpu.png" +dest_files=["res://.godot/imported/overclocked-cpu.png-ea4ac471a41df8f69d3cc5f5704458a4.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/overflow-error.png b/assets/cards/overflow-error.png new file mode 100644 index 0000000..797061e Binary files /dev/null and b/assets/cards/overflow-error.png differ diff --git a/assets/cards/overflow-error.png.import b/assets/cards/overflow-error.png.import new file mode 100644 index 0000000..a8fde13 --- /dev/null +++ b/assets/cards/overflow-error.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ulq2c5moob2o" +path.bptc="res://.godot/imported/overflow-error.png-115a7db053619586fd4afa971403e3cb.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/overflow-error.png" +dest_files=["res://.godot/imported/overflow-error.png-115a7db053619586fd4afa971403e3cb.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/packet-accelerator.png b/assets/cards/packet-accelerator.png new file mode 100644 index 0000000..e3eed88 Binary files /dev/null and b/assets/cards/packet-accelerator.png differ diff --git a/assets/cards/packet-accelerator.png.import b/assets/cards/packet-accelerator.png.import new file mode 100644 index 0000000..27cfc4f --- /dev/null +++ b/assets/cards/packet-accelerator.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dou2tnqsxchik" +path.bptc="res://.godot/imported/packet-accelerator.png-9f84e0a5fe0337b07b2c54189a94839b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/packet-accelerator.png" +dest_files=["res://.godot/imported/packet-accelerator.png-9f84e0a5fe0337b07b2c54189a94839b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/packet-loss.png b/assets/cards/packet-loss.png new file mode 100644 index 0000000..ac13241 Binary files /dev/null and b/assets/cards/packet-loss.png differ diff --git a/assets/cards/packet-loss.png.import b/assets/cards/packet-loss.png.import new file mode 100644 index 0000000..9a9152b --- /dev/null +++ b/assets/cards/packet-loss.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bpygeg7nblnb7" +path.bptc="res://.godot/imported/packet-loss.png-de79d05edc36a6bb21707b4c8852e7db.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/packet-loss.png" +dest_files=["res://.godot/imported/packet-loss.png-de79d05edc36a6bb21707b4c8852e7db.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/packet-sniffer.png b/assets/cards/packet-sniffer.png new file mode 100644 index 0000000..1f29b00 Binary files /dev/null and b/assets/cards/packet-sniffer.png differ diff --git a/assets/cards/packet-sniffer.png.import b/assets/cards/packet-sniffer.png.import new file mode 100644 index 0000000..4010fe5 --- /dev/null +++ b/assets/cards/packet-sniffer.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddwa8vmdalkxr" +path.bptc="res://.godot/imported/packet-sniffer.png-2a557665572f3f6fc8c776c2a84e3822.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/packet-sniffer.png" +dest_files=["res://.godot/imported/packet-sniffer.png-2a557665572f3f6fc8c776c2a84e3822.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/payload-injector.png b/assets/cards/payload-injector.png new file mode 100644 index 0000000..b3954e4 Binary files /dev/null and b/assets/cards/payload-injector.png differ diff --git a/assets/cards/payload-injector.png.import b/assets/cards/payload-injector.png.import new file mode 100644 index 0000000..ecf015f --- /dev/null +++ b/assets/cards/payload-injector.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c63uhisyhdupo" +path.bptc="res://.godot/imported/payload-injector.png-7fa216033355826c9e2b0ae2f4ee0a44.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/payload-injector.png" +dest_files=["res://.godot/imported/payload-injector.png-7fa216033355826c9e2b0ae2f4ee0a44.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/payload-module.png b/assets/cards/payload-module.png new file mode 100644 index 0000000..c21c3d7 Binary files /dev/null and b/assets/cards/payload-module.png differ diff --git a/assets/cards/payload-module.png.import b/assets/cards/payload-module.png.import new file mode 100644 index 0000000..7778ac3 --- /dev/null +++ b/assets/cards/payload-module.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://u8ex6elardgk" +path.bptc="res://.godot/imported/payload-module.png-77b0c8416475cc27098110512d46a1e5.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/payload-module.png" +dest_files=["res://.godot/imported/payload-module.png-77b0c8416475cc27098110512d46a1e5.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/persistent-infection.png b/assets/cards/persistent-infection.png new file mode 100644 index 0000000..a37daef Binary files /dev/null and b/assets/cards/persistent-infection.png differ diff --git a/assets/cards/persistent-infection.png.import b/assets/cards/persistent-infection.png.import new file mode 100644 index 0000000..c58310d --- /dev/null +++ b/assets/cards/persistent-infection.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://tkcaf5c5dyue" +path.bptc="res://.godot/imported/persistent-infection.png-03ba8f3fc41612e887f187e4c7b44b13.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/persistent-infection.png" +dest_files=["res://.godot/imported/persistent-infection.png-03ba8f3fc41612e887f187e4c7b44b13.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/phantom-cursor.png b/assets/cards/phantom-cursor.png new file mode 100644 index 0000000..64d93f2 Binary files /dev/null and b/assets/cards/phantom-cursor.png differ diff --git a/assets/cards/phantom-cursor.png.import b/assets/cards/phantom-cursor.png.import new file mode 100644 index 0000000..7674a34 --- /dev/null +++ b/assets/cards/phantom-cursor.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cqlvh1mm6872q" +path.bptc="res://.godot/imported/phantom-cursor.png-968511fcb09c7dc98682846d28c5a783.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/phantom-cursor.png" +dest_files=["res://.godot/imported/phantom-cursor.png-968511fcb09c7dc98682846d28c5a783.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/pingable-server.png b/assets/cards/pingable-server.png new file mode 100644 index 0000000..60a1700 Binary files /dev/null and b/assets/cards/pingable-server.png differ diff --git a/assets/cards/pingable-server.png.import b/assets/cards/pingable-server.png.import new file mode 100644 index 0000000..afb42cf --- /dev/null +++ b/assets/cards/pingable-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmryvowk834iw" +path.bptc="res://.godot/imported/pingable-server.png-8861c7b469e4b9fb7fd59d9b435c875d.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/pingable-server.png" +dest_files=["res://.godot/imported/pingable-server.png-8861c7b469e4b9fb7fd59d9b435c875d.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/pixelated-picture.png b/assets/cards/pixelated-picture.png new file mode 100644 index 0000000..c292ea0 Binary files /dev/null and b/assets/cards/pixelated-picture.png differ diff --git a/assets/cards/pixelated-picture.png.import b/assets/cards/pixelated-picture.png.import new file mode 100644 index 0000000..eb38cfc --- /dev/null +++ b/assets/cards/pixelated-picture.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ddbgf11c5dlcv" +path.bptc="res://.godot/imported/pixelated-picture.png-705d858a97c8cb145f47cc7550fbd2f3.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/pixelated-picture.png" +dest_files=["res://.godot/imported/pixelated-picture.png-705d858a97c8cb145f47cc7550fbd2f3.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/power-server.png b/assets/cards/power-server.png new file mode 100644 index 0000000..5f39e47 Binary files /dev/null and b/assets/cards/power-server.png differ diff --git a/assets/cards/power-server.png.import b/assets/cards/power-server.png.import new file mode 100644 index 0000000..9e5bece --- /dev/null +++ b/assets/cards/power-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cpv6a6ha88ijt" +path.bptc="res://.godot/imported/power-server.png-e227b43dc59dcda312fc8172b2e5bdaf.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/power-server.png" +dest_files=["res://.godot/imported/power-server.png-e227b43dc59dcda312fc8172b2e5bdaf.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/protected-server.png b/assets/cards/protected-server.png new file mode 100644 index 0000000..9118678 Binary files /dev/null and b/assets/cards/protected-server.png differ diff --git a/assets/cards/protected-server.png.import b/assets/cards/protected-server.png.import new file mode 100644 index 0000000..c44492c --- /dev/null +++ b/assets/cards/protected-server.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bub4ilbklu1ne" +path.bptc="res://.godot/imported/protected-server.png-961e03e3368349c01a163dfeef6edf2b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/protected-server.png" +dest_files=["res://.godot/imported/protected-server.png-961e03e3368349c01a163dfeef6edf2b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/proxy-node.png b/assets/cards/proxy-node.png new file mode 100644 index 0000000..e4730eb Binary files /dev/null and b/assets/cards/proxy-node.png differ diff --git a/assets/cards/proxy-node.png.import b/assets/cards/proxy-node.png.import new file mode 100644 index 0000000..da5159f --- /dev/null +++ b/assets/cards/proxy-node.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cyb8x4lpdm607" +path.bptc="res://.godot/imported/proxy-node.png-64beadc307dc4aacb6f17ee4159d161a.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/proxy-node.png" +dest_files=["res://.godot/imported/proxy-node.png-64beadc307dc4aacb6f17ee4159d161a.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/proxy-relay.png b/assets/cards/proxy-relay.png new file mode 100644 index 0000000..30ec076 Binary files /dev/null and b/assets/cards/proxy-relay.png differ diff --git a/assets/cards/proxy-relay.png.import b/assets/cards/proxy-relay.png.import new file mode 100644 index 0000000..612cd60 --- /dev/null +++ b/assets/cards/proxy-relay.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d23ajo4r47aar" +path.bptc="res://.godot/imported/proxy-relay.png-dbe153ab2e417070376b39e7d6a84e01.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/proxy-relay.png" +dest_files=["res://.godot/imported/proxy-relay.png-dbe153ab2e417070376b39e7d6a84e01.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/quantum-coprocessor.png b/assets/cards/quantum-coprocessor.png new file mode 100644 index 0000000..ca27b7e Binary files /dev/null and b/assets/cards/quantum-coprocessor.png differ diff --git a/assets/cards/quantum-coprocessor.png.import b/assets/cards/quantum-coprocessor.png.import new file mode 100644 index 0000000..1101ddf --- /dev/null +++ b/assets/cards/quantum-coprocessor.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7mi25ifyrun2" +path.bptc="res://.godot/imported/quantum-coprocessor.png-daacbbfb09d71ea1a6bbd2b80bc4f27b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/quantum-coprocessor.png" +dest_files=["res://.godot/imported/quantum-coprocessor.png-daacbbfb09d71ea1a6bbd2b80bc4f27b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/quarantine-host.png b/assets/cards/quarantine-host.png new file mode 100644 index 0000000..db5e072 Binary files /dev/null and b/assets/cards/quarantine-host.png differ diff --git a/assets/cards/quarantine-host.png.import b/assets/cards/quarantine-host.png.import new file mode 100644 index 0000000..9895f09 --- /dev/null +++ b/assets/cards/quarantine-host.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://eeb6thoi2xvy" +path.bptc="res://.godot/imported/quarantine-host.png-5ce5e25939943f41f4b8becbf07d95e2.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/quarantine-host.png" +dest_files=["res://.godot/imported/quarantine-host.png-5ce5e25939943f41f4b8becbf07d95e2.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/race-condition.png b/assets/cards/race-condition.png new file mode 100644 index 0000000..50a5f0f Binary files /dev/null and b/assets/cards/race-condition.png differ diff --git a/assets/cards/race-condition.png.import b/assets/cards/race-condition.png.import new file mode 100644 index 0000000..d3bd0a1 --- /dev/null +++ b/assets/cards/race-condition.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dk5fgqbdmyfvg" +path.bptc="res://.godot/imported/race-condition.png-51e46bf1eef3c449875d1bb61ffc279b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/race-condition.png" +dest_files=["res://.godot/imported/race-condition.png-51e46bf1eef3c449875d1bb61ffc279b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/raid-array.png b/assets/cards/raid-array.png new file mode 100644 index 0000000..28be164 Binary files /dev/null and b/assets/cards/raid-array.png differ diff --git a/assets/cards/raid-array.png.import b/assets/cards/raid-array.png.import new file mode 100644 index 0000000..0fb9865 --- /dev/null +++ b/assets/cards/raid-array.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d4g6hmk5p5ogf" +path.bptc="res://.godot/imported/raid-array.png-3ea8ab82e854e9bc0de2a3737afcefef.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/raid-array.png" +dest_files=["res://.godot/imported/raid-array.png-3ea8ab82e854e9bc0de2a3737afcefef.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/ram-expansion.png b/assets/cards/ram-expansion.png new file mode 100644 index 0000000..f81120c Binary files /dev/null and b/assets/cards/ram-expansion.png differ diff --git a/assets/cards/ram-expansion.png.import b/assets/cards/ram-expansion.png.import new file mode 100644 index 0000000..4322eaa --- /dev/null +++ b/assets/cards/ram-expansion.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cwoltrltdiqu2" +path.bptc="res://.godot/imported/ram-expansion.png-2b58865bef116c8df5a09e70c5af7722.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/ram-expansion.png" +dest_files=["res://.godot/imported/ram-expansion.png-2b58865bef116c8df5a09e70c5af7722.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/ransomware.png b/assets/cards/ransomware.png new file mode 100644 index 0000000..bf45dfd Binary files /dev/null and b/assets/cards/ransomware.png differ diff --git a/assets/cards/ransomware.png.import b/assets/cards/ransomware.png.import new file mode 100644 index 0000000..2f6b6ba --- /dev/null +++ b/assets/cards/ransomware.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bmrm8cj5n65wg" +path.bptc="res://.godot/imported/ransomware.png-195cc861d72493740231a685bce8efc5.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/ransomware.png" +dest_files=["res://.godot/imported/ransomware.png-195cc861d72493740231a685bce8efc5.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/recursive-infection.png b/assets/cards/recursive-infection.png new file mode 100644 index 0000000..ebae163 Binary files /dev/null and b/assets/cards/recursive-infection.png differ diff --git a/assets/cards/recursive-infection.png.import b/assets/cards/recursive-infection.png.import new file mode 100644 index 0000000..78a1eba --- /dev/null +++ b/assets/cards/recursive-infection.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dlvd7h6jiodip" +path.bptc="res://.godot/imported/recursive-infection.png-0b7ef02cdf18cd2cdfa7ee609bb0ae93.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/recursive-infection.png" +dest_files=["res://.godot/imported/recursive-infection.png-0b7ef02cdf18cd2cdfa7ee609bb0ae93.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/redundant-power-supply.png b/assets/cards/redundant-power-supply.png new file mode 100644 index 0000000..e7c90d1 Binary files /dev/null and b/assets/cards/redundant-power-supply.png differ diff --git a/assets/cards/redundant-power-supply.png.import b/assets/cards/redundant-power-supply.png.import new file mode 100644 index 0000000..2fab2ff --- /dev/null +++ b/assets/cards/redundant-power-supply.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://by73pqknlykoi" +path.bptc="res://.godot/imported/redundant-power-supply.png-4046120167fce01611d850bd8b94c928.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/redundant-power-supply.png" +dest_files=["res://.godot/imported/redundant-power-supply.png-4046120167fce01611d850bd8b94c928.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/replication-routine.png b/assets/cards/replication-routine.png new file mode 100644 index 0000000..fca5ebe Binary files /dev/null and b/assets/cards/replication-routine.png differ diff --git a/assets/cards/replication-routine.png.import b/assets/cards/replication-routine.png.import new file mode 100644 index 0000000..f02c1a8 --- /dev/null +++ b/assets/cards/replication-routine.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cktogv6ts6slm" +path.bptc="res://.godot/imported/replication-routine.png-d32c8636c94afdd9395ef257ecaf5bec.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/replication-routine.png" +dest_files=["res://.godot/imported/replication-routine.png-d32c8636c94afdd9395ef257ecaf5bec.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/resource-leech.png b/assets/cards/resource-leech.png new file mode 100644 index 0000000..2e7ed8e Binary files /dev/null and b/assets/cards/resource-leech.png differ diff --git a/assets/cards/resource-leech.png.import b/assets/cards/resource-leech.png.import new file mode 100644 index 0000000..c76db6b --- /dev/null +++ b/assets/cards/resource-leech.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://coidynogmubk2" +path.bptc="res://.godot/imported/resource-leech.png-33c6f6daf52c0d894008e0241bd9a822.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/resource-leech.png" +dest_files=["res://.godot/imported/resource-leech.png-33c6f6daf52c0d894008e0241bd9a822.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/rollback-routine.png b/assets/cards/rollback-routine.png new file mode 100644 index 0000000..204578e Binary files /dev/null and b/assets/cards/rollback-routine.png differ diff --git a/assets/cards/rollback-routine.png.import b/assets/cards/rollback-routine.png.import new file mode 100644 index 0000000..242f338 --- /dev/null +++ b/assets/cards/rollback-routine.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cv1qtkgnbqjip" +path.bptc="res://.godot/imported/rollback-routine.png-a8bae71fa5f1f9f272ff5fb247f5bb24.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/rollback-routine.png" +dest_files=["res://.godot/imported/rollback-routine.png-a8bae71fa5f1f9f272ff5fb247f5bb24.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/rootkit.png b/assets/cards/rootkit.png new file mode 100644 index 0000000..c6f135f Binary files /dev/null and b/assets/cards/rootkit.png differ diff --git a/assets/cards/rootkit.png.import b/assets/cards/rootkit.png.import new file mode 100644 index 0000000..84dc703 --- /dev/null +++ b/assets/cards/rootkit.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://pq3bku5h43n3" +path.bptc="res://.godot/imported/rootkit.png-a99791c6dffed075180030a4db24996c.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/rootkit.png" +dest_files=["res://.godot/imported/rootkit.png-a99791c6dffed075180030a4db24996c.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/sandbox-mode.png b/assets/cards/sandbox-mode.png new file mode 100644 index 0000000..892ec4d Binary files /dev/null and b/assets/cards/sandbox-mode.png differ diff --git a/assets/cards/sandbox-mode.png.import b/assets/cards/sandbox-mode.png.import new file mode 100644 index 0000000..84a3e19 --- /dev/null +++ b/assets/cards/sandbox-mode.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cr64oobm6g3n7" +path.bptc="res://.godot/imported/sandbox-mode.png-ab5b3128e805425fc3c9919c73e322f8.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/sandbox-mode.png" +dest_files=["res://.godot/imported/sandbox-mode.png-ab5b3128e805425fc3c9919c73e322f8.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/screen-tear.png b/assets/cards/screen-tear.png new file mode 100644 index 0000000..4806d22 Binary files /dev/null and b/assets/cards/screen-tear.png differ diff --git a/assets/cards/screen-tear.png.import b/assets/cards/screen-tear.png.import new file mode 100644 index 0000000..87ca178 --- /dev/null +++ b/assets/cards/screen-tear.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dgao4cgqq5uke" +path.bptc="res://.godot/imported/screen-tear.png-fe471608fe7c93b3717d8172cc56d56f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/screen-tear.png" +dest_files=["res://.godot/imported/screen-tear.png-fe471608fe7c93b3717d8172cc56d56f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/segmentation-fault.png b/assets/cards/segmentation-fault.png new file mode 100644 index 0000000..2438ce2 Binary files /dev/null and b/assets/cards/segmentation-fault.png differ diff --git a/assets/cards/segmentation-fault.png.import b/assets/cards/segmentation-fault.png.import new file mode 100644 index 0000000..c917f00 --- /dev/null +++ b/assets/cards/segmentation-fault.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cdiaq66apj6n4" +path.bptc="res://.godot/imported/segmentation-fault.png-41cdb7337a2a0c88230ab2fe4eee365a.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/segmentation-fault.png" +dest_files=["res://.godot/imported/segmentation-fault.png-41cdb7337a2a0c88230ab2fe4eee365a.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/server-farm.png b/assets/cards/server-farm.png new file mode 100644 index 0000000..0665fd7 Binary files /dev/null and b/assets/cards/server-farm.png differ diff --git a/assets/cards/server-farm.png.import b/assets/cards/server-farm.png.import new file mode 100644 index 0000000..bddb528 --- /dev/null +++ b/assets/cards/server-farm.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bjf0bn3pqch60" +path.bptc="res://.godot/imported/server-farm.png-eb5aa2a21ad83008d4c6980ad331840b.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/server-farm.png" +dest_files=["res://.godot/imported/server-farm.png-eb5aa2a21ad83008d4c6980ad331840b.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/service-pack.png b/assets/cards/service-pack.png new file mode 100644 index 0000000..42ecc94 Binary files /dev/null and b/assets/cards/service-pack.png differ diff --git a/assets/cards/service-pack.png.import b/assets/cards/service-pack.png.import new file mode 100644 index 0000000..ce55056 --- /dev/null +++ b/assets/cards/service-pack.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dx7qvujqiafdk" +path.bptc="res://.godot/imported/service-pack.png-4ec0a40185034811f1064376c04ef0e4.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/service-pack.png" +dest_files=["res://.godot/imported/service-pack.png-4ec0a40185034811f1064376c04ef0e4.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/session-hijack.png b/assets/cards/session-hijack.png new file mode 100644 index 0000000..14026bc Binary files /dev/null and b/assets/cards/session-hijack.png differ diff --git a/assets/cards/session-hijack.png.import b/assets/cards/session-hijack.png.import new file mode 100644 index 0000000..b731416 --- /dev/null +++ b/assets/cards/session-hijack.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bd3h4drldil3g" +path.bptc="res://.godot/imported/session-hijack.png-66e98f788bbb22957e50ffa828b7d463.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/session-hijack.png" +dest_files=["res://.godot/imported/session-hijack.png-66e98f788bbb22957e50ffa828b7d463.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/solid-state-cache.png b/assets/cards/solid-state-cache.png new file mode 100644 index 0000000..ca04263 Binary files /dev/null and b/assets/cards/solid-state-cache.png differ diff --git a/assets/cards/solid-state-cache.png.import b/assets/cards/solid-state-cache.png.import new file mode 100644 index 0000000..2a8e1d8 --- /dev/null +++ b/assets/cards/solid-state-cache.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c1lg26bb3k1xf" +path.bptc="res://.godot/imported/solid-state-cache.png-a5b41b56ddf8101550fafcb56fb081cc.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/solid-state-cache.png" +dest_files=["res://.godot/imported/solid-state-cache.png-a5b41b56ddf8101550fafcb56fb081cc.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/spoofed-mac.png b/assets/cards/spoofed-mac.png new file mode 100644 index 0000000..0045097 Binary files /dev/null and b/assets/cards/spoofed-mac.png differ diff --git a/assets/cards/spoofed-mac.png.import b/assets/cards/spoofed-mac.png.import new file mode 100644 index 0000000..11ca9f6 --- /dev/null +++ b/assets/cards/spoofed-mac.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c07wuum2214lw" +path.bptc="res://.godot/imported/spoofed-mac.png-4cb672eae54766cda30606ce1ff8538f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/spoofed-mac.png" +dest_files=["res://.godot/imported/spoofed-mac.png-4cb672eae54766cda30606ce1ff8538f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/stable-release.png b/assets/cards/stable-release.png new file mode 100644 index 0000000..35e451f Binary files /dev/null and b/assets/cards/stable-release.png differ diff --git a/assets/cards/stable-release.png.import b/assets/cards/stable-release.png.import new file mode 100644 index 0000000..c3868d9 --- /dev/null +++ b/assets/cards/stable-release.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dmt7x5rpuu425" +path.bptc="res://.godot/imported/stable-release.png-56a65e17885dc9909aeb990e02f57602.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/stable-release.png" +dest_files=["res://.godot/imported/stable-release.png-56a65e17885dc9909aeb990e02f57602.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/stack-overflow.png b/assets/cards/stack-overflow.png new file mode 100644 index 0000000..facd758 Binary files /dev/null and b/assets/cards/stack-overflow.png differ diff --git a/assets/cards/stack-overflow.png.import b/assets/cards/stack-overflow.png.import new file mode 100644 index 0000000..375dadd --- /dev/null +++ b/assets/cards/stack-overflow.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b7u6hnerim4st" +path.bptc="res://.godot/imported/stack-overflow.png-6207b2b4939e7e4856d27ee3252f4479.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/stack-overflow.png" +dest_files=["res://.godot/imported/stack-overflow.png-6207b2b4939e7e4856d27ee3252f4479.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/stock-rice.png b/assets/cards/stock-rice.png new file mode 100644 index 0000000..1323f02 Binary files /dev/null and b/assets/cards/stock-rice.png differ diff --git a/assets/cards/stock-rice.png.import b/assets/cards/stock-rice.png.import new file mode 100644 index 0000000..6109696 --- /dev/null +++ b/assets/cards/stock-rice.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bgxnsulm0j7mb" +path.bptc="res://.godot/imported/stock-rice.png-9a3e1ff170be55dfb7e32dbe63f5bf67.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/stock-rice.png" +dest_files=["res://.godot/imported/stock-rice.png-9a3e1ff170be55dfb7e32dbe63f5bf67.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/surge-protector.png b/assets/cards/surge-protector.png new file mode 100644 index 0000000..92951e5 Binary files /dev/null and b/assets/cards/surge-protector.png differ diff --git a/assets/cards/surge-protector.png.import b/assets/cards/surge-protector.png.import new file mode 100644 index 0000000..de58e20 --- /dev/null +++ b/assets/cards/surge-protector.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b2rcdlr3hjrlr" +path.bptc="res://.godot/imported/surge-protector.png-269629ce98c6dab9aef4c45d5ad08e20.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/surge-protector.png" +dest_files=["res://.godot/imported/surge-protector.png-269629ce98c6dab9aef4c45d5ad08e20.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/test-bench.png b/assets/cards/test-bench.png new file mode 100644 index 0000000..e9935d1 Binary files /dev/null and b/assets/cards/test-bench.png differ diff --git a/assets/cards/test-bench.png.import b/assets/cards/test-bench.png.import new file mode 100644 index 0000000..a169d62 --- /dev/null +++ b/assets/cards/test-bench.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5g1xraptah4p" +path.bptc="res://.godot/imported/test-bench.png-2d3bb91f8c9e7fe59ff94ae405d2fadf.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/test-bench.png" +dest_files=["res://.godot/imported/test-bench.png-2d3bb91f8c9e7fe59ff94ae405d2fadf.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/trojan-horse.png b/assets/cards/trojan-horse.png new file mode 100644 index 0000000..cce889f Binary files /dev/null and b/assets/cards/trojan-horse.png differ diff --git a/assets/cards/trojan-horse.png.import b/assets/cards/trojan-horse.png.import new file mode 100644 index 0000000..cf1db8c --- /dev/null +++ b/assets/cards/trojan-horse.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cgni42h4xq543" +path.bptc="res://.godot/imported/trojan-horse.png-d0a2f13f5865842be1297072aaba08b3.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/trojan-horse.png" +dest_files=["res://.godot/imported/trojan-horse.png-d0a2f13f5865842be1297072aaba08b3.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/tunnel.png b/assets/cards/tunnel.png new file mode 100644 index 0000000..cc641d8 Binary files /dev/null and b/assets/cards/tunnel.png differ diff --git a/assets/cards/tunnel.png.import b/assets/cards/tunnel.png.import new file mode 100644 index 0000000..65eb8a2 --- /dev/null +++ b/assets/cards/tunnel.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ttqr40ov1n56" +path.bptc="res://.godot/imported/tunnel.png-a0b864281d2b62009f4b362ca9b7fa96.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/tunnel.png" +dest_files=["res://.godot/imported/tunnel.png-a0b864281d2b62009f4b362ca9b7fa96.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/turn-sequence.png b/assets/cards/turn-sequence.png new file mode 100644 index 0000000..b8b8fa3 Binary files /dev/null and b/assets/cards/turn-sequence.png differ diff --git a/assets/cards/turn-sequence.png.import b/assets/cards/turn-sequence.png.import new file mode 100644 index 0000000..f3d6f3a --- /dev/null +++ b/assets/cards/turn-sequence.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://g5ixi8wndphn" +path.bptc="res://.godot/imported/turn-sequence.png-ef774dd07e52ba87f67abc1077e0834c.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/turn-sequence.png" +dest_files=["res://.godot/imported/turn-sequence.png-ef774dd07e52ba87f67abc1077e0834c.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/undefined-behavior.png b/assets/cards/undefined-behavior.png new file mode 100644 index 0000000..7eaa92a Binary files /dev/null and b/assets/cards/undefined-behavior.png differ diff --git a/assets/cards/undefined-behavior.png.import b/assets/cards/undefined-behavior.png.import new file mode 100644 index 0000000..2b7c99b --- /dev/null +++ b/assets/cards/undefined-behavior.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://drerivbjynib1" +path.bptc="res://.godot/imported/undefined-behavior.png-7b382eb2bc4de51496442e31db8b8bf5.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/undefined-behavior.png" +dest_files=["res://.godot/imported/undefined-behavior.png-7b382eb2bc4de51496442e31db8b8bf5.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/unhandled-exception.png b/assets/cards/unhandled-exception.png new file mode 100644 index 0000000..e997657 Binary files /dev/null and b/assets/cards/unhandled-exception.png differ diff --git a/assets/cards/unhandled-exception.png.import b/assets/cards/unhandled-exception.png.import new file mode 100644 index 0000000..f8230c3 --- /dev/null +++ b/assets/cards/unhandled-exception.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://53pcw6mi0nww" +path.bptc="res://.godot/imported/unhandled-exception.png-0c815baf1a3531a055f74339a035a856.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/unhandled-exception.png" +dest_files=["res://.godot/imported/unhandled-exception.png-0c815baf1a3531a055f74339a035a856.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/upgraded-hardware.png b/assets/cards/upgraded-hardware.png new file mode 100644 index 0000000..3a26e27 Binary files /dev/null and b/assets/cards/upgraded-hardware.png differ diff --git a/assets/cards/upgraded-hardware.png.import b/assets/cards/upgraded-hardware.png.import new file mode 100644 index 0000000..e8e43c8 --- /dev/null +++ b/assets/cards/upgraded-hardware.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://sysc8l8bs45b" +path.bptc="res://.godot/imported/upgraded-hardware.png-3bc271f9640e22c9505918bb66d9e1ec.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/upgraded-hardware.png" +dest_files=["res://.godot/imported/upgraded-hardware.png-3bc271f9640e22c9505918bb66d9e1ec.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/uptime-monitor.png b/assets/cards/uptime-monitor.png new file mode 100644 index 0000000..4d3d787 Binary files /dev/null and b/assets/cards/uptime-monitor.png differ diff --git a/assets/cards/uptime-monitor.png.import b/assets/cards/uptime-monitor.png.import new file mode 100644 index 0000000..5d5b48e --- /dev/null +++ b/assets/cards/uptime-monitor.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cf0akwtwgcgwa" +path.bptc="res://.godot/imported/uptime-monitor.png-0b15d58f3a084b2997bbe0e8968b3cf3.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/uptime-monitor.png" +dest_files=["res://.godot/imported/uptime-monitor.png-0b15d58f3a084b2997bbe0e8968b3cf3.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/version-control.png b/assets/cards/version-control.png new file mode 100644 index 0000000..041ed26 Binary files /dev/null and b/assets/cards/version-control.png differ diff --git a/assets/cards/version-control.png.import b/assets/cards/version-control.png.import new file mode 100644 index 0000000..5c91e65 --- /dev/null +++ b/assets/cards/version-control.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8li1vlgal0pi" +path.bptc="res://.godot/imported/version-control.png-aef73cb7bc97c8091379403e17db3702.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/version-control.png" +dest_files=["res://.godot/imported/version-control.png-aef73cb7bc97c8091379403e17db3702.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/visual-artifact.png b/assets/cards/visual-artifact.png new file mode 100644 index 0000000..ed8a07a Binary files /dev/null and b/assets/cards/visual-artifact.png differ diff --git a/assets/cards/visual-artifact.png.import b/assets/cards/visual-artifact.png.import new file mode 100644 index 0000000..84290c0 --- /dev/null +++ b/assets/cards/visual-artifact.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dwfjmo1pu15g5" +path.bptc="res://.godot/imported/visual-artifact.png-06aef59016d9647d5abb5542e4151b4f.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/visual-artifact.png" +dest_files=["res://.godot/imported/visual-artifact.png-06aef59016d9647d5abb5542e4151b4f.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/warm-standby.png b/assets/cards/warm-standby.png new file mode 100644 index 0000000..aa18f60 Binary files /dev/null and b/assets/cards/warm-standby.png differ diff --git a/assets/cards/warm-standby.png.import b/assets/cards/warm-standby.png.import new file mode 100644 index 0000000..9924449 --- /dev/null +++ b/assets/cards/warm-standby.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://l618fx2ocwrr" +path.bptc="res://.godot/imported/warm-standby.png-7371c5bb126f030c07d543999fb0b4a9.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/warm-standby.png" +dest_files=["res://.godot/imported/warm-standby.png-7371c5bb126f030c07d543999fb0b4a9.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/watchdog-timer.png b/assets/cards/watchdog-timer.png new file mode 100644 index 0000000..0d068d5 Binary files /dev/null and b/assets/cards/watchdog-timer.png differ diff --git a/assets/cards/watchdog-timer.png.import b/assets/cards/watchdog-timer.png.import new file mode 100644 index 0000000..d4c4e41 --- /dev/null +++ b/assets/cards/watchdog-timer.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://egsyyqqera3y" +path.bptc="res://.godot/imported/watchdog-timer.png-a5c0f6c20d372d37d9ca8cf52fcf8d2e.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/watchdog-timer.png" +dest_files=["res://.godot/imported/watchdog-timer.png-a5c0f6c20d372d37d9ca8cf52fcf8d2e.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/worm-protocol.png b/assets/cards/worm-protocol.png new file mode 100644 index 0000000..fa016d7 Binary files /dev/null and b/assets/cards/worm-protocol.png differ diff --git a/assets/cards/worm-protocol.png.import b/assets/cards/worm-protocol.png.import new file mode 100644 index 0000000..5599047 --- /dev/null +++ b/assets/cards/worm-protocol.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c8im013mxsids" +path.bptc="res://.godot/imported/worm-protocol.png-d8e2741fe7fecb3bee59d83b853e6016.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/worm-protocol.png" +dest_files=["res://.godot/imported/worm-protocol.png-d8e2741fe7fecb3bee59d83b853e6016.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/cards/zero-day.png b/assets/cards/zero-day.png new file mode 100644 index 0000000..4dceeb3 Binary files /dev/null and b/assets/cards/zero-day.png differ diff --git a/assets/cards/zero-day.png.import b/assets/cards/zero-day.png.import new file mode 100644 index 0000000..83b9a78 --- /dev/null +++ b/assets/cards/zero-day.png.import @@ -0,0 +1,41 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://omvhav7jf0pb" +path.bptc="res://.godot/imported/zero-day.png-474d95a7546f4f8059aa23f8fa33ebf7.bptc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/cards/zero-day.png" +dest_files=["res://.godot/imported/zero-day.png-474d95a7546f4f8059aa23f8fa33ebf7.bptc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/playmat.glb b/assets/playmat.glb new file mode 100644 index 0000000..98cab16 Binary files /dev/null and b/assets/playmat.glb differ diff --git a/assets/playmat.glb.import b/assets/playmat.glb.import new file mode 100644 index 0000000..1ffad18 --- /dev/null +++ b/assets/playmat.glb.import @@ -0,0 +1,45 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://dx42gyxom1dlb" +path="res://.godot/imported/playmat.glb-d9737516f14bdadcb60b8362bc02041d.scn" + +[deps] + +source_file="res://assets/playmat.glb" +dest_files=["res://.godot/imported/playmat.glb-d9737516f14bdadcb60b8362bc02041d.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/root_script=null +mesh_library/use_node_names_as_mesh_names=false +array_mesh/deduplicate_surfaces=true +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_name_suffixes=true +nodes/use_node_type_suffixes=true +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +animation/import_rest_as_RESET=false +import_script/path="" +materials/extract=0 +materials/extract_format=0 +materials/extract_path="" +_subresources={} +gltf/naming_version=2 +gltf/embedded_image_handling=1 +gltf/texture_map_mode=1 diff --git a/assets/playmat.tres b/assets/playmat.tres new file mode 100644 index 0000000..12cb309 --- /dev/null +++ b/assets/playmat.tres @@ -0,0 +1,15 @@ +[gd_resource type="StandardMaterial3D" format=3 uid="uid://br7tudxocdqc5"] + +[ext_resource type="Texture2D" uid="uid://hh3bkokkxlbg" path="res://assets/playmat_soft_suede_fabric_11_color.jpg" id="1_vwyhm"] +[ext_resource type="Texture2D" uid="uid://cw4w4ttglxv7p" path="res://assets/playmat_soft_suede_fabric_11_normal.jpg" id="2_7rrjq"] +[ext_resource type="Texture2D" uid="uid://bh3216osa4865" path="res://assets/playmat_soft_suede_fabric_11_roughness.png" id="3_18x2y"] + +[resource] +albedo_texture = ExtResource("1_vwyhm") +metallic_specular = 0.0 +roughness_texture = ExtResource("3_18x2y") +normal_enabled = true +normal_texture = ExtResource("2_7rrjq") +uv1_scale = Vector3(2.284, 1.903, 1) +uv1_offset = Vector3(0.908, 0, 0) +texture_filter = 5 diff --git a/assets/playmat_soft_suede_fabric_11_color.jpg b/assets/playmat_soft_suede_fabric_11_color.jpg new file mode 100644 index 0000000..a1adbe2 Binary files /dev/null and b/assets/playmat_soft_suede_fabric_11_color.jpg differ diff --git a/assets/playmat_soft_suede_fabric_11_color.jpg.import b/assets/playmat_soft_suede_fabric_11_color.jpg.import new file mode 100644 index 0000000..02a2d86 --- /dev/null +++ b/assets/playmat_soft_suede_fabric_11_color.jpg.import @@ -0,0 +1,44 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hh3bkokkxlbg" +path.s3tc="res://.godot/imported/playmat_soft_suede_fabric_11_color.jpg-d12aff910350983bcc520ede90c103e9.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "e3722443f9682798e8bfafbb24d5c739" +} + +[deps] + +source_file="res://assets/playmat_soft_suede_fabric_11_color.jpg" +dest_files=["res://.godot/imported/playmat_soft_suede_fabric_11_color.jpg-d12aff910350983bcc520ede90c103e9.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/playmat_soft_suede_fabric_11_normal.jpg b/assets/playmat_soft_suede_fabric_11_normal.jpg new file mode 100644 index 0000000..18d72ee Binary files /dev/null and b/assets/playmat_soft_suede_fabric_11_normal.jpg differ diff --git a/assets/playmat_soft_suede_fabric_11_normal.jpg.import b/assets/playmat_soft_suede_fabric_11_normal.jpg.import new file mode 100644 index 0000000..23e988c --- /dev/null +++ b/assets/playmat_soft_suede_fabric_11_normal.jpg.import @@ -0,0 +1,44 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cw4w4ttglxv7p" +path.s3tc="res://.godot/imported/playmat_soft_suede_fabric_11_normal.jpg-448824ebc60fa1efed9fe5e2d036db7b.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "e75496cbf2a60fa2f858d7edb3b82b70" +} + +[deps] + +source_file="res://assets/playmat_soft_suede_fabric_11_normal.jpg" +dest_files=["res://.godot/imported/playmat_soft_suede_fabric_11_normal.jpg-448824ebc60fa1efed9fe5e2d036db7b.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=1 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/playmat_soft_suede_fabric_11_roughness.png b/assets/playmat_soft_suede_fabric_11_roughness.png new file mode 100644 index 0000000..029eda8 Binary files /dev/null and b/assets/playmat_soft_suede_fabric_11_roughness.png differ diff --git a/assets/playmat_soft_suede_fabric_11_roughness.png.import b/assets/playmat_soft_suede_fabric_11_roughness.png.import new file mode 100644 index 0000000..0cf0b4d --- /dev/null +++ b/assets/playmat_soft_suede_fabric_11_roughness.png.import @@ -0,0 +1,44 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bh3216osa4865" +path.s3tc="res://.godot/imported/playmat_soft_suede_fabric_11_roughness.png-fff690db98e029298381abbc66179d9a.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} +generator_parameters={ +"md5": "a2abd3d2945f9a9ac75906d98a053378" +} + +[deps] + +source_file="res://assets/playmat_soft_suede_fabric_11_roughness.png" +dest_files=["res://.godot/imported/playmat_soft_suede_fabric_11_roughness.png-fff690db98e029298381abbc66179d9a.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/data/cards.csv b/data/cards.csv new file mode 100644 index 0000000..a2eff4c --- /dev/null +++ b/data/cards.csv @@ -0,0 +1,137 @@ +"Name","Count","Front Template","Back Template","Bandwidth","Cores","Description","Type","Image","Expansion Slots","Ability Cost","Ability Name","Ability Description","Health","Set" +"Carbon NanoBots","1","Anomaly Front","Card Back",,"2","Nasty little bugs...","B","nano-bots","4","6","Replicate","Anomaly may create a copy of itself. Only one copy is allowed at a time. If the copy is defeated the original does not lose any hardware upgrades. If the original is defeated the replicate is as well.","10","1" +"Corrupt Driver","1","Anomaly Front","Card Back",,"3",,"V","driver-ascii-art","3","4","Driver Fault","Choose one Hardware on an enemy Anomaly in combat with this Anomaly. It is disabled until the end of your next command.","10","1" +"Pixelated Picture","1","Anomaly Front","Card Back",,"3",,"G","pix","3","3","Low Resolution","Attacking Anomalies have -1 cores against this Anomaly.","10","1" +"Beta Version 1.0","1","Anomaly Front","Card Back",,"4",,"P","broken-bits","2","4","Push Update","While in combat an additional piece of hardware can be placed on this anomaly until the end of your command. If there are no Expansion Slots available this can still be attached.","9","1" +"Code Zero","1","Anomaly Front","Card Back",,"3",,"V","code-zero","4","4","Patient Zero","Place an Infection counter on every enemy Anomaly in combat at this Server. While this Anomaly is in play, an Anomaly with 1+ Infection counters has -1 Core.","10","1" +"Data Leaker","1","Anomaly Front","Card Back",,"3",,"G","data-leaker","3","3","Exfiltrate","Look at your opponent's hand and choose one card in it. They must discard that card without gaining Bandwidth. If this Anomaly breached a Server this command, draw a card.","10","1" +"Backup Machine","1","Anomaly Front","Card Back",,"3",,"P","backup","3","5","Restore Point","Remove 3 damage from this Anomaly, or return one Hardware or Program from your discard pile to your hand. If it is a Hardware and this Anomaly has an open Expansion Slot, you may install it immediately for 2 less Gb.","10","1" +"Broken Bits","1","Anomaly Front","Card Back",,"4",,"B","broken-bits-2","2","4","Bit Flip","During a combat at this Server, reroll any number of this Anomaly's Core dice.","9","1" +"Recursive Infection","1","Program Front","Card Back","6",,"Whenever an enemy Anomaly attacks or breaches this Server, place an Infection counter on it. An Anomaly with 3+ Infection counters has -2 Core.","V",,,,,,,"1" +"Memory Parasite","1","Program Front","Card Back","5",,"Enemy Anomalies attacking this Server have 1 hardware component disabled of the owners choosing.","V",,,,,,,"1" +"Replication Routine","1","Program Front","Card Back","6",,"When you install a Virus Program on this Server, you may install a second Virus Program from your hand here for no Bandwidth cost.","V",,,,,,,"1" +"Resource Leech","1","Program Front","Card Back","5",,"Whenever an enemy Anomaly takes damage while attacking this Server, gain 3 Gb.","V",,,,,,,"1" +"Worm Protocol","1","Program Front","Card Back","4",,"The localized effects of your other Programs on this Server also apply at one adjacent Server you choose when this is installed.","V",,,,,,,"1" +"Payload Injector","1","Program Front","Card Back","6",,"The first Execution you play targeting this Server each round costs 2 less Gb.","V",,,,,,,"1" +"Persistent Infection","1","Program Front","Card Back","6",,"Whenever an enemy Anomaly takes damage at this Server, place an Infection counter on it permanently.","V",,,,,,,"1" +"Infinite Loop","1","Program Front","Card Back","5",,"If the attacking Anomaly is controlled by the owner of this Program, it may attack a second adjacent Server in the same command.","B",,,,,,,"1" +"Stack Overflow","1","Program Front","Card Back","7",,"Anomalies you control defending this Server gain +1 Core for each Program installed on this Server (including this one).","B",,,,,,,"1" +"Race Condition","1","Program Front","Card Back","4",,"During any combat at this Server, both players secretly choose Attack or Defend. If the choices differ, the defender gains a combat bonus of +2 Cores.","B",,,,,,,"1" +"Bloatware","1","Program Front","Card Back","6",,"At the start of any combat at this Server, the attacking Anomaly loses 1 Core for each Hardware installed on it.","B",,,,,,,"1" +"Null Pointer","1","Program Front","Card Back","5",,"Once per round, when an enemy Execution would resolve at this Server, it's effect does not occur.","B",,,,,,,"1" +"Stock Rice","1","Program Front","Card Back","4",,"Neither Anomaly in a combat that takes place at this Server may use any Hardware bonuses.","B",,,,,,,"1" +"Overflow Error","1","Program Front","Card Back","5",,"When an enemy Anomaly takes damage while attacking this Server, disable one Program its controller has in play until their next command. If the Anomaly was destroyed, you may destroy that Program instead.","B",,,,,,,"1" +"Undefined Behavior","1","Program Front","Card Back","8",,"Once per round, copy the localized effect of another Program on another Server. Then disable this Program until your next command.","B",,,,,,,"1" +"Packet Loss","1","Program Front","Card Back","6",,"When an enemy successfully breaches this Server, its controller discards a card at random.","G",,,,,,,"1" +"Desynchronization","1","Program Front","Card Back","5",,"Enemy Anomalies attacking this Server cannot use their Hardware's ""once per round"" abilities during that combat.","G",,,,,,,"1" +"Visual Artifact","1","Program Front","Card Back","5",,"The first attack made against an Anomaly you control at this Server suffers -1 Core.","G",,,,,,,"1" +"Ghost Process","1","Program Front","Card Back","6",,"Your Executions played targeting this Server may also affect Anomalies, Programs, and Hardware at one adjacent Server.","G",,,,,,,"1" +"False Positive","1","Program Front","Card Back","7",,"When an enemy Execution targets an Anomaly you control at this Server, you may redirect it to another legal Anomaly at another Server.","G",,,,,,,"1" +"Fragmentation","1","Program Front","Card Back","6",,"Executions your opponents play targeting this Server cost +2 Gb.","G",,,,,,,"1" +"Latency Spike","1","Program Front","Card Back","5",,"The attacking player cannot play Executions during the first step of any combat at this Server.","G",,,,,,,"1" +"Hotfix","1","Program Front","Card Back","7",,"The first Program on this Server that would be destroyed each round is instead disabled until your next command.","P",,,,,,,"1" +"Error Correction","1","Program Front","Card Back","5",,"At the beginning of your first command each round, remove one negative counter or status from each Anomaly you control at this Server.","P",,,,,,,"1" +"Garbage Collection","1","Program Front","Card Back","6",,"Once per round, sacrifice one Program installed on this Server to recover its printed Bandwidth value.","P",,,,,,,"1" +"Version Control","1","Program Front","Card Back","5",,"When a Program on this Server would be destroyed, or when this Server is captured, return one Program from this Server to your hand instead of discarding it.","P",,,,,,,"1" +"Rollback Routine","1","Program Front","Card Back","4",,"Once per round, undo the most recent temporary stat reduction applied to an Anomaly you control at this Server.","P",,,,,,,"1" +"Compatibility Layer","1","Program Front","Card Back","6",,"This Server may hold one additional Program beyond the normal limit, and Patch Programs installed here cost 2 less Gb.","P",,,,,,,"1" +"RAM Expansion","1","Hardware Front","Card Back","5",,"Anomaly gains +2 Health.",,,,,,,,"1" +"Additional Core","1","Hardware Front","Card Back","5",,"Anomaly gains +1 Core.",,,,,,,,"1" +"Overclocked CPU","1","Hardware Front","Card Back","6",,"Anomaly gains +2 Cores during combat, but one installed Program at the current server becomes disabled afterward for 2 commands.",,,,,,,,"1" +"Solid-State Cache","1","Hardware Front","Card Back","6",,"The first Program installed on the occupied Server each round costs 3 less Gb.",,,,,,,,"1" +"Redundant Power Supply","1","Hardware Front","Card Back","8",,"The first time this Anomaly would be destroyed, do not destroy the Hardware.",,,,,,,,"1" +"Network Interface Upgrade","1","Hardware Front","Card Back","4",,"This Hardware can be played without taking an Expansion Slot on the Anomaly.",,,,,,,,"1" +"Dedicated GPU","1","Hardware Front","Card Back","6",,"Executions performed by this Anomaly receive +1 effectiveness or combat strength.",,,,,,,,"1" +"ECC Memory","1","Hardware Front","Card Back","5",,"Opponents cannot place Bug counters or Bug status effects on this Anomaly.",,,,,,,,"1" +"Cooling System","1","Hardware Front","Card Back","6",,"Allow one Hardware to activate twice per round.",,,,,,,,"1" +"RAID Array","1","Hardware Front","Card Back","5",,"When this Anomaly is destroyed, all hardware can be kept by paying half the Bandwidth cost.",,,,,,,,"1" +"Packet Accelerator","1","Hardware Front","Card Back","4",,"This Anomaly gains +1 Core hen attacking.",,,,,,,,"1" +"Firewall Appliance","1","Hardware Front","Card Back","6",,"The first hostile Program or Execution targeting this Anomaly each round costs the opponent +3 Gb.",,,,,,,,"1" +"Hardware Sandbox","1","Hardware Front","Card Back","7",,"Choose one Program installed on the occupied Server. It cannot be targeted by opponents.",,,,,,,,"1" +"Diagnostic Module","1","Hardware Front","Card Back","4",,"Look at one face down card in your draw pile. You may place it at the bottom and draw another to start your first command each round.",,,,,,,,"1" +"Hot-Swap Bay","1","Hardware Front","Card Back","6",,"Once per round, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost.",,,,,,,,"1" +"Quantum Coprocessor","1","Hardware Front","Card Back","9",,"Once per round when this Anomaly uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware.",,,,,,,,"1" +"High Bandwidth Server","1","Server Front","Card Back",,,"Add additional 4 Gb to resource total",,,,,,,,"1" +"MultiCore Server","1","Server Front","Card Back",,,"Add 2 Cores to any Anomalies",,,,,,,,"1" +"Cluster Server","1","Server Front","Card Back",,,"Up to 2 Anomalies can defend this Server",,,,,,,,"1" +"Power Server","1","Server Front","Card Back",,,"Add additional 4 Gb to resource total",,,,,,,,"1" +"Backup Server","1","Server Front","Card Back",,,"Duplicate Anomaly based at this Server",,,,,,,,"1" +"Server Farm","1","Server Front","Card Back",,,"Add 4 Gb to resource total and 2 Cores to any Anomaly",,,,,,,,"1" +"Upgraded Hardware","1","Server Front","Card Back",,,"Hardware upgrades cost 2 less Gb to install",,,,,,,,"1" +"Network Throttle","1","Server Front","Card Back",,,"Firewalls cost 1 less Gb to install",,,,,,,,"1" +"Cloud Compute","1","Server Front","Card Back",,,"Add 4 Cores to any Anomalies",,,,,,,,"1" +"Duplicate Server","1","Server Front","Card Back",,,"Copy one adjacent Server ability",,,,,,,,"1" +"Pingable Server","1","Server Front","Card Back",,,"Up to 2 Anomalies can defend this Server",,,,,,,,"1" +"Protected Server","1","Server Front","Card Back",,,"Add 2 Gb if defending this Server",,,,,,,,"1" +"Callable Server","1","Server Front","Card Back",,,"When drawing a card, you may choose to place it on the bottom of the deck and draw another",,,,,,,,"1" +"Execute: Disconnect","1","Execution Front","Card Back","4",,"Move one Anomaly you control at the target Server to an adjacent Server, removing it from any combat there.",,,,,,,,"1" +"Execute: Sabotage","1","Execution Front","Card Back","7",,"Destroy or disable one Hardware on an enemy Anomaly in combat at the target Server.",,,,,,,,"1" +"Execute: Kill Process","1","Execution Front","Card Back","5",,"Disable one Program installed on the target Server until its controller's next command.",,,,,,,,"1" +"Execute: Force Reboot","1","Execution Front","Card Back","5",,"Remove all temporary bonuses and penalties from one Anomaly you control at the target Server, or one Anomaly attacking it. That Anomaly cannot play another Execution until end of current command.",,,,,,,,"1" +"Execute: Fork","1","Execution Front","Card Back","7",,"Copy the localized effect of one Program installed on the target Server until end of current command.",,,,,,,,"1" +"Execute: Ping Sweep","1","Execution Front","Card Back","4",,"You may draw 2 cards from the top of your deck.",,,,,,,,"1" +"Execute: Trace Route","1","Execution Front","Card Back","5",,"Move one Anomaly you control from an adjacent Server to the target Server. If the target Server is enemy-controlled, your Anomaly attacks it with +1 Core for the resulting combat.",,,,,,,,"1" +"Execute: Override","1","Execution Front","Card Back","5",,"Choose one enemy Program installed on the target Server. Ignore its text until end of current command.",,,,,,,,"1" +"Execute: Memory Dump","1","Execution Front","Card Back","4",,"Draw 2 cards, then discard 1. If you control the target Server, draw 1 extra card instead of discarding.",,,,,,,,"1" +"Execute: Rollback","1","Execution Front","Card Back","4",,"Return one Program or Hardware installed at the target Server this command to its owner's hand.",,,,,,,,"1" +"Execute: Root Access","1","Execution Front","Card Back","4",,"Until end of current command, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected.",,,,,,,,"1" +"Execute: Packet Flood","1","Execution Front","Card Back","5",,"Anomalies based at the target Server cannot move or retreat until the start of their controller's next command.",,,,,,,,"1" +"Execute: Emergency Shutdown","1","Execution Front","Card Back","6",,"End any combat at the target Server immediately. All Anomalies there remain and become Disabled until end of current command.",,,,,,,,"1" +"Execute: Process Clone","1","Execution Front","Card Back","7",,"Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of current command.",,,,,,,,"1" +"Execute: Defragment","1","Execution Front","Card Back","4",,"Re-enable one Disabled Program on the target Server, or one Disabled Hardware on an Anomaly there.",,,,,,,,"1" +"Execute: Remote Access","1","Execution Front","Card Back","6",,"Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of current command.",,,,,,,,"1" +"Execute: Purge","1","Execution Front","Card Back","4",,"Remove all Virus/Infection counters and hostile persistent effects from every Anomaly you control at the target Server.",,,,,,,,"1" +"Execute: Hard Reset","1","Execution Front","Card Back","6",,"Uninstall any number of Programs from the target Server you control. For each card returned to your hand this way, recover 1 Gb.",,,,,,,,"1" +"Turn Sequence","1","Turn Order Front","Card Back",,,"The order of a round and the steps of one command. The first player leads every round.",,,,,,,,"1" +"Ransomware","1","Anomaly Front","Card Back",,"4",,"V","ransomware","2","4","Extortion","Choose one enemy Anomaly in combat with this Anomaly. Its controller either pays you 2 Gb for each Hardware on it, or discards one of its Hardware.","9","2" +"Botnet","1","Anomaly Front","Card Back",,"2",,"V","botnet","4","3","Command and Control","Place an Infection counter on one enemy Anomaly adjacent to this Anomaly. While this Anomaly is in play, whenever an enemy Anomaly with an Infection counter takes damage, gain 1 Gb.","12","2" +"Trojan Horse","1","Anomaly Front","Card Back",,"3",,"V","trojan-horse","3","4","Payload","Choose one enemy Anomaly in combat with this Anomaly. Place an Infection counter on it, then it takes 1 damage for each Infection counter on it.","10","2" +"Fuzzer","1","Anomaly Front","Card Back",,"3",,"B","fuzzer","3","3","Fuzz Input","Place a Bug counter on each enemy Anomaly in combat with this Anomaly.","10","2" +"Off By One","1","Anomaly Front","Card Back",,"4",,"B","off-by-one","2","4","Boundary Error","After the roll in a combat at this Server, set one of this Anomaly's dice to 6, or one enemy die to 1.","9","2" +"Heisenbug","1","Anomaly Front","Card Back",,"2",,"B","heisenbug","4","3","Observer Effect","Once per round, when this Anomaly takes damage, prevent 2 of that damage and place a Bug counter on the enemy Anomaly that dealt it.","12","2" +"Screen Tear","1","Anomaly Front","Card Back",,"3",,"G","screen-tear","3","4","Tear","This command, this Anomaly may attack a location two lines away as though it were adjacent, crossing at most one Firewall.","10","2" +"Phantom Cursor","1","Anomaly Front","Card Back",,"2",,"G","phantom-cursor","4","3","Haunt","Look at the top 2 cards of your opponent's Server pile and put one of them on the bottom. If this Anomaly breached a Server this command, draw a card.","12","2" +"Dead Pixel","1","Anomaly Front","Card Back",,"4",,"G","dead-pixel","2","3","Blackout","Until your next command, the Server this Anomaly stands on counts as adjacent to nothing for enemy Executions and Programs.","9","2" +"Service Pack","1","Anomaly Front","Card Back",,"3",,"P","service-pack","3","4","Roll Out","Re-enable all of your disabled Hardware and Programs at this Server, and remove 2 damage from this Anomaly.","10","2" +"Long Term Support","1","Anomaly Front","Card Back",,"4",,"P","long-term-support","2","3","Stable Branch","Until your next command, each time this Anomaly would take damage, it takes 2 less.","9","2" +"Checksum","1","Anomaly Front","Card Back",,"2",,"P","checksum","4","4","Rebuild","Move one Hardware from an Anomaly you control at an adjacent Server onto this Anomaly. It must fit its Expansion Slots.","12","2" +"Zero-Day","1","Program Front","Card Back","5",,"When your Anomaly attacks from this Server, place an Infection counter on each defender before the roll.","V",,,,,,,"2" +"Keylogger","1","Program Front","Card Back","5",,"Whenever an enemy Anomaly with an Infection counter attacks this Server, look at its controller's hand and choose a card. They discard it unless they pay 2 Gb.","V",,,,,,,"2" +"Rootkit","1","Program Front","Card Back","6",,"At the start of your first command each round, each enemy Anomaly with an Infection counter that is adjacent to this Server takes 1 damage.","V",,,,,,,"2" +"Drive-By Download","1","Program Front","Card Back","4",,"When an enemy Anomaly breaches this Server, place 2 Infection counters on it.","V",,,,,,,"2" +"Segmentation Fault","1","Program Front","Card Back","5",,"Enemy Anomalies with 2 or more Bug counters attacking this Server roll one die fewer.","B",,,,,,,"2" +"Unhandled Exception","1","Program Front","Card Back","4",,"When a combat at this Server ends in a stalemate, place a Bug counter on the attacker and gain 2 Gb. When an Anomaly attacking this Server loses the roll by exactly 1, it takes 1 more damage.","B",,,,,,,"2" +"Heap Corruption","1","Program Front","Card Back","5",,"When your Anomaly attacks from this Server, place a Bug counter on each defender before the roll.","B",,,,,,,"2" +"Bit Rot","1","Program Front","Card Back","5",,"At the start of your first command each round, place a Bug counter on each enemy Anomaly adjacent to this Server that already has one.","B",,,,,,,"2" +"Tunnel","1","Program Front","Card Back","5",,"Your Anomalies may advance and attack along Firewalled lines touching this Server as though the Firewalls were not there.","G",,,,,,,"2" +"Mirror Site","1","Program Front","Card Back","6",,"When you install this, choose a location that is not adjacent to this Server. For your Anomalies, this Server counts as adjacent to it.","G",,,,,,,"2" +"Session Hijack","1","Program Front","Card Back","4",,"Whenever an enemy Anomaly adjacent to this Server is recalled, draw a card.","G",,,,,,,"2" +"Packet Sniffer","1","Program Front","Card Back","4",,"When an enemy Anomaly breaches this Server, look at its controller's hand and draw a card.","G",,,,,,,"2" +"Uptime Monitor","1","Program Front","Card Back","5",,"At the start of your first command each round, gain 1 Gb for each Patch Program you control, up to 3.","P",,,,,,,"2" +"Warm Standby","1","Program Front","Card Back","5",,"When your Anomaly defending this Server is destroyed, it may be placed again this round.","P",,,,,,,"2" +"Hot Patch","1","Program Front","Card Back","5",,"At the start of your first command each round, remove 1 damage from each Anomaly you control at this Server, or 2 from each Patch Anomaly.","P",,,,,,,"2" +"Failover","1","Program Front","Card Back","4",,"When your Anomaly defending this Server is destroyed, return one of its Hardware to your hand instead of discarding it.","P",,,,,,,"2" +"Sandbox Mode","1","Program Front","Card Back","5",,"Anomalies you control at this Server cannot receive Infection or Bug counters.","P",,,,,,,"2" +"Payload Module","1","Hardware Front","Card Back","5",,"When this Anomaly wins a roll, place an Infection counter on each enemy Anomaly adjacent to it.",,,,,,,,"2" +"Exploit Kit","1","Hardware Front","Card Back","5",,"This Anomaly has +1 Core in combat against an Anomaly with an Infection counter.",,,,,,,,"2" +"Watchdog Timer","1","Hardware Front","Card Back","5",,"Once per round, in a combat this Anomaly is in, one of its dice showing 1 counts as 6.",,,,,,,,"2" +"Bug Injector","1","Hardware Front","Card Back","4",,"When this Anomaly attacks, place a Bug counter on one defender before the roll.",,,,,,,,"2" +"Spoofed MAC","1","Hardware Front","Card Back","5",,"Enemy Programs do not treat this Anomaly as attacking their Server.",,,,,,,,"2" +"Proxy Relay","1","Hardware Front","Card Back","4",,"Level 1 Firewalls do not block this Anomaly.",,,,,,,,"2" +"Surge Protector","1","Hardware Front","Card Back","5",,"The first Core penalty on this Anomaly each round is ignored. If a Patch Anomaly wears this, the second is too.",,,,,,,,"2" +"Heat Sink","1","Hardware Front","Card Back","6",,"This Anomaly has +2 Health, or +4 if it is a Patch Anomaly.",,,,,,,,"2" +"Execute: Quarantine","1","Execution Front","Card Back","4",,"Choose one enemy Anomaly with an Infection counter at the target Server. It cannot advance or attack until its controller's next command. If a Virus Anomaly you control is at the target Server, it also has -1 Core this combat.",,,,,,,,"2" +"Execute: Data Siphon","1","Execution Front","Card Back","4",,"Gain 1 Gb for each Infection counter on enemy Anomalies at the target Server, up to 5.",,,,,,,,"2" +"Execute: Fuzz","1","Execution Front","Card Back","4",,"After the roll in a combat at the target Server, reroll every die showing 1 on one side. If a Bug Anomaly you control is in the combat you choose the side; otherwise your opponent does.",,,,,,,,"2" +"Execute: Segfault","1","Execution Front","Card Back","4",,"Deal 2 damage to one Anomaly at the target Server, or 3 if a Bug Anomaly you control is in combat there.",,,,,,,,"2" +"Execute: Port Scan","1","Execution Front","Card Back","3",,"Look at one of your opponent's face-down Anomalies. If a Glitch Anomaly you control is at the target Server, draw a card.",,,,,,,,"2" +"Execute: Lag Spike","1","Execution Front","Card Back","4",,"One enemy Anomaly at the target Server cannot be recalled or placed until its controller's next command. If a Glitch Anomaly you control is at the target Server, it also takes 1 damage.",,,,,,,,"2" +"Execute: Snapshot","1","Execution Front","Card Back","4",,"Until the end of the current command, one Hardware on an Anomaly you control at the target Server is protected.",,,,,,,,"2" +"Execute: Snapshot Restore","1","Execution Front","Card Back","4",,"Remove 4 damage from one Anomaly you control at the target Server. If it is a Patch Anomaly, also re-enable its disabled Hardware.",,,,,,,,"2" +"Quarantine Host","1","Server Front","Card Back",,,"Virus Programs installed here cost 2 less Gb",,,,,,,,"2" +"Test Bench","1","Server Front","Card Back",,,"When a combat starts here, place a Bug counter on the attacker if a Bug Program is installed here",,,,,,,,"2" +"Proxy Node","1","Server Front","Card Back",,,"Executions you play targeting this Server may target an adjacent Server instead",,,,,,,,"2" +"Stable Release","1","Server Front","Card Back",,,"Patch Programs installed here cannot be disabled",,,,,,,,"2" +"Cache Server","1","Server Front","Card Back",,,"Gain 2 Gb when you capture this Server back from an enemy",,,,,,,,"2" +"Honeypot","1","Server Front","Card Back",,,"The first Anomaly to attack this Server each round has -1 Core",,,,,,,,"2" +"Load Balancer","1","Server Front","Card Back",,,"Once per round, your Anomaly here may swap places with another Anomaly you control at an adjacent Server",,,,,,,,"2" \ No newline at end of file diff --git a/data/cards.csv.import b/data/cards.csv.import new file mode 100644 index 0000000..8dd0c09 --- /dev/null +++ b/data/cards.csv.import @@ -0,0 +1,3 @@ +[remap] + +importer="keep" diff --git a/engine/bots/eval.gd b/engine/bots/eval.gd new file mode 100644 index 0000000..e34949f --- /dev/null +++ b/engine/bots/eval.gd @@ -0,0 +1,318 @@ +class_name BotEval +## Scoring helpers the greedy bot shares (bots/eval.ts): board values, combat odds and what a combat +## is worth. Everything reads a player's view and changes nothing. + +# A location is worth about 10 points, plus 8 more when it's taken from the opponent. Bandwidth counts +# half a point per Bandwidth, a card in hand about 2. +const LOCATION_POINTS := 10.0 +const ENEMY_LOCATION_POINTS := 8.0 +const BANDWIDTH_POINTS := 0.5 +const LOSS_POINTS := 4.0 +const CARD_POINTS := 2.0 + +## Hardware's rough combat Cores, by name. +const HARDWARE_CORES := {"Additional Core": 1, "Overclocked CPU": 2, "Packet Accelerator": 1} + + +static func location_value(v: Dictionary, p: int, loc: String) -> float: + if GameMap.is_start(loc): + return 0.0 # starting Servers can't be captured + var taken := 0.0 if v.locations[loc].owner == null else ENEMY_LOCATION_POINTS + return LOCATION_POINTS + taken + v.rules.levelBandwidth[GameMap.level_for(p, loc)] * BANDWIDTH_POINTS + + +## How many Anomalies capturing `loc` would unlock for `p` (level unlocks only). +static func unlocks_at(v: Dictionary, p: int, loc: String) -> int: + if v.rules.recruit.on or v.rules.buyAnomalies.on or GameMap.is_start(loc): + return 0 + var level := GameMap.level_for(p, loc) + if level <= v.players[p].unlockedLevel: + return 0 + var n := 0 + for av in v.players[p].anomalies.slice(0, mini(level, 4)): + if not av.faceUp: + n += 1 + return n + + +## What losing an Anomaly costs: the tempo, plus its Hardware. +static func anomaly_stake(v: Dictionary, r: Dictionary) -> float: + var bw := 0 + for h in State.hardware_of(v, r): + bw += 0 if h < 0 else State.def_of(v, h).bandwidth + return LOSS_POINTS + bw * BANDWIDTH_POINTS + + +# --------------------------------------------------------------------------------------------- +# Dice + +## Distributions of the sum of k d6, by k: the probability of each total, as an Array by total. +## A static cache, filled on the main thread's first use; see diceSum in eval.ts. +static var _sum_dist: Array = [[1.0]] + + +static func dice_sum(k: int) -> Array: + while _sum_dist.size() <= k: + var prev: Array = _sum_dist[_sum_dist.size() - 1] + var next := [] + next.resize(prev.size() + 6) + next.fill(0.0) + for s in prev.size(): + var p: float = prev[s] + for f in range(1, 7): + next[s + f] += p / 6 + _sum_dist.append(next) + return _sum_dist[k] + + +## P(a > b) where a = fa + ka d6 and b = fb + kb d6, ties rerolled at `tie` odds. +static func _beats(fa: int, ka: int, fb: int, kb: int, tie: float) -> float: + var da := dice_sum(ka) + var db := dice_sum(kb) + var win := 0.0 + var draw := 0.0 + for a in da.size(): + var pa: float = da[a] + if pa == 0: + continue + for b in db.size(): + var pb: float = db[b] + if pb == 0: + continue + var x := fa + a + var y := fb + b + if x > y: + win += pa * pb + elif x == y: + draw += pa * pb + return win + draw * tie + + +## Probability of each margin (a − b) where a = fa + ka d6 and b = fb + kb d6, in TS Map order. +static func margin_dist(fa: int, ka: int, fb: int, kb: int) -> Dictionary: + var da := dice_sum(ka) + var db := dice_sum(kb) + var out := {} + for a in da.size(): + var pa: float = da[a] + if pa == 0: + continue + for b in db.size(): + var pb: float = db[b] + if pb == 0: + continue + var m := fa + a - fb - b + out[m] = out.get(m, 0.0) + pa * pb + return out + + +## Averages margin distributions, for a combat whose bonus is decided by a coin flip (Race Condition). +static func _mix_dist(dists: Array) -> Dictionary: + var out := {} + for d in dists: + for m in d: + out[m] = out.get(m, 0.0) + d[m] / dists.size() + return out + + +## The dice each side of the current combat still has to roll (or has rolled), for the odds. +## `reroll` is null or {ref, k}. +static func _combat_dice(v: Dictionary, reroll: Variant) -> Dictionary: + var c: Dictionary = v.combat + var fa := 0 + var ka := 0 + var fd := 0 + var kd := 0 + for r in State.fighters_of(c): + var want := Query.cores_of(v, Query.fighter_of(v, r)) + var dice := [] + if c.rolled: + dice = c.dice.get(State.ref_key(r), []).duplicate() + dice.sort() + if dice.size() > want: + dice = dice.slice(0, want) + var extra := want - dice.size() + if reroll != null and State.ref_key(reroll.ref) == State.ref_key(r): + extra += dice.filter(func(d): return d <= reroll.k).size() + dice = dice.filter(func(d): return d > reroll.k) + var fixed := Util.sum(dice) + if r == c.attacker: + fa += fixed + ka += extra + else: + fd += fixed + kd += extra + return {"fa": fa, "ka": ka, "fd": fd, "kd": kd} + + +## Chance the attacker wins the current combat. Before the roll that's the Core odds. After it, the +## dice on the table count: Core changes add dice or drop the highest ones, and `reroll` lets a +## fighter reroll its dice showing k or less (Bit Flip). +static func combat_odds(v: Dictionary, reroll: Variant = null) -> float: + var c: Dictionary = v.combat + var atk := 0 + var def := 0 + for r in State.fighters_of(c): + var n := Query.cores_of(v, Query.fighter_of(v, r)) + if r == c.attacker: + atk += n + else: + def += n + var tie := Odds.win_chance(atk, def) + if not c.rolled: + return tie + var d := _combat_dice(v, reroll) + return _beats(d.fa, d.ka, d.fd, d.kd, tie) + + +## Health rule: the margin distribution of the current combat, given the dice on the table. +static func combat_dist(v: Dictionary, reroll: Variant = null) -> Dictionary: + var d := _combat_dice(v, reroll) + return margin_dist(d.fa, d.ka, d.fd, d.kd) + + +## Cores each side would have if `r` attacked `target` from `origin` now, counting what the target's +## Programs do when a combat starts there (Bloatware, Visual Artifact, Memory Parasite), and whether +## Race Condition may add +2 to the defence. Returns {atk, def, race}. +static func _attack_cores(v: Dictionary, r: Dictionary, origin: String, target: String, bonus: int) -> Dictionary: + var atk := Query.cores_of(v, {"ref": r, "role": "attack", "at": origin, "loc": target, "combat": null}) + bonus + var def := 0 + for d in State.defenders_at(v, target): + def += Query.cores_of(v, {"ref": d, "role": "defend", "at": target, "loc": target, "combat": null}) + var race := false + for x in Query.sources(v): + if x.at != target or x.controller == r.player: + continue + var hw := State.hardware_of(v, r) + if x.name == "Bloatware" and not Query.bug_immune(v, r, x.controller): + atk -= hw.size() + if x.name == "Visual Artifact" and not v.cards[x.id].get("spent", false): + atk -= 1 + if x.name == "Race Condition": + race = true + if x.name == "Memory Parasite": + var bonuses := [] + for h in hw: + if Query.hardware_active(v, h): + bonuses.append(hardware_cores(v, h)) + if not bonuses.is_empty(): + atk -= bonuses.min() + return {"atk": maxi(1, atk), "def": maxi(1, def), "race": race} + + +## Chance an attack would win the roll if declared now. +static func attack_odds(v: Dictionary, r: Dictionary, origin: String, target: String, bonus := 0) -> float: + var c := _attack_cores(v, r, origin, target, bonus) + if c.race: + return (Odds.win_chance(c.atk, c.def) + Odds.win_chance(c.atk, c.def + 2)) / 2 + return Odds.win_chance(c.atk, c.def) + + +## Health rule: margin distribution of an attack declared now. +static func attack_dist(v: Dictionary, r: Dictionary, origin: String, target: String, bonus := 0) -> Dictionary: + var c := _attack_cores(v, r, origin, target, bonus) + var plain := margin_dist(0, c.atk, 0, c.def) + return _mix_dist([plain, margin_dist(0, c.atk, 0, c.def + 2)]) if c.race else plain + + +## Health rule: expected points for `me` from a combat with the given margin distribution. +## Destroying every defender wins the location and their stakes. Damage short of that is worth a +## share of those stakes plus half the location, since the defender can still recall and heal. +## Damage to the attacker is worth the same share of its own stake. +static func damage_value(v: Dictionary, me: int, attacker: Dictionary, defenders: Array, dist: Dictionary, loc_value: float) -> float: + var left_d := 0 + var stake_d := 0.0 + for d in defenders: + left_d += Query.health_left(v, d) + stake_d += anomaly_stake(v, d) + var sum_left := maxi(1, left_d) + var stake_a := anomaly_stake(v, attacker) + var left_a := maxi(1, Query.health_left(v, attacker)) + var total := 0.0 + for m in dist: + var p: float = dist[m] + if m > 0: + total += p * (loc_value + stake_d if m >= sum_left else (m * (stake_d + loc_value / 2)) / sum_left) + elif m < 0: + total -= p * (stake_a if -m >= left_a else (-m * stake_a) / left_a) + return total if attacker.player == me else -total + + +## Points for the attacking player from declaring an attack now: under the health rule the expected +## damage value, otherwise the odds of taking the location against losing the Anomaly. +static func attack_value(v: Dictionary, r: Dictionary, origin: String, target: String, loc_value: float, bonus := 0) -> float: + if not v.rules.health.on: + var chance := attack_odds(v, r, origin, target, bonus) + return chance * loc_value - (1 - chance) * anomaly_stake(v, r) + return damage_value(v, r.player, r, State.defenders_at(v, target), attack_dist(v, r, origin, target, bonus), loc_value) + + +## Chance `target` falls to this attack: the win odds, or under the health rule the odds of +## destroying every defender. +static func fall_chance(v: Dictionary, r: Dictionary, origin: String, target: String, bonus := 0) -> float: + if not v.rules.health.on: + return attack_odds(v, r, origin, target, bonus) + var need := 0 + for d in State.defenders_at(v, target): + need += Query.health_left(v, d) + var p := 0.0 + var dist := attack_dist(v, r, origin, target, bonus) + for m in dist: + if m >= need: + p += dist[m] + return p + + +## Rough Cores a Hardware card adds in combat. +static func hardware_cores(v: Dictionary, hw: int) -> int: + return HARDWARE_CORES.get(v.cards[hw].name, 0) + + +## Health a Hardware card adds to its wearer (RAM Expansion), when the health rule is on. +static func hardware_health(v: Dictionary, hw: int) -> int: + return CardScripts.of(v.cards[hw].name).get("health", 0) if v.rules.health.on else 0 + + +# --------------------------------------------------------------------------------------------- +# What the current combat is worth + +## Points for `me` if the combat goes each way: {win, lose}. +static func stakes(v: Dictionary, me: int) -> Dictionary: + var c: Dictionary = v.combat + var loc := location_value(v, c.attacker.player, c.loc) + var atk := anomaly_stake(v, c.attacker) + var def := 0.0 + for d in c.defenders: + def += anomaly_stake(v, d) + if c.attacker.player == me: + return {"win": loc + def / 2, "lose": -atk} + return {"win": atk / 2, "lose": -(loc + def)} + + +## Expected points for `me` from the current combat, or from how it ended. `reroll` ({ref, k}) +## values a Bit Flip of one fighter's dice showing k or less. +static func combat_value(v: Dictionary, me: int, reroll: Variant = null) -> float: + var c = v.combat + if c == null: + return 0.0 + var i_attack: bool = c.attacker.player == me + if c.ended: + # Ended early: the attacker takes the location only if every defender left. + var taken: bool = c.defenders.is_empty() and State.anomaly(v, c.attacker).at != null + if not taken: + return 0.0 + return location_value(v, me, c.loc) if i_attack else -location_value(v, c.attacker.player, c.loc) + if v.rules.health.on: + return damage_value(v, me, c.attacker, c.defenders, combat_dist(v, reroll), location_value(v, c.attacker.player, c.loc)) + var st := stakes(v, me) + var p_atk := combat_odds(v, reroll) + var p := p_atk if i_attack else 1 - p_atk + return p * st.win + (1 - p) * st.lose + + +static func card_name(v: Dictionary, id: int) -> String: + return "" if id < 0 else v.cards[id].name + + +static func printed_bandwidth(v: Dictionary, id: int) -> int: + return 0 if id < 0 else State.def_of(v, id).bandwidth diff --git a/engine/bots/eval.gd.uid b/engine/bots/eval.gd.uid new file mode 100644 index 0000000..e6f45ae --- /dev/null +++ b/engine/bots/eval.gd.uid @@ -0,0 +1 @@ +uid://cldo5g32fpwlm diff --git a/engine/bots/greedy.gd b/engine/bots/greedy.gd new file mode 100644 index 0000000..6682f48 --- /dev/null +++ b/engine/bots/greedy.gd @@ -0,0 +1,1245 @@ +class_name GreedyBot +extends RefCounted +## The greedy bot (bots/greedy.ts). It plans each turn up front: grabs the best open locations, +## attacks when the odds clear `minWinChance`, guards threatened locations, installs Hardware and +## Programs, and walls off undefended locations. On the opponent's turn it answers with combat +## tricks after the roll and tries to stop advances into its locations. +## +## Same shape as RandomBot: `bot_name`, and `choose(view, actions, me)`. It keeps a plan per turn, +## so make one per game. It only reads `view` (which shares parts with the real state). + +const DEFAULT := { + ## Only attack when the chance to win is at least this. + "minWinChance": 0.6, + ## Firewall level used to wall off undefended frontier locations; 0 = never place Firewalls. + "firewallLevel": 1, + "maxFirewallsPerTurn": 2, + ## Bandwidth, counting salvageable cards, kept back after spending in step 6. + "bandwidthReserve": 6, + ## Play Programs, Executions and Abilities. Off plays like the Phase 2 bot: Core Hardware only. + "useCards": true, + ## Extra value of a capture per Anomaly it unlocks (a location is worth about 12). 0 ignores unlocks. + "unlockPoints": 15, +} + +## Bot styles to pick from: parameter presets, as the app offers (BOT_STYLES in app/src/match.ts). +const STYLES := { + "greedy": { + "label": "Greedy", + "about": "The sim’s standard bot: attacks at 60%+ odds, walls with Lv 1 Firewalls, plays its cards.", + "params": {"minWinChance": 0.6, "firewallLevel": 1, "maxFirewallsPerTurn": 2, "bandwidthReserve": 6, "useCards": true, "unlockPoints": 15}, + }, + "cautious": { + "label": "Cautious", + "about": "Greedy, but attacks only at 75%+ odds.", + "params": {"minWinChance": 0.75, "firewallLevel": 1, "maxFirewallsPerTurn": 2, "bandwidthReserve": 6, "useCards": true, "unlockPoints": 15}, + }, + "bold": { + "label": "Bold", + "about": "Greedy, but attacks at 50%+ odds.", + "params": {"minWinChance": 0.5, "firewallLevel": 1, "maxFirewallsPerTurn": 2, "bandwidthReserve": 6, "useCards": true, "unlockPoints": 15}, + }, + "wall3": { + "label": "Wall builder", + "about": "Greedy, but walls off with Lv 3 Firewalls.", + "params": {"minWinChance": 0.6, "firewallLevel": 3, "maxFirewallsPerTurn": 2, "bandwidthReserve": 6, "useCards": true, "unlockPoints": 15}, + }, + "nocards": { + "label": "Easy", + "about": "Greedy, but only uses Core Hardware: no Programs, Executions or Abilities.", + "params": {"minWinChance": 0.6, "firewallLevel": 1, "maxFirewallsPerTurn": 2, "bandwidthReserve": 6, "useCards": false, "unlockPoints": 15}, + }, +} + +const BP := BotEval.BANDWIDTH_POINTS +const CARD_POINTS := BotEval.CARD_POINTS + +# --------------------------------------------------------------------------------------------- +# How much the bot wants each card + +## Programs by how much they help where they're installed, roughly in points per turn. +const PROGRAM_WEIGHT := { + "Stack Overflow": 4, "Race Condition": 3, "Bloatware": 3, "Visual Artifact": 2, "Memory Parasite": 2, + "Recursive Infection": 2, "Resource Leech": 2, "Overflow Error": 2, "Persistent Infection": 1, "Stock Rice": 1.5, + "Packet Loss": 1.5, "Null Pointer": 1.5, "Fragmentation": 1, "Latency Spike": 1, "Desynchronization": 0.5, + "False Positive": 0.5, "Hotfix": 0.5, "Version Control": 1.5, "Compatibility Layer": 1.5, "Replication Routine": 1, + "Worm Protocol": 1.5, "Payload Injector": 0.5, "Ghost Process": 0.5, "Garbage Collection": 1, "Error Correction": 0.5, + "Rollback Routine": 1, "Undefined Behavior": 1.5, "Infinite Loop": 2, +} +## Programs that only matter when an enemy attacks their location. +const DEFENSIVE := { + "Stack Overflow": true, "Race Condition": true, "Bloatware": true, "Visual Artifact": true, "Memory Parasite": true, + "Recursive Infection": true, "Resource Leech": true, "Overflow Error": true, "Persistent Infection": true, + "Stock Rice": true, "Packet Loss": true, "Null Pointer": true, "Fragmentation": true, "Latency Spike": true, + "Desynchronization": true, "False Positive": true, "Version Control": true, "Undefined Behavior": true, +} +const UTILITY_HARDWARE := { + "Redundant Power Supply": 2, "RAID Array": 1.5, "Diagnostic Module": 1.5, "Firewall Appliance": 1, "ECC Memory": 1, + "Hardware Sandbox": 1, "Dedicated GPU": 1, "Quantum Coprocessor": 1, "Hot-Swap Bay": 1, "Solid-State Cache": 1, + "Cooling System": 0.5, "Network Interface Upgrade": 1.5, +} +## Executions worth holding for the opponent's turn. +const HELD := { + "Execute: Emergency Shutdown": true, "Execute: Disconnect": true, "Execute: Sabotage": true, "Execute: Packet Flood": true, +} +## Executions and Abilities that can change a combat already under way. +const COMBAT_TRICKS := { + "Execute: Disconnect": true, "Execute: Sabotage": true, "Execute: Kill Process": true, "Execute: Force Reboot": true, + "Execute: Fork": true, "Execute: Override": true, "Execute: Emergency Shutdown": true, "Execute: Process Clone": true, + "Execute: Defragment": true, "Execute: Remote Access": true, "Execute: Purge": true, "Corrupt Driver": true, + "Pixelated Picture": true, "Beta Version 1.0": true, "Code Zero": true, "Broken Bits": true, "Hot-Swap Bay": true, + "Rollback Routine": true, "Undefined Behavior": true, +} +## Enemy Programs that make an attack on a location harder. +const HARD_TARGET := { + "Stack Overflow": true, "Race Condition": true, "Bloatware": true, "Visual Artifact": true, "Memory Parasite": true, + "Stock Rice": true, +} +const DUPLICATE_RANK := ["Cloud Compute", "Server Farm", "MultiCore Server", "High Bandwidth Server", "Power Server", + "Cluster Server", "Pingable Server", "Backup Server", "Protected Server"] + +var bot_name := "greedy" +var params: Dictionary + +# Per-game memory. +## This turn's plan from the deploy step: {turn, deploy, attacks, attackers (slot -> true)}, or null. +var _plan = null +var _queue_for := "" +var _queue := [] +var _copied_turn := -1 +## Responses already tried in this window, so one that can't be paid for isn't retried forever. +var _tried := {} +var _tried_for := "" + + +func _init(p: Dictionary = {}) -> void: + params = DEFAULT.duplicate() + params.merge(p, true) + bot_name = "greedy" if params.useCards else "greedy-nocards" + + +# --------------------------------------------------------------------------------------------- +# Small helpers + +static func _name(v: Dictionary, id: int) -> String: + return BotEval.card_name(v, id) + + +static func _bw(v: Dictionary, id: int) -> int: + return BotEval.printed_bandwidth(v, id) + + +## TS `===` for the values choices carry: numbers by value, everything else by type and value. +static func _same(a: Variant, b: Variant) -> bool: + var na := typeof(a) == TYPE_INT or typeof(a) == TYPE_FLOAT + var nb := typeof(b) == TYPE_INT or typeof(b) == TYPE_FLOAT + if na and nb: + return a == b + return typeof(a) == typeof(b) and a == b + + +## `a.args.to ?? a.target`. +static func _to_or_target(a: Dictionary) -> Variant: + var to = a.args.get("to") + return to if to != null else a.get("target") + + +## Board order as seen from `me`'s side. North gets South's order rotated 180°, which maps the board +## onto itself, so tie-breaks never favor a seat. +static func _grid_from(me: int) -> Array: + if me == 0: + return GameMap.GRID + var out: Array = GameMap.GRID.duplicate() + out.reverse() + return out + + +static func _locations_from(me: int) -> Array: + if me == 0: + return GameMap.LOCATIONS + var out: Array = GameMap.LOCATIONS.duplicate() + out.reverse() + return out + + +## How much the bot wants to keep a card rather than salvage it. Below 3 is fodder. +static func _keep_score(v: Dictionary, id: int) -> float: + var def := State.def_of(v, id) + if def.kind == "anomaly": + return 1.0 if _recruit_slot(v, v.cards[id].owner, id) == null else 7.0 + if def.kind == "hardware": + if BotEval.hardware_cores(v, id) > 0 or BotEval.hardware_health(v, id) > 0: + return 6.0 + return UTILITY_HARDWARE.get(def.name, 0) * 2.0 + if def.kind == "program": + return PROGRAM_WEIGHT.get(def.name, 1) + if HELD.has(def.name): + return 4.0 + return 1.5 + + +## Bandwidth available this turn, counting cards the bot is willing to salvage. +static func _spendable(v: Dictionary, me: int) -> int: + var pl: Dictionary = v.players[me] + var n: int = pl.bandwidth + for id in pl.hand: + if _keep_score(v, id) < 3: + n += _bw(v, id) + return n + + +## The salvage that best covers `cost`, never the card being paid for. Null if none is needed or +## possible. +static func _salvage_for(v: Dictionary, me: int, cost: int, except: Variant = null) -> Variant: + var pl: Dictionary = v.players[me] + var need: int = cost - pl.bandwidth + if need <= 0: + return null + var hand: Array = pl.hand.filter(func(id): return id != except and id >= 0) + var total := 0 + for id in hand: + total += _bw(v, id) + if total < need: + return null + var order := Util.sorted_cmp(hand, func(a, b): + var d := _keep_score(v, a) - _keep_score(v, b) + return d if d != 0 else float(_bw(v, b) - _bw(v, a))) + var fodder := order.filter(func(id): return _keep_score(v, id) < 3) + var fodder_bw := 0 + for id in fodder: + fodder_bw += _bw(v, id) + var from := fodder if fodder_bw >= need else order + var card = null + for id in from: + if _bw(v, id) >= need: + card = id + break + if card == null: + card = from[0] + return {"type": "salvage", "card": card} + + +## The card an action spends from hand, so Salvage doesn't use it. +static func _spent_card(a: Dictionary) -> Variant: + if a.type in ["play", "installHardware", "installProgram", "recruit"]: + return a.card + return null + + +# --------------------------------------------------------------------------------------------- +# Recruiting (recruit rule) + +## Where the bot would recruit Anomaly `id`: an empty slot while there's room, otherwise over a +## weaker Anomaly (fewer Cores) that carries no Hardware, preferring one sitting in its slot. +## `taken` are slots already planned this step. +static func _recruit_slot(v: Dictionary, me: int, id: int, taken: Array = []) -> Variant: + if not v.rules.recruit.on: + return null + var avs: Array = v.players[me].anomalies + var cores := func(card: int) -> int: return State.def_of(v, card).cores + var empty := -1 + for i in avs.size(): + if i < 4 and avs[i].card < 0 and not taken.has(i + 1): + empty = i + break + var planned := taken.filter(func(slot): return avs[slot - 1].card < 0).size() + var in_use := 0 + for i in avs.size(): + if (avs[i].card >= 0) if i < 4 else (avs[i].at != null): + in_use += 1 + if empty >= 0 and Query.anomaly_room(v, me) and in_use + planned < 4: + return empty + 1 + var weaker := RulesEngine.recruit_slots(v, me).filter(func(slot): + return not taken.has(slot) and avs[slot - 1].card >= 0 and avs[slot - 1].hardware.is_empty()) + weaker = weaker.filter(func(slot): return cores.call(avs[slot - 1].card) < cores.call(id)) + weaker = Util.sorted_cmp(weaker, func(a, b): + var d := int(avs[a - 1].at != null) - int(avs[b - 1].at != null) + return d if d != 0 else cores.call(avs[a - 1].card) - cores.call(avs[b - 1].card)) + return weaker[0] if not weaker.is_empty() else null + + +## Recruit the strongest Anomalies in hand that fit, within `budget`. +static func _recruit_plan(v: Dictionary, me: int, budget: int) -> Array: + if not v.rules.recruit.on: + return [] + var hand: Array = v.players[me].hand.filter(func(id): return id >= 0 and State.def_of(v, id).kind == "anomaly") + hand = Util.sorted_cmp(hand, func(a, b): return State.def_of(v, b).cores - State.def_of(v, a).cores) + var out := [] + for card in hand: + var price := _bw(v, card) + var slot = _recruit_slot(v, me, card, out.map(func(a): return a.slot)) if price <= budget else null + if slot == null: + continue + out.append({"type": "recruit", "card": card, "slot": slot}) + budget -= price + return out + + +static func _reach(v: Dictionary, me: int) -> int: + var n: int = v.players[me].bandwidth + for id in v.players[me].hand: + n += _bw(v, id) + return n + + +# --------------------------------------------------------------------------------------------- +# The board + +static func _enemy_next_to(v: Dictionary, p: int, loc: String) -> bool: + for l in GameMap.LINES_AT[loc]: + if State.is_open(v, l) and State.controls(v, p, GameMap.other_end(l, loc)): + return true + return false + + +## My grid locations the opponent could advance into or attack, most valuable to them first. +static func _threatened(v: Dictionary, me: int) -> Array: + var opp := State.other(me) + var out := _grid_from(me).filter(func(loc): return State.controls(v, me, loc) and _enemy_next_to(v, opp, loc)) + return Util.sorted_cmp(out, func(a, b): return BotEval.location_value(v, opp, b) - BotEval.location_value(v, opp, a)) + + +## Anomalies `me` can place, advance or attack with this turn: [{at, slot}]. +static func _ready_anomalies(v: Dictionary, me: int) -> Array: + var out := [] + var avs: Array = v.players[me].anomalies + for i in avs.size(): + var a: Dictionary = avs[i] + var slot := i + 1 + if a.faceUp and not a.advanced and a.attacks == 0 and (a.at == null or State.can_act(v, State.ref(me, slot))): + out.append({"at": a.at, "slot": slot}) + return out + + +static func _advance_count(v: Dictionary, me: int) -> int: + var n := 0 + for loc in GameMap.GRID: + if not State.controls(v, me, loc) and State.defenders_at(v, loc).is_empty() and _enemy_next_to(v, me, loc): + n += 1 + return n + + +## Infinite Loop: extra attacks for my Anomalies attacking from `loc`. +static func _extra_attacks_at(v: Dictionary, me: int, loc: String) -> int: + var n := 0 + for x in Query.sources(v): + if x.at == loc and x.controller == me: + n = maxi(n, CardScripts.of(x.name).get("extraAttacks", 0)) + return n + + +static func _clear_cost(v: Dictionary, o: Dictionary) -> int: + return State.firewall_cost(v, v.firewalls.get(o.clear, 0)) if o.clear != null else 0 + + +## Deploy-step plan for the whole turn: which Anomalies advance, which attack and from where, and +## where the rest stand guard. An option is {kind, slot, to, origin, clear, score}; origin is where +## an attacker must stand and clear a Firewall to clear first (each null when there's none). +static func _plan_turn(v: Dictionary, me: int, params: Dictionary) -> Dictionary: + var pl: Dictionary = v.players[me] + var mine := _locations_from(me).filter(func(l): return State.controls(v, me, l)) + var ready := _ready_anomalies(v, me) + var occupant := {} + for i in pl.anomalies.size(): + if pl.anomalies[i].at != null: + occupant[pl.anomalies[i].at] = i + 1 + for x in ready: + if x.at != null: + occupant[x.at] = x.slot + var budget := _spendable(v, me) + + var options := [] + var long_shots := [] + for to in _grid_from(me): + if State.controls(v, me, to): + continue + var defended := not State.defenders_at(v, to).is_empty() + var value: float = BotEval.location_value(v, me, to) + params.unlockPoints * BotEval.unlocks_at(v, me, to) + for line in GameMap.LINES_AT[to]: + var from := GameMap.other_end(line, to) + if not State.controls(v, me, from): + continue + var level: int = v.firewalls.get(line.id, 0) + var clear_cost := State.firewall_cost(v, level) + if clear_cost > budget: + continue + var clear = line.id if level else null + for x in ready: + var slot: int = x.slot + var r := State.ref(me, slot) + if State.fresh_copy(v, r): + continue + if not defended: + # Advancing needs no dice, so prefer weak Anomalies and save strong ones for attacks. + var weakness := 0.01 * Query.cores_of(v, {"ref": r, "role": "attack", "at": null, "loc": null, "combat": null}) + options.append({"kind": "advance", "slot": slot, "to": to, "origin": null, "clear": clear, "score": value - clear_cost * BP - weakness}) + continue + var holder = occupant.get(from) + if holder != null and holder != slot: + continue + var chance := BotEval.attack_odds(v, r, from, to) + if chance < params.minWinChance: + # Health rule: a lost roll only costs damage, so a healthy Anomaly keeps a long shot in + # reserve for when there's nothing better to do (see below). + if v.rules.health.on and chance >= 0.25 and Query.health_left(v, r) * 2 >= Query.health_of(v, r): + long_shots.append({"kind": "attack", "slot": slot, "to": to, "origin": from, "clear": clear, "score": chance}) + continue + var score := BotEval.attack_value(v, r, from, to, value) - clear_cost * BP + options.append({"kind": "attack", "slot": slot, "to": to, "origin": from, "clear": clear, "score": score}) + + options = Util.sorted_cmp(options, func(x, y): return y.score - x.score) + var chosen := [] + var uses := {} + var used_targets := {} + var origins := {} + var clears := {} + for o in options: + if o.score <= 0: + break + if v.rules.commands.on and not chosen.is_empty(): + break # one advance or attack per command + if used_targets.has(o.to): + continue + var n: int = uses.get(o.slot, 0) + if n > 0: + # A second attack only from an Infinite Loop location, from the same origin. + var first: Dictionary = {} + for c in chosen: + if c.slot == o.slot: + first = c + break + if first.kind != "attack" or o.kind != "attack" or o.origin != first.origin: + continue + if n > _extra_attacks_at(v, me, o.origin): + continue + elif o.origin != null and origins.has(o.origin) and origins[o.origin] != o.slot: + continue + var cost := State.firewall_cost(v, v.firewalls.get(o.clear, 0)) if o.clear != null and not clears.has(o.clear) else 0 + if cost > budget: + continue + budget -= cost + if o.clear != null: + clears[o.clear] = true + uses[o.slot] = n + 1 + used_targets[o.to] = true + if o.origin != null: + origins[o.origin] = o.slot + chosen.append(o) + if chosen.is_empty(): + # Nothing to advance into and no attack at good odds: take the best long shot rather than let + # the game stall with every location defended. + long_shots = Util.sorted_cmp(long_shots, func(x, y): return y.score - x.score) + var shot = null + for o in long_shots: + if _clear_cost(v, o) <= budget: + shot = o + break + if shot != null: + budget -= _clear_cost(v, shot) + if shot.clear != null: + clears[shot.clear] = true + uses[shot.slot] = 1 + used_targets[shot.to] = true + origins[shot.origin] = shot.slot + chosen.append(shot) + + var deploy := [] + for line in clears: + deploy.append({"type": "clearFirewall", "line": line}) + var pos := {} + for x in ready: + pos[x.slot] = x.at + var occupied := occupant.duplicate() + var move := func(slot: int, to: String) -> void: + var from = pos.get(slot) + if from != null: + occupied.erase(from) + occupied[to] = slot + pos[slot] = to + deploy.append({"type": "place", "slot": slot, "to": to}) + var free_spot := func(prefer: Array) -> Variant: + for l in prefer: + if not occupied.has(l) and not origins.has(l): + return l + return null + var risky := _threatened(v, me) + var final := [] + + for o in chosen: + if o.kind != "attack": + continue + if pos.get(o.slot) == o.origin: + final.append(o) + elif not occupied.has(o.origin): + move.call(o.slot, o.origin) + final.append(o) + elif final.any(func(f): return f.slot == o.slot and f.origin == o.origin): + final.append(o) + # Advancers still in their slot must enter play first; put them where nobody threatens. + var safe_first := mine.filter(func(l): return not risky.has(l)) + risky + for o in chosen: + if o.kind != "advance": + continue + if pos.get(o.slot) != null: + final.append(o) + else: + var spot = free_spot.call(safe_first) + if spot != null: + move.call(o.slot, spot) + final.append(o) + var busy := {} + for o in final: + busy[o.slot] = true + # Health rule: a badly hurt Anomaly with nothing to do goes back to its slot to heal. + if v.rules.health.on and v.rules.health.recall: + for x in ready: + var slot: int = x.slot + var cur = pos.get(slot) + if busy.has(slot) or cur == null or slot > 4: + continue + var r := State.ref(me, slot) + if Query.health_left(v, r) > maxi(2, ceili(Query.health_of(v, r) * 0.3)): + continue + if busy.has(slot + 4): + continue # recalling would remove its copy, which has a job + busy[slot] = true + occupied.erase(cur) + pos[slot] = null + deploy.append({"type": "recall", "slot": slot}) + # Everyone else guards the most threatened free location. + for x in ready: + var slot: int = x.slot + if busy.has(slot): + continue + var cur = pos.get(slot) + if cur != null and risky.has(cur): + continue + var spot = free_spot.call(risky) + if spot == null and cur == null: + spot = free_spot.call(mine) + if spot != null: + move.call(slot, spot) + + for o in final: + if o.kind == "advance": + deploy.append({"type": "advance", "slot": o.slot, "to": o.to}) + var attacks := [] + var attackers := {} + for o in final: + if o.kind == "attack": + attacks.append({"type": "attack", "slot": o.slot, "to": o.to}) + attackers[o.slot] = true + return {"turn": v.turn, "deploy": deploy, "attacks": attacks, "attackers": attackers} + + +# --------------------------------------------------------------------------------------------- +# Playing cards on your own turn + +static func _in_hand(v: Dictionary, me: int, card_name: String) -> Variant: + for id in v.players[me].hand: + if _name(v, id) == card_name: + return id + return null + + +## How much a performing Server adds: Dedicated GPU power, and a Quantum Coprocessor copy. +static func _from_value(v: Dictionary, me: int, from: Variant) -> float: + if from == null: + return 0.0 + var qc := false + for r in State.refs_in_play(v, me): + if State.anomaly(v, r).at != from: + continue + for h in State.hardware_of(v, r): + if _name(v, h) == "Quantum Coprocessor" and Query.hardware_active(v, h): + qc = true + return RulesEngine.execution_power(v, me, from) + (0.5 if qc else 0.0) + + +## A legal play of a named Execution matching `pick`, ignoring Bandwidth, from the best Server. +static func _find_play(v: Dictionary, me: int, card_name: String, pick: Callable) -> Variant: + if _in_hand(v, me, card_name) == null: + return null + var best = null + for a in RulesEngine.execution_actions(v, me, "any"): + if a.type != "play" or _name(v, a.card) != card_name or not pick.call(a): + continue + if best == null or _from_value(v, me, a.from) > _from_value(v, me, best.from): + best = a + return best + + +## A legal use of a named card's Ability matching `pick`, ignoring Bandwidth. +static func _find_use(v: Dictionary, me: int, card_name: String, pick := Callable()) -> Variant: + for a in RulesEngine.ability_actions(v, me, "any"): + if a.type == "activate" and a.name == card_name and (not pick.is_valid() or pick.call(a)): + return a + return null + + +## Deploy: make a copy (Replicate, Backup Server) before planning, so it can advance too. +static func _copy_action(v: Dictionary, me: int) -> Variant: + if _advance_count(v, me) == 0: + return null + var risky := _threatened(v, me) + var spot = null + for l in _locations_from(me): + if Query.has_room(v, me, l) and not risky.has(l): + spot = l + break + if spot == null: + for l in _locations_from(me): + if Query.has_room(v, me, l): + spot = l + break + if spot == null: + return null + var backup = _find_use(v, me, "Backup Server", func(a): return a.args.get("to") == spot) + if backup != null: + return backup + var replicate = _find_use(v, me, "Carbon NanoBots", func(a): return a.args.get("to") == spot) + if replicate != null and _spendable(v, me) >= RulesEngine.action_cost(v, replicate) + 4: + return replicate + return null + + +## Hardware worth installing now: Core Hardware on fighters, useful utility Hardware anywhere. +static func _hardware_plan(v: Dictionary, me: int, attackers: Dictionary, budget: int, use_cards: bool) -> Array: + var pl: Dictionary = v.players[me] + var risky := _threatened(v, me) + var out := [] + var wearers := State.refs_in_play(v, me).filter(func(r): return not State.is_copy(r)) + wearers = Util.sorted_cmp(wearers, func(x, y): return int(attackers.has(y.slot)) - int(attackers.has(x.slot))) + var free_slots := {} + for r in wearers: + free_slots[r.slot] = Query.slots_free(v, r) + var fights := func(r: Dictionary) -> bool: + return attackers.has(r.slot) or risky.has(State.anomaly(v, r).at) + var has_executions: bool = pl.hand.any(func(id): return State.def_of(v, id).kind == "execution") + # Network Interface Upgrade first, since it opens an Expansion Slot for the rest. + var niu_first := func(id: int) -> int: return 1 if _name(v, id) == "Network Interface Upgrade" else 0 + var hand := Util.sorted_cmp(pl.hand, func(a, b): + var d: int = niu_first.call(b) - niu_first.call(a) + return d if d != 0 else BotEval.hardware_cores(v, b) - BotEval.hardware_cores(v, a)) + for card in hand: + var def := State.def_of(v, card) + if def.kind != "hardware": + continue + var cores := BotEval.hardware_cores(v, card) + BotEval.hardware_health(v, card) + var target = null + if cores > 0: + # Core Hardware, and Health Hardware (RAM Expansion), go on Anomalies that fight. + var attack_only: bool = def.name == "Packet Accelerator" + for r in wearers: + if free_slots[r.slot] > 0 and fights.call(r) and (not attack_only or attackers.has(r.slot)): + target = r + break + elif def.name == "Network Interface Upgrade": + # Adds an Expansion Slot: best on a fighter whose slots are full. + for r in Util.sorted_cmp(wearers, func(x, y): return free_slots[x.slot] - free_slots[y.slot]): + if fights.call(r): + target = r + break + if target == null and not wearers.is_empty(): + target = wearers[0] + elif use_cards and UTILITY_HARDWARE.get(def.name, 0) > 0: + if def.name in ["Dedicated GPU", "Quantum Coprocessor"] and not has_executions: + continue + var protects: bool = def.name in ["Redundant Power Supply", "RAID Array"] + for r in wearers: + var ok: bool = (not State.anomaly(v, r).hardware.is_empty() and free_slots[r.slot] > 0) if protects else free_slots[r.slot] > 1 + if ok: + target = r + break + if target == null: + continue + var cost := RulesEngine.hardware_cost(v, card, target) + if cost > budget: + continue + budget -= cost + free_slots[target.slot] += 1 if def.name == "Network Interface Upgrade" else -1 + out.append({"type": "installHardware", "card": card, "slot": target.slot}) + return out + + +## Negative effects on an Anomaly that Error Correction or Purge could clear. +static func _afflicted(v: Dictionary, r: Dictionary) -> bool: + var av := State.anomaly(v, r) + return av.infection + av.permanentInfection > 0 or State.hardware_of(v, r).any(func(h): return not Query.hardware_active(v, h)) + + +static func _neighbors_mine(v: Dictionary, me: int, at: String) -> Array: + var out := [] + for l in GameMap.LINES_AT[at]: + if State.is_open(v, l) and State.controls(v, me, GameMap.other_end(l, at)): + out.append(GameMap.other_end(l, at)) + return out + + +## How much installing Program `name` on my location `at` is worth, in points. +static func _program_value(v: Dictionary, me: int, card_name: String, at: String, risky: Array) -> float: + var opp := State.other(me) + var w: float = PROGRAM_WEIGHT.get(card_name, 1) + var guarded := not State.defenders_at(v, at).is_empty() + var threat := (1.0 if guarded else 0.4) if risky.has(at) else 0.1 + var here: Array = v.locations[at].programs.map(func(id): return _name(v, id)) + var hand: Array = v.players[me].hand.map(func(id): return _name(v, id)) + var enemy_near := _neighbors_mine(v, opp, at) + var slots: int = Query.program_slots(v, at) - here.size() + match card_name: + "Infinite Loop": + return w if enemy_near.filter(func(l): return not State.defenders_at(v, l).is_empty()).size() >= 2 and guarded else 0.0 + "Compatibility Layer": + return w if risky.has(at) else 0.3 + "Replication Routine": + var viruses: Array = v.players[me].hand.filter(func(id): + var d := State.def_of(v, id) + return d.type == "V" and d.kind == "program" and _name(v, id) != card_name) + if slots < 2 or viruses.is_empty(): + return 0.0 + var top := -INF + for id in viruses: + top = maxf(top, _program_value(v, me, _name(v, id), at, risky)) + return 0.5 + top + "Garbage Collection", "Hotfix": + return w * threat if not here.is_empty() else 0.0 + "Error Correction": + return 2.0 if State.refs_in_play(v, me).any(func(r): return State.anomaly(v, r).at == at and _afflicted(v, r)) else 0.0 + "Rollback Routine": + # Helps my Anomalies attacking from here into Programs that cut Cores. + var cutters := enemy_near.any(func(l): return v.locations[l].programs.any(func(id): return _name(v, id) in ["Bloatware", "Visual Artifact"])) + return w * 1.5 if guarded and cutters else 0.0 + "Payload Injector": + var n := hand.filter(func(x): return x in ["Execute: Memory Dump", "Execute: Process Clone", "Execute: Purge", "Execute: Hard Reset"]).size() + return w * 1.5 if n >= 1 else 0.0 + "Ghost Process": + var tricks := hand.any(func(x): return x in ["Execute: Kill Process", "Execute: Override", "Execute: Sabotage"]) + return 1.0 if tricks and enemy_near.any(func(l): return not v.locations[l].programs.is_empty()) else 0.0 + "Worm Protocol": + var helps := here.any(func(x): return DEFENSIVE.has(x)) and _neighbors_mine(v, me, at).any(func(l): return risky.has(l)) + return w if helps else 0.0 + return w * threat * (BotEval.location_value(v, opp, at) / 18) if DEFENSIVE.has(card_name) else w * 0.4 + + +## Programs worth installing, best first. +static func _program_plan(v: Dictionary, me: int, budget: int) -> Array: + var pl: Dictionary = v.players[me] + var risky := _threatened(v, me) + var mine := _locations_from(me).filter(func(l): return State.controls(v, me, l)) + var room := {} + for l in mine: + room[l] = Query.program_slots(v, l) - v.locations[l].programs.size() + var picks := [] + var seen := {} + for card in pl.hand: + var card_name := _name(v, card) + if not PROGRAM_WEIGHT.has(card_name) or seen.has(card_name): + continue + seen[card_name] = true + for at in mine: + if room[at] <= 0 or v.locations[at].programs.any(func(id): return _name(v, id) == card_name): + continue + var value := _program_value(v, me, card_name, at, risky) + picks.append({"card": card, "at": at, "value": value - RulesEngine.program_cost(v, me, card, at) * BP * 0.3}) + picks = Util.sorted_cmp(picks, func(a, b): return b.value - a.value) + var out := [] + var used := {} + for p in picks: + if p.value <= 0.3 or used.has(p.card) or room[p.at] <= 0: + continue + var cost := RulesEngine.program_cost(v, me, p.card, p.at) + if cost > budget: + continue + budget -= cost + used[p.card] = true + room[p.at] -= 1 + out.append({"type": "installProgram", "card": p.card, "at": p.at}) + return out + + +## Step 3: switch off a Program that guards a location I'm about to attack, when it's worth it. +static func _clear_the_way(v: Dictionary, me: int, plan: Variant) -> Array: + if plan == null or plan.turn != v.turn: + return [] + var out := [] + for a in plan.attacks: + if a.type != "attack": + continue + var r := State.ref(me, a.slot) + if State.anomaly(v, r).at == null: + continue # the planned attacker left play (a copy removed by a recall) + var origin = null + for i in range(plan.deploy.size() - 1, -1, -1): + var d: Dictionary = plan.deploy[i] + if d.type == "place" and d.slot == a.slot: + origin = d + break + var from = origin.to if origin != null else State.anomaly(v, r).at + if from == null: + continue + var before := BotEval.attack_odds(v, r, from, a.to) + var best = null + for card_name in ["Execute: Kill Process", "Execute: Override"]: + if _in_hand(v, me, card_name) == null: + continue + for play in RulesEngine.execution_actions(v, me, "any"): + if play.type != "play" or _name(v, play.card) != card_name: + continue + var prog = play.args.get("card") + if prog == null or State.program_location(v, prog) != a.to or not HARD_TARGET.has(_name(v, prog)): + continue + var after = _simulate(v, me, play) + if after == null: + continue + var gain := BotEval.attack_odds(after, r, from, a.to) - before + if gain > 0.08 and (best == null or gain > best.gain): + best = {"play": play, "gain": gain} + if best != null: + out.append(best.play) + return out + + +## Step 3: extra captures with Trace Route, and cleaning up Anomalies before they fight. +static func _pre_attack_plays(v: Dictionary, me: int, plan: Variant) -> Array: + var out := [] + var planned: Dictionary = plan.attackers if plan != null and plan.turn == v.turn else {} + var trace = _in_hand(v, me, "Execute: Trace Route") + if trace != null and _spendable(v, me) >= 5: + var best = null + for a in RulesEngine.execution_actions(v, me, "any"): + if a.type != "play" or a.card != trace: + continue + var r: Dictionary = a.args.ref + var av := State.anomaly(v, r) + var t: String = a.target + if planned.has(r.slot) or av.advanced or av.attacks > 0 or State.controls(v, me, t): + continue + # Don't pull a guard off a threatened location. + if _threatened(v, me).has(av.at) and State.defenders_at(v, av.at).size() < 2: + continue + if v.declarations.any(func(d): return d.to == t): + continue + var value := BotEval.location_value(v, me, t) + var bonus: int = 1 + RulesEngine.execution_power(v, me, a.from) + var defended := not State.defenders_at(v, t).is_empty() + var chance := BotEval.attack_odds(v, r, av.at, t, bonus) if defended else 1.0 + var score := (BotEval.attack_value(v, r, av.at, t, value, bonus) if defended else value) - 5 * BP - CARD_POINTS + if chance >= 0.6 and score > 0 and (best == null or score > best.score): + best = {"a": a, "score": score} + if best != null: + out.append(best.a) + # Clean up Anomalies carrying Infection or disabled Hardware. + for r in State.refs_in_play(v, me): + var av := State.anomaly(v, r) + var disabled := State.hardware_of(v, r).filter(func(h): return not Query.hardware_active(v, h)) + if av.infection + av.permanentInfection < 2 and disabled.is_empty(): + continue + var purge = _find_play(v, me, "Execute: Purge", func(a): return _to_or_target(a) == av.at) + if purge != null: + out.append(purge) + elif not disabled.is_empty(): + var defrag = _find_play(v, me, "Execute: Defragment", func(a): return a.args.get("card") == disabled[0]) + if defrag != null: + out.append(defrag) + return out + + +## Step 6: card draw, Exfiltrate, Restore Point and Undefined Behavior, when Bandwidth is spare. +static func _utility_plays(v: Dictionary, me: int, budget: int) -> Array: + var out := [] + var left := [budget] + var add := func(a: Variant, cost: int) -> void: + if a != null and cost <= left[0]: + out.append(a) + left[0] -= cost + add.call(_find_play(v, me, "Execute: Memory Dump", func(a): return a.target != null and State.controls(v, me, a.target)), 4) + add.call(_find_play(v, me, "Execute: Ping Sweep", func(_a): return true), 4) + if not v.players[State.other(me)].hand.is_empty(): + add.call(_find_use(v, me, "Data Leaker"), 3) + # Restore Point: heal a wounded Backup Machine first, otherwise recover a good card. + add.call(_find_use(v, me, "Backup Machine", func(a): + if not a.args.get("heal", false): + return false + for r in State.refs_in_play(v, me): + if State.anomaly(v, r).card == a.card and not State.is_copy(r): + return State.anomaly(v, r).damage >= 3 + return false), 5) + add.call(_find_use(v, me, "Backup Machine", func(a): + if a.args.get("heal", false): + return false + var id: int = a.args.card + return BotEval.hardware_cores(v, id) > 0 or PROGRAM_WEIGHT.get(_name(v, id), 0) >= 2), 5) + # Undefined Behavior: copy a strong defensive Program onto its own location. + add.call(_find_use(v, me, "Undefined Behavior", func(a): + return _name(v, a.args.card) in ["Stack Overflow", "Race Condition", "Bloatware"]), 0) + return out + + +## Firewalls around undefended threatened locations whose every enemy line has a gateway. +static func _firewall_plan(v: Dictionary, me: int, params: Dictionary, budget: int) -> Array: + if params.firewallLevel <= 0: + return [] + var pl: Dictionary = v.players[me] + var opp := State.other(me) + var out := [] + var cost := State.firewall_cost(v, params.firewallLevel) + var left: int = params.maxFirewallsPerTurn + for loc in _threatened(v, me): + if pl.anomalies.any(func(a): return a.at == loc): + continue + var exposed: Array = GameMap.LINES_AT[loc].filter(func(l): return State.is_open(v, l) and State.controls(v, opp, GameMap.other_end(l, loc))) + # A location reachable along a gateway-free line can't be walled off. + if exposed.any(func(l): return not l.gateway) or exposed.size() > left: + continue + if budget - cost * exposed.size() < params.bandwidthReserve: + break + for line in exposed: + out.append({"type": "firewall", "line": line.id, "level": params.firewallLevel}) + budget -= cost * exposed.size() + left -= exposed.size() + return out + + +## Bandwidth to keep for the opponent's turn: enough for the best trick held. +static func _held_reserve(v: Dictionary, me: int, params: Dictionary) -> int: + if not params.useCards: + return 0 + var n := 0 + for id in v.players[me].hand: + if HELD.has(_name(v, id)): + n = maxi(n, _bw(v, id)) + return n + + +static func _total_cost(v: Dictionary, list: Array) -> int: + var n := 0 + for a in list: + n += RulesEngine.action_cost(v, a) + return n + + +static func _plan_play(v: Dictionary, me: int, params: Dictionary, plan: Variant) -> Array: + var budget := _spendable(v, me) + var attackers: Dictionary = plan.attackers if v.step == "play" and plan != null and plan.turn == v.turn else {} + var sale = RulesEngine.anomaly_for_sale(v, me) + var recruits := _recruit_plan(v, me, budget) + if sale != null and sale.price <= budget: + recruits.append({"type": "buyAnomaly", "slot": sale.slot}) + if v.step == "play": + var early := [] + if params.useCards: + early = _clear_the_way(v, me, plan) + _pre_attack_plays(v, me, plan) + return recruits + early + _hardware_plan(v, me, attackers, budget - _total_cost(v, recruits + early), params.useCards) + var keep := _held_reserve(v, me, params) + var hw := _hardware_plan(v, me, attackers, budget - keep - _total_cost(v, recruits), params.useCards) + var left := budget - keep - _total_cost(v, recruits + hw) + var progs := _program_plan(v, me, left - params.bandwidthReserve) if params.useCards else [] + left -= _total_cost(v, progs) + var walls := _firewall_plan(v, me, params, left) + left -= _total_cost(v, walls) + var extra := _utility_plays(v, me, left - params.bandwidthReserve) if params.useCards else [] + return recruits + hw + progs + walls + extra + + +# --------------------------------------------------------------------------------------------- +# Responding + +## Plays out an Execution or Ability on a copy of the view, to see what it would do. Null if it +## failed (where TS catches a throw). +static func _simulate(v: Dictionary, me: int, a: Dictionary) -> Variant: + # Copy only what card effects change; card definitions and rules are shared read-only. + var c := v.duplicate() + c.players = v.players.duplicate(true) + c.locations = v.locations.duplicate(true) + c.cards = v.cards.map(func(x): return x.duplicate()) + c.firewalls = v.firewalls.duplicate() + c.declarations = v.declarations.duplicate() + c.tasks = v.tasks.duplicate() + c.stack = v.stack.duplicate() + c.combat = v.combat.duplicate(true) if v.combat != null else null + c.virtuals = v.virtuals.map(func(x): return x.duplicate()) + c.used = v.used.duplicate() + c.stats = v.stats.duplicate(true) + c.cardUse = {} + c.log = null + var errors := Util.errors.size() + var was_quiet := Util.quiet + Util.quiet = true + if a.type == "play": + var card_name := _name(c, a.card) + State.remove_from(c.players[me].hand, a.card) + var item := { + "kind": "execution", "player": me, "card": a.card, "name": card_name, "target": a.target, "args": a.args, + "from": a.from, "power": RulesEngine.execution_power(c, me, a.from), + } + CardScripts.of(card_name).execution.resolve.call(c, item) + elif a.type == "activate": + var src = RulesEngine.ability_source(c, a.card, a.name) + if src == null: + Util.quiet = was_quiet + return null + var item := {"kind": "ability", "player": me, "card": a.card, "name": a.name, "target": null, "args": a.args, "from": null, "power": 0} + CardScripts.of(src.name).ability.resolve.call(c, item, src) + Util.quiet = was_quiet + if Util.errors.size() > errors: + Util.errors.resize(errors) + return null + c.choice = null + return c + + +## Whether a candidate touches the current combat at all, to skip pointless simulations. +static func _touches_combat(v: Dictionary, a: Dictionary) -> bool: + var c: Dictionary = v.combat + var near := [c.loc, c.origin] + if a.type == "activate": + return COMBAT_TRICKS.has(a.name) + if a.type != "play" or not COMBAT_TRICKS.has(_name(v, a.card)): + return false + if a.args.get("ref") != null: + return true + if a.args.get("card") != null: + var loc = State.program_location(v, a.args.card) + return near.has(loc) if loc != null else true + var to = a.args.get("to") + return near.has(a.target) or near.has(to if to != null else "") + + +static func _price(v: Dictionary, a: Dictionary) -> float: + var card: bool = a.type == "play" or (a.type == "activate" and a.name == "Beta Version 1.0") + return RulesEngine.action_cost(v, a) * BP + (CARD_POINTS if card else 0.0) + + +## The best combat trick for `me` once the dice are down, if one is worth its cost. +static func _combat_trick(v: Dictionary, me: int) -> Variant: + var c: Dictionary = v.combat + if not c.rolled: + return null + var base := BotEval.combat_value(v, me) + var best = null + var best_gain := 0.25 + for a in RulesEngine.execution_actions(v, me, "reachable") + RulesEngine.ability_actions(v, me, "reachable"): + if not _touches_combat(v, a): + continue + var value: float + if a.type == "activate" and a.name == "Broken Bits": + var r = null + for x in State.refs_in_play(v, me): + if State.anomaly(v, x).card == a.card and not State.is_copy(x): + r = x + break + value = BotEval.combat_value(v, me, {"ref": r, "k": a.args.k}) + else: + var after = _simulate(v, me, a) + if after == null: + continue + value = BotEval.combat_value(after, me) + (_from_value(v, me, a.from) * 0.1 if a.type == "play" else 0.0) + var gain := value - base - _price(v, a) + if gain > best_gain: + best = a + best_gain = gain + return best + + +## Outside combat: try to stop the opponent's newest advance or attack on one of my locations. +static func _stop_declaration(v: Dictionary, me: int) -> Variant: + if v.declarations.is_empty(): + return null + var d: Dictionary = v.declarations[v.declarations.size() - 1] + if d.ref.player == me or not State.controls(v, me, d.to): + return null + var at = State.anomaly(v, d.ref).at + if at == null: + return null + var defended := not State.defenders_at(v, d.to).is_empty() + var risk := BotEval.fall_chance(v, d.ref, d.from, d.to) if defended else 1.0 + var stake := risk * BotEval.location_value(v, d.ref.player, d.to) + # Root the Anomaly that declared, so it can't move. + var flood = _find_play(v, me, "Execute: Packet Flood", func(a): return _to_or_target(a) == at) + if flood != null and stake > 5 * BP + CARD_POINTS + 2: + return flood + if defended: + return null + # Put a copy in the way. + var replicate = _find_use(v, me, "Carbon NanoBots", func(a): return a.args.get("to") == d.to) + var copy = _find_use(v, me, "Backup Server", func(a): return a.args.get("to") == d.to) + if copy == null and replicate != null and _reach(v, me) >= RulesEngine.action_cost(v, replicate): + copy = replicate + if copy != null: + return copy + # Or cash in the Programs there before they're lost. + var progs: Array = v.locations[d.to].programs + if progs.is_empty(): + return null + var top := 0 + for i in progs.size(): + top = _bw(v, progs[i]) if i == 0 else maxi(top, _bw(v, progs[i])) + var gc = _find_use(v, me, "Garbage Collection", func(a): + return State.program_location(v, a.args.card) == d.to and _bw(v, a.args.card) == top) + if gc != null: + return gc + var reset = _find_play(v, me, "Execute: Hard Reset", func(a): return a.target == d.to and a.args.cards.size() == progs.size()) + var total := 0 + for p in progs: + total += _bw(v, p) + return reset if reset != null and total >= 8 else null + + +## Sends back an expensive enemy Program or Hardware installed this turn. +static func _rollback_install(v: Dictionary, me: int) -> Variant: + return _find_play(v, me, "Execute: Rollback", func(a): return v.cards[a.args.card].owner != me and _bw(v, a.args.card) >= 7) + + +# --------------------------------------------------------------------------------------------- +# Choices + +static func _choose_index(v: Dictionary, me: int, ch: Dictionary) -> int: + var opts: Array = ch.options + var val := func(i: int) -> Variant: return opts[i].value + var best := func(score: Callable) -> int: + var b := 0 + for i in range(1, opts.size()): + if score.call(i) > score.call(b): + b = i + return b + var card_val := func(id: int) -> float: return _keep_score(v, id) + _bw(v, id) * 0.2 + var find := func(pred: Callable) -> int: + for i in opts.size(): + if pred.call(opts[i]): + return i + return -1 + var yes_if_affordable := func(yes: Variant) -> int: + var i: int = find.call(func(o): return _same(o.value, yes)) + if i >= 0 and opts[i].get("cost", 0) <= v.players[me].bandwidth: + return i + return find.call(func(o): return not _same(o.value, yes)) + match ch.kind: + "Callable Server:redraw": + # The drawn card, unless it has left the hand since (salvaged while choosing). + var card: int = ch.resume.data.card + var redraw: bool = v.players[me].hand.has(card) and _keep_score(v, card) < 2 + return find.call(func(o): return _same(o.value, redraw)) + "Diagnostic Module:bottom": + var weak: bool = opts.any(func(o): return ["Network Interface", "Root Access", "Execute: Rollback", "Ping Sweep"].any(func(w): return o.label.contains(w))) + return find.call(func(o): return _same(o.value, weak)) + "Duplicate Server:copy": + return best.call(func(i): + var k := DUPLICATE_RANK.find(str(val.call(i))) + 1 + return -(k if k != 0 else 99)) + "Memory Parasite:disable", "Overclocked CPU:disable": + return best.call(func(i): return -(BotEval.hardware_cores(v, val.call(i)) * 10 + card_val.call(val.call(i)))) + "Replication Routine:install": + return best.call(func(i): return 0.5 if val.call(i) == null else PROGRAM_WEIGHT.get(_name(v, val.call(i)), 1)) + "Worm Protocol:spread": + var risky := _threatened(v, me) + return best.call(func(i): + var loc = val.call(i) + return 2 if risky.has(loc) else (1 if State.controls(v, me, loc) else 0)) + "Race Condition:pick": + return (v.seq + v.turn + me) % 2 + "Overflow Error:hit": + return best.call(func(i): + var x: Dictionary = val.call(i) + return _bw(v, x.card) + (0.5 if x.mode == "destroy" else 0.0)) + "Error Correction:remove": + return best.call(func(i): + var x := str(val.call(i)) + if x.begins_with("hw:"): + return 4 + BotEval.hardware_cores(v, int(x.substr(3))) + return 3 if x == "permanent" else (2 if x == "infection" else 1)) + "Version Control:save", "Hardware Sandbox:protect": + return best.call(func(i): return _bw(v, val.call(i)) + PROGRAM_WEIGHT.get(_name(v, val.call(i)), 0)) + "RAID Array:keep", "Backup Machine:install": + return yes_if_affordable.call(true) + "Quantum Coprocessor:copy", "False Positive:redirect": + return 1 if opts.size() > 1 else 0 + "Execute: Memory Dump:discard": + return best.call(func(i): return -card_val.call(val.call(i))) + "Data Leaker:discard": + return best.call(func(i): return _bw(v, val.call(i))) + return 0 + + +# --------------------------------------------------------------------------------------------- + +## The next action toward `a`: a Salvage to afford it, or `a` itself. Null if it can't happen. +static func _toward(v: Dictionary, me: int, a: Dictionary, legal: Dictionary) -> Variant: + var cost := RulesEngine.action_cost(v, a) + if cost > v.players[me].bandwidth: + return _salvage_for(v, me, cost, _spent_card(a)) + return legal.get(RulesEngine.action_key(a)) + + +func choose(v: Dictionary, actions: Array, me: int) -> Dictionary: + var legal := {} + for a in actions: + legal[RulesEngine.action_key(a)] = a + + if v.choice != null: + var pick = legal.get("choose:%d" % _choose_index(v, me, v.choice)) + if pick != null: + return pick + for a in actions: + if a.type == "choose": + return a + return actions[0] + + var w = RulesEngine.open_window(v) + if w != null: + if not params.useCards: + return {"type": "pass"} + var combat_id: int = v.combat.id if v.combat != null else 0 + var ties: int = v.combat.ties if v.combat != null else 0 + var key := "%d:%s:%d:%d:%d" % [v.turn, w.kind, v.stack.size(), combat_id, ties] + if key != _tried_for: + _tried_for = key + _tried = {} + var want = null + if v.combat != null and not v.combat.ended: + if w.kind == "postRoll": + want = _combat_trick(v, me) + elif w.kind == "response" and v.active != me and v.stack.is_empty(): + want = _stop_declaration(v, me) + if want == null: + want = _rollback_install(v, me) + if want != null and not _tried.has(RulesEngine.action_key(want)): + var next = _toward(v, me, want, legal) + if next != null: + if next.type != "salvage": + _tried[RulesEngine.action_key(want)] = true + return next + _tried[RulesEngine.action_key(want)] = true + return {"type": "pass"} + + var step_key := "%d:%s" % [v.turn, v.step] + if step_key != _queue_for: + if v.step == "deploy" and params.useCards and _copied_turn != v.turn: + _copied_turn = v.turn + var copy = _copy_action(v, me) + var next = _toward(v, me, copy, legal) if copy != null else null + if next != null: + if next.type == "salvage": + _copied_turn = -1 + return next + _queue_for = step_key + if v.step == "deploy": + _plan = _plan_turn(v, me, params) + _queue = _plan.deploy.duplicate() + elif v.step == "attack": + _queue = _plan.attacks.duplicate() if _plan != null and _plan.turn == v.turn else [] + else: + _queue = _plan_play(v, me, params, _plan) + while not _queue.is_empty(): + var next: Dictionary = _queue[0] + var cost := RulesEngine.action_cost(v, next) + if cost > v.players[me].bandwidth: + var salvage = _salvage_for(v, me, cost, _spent_card(next)) + if salvage != null: + return salvage + _queue.pop_front() + continue + _queue.pop_front() + var action = legal.get(RulesEngine.action_key(next)) + if action != null: + return action + return {"type": "end"} diff --git a/engine/bots/greedy.gd.uid b/engine/bots/greedy.gd.uid new file mode 100644 index 0000000..48be4a9 --- /dev/null +++ b/engine/bots/greedy.gd.uid @@ -0,0 +1 @@ +uid://c8eurfxxusevb diff --git a/engine/bots/random.gd b/engine/bots/random.gd new file mode 100644 index 0000000..1ba04a5 --- /dev/null +++ b/engine/bots/random.gd @@ -0,0 +1,32 @@ +class_name RandomBot +extends RefCounted +## Baseline bot (bots/random.ts): ends the step or passes 30% of the time, otherwise picks any legal +## action. Choices are picked at random too. +## +## A bot has `bot_name` and `choose(view, actions, me) -> action`, picking one of `actions` for +## player `me` while seeing only `view` (see RulesEngine.view_for). Bots are made per game, from a +## seed, so they can keep per-game memory. + +var bot_name := "random" +var _rng: Dictionary + + +func _init(seed: int) -> void: + _rng = Rng.make(seed) + + +func choose(_view: Dictionary, actions: Array, _me: int) -> Dictionary: + var stop = null + var others := [] + for a in actions: + if a.type == "end" or a.type == "pass": + if stop == null: + stop = a + else: + others.append(a) + if others.is_empty(): + return stop if stop != null else actions[0] + if stop != null and Rng.next_float(_rng) < 0.3: + return stop + var choices := others.filter(func(a): return a.type == "choose") + return Rng.pick(_rng, choices if not choices.is_empty() and Rng.next_float(_rng) < 0.8 else others) diff --git a/engine/bots/random.gd.uid b/engine/bots/random.gd.uid new file mode 100644 index 0000000..564b6ce --- /dev/null +++ b/engine/bots/random.gd.uid @@ -0,0 +1 @@ +uid://dnsq54w8tqkx7 diff --git a/engine/cards.gd b/engine/cards.gd new file mode 100644 index 0000000..f257e66 --- /dev/null +++ b/engine/cards.gd @@ -0,0 +1,66 @@ +class_name Cards +## Card definitions from the Cider deck CSV (cards.ts). +## +## A CardDef is a Dictionary: {name, kind, bandwidth, cores, health, slots, type, text, set} and, +## when printed, ability: {name, cost, text}. kind is "anomaly", "server", "program", "hardware" or +## "execution". A pool is {all: Array of defs, by_name: Dictionary name -> def}. + +const DEFAULT_CSV := "res://data/cards.csv" + +const KIND_BY_TEMPLATE := { + "Anomaly Front": "anomaly", + "Server Front": "server", + "Server Front Alt": "server", + "Program Front": "program", + "Hardware Front": "hardware", + "Execution Front": "execution", +} + + +static func _num(s: String) -> int: + return int(s) if s != "" else 0 + + +## Reads the CSV's text. Reference cards (Turn Sequence) are skipped. By default only set 1 (the base +## game) is loaded; `sets` picks others, or "all". `source` names the file in errors. +static func parse_cards(csv: String, sets: Variant = [1], source := "cards.csv") -> Dictionary: + var all := [] + var by_name := {} + for row in Csv.parse_objects(csv): + var kind: String = KIND_BY_TEMPLATE.get(row.get("Front Template", ""), "") + if kind == "": + continue + var set_no := int(row["Set"]) if row.get("Set", "") != "" else 1 + if not (sets is String and sets == "all") and not (sets as Array).has(set_no): + continue + var card := { + "name": row["Name"], + "kind": kind, + "bandwidth": _num(row.get("Bandwidth", "")), + "cores": _num(row.get("Cores", "")), + "health": _num(row.get("Health", "")), + "slots": _num(row.get("Expansion Slots", "")), + "type": row.get("Type", ""), + "text": row.get("Description", ""), + "set": set_no, + } + if row.get("Ability Name", "") != "": + card.ability = { + "name": row["Ability Name"], + "cost": _num(row.get("Ability Cost", "")), + "text": row.get("Ability Description", ""), + } + if by_name.has(card.name): + Util.fail("Duplicate card name in %s: %s" % [source, card.name]) + continue + all.append(card) + by_name[card.name] = card + return {"all": all, "by_name": by_name} + + +## Loads the card CSV from disk. See parse_cards for `sets`. +static func load_cards(path := DEFAULT_CSV, sets: Variant = [1]) -> Dictionary: + var text := FileAccess.get_file_as_string(path) + if text == "": + Util.fail("Can't read %s" % path) + return parse_cards(text, sets, path) diff --git a/engine/cards.gd.uid b/engine/cards.gd.uid new file mode 100644 index 0000000..876cbd4 --- /dev/null +++ b/engine/cards.gd.uid @@ -0,0 +1 @@ +uid://ctcmy378sx1dp diff --git a/engine/cards/anomalies.gd b/engine/cards/anomalies.gd new file mode 100644 index 0000000..a19bc50 --- /dev/null +++ b/engine/cards/anomalies.gd @@ -0,0 +1,271 @@ +class_name AnomalyCards +## Anomaly Abilities (cards/anomalies.ts). Each costs the Bandwidth printed on the card, can be used +## once per turn at Execution timing, and only while the Anomaly is in play. For Abilities, "a combat +## at this Server" means any combat the Anomaly is fighting in, attacking or defending. + + +## Hardware cost after discounts (Upgraded Hardware), for Abilities that install Hardware. +static func _install_cost(s: Dictionary, card: int, r: Dictionary) -> int: + return Query.cost_of(s, {"kind": "hardware", "player": r.player, "card": card, "ref": r, "at": State.anomaly(s, r).at}) + + +static func scripts() -> Dictionary: + return { + # The copy has the same Cores and uses the original's Hardware bonuses, but no Hardware or + # Ability of its own. It enters play on a location you control with room. + "Carbon NanoBots": { + "text": "Anomaly may create a copy of itself. Only one copy is allowed at a time. If the copy is defeated the original does not lose any hardware upgrades. If the original is defeated the replicate is as well.", + "ability": {"uses": _nanobots_uses, "resolve": _nanobots_resolve}, + }, + + "Corrupt Driver": { + "text": "Choose one Hardware on an enemy Anomaly in combat with this Anomaly. It is disabled until the end of your next command.", + "ability": {"uses": _driver_uses, "resolve": _driver_resolve}, + }, + + "Pixelated Picture": { + "text": "Attacking Anomalies have -1 cores against this Anomaly.", + "ability": {"uses": _pixelated_uses, "resolve": _pixelated_resolve}, + }, + + # Reading: during a combat it's in, install one Hardware from hand on it (paying its cost), + # ignoring Expansion Slots. That Hardware is discarded at the end of your turn. + "Beta Version 1.0": { + "text": "While in combat an additional piece of hardware can be placed on this anomaly until the end of your command. If there are no Expansion Slots available this can still be attached.", + "ability": { + "uses": _beta_uses, + "extraCost": func(s, src, args): return _install_cost(s, args.card, src.ref), + "resolve": _beta_resolve, + }, + }, + + "Code Zero": { + "text": "Place an Infection counter on every enemy Anomaly in combat at this Server. While this Anomaly is in play, an Anomaly with 1+ Infection counters has -1 Core.", + "globalCores": func(s, f): return -1 if State.infection_of(State.anomaly(s, f.ref)) >= 1 else 0, + "ability": { + "uses": func(s, src): return [{}] if not State.opponents_in_combat(s, src.ref).is_empty() else [], + "resolve": _code_zero_resolve, + }, + }, + + # "Breached a Server" = captured an enemy location this turn. + "Data Leaker": { + "text": "Look at your opponent's hand and choose one card in it. They must discard that card without gaining Bandwidth. If this Anomaly breached a Server this command, draw a card.", + "ability": { + "uses": func(s, src): return [{}] if not s.players[State.other(src.controller)].hand.is_empty() else [], + "resolve": _leaker_resolve, + }, + "resume": {"discard": _leaker_discard}, + }, + + # Restore Point either heals 3 damage (health rule) or recovers a card from the discard pile. + "Backup Machine": { + "text": "Remove 3 damage from this Anomaly, or return one Hardware or Program from your discard pile to your hand. If it is a Hardware and this Anomaly has an open Expansion Slot, you may install it immediately for 2 less Gb.", + "ability": {"uses": _backup_uses, "resolve": _backup_resolve}, + "resume": {"install": _backup_install}, + }, + + # Rerolls this Anomaly's dice showing k or less; that's always the best way to pick dice. + "Broken Bits": { + "text": "During a combat at this Server, reroll any number of this Anomaly's Core dice.", + "ability": {"uses": _bits_uses, "resolve": _bits_resolve}, + }, + } + + +# Carbon NanoBots + +static func _nanobots_uses(s: Dictionary, src: Dictionary) -> Array: + if State.anomaly(s, State.copy_of(src.ref)).at != null or not Query.can_copy(s, src.controller): + return [] + var out := [] + for l in GameMap.LOCATIONS: + if Query.has_room(s, src.controller, l): + out.append({"to": l}) + return out + + +static func _nanobots_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var to: String = item.args.to + if State.anomaly(s, State.copy_of(src.ref)).at != null or not Query.can_copy(s, src.controller) \ + or not Query.has_room(s, src.controller, to): + return + State.fired(s, "Carbon NanoBots", src.controller) + Flow.create_copy(s, src.ref, to) + + +# Corrupt Driver + +static func _driver_uses(s: Dictionary, src: Dictionary) -> Array: + var hws := [] + for r in State.opponents_in_combat(s, src.ref): + hws.append_array(State.hardware_of(s, r)) + var out := [] + for hw in Util.uniq(hws): + if Query.hardware_active(s, hw): + out.append({"card": hw}) + return out + + +static func _driver_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var hw: int = item.args.card + s.cards[hw].disabledUntil = maxi(s.cards[hw].disabledUntil, State.end_of(State.next_turn_of(s, src.controller))) + State.fired(s, "Corrupt Driver", src.controller) + State.say(s, "Driver Fault disables %s until the end of %s's next turn." % [State.name_of(s, hw), State.player_name(src.controller)]) + + +# Pixelated Picture + +static func _pixelated_uses(s: Dictionary, src: Dictionary) -> Array: + if not State.in_combat(s, src.ref): + return [] + for d in s.combat.defenders: + if State.ref_key(d) == State.ref_key(src.ref): + return [{}] + return [] + + +static func _pixelated_resolve(s: Dictionary, _item: Dictionary, src: Dictionary) -> void: + var c = s.combat + if c == null or c.ended: + return + State.add_mod(s, c.attacker, -1, "Low Resolution", src.controller, {"combat": c.id}) + State.fired(s, "Pixelated Picture", src.controller) + State.say(s, "Low Resolution: %s gets -1 Core." % State.anomaly_name(s, c.attacker)) + + +# Beta Version 1.0 + +static func _beta_uses(s: Dictionary, src: Dictionary) -> Array: + if not State.in_combat(s, src.ref): + return [] + var hand: Array = s.players[src.controller].hand.filter(func(id): return State.def_of(s, id).kind == "hardware") + return CardUtil.card_options(s, hand).map(func(o): return {"card": o.value}) + + +static func _beta_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var card: int = item.args.card + if not s.players[src.controller].hand.has(card) or not State.in_combat(s, src.ref): + return + HardwareCards.attach_hardware(s, card, src.ref) + var turn: int = s.turn if s.active == src.controller else State.next_turn_of(s, src.controller) + s.cards[card].pushedUntil = State.end_of(turn) + State.fired(s, "Beta Version 1.0", src.controller) + State.say(s, "Push Update attaches %s to %s until the end of %s's turn." % [State.name_of(s, card), State.anomaly_name(s, src.ref), State.player_name(src.controller)]) + + +# Code Zero + +static func _code_zero_resolve(s: Dictionary, _item: Dictionary, src: Dictionary) -> void: + var foes := State.opponents_in_combat(s, src.ref) + for r in foes: + State.anomaly(s, r).infection += 1 + State.fired(s, "Code Zero", src.controller) + var names := ", ".join(foes.map(func(r): return "%s (%d)" % [State.anomaly_name(s, r), State.infection_of(State.anomaly(s, r))])) + State.say(s, "Patient Zero infects %s." % names) + + +# Data Leaker + +static func _leaker_resolve(s: Dictionary, _item: Dictionary, src: Dictionary) -> void: + var hand: Array = s.players[State.other(src.controller)].hand + if hand.is_empty(): + return + State.fired(s, "Data Leaker", src.controller) + State.ask(s, { + "player": src.controller, + "kind": "Data Leaker:discard", + "prompt": "Exfiltrate: choose a card from your opponent's hand for them to discard.", + "options": CardUtil.card_options(s, hand), + "resume": {"name": "Data Leaker", "fn": "discard", "data": {"ref": src.ref}}, + }) + + +static func _leaker_discard(s: Dictionary, data: Dictionary, card: Variant) -> void: + var p: int = data.ref.player + if State.remove_from(s.players[State.other(p)].hand, card): + State.to_discard(s, card) + State.say(s, "Exfiltrate: %s discards %s." % [State.player_name(State.other(p)), State.name_of(s, card)]) + if State.anomaly(s, data.ref).breachedTurn == s.turn: + Flow.draw_cards(s, p, 1) + + +# Backup Machine + +static func _backup_uses(s: Dictionary, src: Dictionary) -> Array: + var out := [] + if s.rules.health.on and State.anomaly(s, src.ref).damage > 0: + out.append({"heal": true}) + var discard: Array = s.players[src.controller].discard.filter(func(id): return ["hardware", "program"].has(State.def_of(s, id).kind)) + for o in CardUtil.card_options(s, discard): + out.append({"card": o.value}) + return out + + +static func _backup_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var p: int = src.controller + if item.args.get("heal", false): + var av := State.anomaly(s, src.ref) + if av.at == null or av.damage == 0: + return + var healed := mini(3, av.damage) + av.damage -= healed + State.fired(s, "Backup Machine", p) + State.say(s, "Restore Point heals %d damage on %s." % [healed, State.anomaly_name(s, src.ref)]) + return + var card: int = item.args.card + if not State.remove_from(s.players[p].discard, card): + return + State.to_hand(s, card) + State.fired(s, "Backup Machine", p) + State.say(s, "Restore Point returns %s to %s's hand." % [State.name_of(s, card), State.player_name(p)]) + if State.def_of(s, card).kind != "hardware" or Query.slots_free(s, src.ref) <= 0: + return + var cost := maxi(0, _install_cost(s, card, src.ref) - 2) + State.ask(s, { + "player": p, + "kind": "Backup Machine:install", + "prompt": "Restore Point: install %s on %s now for %d Gb?" % [State.name_of(s, card), State.anomaly_name(s, src.ref), cost], + "options": [ + {"label": "Keep it in hand", "value": false}, + {"label": "Install it for %d Gb" % cost, "value": true, "cost": cost}, + ], + "resume": {"name": "Backup Machine", "fn": "install", "data": {"card": card, "ref": src.ref, "cost": cost}}, + }) + + +static func _backup_install(s: Dictionary, data: Dictionary, yes: Variant) -> void: + if not yes or State.anomaly(s, data.ref).at == null or not s.players[data.ref.player].hand.has(data.card): + return + s.players[data.ref.player].bandwidth -= data.cost + s.stats.bandwidthOnCards[data.ref.player] += data.cost + HardwareCards.attach_hardware(s, data.card, data.ref) + State.say(s, "%s is installed on %s." % [State.name_of(s, data.card), State.anomaly_name(s, data.ref)]) + + +# Broken Bits + +static func _bits_uses(s: Dictionary, src: Dictionary) -> Array: + var c = s.combat + if c == null or c.ended or not c.rolled or not State.in_combat(s, src.ref): + return [] + var dice: Array = c.dice.get(State.ref_key(src.ref), []) + var ks: Array = Util.uniq(dice).filter(func(v): return v < 6) + ks.sort() + return ks.map(func(k): return {"k": k}) + + +static func _bits_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var c = s.combat + if c == null or c.ended or not c.rolled: + return + var key := State.ref_key(src.ref) + var before: Array = c.dice.get(key, []).duplicate() + var k: int = item.args.k + var after := [] + for v in before: + after.append(State.roll_die(s) if v <= k else v) + c.dice[key] = after + State.fired(s, "Broken Bits", src.controller) + var rerolled := before.filter(func(v): return v <= k).size() + State.say(s, "Bit Flip rerolls %d dice: [%s] → [%s]." % [rerolled, ",".join(before.map(func(v): return str(v))), ",".join(after.map(func(v): return str(v)))]) diff --git a/engine/cards/anomalies.gd.uid b/engine/cards/anomalies.gd.uid new file mode 100644 index 0000000..3dd0b5e --- /dev/null +++ b/engine/cards/anomalies.gd.uid @@ -0,0 +1 @@ +uid://ch4bumb8x8y5x diff --git a/engine/cards/executions.gd b/engine/cards/executions.gd new file mode 100644 index 0000000..d14f317 --- /dev/null +++ b/engine/cards/executions.gd @@ -0,0 +1,598 @@ +class_name ExecutionCards +## Executions (cards/executions.ts). Each targets a location (the "target Server") and resolves there, +## then goes to the discard pile. Ghost Process lets its controller's Executions reach one adjacent +## location too. + + +static func _live_combat(s: Dictionary) -> Variant: + return s.combat if s.combat != null and not s.combat.ended else null + + +## Unique Anomaly refs, first seen first. +static func _uniq_refs(refs: Array) -> Array: + var seen := {} + var out := [] + for r in refs: + var k := State.ref_key(r) + if not seen.has(k): + seen[k] = true + out.append(r) + return out + + +## Plays for every target whose reach includes a location, with the args `args_at(loc)` allows there. +static func _across_scope(s: Dictionary, p: int, args_at: Callable) -> Array: + var out := [] + var ghosts := CardUtil.ghosts_of(s, p) + var at := {} + for target in GameMap.LOCATIONS: + for loc in CardUtil.scope_of(s, p, target, ghosts): + if not at.has(loc): + at[loc] = args_at.call(loc) + for args in at[loc]: + out.append({"target": target, "args": args}) + return out + + +static func _wearer_list(s: Dictionary, hw: Variant) -> Array: + var r = State.wearer_of(s, hw) if hw != null else null + return [r] if r != null else [] + + +static func _ref_target(_s: Dictionary, item: Dictionary) -> Array: + return [item.args.ref] if item.args.get("ref") != null else [] + + +static func _draw_n(s: Dictionary, p: int, n: int) -> void: + Flow.draw_cards(s, p, n) + + +static func _has_negatives(s: Dictionary, r: Dictionary) -> bool: + var av := State.anomaly(s, r) + if av.infection > 0 or av.permanentInfection > 0 or State.running(s, av.rootedUntil) or State.running(s, av.disabledUntil): + return true + for m in State.active_mods(s, av): + if m.cores < 0: + return true + for hw in State.hardware_of(s, r): + if not Query.hardware_active(s, hw): + return true + return false + + +static func scripts() -> Dictionary: + return { + # Reading: the Anomaly moves to a location you control with room. An attacker "at" the target + # (attacking it) can retreat back to where it stands. + "Execute: Disconnect": { + "text": "Move one Anomaly you control at the target Server to an adjacent Server, removing it from any combat there.", + "execution": {"plays": _disconnect_plays, "targetsAnomalies": _ref_target, "resolve": _disconnect_resolve}, + }, + + # Reading: an unspecified disable lasts until something re-enables it (Execute: Defragment). + "Execute: Sabotage": { + "text": "Destroy or disable one Hardware on an enemy Anomaly in combat at the target Server.", + "execution": { + "plays": _sabotage_plays, + "targetsAnomalies": func(s, item): return _wearer_list(s, item.args.get("card")), + "resolve": _sabotage_resolve, + }, + }, + + "Execute: Kill Process": { + "text": "Disable one Program installed on the target Server until its controller's next command.", + "execution": {"plays": _targetable_program_plays, "resolve": _kill_resolve}, + }, + + # Ruling: Servers perform Executions, so "that Anomaly cannot play another Execution" stops the + # Server it stands on from performing Executions for the rest of the turn. + "Execute: Force Reboot": { + "text": "Remove all temporary bonuses and penalties from one Anomaly you control at the target Server, or one Anomaly attacking it. That Anomaly cannot play another Execution until end of current command.", + "execution": {"plays": _reboot_plays, "targetsAnomalies": _ref_target, "resolve": _reboot_resolve}, + }, + + "Execute: Fork": { + "text": "Copy the localized effect of one Program installed on the target Server until end of current command.", + "execution": {"plays": _targetable_program_plays, "resolve": _fork_resolve}, + }, + + "Execute: Ping Sweep": { + "text": "You may draw 2 cards from the top of your deck.", + "execution": { + "plays": func(_s, _p): return [{"target": null, "args": {}}], + "resolve": _ping_resolve, + }, + }, + + # Reading: resolves right away, only while no combat is going on. Into your own location it's a + # move; into an unowned or undefended one it's a capture; into a defended one it's an attack. + "Execute: Trace Route": { + "text": "Move one Anomaly you control from an adjacent Server to the target Server. If the target Server is enemy-controlled, your Anomaly attacks it with +1 Core for the resulting combat.", + "execution": {"plays": _trace_plays, "targetsAnomalies": _ref_target, "resolve": _trace_resolve}, + }, + + "Execute: Override": { + "text": "Choose one enemy Program installed on the target Server. Ignore its text until end of current command.", + "execution": {"plays": _override_plays, "resolve": _override_resolve}, + }, + + "Execute: Memory Dump": { + "text": "Draw 2 cards, then discard 1. If you control the target Server, draw 1 extra card instead of discarding.", + "execution": {"plays": _every_location, "resolve": _dump_resolve}, + "resume": {"discard": _dump_discard, "drop": _dump_drop}, + }, + + "Execute: Rollback": { + "text": "Return one Program or Hardware installed at the target Server this command to its owner's hand.", + "execution": { + "plays": _rollback_plays, + "targetsAnomalies": func(s, item): return _wearer_list(s, item.args.get("card")), + "resolve": _rollback_resolve, + }, + }, + + # Protected = Hardware Sandbox's Program. No card protects Hardware yet. + "Execute: Root Access": { + "text": "Until end of current command, your Programs and Executions at the target Server may target protected Programs and Hardware as though they were unprotected.", + "execution": {"plays": _every_location, "resolve": _root_resolve}, + }, + + # Rooted Anomalies can't advance, attack, reposition, or be moved; their declared moves fail. + "Execute: Packet Flood": { + "text": "Anomalies based at the target Server cannot move or retreat until the start of their controller's next command.", + "execution": {"plays": _flood_plays, "resolve": _flood_resolve}, + }, + + # Reading: Disabled Anomalies still defend, but can't advance, attack, move or use Abilities. + "Execute: Emergency Shutdown": { + "text": "End any combat at the target Server immediately. All Anomalies there remain and become Disabled until end of current command.", + "execution": {"plays": _shutdown_plays, "resolve": _shutdown_resolve}, + }, + + "Execute: Process Clone": { + "text": "Choose one Program installed on the target Server you control. Treat it as though a second copy were installed there until end of current command.", + "execution": {"plays": _clone_plays, "resolve": _clone_resolve}, + }, + + "Execute: Defragment": { + "text": "Re-enable one Disabled Program on the target Server, or one Disabled Hardware on an Anomaly there.", + "execution": {"plays": _defrag_plays, "resolve": _defrag_resolve}, + }, + + # Reading: the Program keeps its owner, and runs at both locations until end of turn. + "Execute: Remote Access": { + "text": "Activate one Program installed on a Server adjacent to the target Server as though it were installed on the target Server, until end of current command.", + "execution": {"plays": _remote_plays, "resolve": _remote_resolve}, + }, + + "Execute: Purge": { + "text": "Remove all Virus/Infection counters and hostile persistent effects from every Anomaly you control at the target Server.", + "execution": {"plays": _purge_plays, "resolve": _purge_resolve}, + }, + + "Execute: Hard Reset": { + "text": "Uninstall any number of Programs from the target Server you control. For each card returned to your hand this way, recover 1 Gb.", + "execution": {"plays": _reset_plays, "resolve": _reset_resolve}, + }, + } + + +static func _every_location(_s: Dictionary, _p: int) -> Array: + return GameMap.LOCATIONS.map(func(target): return {"target": target, "args": {}}) + + +## Plays on each active Program `p` may target, in the scope of each target (Kill Process, Fork). +static func _targetable_program_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): + return CardUtil.programs_on(s, loc).filter(func(id): return Query.can_target_program(s, id, p)).map(func(card): return {"card": card})) + + +# Disconnect + +static func _disconnect_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): + var out := [] + for r in CardUtil.mine(s, p, loc): + if not State.can_act(s, r): + continue + var at: String = State.anomaly(s, r).at + var dests: Array = State.neighbors(s, loc).filter(func(d): return d != at and Query.has_room(s, p, d)) + if State.in_combat(s, r) and at != loc: + dests.append(at) + for to in dests: + out.append({"ref": r, "to": to}) + return out) + + +static func _disconnect_resolve(s: Dictionary, item: Dictionary) -> void: + var r: Dictionary = item.args.ref + var to: String = item.args.to + var av := State.anomaly(s, r) + if av.at == null or not State.can_act(s, r) or (to != av.at and not Query.has_room(s, r.player, to)): + return + State.fired(s, item.name, item.player) + if State.in_combat(s, r): + Flow.drop_from_combat(s, r) + if to != av.at: + Flow.move_anomaly(s, r, to) + + +# Sabotage + +static func _sabotage_plays(s: Dictionary, p: int) -> Array: + var c = _live_combat(s) + if c == null: + return [] + var hws := [] + for r in State.fighters_of(c): + if r.player != p: + hws.append_array(State.hardware_of(s, r)) + hws = Util.uniq(hws) + var out := [] + for target in GameMap.LOCATIONS: + if not CardUtil.scope_of(s, p, target).has(c.loc): + continue + for card in hws: + out.append({"target": target, "args": {"card": card, "mode": "destroy"}}) + if Query.hardware_active(s, card): + out.append({"target": target, "args": {"card": card, "mode": "disable"}}) + return out + + +static func _sabotage_resolve(s: Dictionary, item: Dictionary) -> void: + var hw: int = item.args.card + var owner = State.wearer_of(s, hw) + if owner == null: + return + State.fired(s, item.name, item.player) + if item.args.mode == "destroy": + State.uninstall_hardware(s, hw) + State.to_discard(s, hw) + State.stat(s, "hardwareLost", owner.player) + State.say(s, "Sabotage destroys %s." % State.name_of(s, hw)) + HardwareCards.shed_hardware(s, owner) + else: + s.cards[hw].disabledUntil = Types.FOREVER + State.say(s, "Sabotage disables %s." % State.name_of(s, hw)) + + +# Kill Process + +static func _kill_resolve(s: Dictionary, item: Dictionary) -> void: + var card: int = item.args.card + if State.program_location(s, card) == null: + return + var until := State.start_of(State.next_turn_of(s, State.owner_of(s, card))) + s.cards[card].disabledUntil = maxi(s.cards[card].disabledUntil, until) + State.fired(s, item.name, item.player) + State.say(s, "Kill Process disables %s until %s's next turn." % [State.name_of(s, card), State.player_name(State.owner_of(s, card))]) + + +# Force Reboot + +static func _reboot_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): + var c = _live_combat(s) + var attacker := [c.attacker] if c != null and c.loc == loc else [] + return _uniq_refs(CardUtil.mine(s, p, loc) + attacker).map(func(r): return {"ref": r})) + + +static func _reboot_resolve(s: Dictionary, item: Dictionary) -> void: + var r: Dictionary = item.args.ref + var av := State.anomaly(s, r) + if av.at == null: + return + var live := State.active_mods(s, av) + av.mods = av.mods.filter(func(m): return not live.has(m)) + # Servers perform Executions: the Server this Anomaly stands on can't for the rest of the turn. + State.mark_used(s, "noExec:%s" % av.at) + State.fired(s, item.name, item.player) + State.say(s, "Force Reboot clears %d temporary effect(s) from %s." % [live.size(), State.anomaly_name(s, r)]) + + +# Fork + +static func _fork_resolve(s: Dictionary, item: Dictionary) -> void: + var card: int = item.args.card + if State.program_location(s, card) == null or not Query.program_active(s, card): + return + s.seq += 1 + s.virtuals.append({ + "id": s.seq, "name": State.name_of(s, card), "controller": item.player, "at": item.target, + "until": State.end_of_turn(s), "installed": false, "from": card, + }) + State.fired(s, item.name, item.player) + State.say(s, "Fork copies %s on %s for %s until end of turn." % [State.name_of(s, card), item.target, State.player_name(item.player)]) + + +# Ping Sweep + +static func _ping_resolve(s: Dictionary, item: Dictionary) -> void: + State.fired(s, item.name, item.player) + _draw_n(s, item.player, 2 + item.power) + + +# Trace Route + +static func _trace_plays(s: Dictionary, p: int) -> Array: + if _live_combat(s) != null: + return [] + var out := [] + for target in GameMap.LOCATIONS: + if GameMap.is_start(target) and not State.controls(s, p, target): + continue + var mine_there := State.controls(s, p, target) + if mine_there and not Query.has_room(s, p, target): + continue + for r in State.refs_in_play(s, p): + var at: String = State.anomaly(s, r).at + if at != target and State.can_act(s, r) and State.adjacent(s, at, target): + out.append({"target": target, "args": {"ref": r}}) + return out + + +static func _trace_resolve(s: Dictionary, item: Dictionary) -> void: + var r: Dictionary = item.args.ref + var t: String = item.target + var av := State.anomaly(s, r) + if av.at == null or not State.can_act(s, r) or not State.adjacent(s, av.at, t) or _live_combat(s) != null: + return + var owner = s.locations[t].owner + State.fired(s, item.name, item.player) + if owner == item.player: + if Query.has_room(s, item.player, t): + Flow.move_anomaly(s, r, t) + elif owner == null: + State.push_capture(s, r, t, "capturesUnowned") + elif State.defenders_at(s, t).is_empty(): + State.push_capture(s, r, t, "capturesUndefended") + else: + var c := State.start_combat(s, r, av.at, t, "traceRoute") + State.add_mod(s, r, 1 + item.power, "Trace Route", item.player, {"combat": c.id}) + Query.emit(s, "onAttackDeclared", {"ref": r, "to": t}) + + +# Override + +static func _override_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): + return CardUtil.programs_on(s, loc) \ + .filter(func(id): return State.owner_of(s, id) != p and Query.can_target_program(s, id, p)) \ + .map(func(card): return {"card": card})) + + +static func _override_resolve(s: Dictionary, item: Dictionary) -> void: + var card: int = item.args.card + if State.program_location(s, card) == null: + return + s.cards[card].ignoredUntil = State.end_of_turn(s) + State.fired(s, item.name, item.player) + State.say(s, "Override: %s's text is ignored until end of turn." % State.name_of(s, card)) + + +# Memory Dump + +static func _dump_resolve(s: Dictionary, item: Dictionary) -> void: + var p: int = item.player + State.fired(s, item.name, p) + if State.controls(s, p, item.target): + _draw_n(s, p, 3 + item.power) + return + var tasks := [] + for i in 2 + item.power: + tasks.append({"t": "draw", "player": p}) + tasks.append(State.later("Execute: Memory Dump", "discard", {"player": p})) + State.push_tasks(s, tasks) + + +static func _dump_discard(s: Dictionary, data: Dictionary, _value: Variant) -> void: + var hand: Array = s.players[data.player].hand + if hand.is_empty(): + return + State.ask(s, { + "player": data.player, + "kind": "Execute: Memory Dump:discard", + "prompt": "Memory Dump: discard a card.", + "options": CardUtil.card_options(s, hand), + "resume": {"name": "Execute: Memory Dump", "fn": "drop", "data": {"player": data.player}}, + }) + + +static func _dump_drop(s: Dictionary, data: Dictionary, card: Variant) -> void: + if State.remove_from(s.players[data.player].hand, card): + State.to_discard(s, card) + + +# Rollback + +static func _rollback_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): + var progs: Array = s.locations[loc].programs.filter(func(id): + return s.cards[id].installedTurn == s.turn and Query.can_target_program(s, id, p)) + var worn := [] + for r in State.anomalies_at(s, loc): + worn.append_array(State.anomaly(s, r).hardware) + var hws: Array = Util.uniq(worn).filter(func(id): return s.cards[id].installedTurn == s.turn) + return (progs + hws).map(func(card): return {"card": card})) + + +static func _rollback_resolve(s: Dictionary, item: Dictionary) -> void: + var card: int = item.args.card + var wearer = State.wearer_of(s, card) + if State.uninstall_program(s, card) == null and State.uninstall_hardware(s, card) == null: + return + State.to_hand(s, card) + State.fired(s, item.name, item.player) + State.say(s, "Rollback returns %s to %s's hand." % [State.name_of(s, card), State.player_name(State.owner_of(s, card))]) + if wearer != null: + HardwareCards.shed_hardware(s, wearer) + + +# Root Access + +static func _root_resolve(s: Dictionary, item: Dictionary) -> void: + s.locations[item.target].rootAccess[item.player] = State.end_of_turn(s) + State.fired(s, item.name, item.player) + + +# Packet Flood + +static func _flood_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): return [{"to": loc}] if not State.anomalies_at(s, loc).is_empty() else []) + + +static func _flood_resolve(s: Dictionary, item: Dictionary) -> void: + var loc: String = item.args.get("to") if item.args.get("to") != null else item.target + var here := State.anomalies_at(s, loc) + if here.is_empty(): + return + for r in here: + var av := State.anomaly(s, r) + av.rootedUntil = maxi(av.rootedUntil, State.start_of(State.next_turn_of(s, r.player))) + State.fired(s, item.name, item.player) + State.say(s, "Packet Flood: %s can't move." % ", ".join(here.map(func(r): return State.anomaly_name(s, r)))) + + +# Emergency Shutdown + +static func _shutdown_plays(s: Dictionary, p: int) -> Array: + var c = _live_combat(s) + if c == null: + return [] + var out := [] + for target in GameMap.LOCATIONS: + if CardUtil.scope_of(s, p, target).has(c.loc): + out.append({"target": target, "args": {}}) + return out + + +static func _shutdown_resolve(s: Dictionary, item: Dictionary) -> void: + var c = _live_combat(s) + if c == null or not CardUtil.scope_of(s, item.player, item.target).has(c.loc): + return + var everyone := _uniq_refs(State.fighters_of(c) + State.anomalies_at(s, c.loc)) + Flow.end_combat(s, "Emergency Shutdown") + for r in everyone: + State.anomaly(s, r).disabledUntil = maxi(State.anomaly(s, r).disabledUntil, State.end_of_turn(s)) + State.fired(s, item.name, item.player) + + +# Process Clone + +static func _clone_plays(s: Dictionary, p: int) -> Array: + var out := [] + for target in GameMap.LOCATIONS: + if not State.controls(s, p, target): + continue + for loc in CardUtil.scope_of(s, p, target): + if State.controls(s, p, loc): + for card in CardUtil.programs_on(s, loc): + out.append({"target": target, "args": {"card": card}}) + return out + + +static func _clone_resolve(s: Dictionary, item: Dictionary) -> void: + var card: int = item.args.card + if State.program_location(s, card) == null or not State.controls(s, item.player, item.target): + return + s.seq += 1 + s.virtuals.append({ + "id": s.seq, "name": State.name_of(s, card), "controller": item.player, "at": item.target, + "until": State.end_of_turn(s), "installed": true, "from": card, + }) + State.fired(s, item.name, item.player) + State.say(s, "Process Clone: a second %s runs on %s until end of turn." % [State.name_of(s, card), item.target]) + + +# Defragment + +static func _defrag_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): + var progs: Array = s.locations[loc].programs.filter(func(id): return State.running(s, s.cards[id].disabledUntil)) + var worn := [] + for r in State.anomalies_at(s, loc): + worn.append_array(State.hardware_of(s, r)) + var hws: Array = Util.uniq(worn).filter(func(id): return not Query.hardware_active(s, id)) + return (progs + hws).map(func(card): return {"card": card})) + + +static func _defrag_resolve(s: Dictionary, item: Dictionary) -> void: + var card: int = item.args.card + if not State.running(s, s.cards[card].disabledUntil): + return + s.cards[card].disabledUntil = 0 + State.fired(s, item.name, item.player) + State.say(s, "Defragment re-enables %s." % State.name_of(s, card)) + + +# Remote Access + +static func _remote_plays(s: Dictionary, p: int) -> Array: + var out := [] + for target in GameMap.LOCATIONS: + for n in State.neighbors(s, target): + for id in CardUtil.programs_on(s, n): + if Query.can_target_program(s, id, p): + out.append({"target": target, "args": {"card": id}}) + return out + + +static func _remote_resolve(s: Dictionary, item: Dictionary) -> void: + var card: int = item.args.card + if State.program_location(s, card) == null: + return + s.seq += 1 + s.virtuals.append({ + "id": s.seq, "name": State.name_of(s, card), "controller": State.owner_of(s, card), "at": item.target, + "until": State.end_of_turn(s), "installed": true, "from": card, + }) + State.fired(s, item.name, item.player) + State.say(s, "Remote Access: %s also runs on %s until end of turn." % [State.name_of(s, card), item.target]) + + +# Purge + +static func _purge_plays(s: Dictionary, p: int) -> Array: + return _across_scope(s, p, func(loc): + for r in CardUtil.mine(s, p, loc): + if _has_negatives(s, r): + return [{"to": loc}] + return []) + + +static func _purge_resolve(s: Dictionary, item: Dictionary) -> void: + var loc: String = item.args.get("to") if item.args.get("to") != null else item.target + var here := CardUtil.mine(s, item.player, loc) + for r in here: + var av := State.anomaly(s, r) + av.infection = 0 + av.permanentInfection = 0 + av.mods = av.mods.filter(func(m): return m.cores >= 0 or m.by == item.player) + av.rootedUntil = 0 + av.disabledUntil = 0 + for hw in State.hardware_of(s, r): + s.cards[hw].disabledUntil = 0 + State.fired(s, item.name, item.player) + State.say(s, "Purge cleans %s." % ", ".join(here.map(func(r): return State.anomaly_name(s, r)))) + + +# Hard Reset + +static func _reset_plays(s: Dictionary, p: int) -> Array: + var out := [] + for target in GameMap.LOCATIONS: + if State.controls(s, p, target) and not s.locations[target].programs.is_empty(): + for cards in CardUtil.subsets(s.locations[target].programs): + out.append({"target": target, "args": {"cards": cards}}) + return out + + +static func _reset_resolve(s: Dictionary, item: Dictionary) -> void: + var back: Array = item.args.cards.filter(func(id): return State.program_location(s, id) == item.target) + for id in back: + State.uninstall_program(s, id) + State.to_hand(s, id) + var gain: int = back.size() * (1 + item.power) + State.gain_bandwidth(s, item.player, gain) + State.fired(s, item.name, item.player) + State.say(s, "Hard Reset returns %s to hand (+%d Gb)." % [", ".join(back.map(func(id): return State.name_of(s, id))), gain]) diff --git a/engine/cards/executions.gd.uid b/engine/cards/executions.gd.uid new file mode 100644 index 0000000..acb819a --- /dev/null +++ b/engine/cards/executions.gd.uid @@ -0,0 +1 @@ +uid://b3a807yeclr0l diff --git a/engine/cards/hardware.gd b/engine/cards/hardware.gd new file mode 100644 index 0000000..244cdec --- /dev/null +++ b/engine/cards/hardware.gd @@ -0,0 +1,422 @@ +class_name HardwareCards +## Hardware (cards/hardware.ts). It works while its wearer is in play. "The occupied Server" is the +## location the wearer stands on. + + +## Uses a Hardware card has left this turn. Its "once per turn" or "first ... each turn" effect gets +## one use, or two when Cooling System on the same Anomaly picks it (Cooling helps one Hardware a turn). +static func hardware_uses_left(s: Dictionary, hw: int) -> int: + var used := State.used_this_turn(s, "hw:%d" % hw) + var cooler = _cooler_for(s, hw) + return (1 if cooler == null else 2) - used + + +static func _cooler_for(s: Dictionary, hw: int) -> Variant: + var r = State.wearer_of(s, hw) + if r == null: + return null + for id in State.anomaly(s, r).hardware: + if id == hw or s.cards[id].name != "Cooling System" or not Query.hardware_active(s, id): + continue + var picked_for = s.used.get("cool:%d" % id) + if picked_for == null or picked_for == hw: + return id + return null + + +## Reading: an Anomaly that loses an Expansion Slot (Network Interface Upgrade removed) discards +## Hardware until it fits, the most recently installed first. +static func shed_hardware(s: Dictionary, r: Dictionary) -> void: + while not Query.slots_fit(s, r): + var hw = null + var list: Array = State.anomaly(s, r).hardware + for i in range(list.size() - 1, -1, -1): + if Query.takes_slot(s, list[i]): + hw = list[i] + break + State.uninstall_hardware(s, hw) + State.to_discard(s, hw) + State.stat(s, "hardwareLost", r.player) + State.say(s, "%s is out of Expansion Slots and discards %s." % [State.anomaly_name(s, r), State.name_of(s, hw)]) + + +static func use_hardware(s: Dictionary, hw: int) -> void: + var cooler = _cooler_for(s, hw) + State.mark_used(s, "hw:%d" % hw) + if State.used_this_turn(s, "hw:%d" % hw) >= 2 and cooler != null: + s.used["cool:%d" % cooler] = hw + State.fired(s, "Cooling System", State.owner_of(s, hw)) + + +## Whether `r` is the Anomaly (or a copy of the Anomaly) wearing Hardware at `wearer`. +static func _wearing(wearer: Variant, r: Dictionary) -> bool: + return wearer != null and wearer.player == r.player and (wearer.slot == r.slot or wearer.slot + 4 == r.slot) + + +## Installs a Hardware card from its owner's hand onto an Anomaly, without paying. +static func attach_hardware(s: Dictionary, card: int, r: Dictionary) -> void: + State.remove_from(s.players[r.player].hand, card) + State.anomaly(s, r).hardware.append(card) + s.cards[card].installedTurn = s.turn + State.stat(s, "hardwareInstalled", r.player) + State.played(s, State.name_of(s, card), r.player) + + +static func scripts() -> Dictionary: + return { + # Health rule: the wearer's Health goes up by 2 (Query.health_of). Without the rule it does nothing. + "RAM Expansion": {"text": "Anomaly gains +2 Health.", "health": 2}, + "Additional Core": {"text": "Anomaly gains +1 Core.", "cores": func(_s, _src, _f): return 1}, + + # Reading: the Program is one on the location the wearer fought from, the owner picks it, and it + # stays disabled through the end of the next turn. + "Overclocked CPU": { + "text": "Anomaly gains +2 Cores during combat, but one installed Program at the current server becomes disabled afterward for 2 commands.", + "cores": func(_s, _src, f): return 2 if f.role != null else 0, + "onCombatEnd": _overclocked_combat_end, + "resume": {"disable": func(s, _data, id): _disable_for_two_turns(s, id)}, + }, + + "Solid-State Cache": { + "text": "The first Program installed on the occupied Server each round costs 3 less Gb.", + "costMod": _cache_cost, + "onPaid": _use_and_fire.bind("Solid-State Cache"), + }, + + # Reading: the first time the wearer is defeated with this installed, all its Hardware stays on + # it (in its slot) instead of being discarded. + "Redundant Power Supply": { + "text": "The first time this Anomaly would be destroyed, do not destroy the Hardware.", + "savePriority": 0, + "onWearerDefeated": _rps_defeated, + }, + + # Ruling: it takes no Expansion Slot and adds one, so the wearer nets +1 Expansion Slot. + "Network Interface Upgrade": { + "text": "This Hardware can be played without taking an Expansion Slot on the Anomaly.", + "noSlot": true, + "extraSlots": 1, + }, + + # Ruling: Servers perform Executions, so this works for Executions performed by the Server the + # wearer stands on. +1 to the number the Execution uses (cards drawn, Cores, Bandwidth recovered). + "Dedicated GPU": { + "text": "Executions performed by this Anomaly receive +1 effectiveness or combat strength.", + "executionPower": 1, + }, + + # Blocks opponents' Bug counters (see CardUtil.add_bugs; no card places them yet) and their + # Bug Program effects on the wearer (Bloatware, Stock Rice). + "ECC Memory": { + "text": "Opponents cannot place Bug counters or Bug status effects on this Anomaly.", + "bugImmunity": true, + }, + + # Works through hardware_uses_left() above. + "Cooling System": {"text": "Allow one Hardware to activate twice per round."}, + + # Reading: half the combined printed Bandwidth of its Hardware, rounded up. + "RAID Array": { + "text": "When this Anomaly is destroyed, all hardware can be kept by paying half the Bandwidth cost.", + "savePriority": 1, + "onWearerDefeated": _raid_defeated, + "resume": {"keep": _raid_keep}, + }, + + "Packet Accelerator": { + "text": "This Anomaly gains +1 Core hen attacking.", + "cores": func(_s, _src, f): return 1 if f.role == "attack" else 0, + }, + + # Programs never target Anomalies, so this taxes Executions (and Hardware they hit). + "Firewall Appliance": { + "text": "The first hostile Program or Execution targeting this Anomaly each round costs the opponent +3 Gb.", + "costMod": _appliance_cost, + "onPaid": _use_and_fire.bind("Firewall Appliance"), + }, + + # Reading: pick the Program on install, and again at the start of your turn if the wearer has + # moved. Protection only holds while the wearer stands on that Program's location. + "Hardware Sandbox": { + "text": "Choose one Program installed on the occupied Server. It cannot be targeted by opponents.", + "onInstall": _sandbox_install, + "onTurnStart": _sandbox_turn_start, + "resume": {"protect": _sandbox_protect}, + }, + + # Reading: at the start of your turn, look at the top card and you may put it on the bottom. + "Diagnostic Module": { + "text": "Look at one face down card in your draw pile. You may place it at the bottom and draw another to start your first command each round.", + "onTurnStart": _diagnostic_turn_start, + "resume": {"bottom": _diagnostic_bottom}, + }, + + # Reading: swap Hardware on this Anomaly, paying the difference in printed Bandwidth (no refund). + "Hot-Swap Bay": { + "text": "Once per round, return one Hardware to your hand and install another Hardware from your hand, paying the difference in cost.", + "ability": { + "hardwareOncePerTurn": true, + "uses": _hot_swap_uses, + "extraCost": _hot_swap_extra, + "resolve": _hot_swap_resolve, + }, + }, + + # Ruling: Servers perform Executions, so "this Anomaly uses an Execution" means one performed by + # the Server the wearer stands on. "Disable this Hardware" lasts until your next turn. + "Quantum Coprocessor": { + "text": "Once per round when this Anomaly uses an Execution, you may copy that Execution's effect with a different legal target, then disable this Hardware.", + "copiesExecutions": true, + "resume": {"offer": _quantum_offer, "copy": _quantum_copy}, + }, + } + + +static func _use_and_fire(s: Dictionary, src: Dictionary, _pay: Dictionary, card_name: String) -> void: + use_hardware(s, src.id) + State.fired(s, card_name, src.controller) + + +# Overclocked CPU + +static func _overclocked_combat_end(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + var c: Dictionary = s.combat + var role := "" + if _wearing(src.get("ref"), c.attacker): + role = "attack" + else: + for d in c.defenders: + if _wearing(src.get("ref"), d): + role = "defend" + break + if role == "": + return + var loc: String = c.origin if role == "attack" else c.loc + if s.locations[loc].owner != src.controller: + return + var progs := CardUtil.programs_on(s, loc) + if progs.is_empty(): + return + State.fired(s, "Overclocked CPU", src.controller) + if progs.size() == 1: + _disable_for_two_turns(s, progs[0]) + return + State.ask(s, { + "player": src.controller, + "kind": "Overclocked CPU:disable", + "prompt": "Overclocked CPU: which Program on %s is disabled for 2 turns?" % loc, + "options": progs.map(func(id): return {"label": State.name_of(s, id), "value": id}), + "resume": {"name": "Overclocked CPU", "fn": "disable", "data": null}, + }) + + +static func _disable_for_two_turns(s: Dictionary, id: int) -> void: + s.cards[id].disabledUntil = maxi(s.cards[id].disabledUntil, State.end_of(s.turn + 1)) + State.say(s, "Overclocked CPU: %s is disabled for 2 turns." % State.name_of(s, id)) + + +# Solid-State Cache, Firewall Appliance + +static func _cache_cost(s: Dictionary, src: Dictionary, pay: Dictionary) -> int: + return -3 if pay.kind == "program" and pay.player == src.controller and pay.get("at") == src.at \ + and hardware_uses_left(s, src.id) > 0 else 0 + + +static func _appliance_cost(s: Dictionary, src: Dictionary, pay: Dictionary) -> int: + if pay.kind != "execution" or pay.player == src.controller or hardware_uses_left(s, src.id) <= 0: + return 0 + for r in pay.get("hostile", []): + if _wearing(src.get("ref"), r): + return 3 + return 0 + + +# Redundant Power Supply, RAID Array + +static func _rps_defeated(s: Dictionary, hw: int, ev: Dictionary) -> bool: + if s.cards[hw].get("spent", false): + return false + s.cards[hw].spent = true + State.fired(s, "Redundant Power Supply", ev.ref.player) + State.say(s, "Redundant Power Supply: %s keeps its Hardware." % State.anomaly_name(s, ev.ref)) + Flow.knock_out(s, ev.ref, ev.loc, ev.role, true) + return true + + +static func _raid_defeated(s: Dictionary, _hw: int, ev: Dictionary) -> bool: + var av := State.anomaly(s, ev.ref) + var total := 0 + for h in av.hardware: + total += State.def_of(s, h).bandwidth + var cost := ceili(total / 2.0) + State.ask(s, { + "player": ev.ref.player, + "kind": "RAID Array:keep", + "prompt": "RAID Array: pay %d Gb to keep %s?" % [cost, ", ".join(av.hardware.map(func(h): return State.name_of(s, h)))], + "options": [ + {"label": "Keep all Hardware for %d Gb" % cost, "value": true, "cost": cost}, + {"label": "Lose the Hardware", "value": false}, + ], + "resume": {"name": "RAID Array", "fn": "keep", "data": {"ref": ev.ref, "loc": ev.loc, "role": ev.role, "cost": cost}}, + }) + return true + + +static func _raid_keep(s: Dictionary, data: Dictionary, keep: Variant) -> void: + if keep: + s.players[data.ref.player].bandwidth -= data.cost + State.stat(s, "bandwidthOnCards", data.ref.player, data.cost) + State.fired(s, "RAID Array", data.ref.player) + Flow.knock_out(s, data.ref, data.loc, data.role, keep) + + +# Hardware Sandbox + +static func _sandbox_install(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.card == src.id: + _ask_sandbox(s, src.id) + + +static func _sandbox_turn_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + if s.active != src.controller: + return + var p = s.cards[src.id].get("protects") + if p == null or State.program_location(s, p) != src.at: + _ask_sandbox(s, src.id) + + +static func _sandbox_protect(s: Dictionary, data: Dictionary, program: Variant) -> void: + s.cards[data.card].protects = program + State.fired(s, "Hardware Sandbox", State.owner_of(s, data.card)) + + +static func _ask_sandbox(s: Dictionary, card: int) -> void: + var r = State.wearer_of(s, card) + var at = State.anomaly(s, r).at if r != null else null + if r == null or not at: + return + var progs: Array = s.locations[at].programs.filter(func(id): return State.owner_of(s, id) == r.player) + if progs.is_empty(): + return + if progs.size() == 1: + s.cards[card].protects = progs[0] + return + State.ask(s, { + "player": r.player, + "kind": "Hardware Sandbox:protect", + "prompt": "Hardware Sandbox: protect which Program on %s?" % at, + "options": progs.map(func(id): return {"label": State.name_of(s, id), "value": id}), + "resume": {"name": "Hardware Sandbox", "fn": "protect", "data": {"card": card}}, + }) + + +# Diagnostic Module + +static func _diagnostic_turn_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + if s.active != src.controller or hardware_uses_left(s, src.id) <= 0: + return + var deck: Array = s.players[src.controller].deck + if deck.size() < 2: + return + use_hardware(s, src.id) + State.fired(s, "Diagnostic Module", src.controller) + var top := State.name_of(s, deck[0]) + State.ask(s, { + "player": src.controller, + "kind": "Diagnostic Module:bottom", + "secret": true, + "prompt": "Diagnostic Module: the top card of your deck is %s. Put it on the bottom?" % top, + "options": [ + {"label": "Keep %s on top" % top, "value": false}, + {"label": "Put %s on the bottom" % top, "value": true}, + ], + "resume": {"name": "Diagnostic Module", "fn": "bottom", "data": {"player": src.controller}}, + }) + + +static func _diagnostic_bottom(s: Dictionary, data: Dictionary, bottom: Variant) -> void: + var deck: Array = s.players[data.player].deck + if bottom and not deck.is_empty(): + deck.append(deck.pop_front()) + + +# Hot-Swap Bay + +static func _hot_swap_uses(s: Dictionary, src: Dictionary) -> Array: + var av := State.anomaly(s, src.ref) + var hand: Array = s.players[src.controller].hand.filter(func(id): return State.def_of(s, id).kind == "hardware") + var out := [] + for out_card in av.hardware: + for o in CardUtil.card_options(s, hand): + if Query.slots_fit(s, src.ref, out_card, o.value): + out.append({"card": out_card, "cards": [o.value]}) + return out + + +static func _hot_swap_extra(s: Dictionary, _src: Dictionary, args: Dictionary) -> int: + return maxi(0, State.def_of(s, args.cards[0]).bandwidth - State.def_of(s, args.card).bandwidth) + + +static func _hot_swap_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var out_card: int = item.args.card + var into: int = item.args.cards[0] + var r: Dictionary = src.ref + if not State.anomaly(s, r).hardware.has(out_card) or not s.players[src.controller].hand.has(into): + return + if not Query.slots_fit(s, r, out_card, into): + return + State.uninstall_hardware(s, out_card) + State.to_hand(s, out_card) + attach_hardware(s, into, r) + State.fired(s, "Hot-Swap Bay", src.controller) + State.say(s, "Hot-Swap Bay swaps %s for %s on %s." % [State.name_of(s, out_card), State.name_of(s, into), State.anomaly_name(s, r)]) + + +# Quantum Coprocessor + +static func _quantum_offer(s: Dictionary, data: Dictionary, _value: Variant) -> void: + var item: Dictionary = data.item + var qc = null + for r in State.refs_in_play(s, item.player): + if State.is_copy(r) or State.anomaly(s, r).at != item.from or Query.desynced(s, r): + continue + for hw in State.anomaly(s, r).hardware: + if s.cards[hw].name == "Quantum Coprocessor" and Query.hardware_active(s, hw) and hardware_uses_left(s, hw) > 0: + qc = hw + break + if qc != null: + break + if qc == null: + return + var ex: Dictionary = CardScripts.of(item.name).get("execution", {}) + if ex.is_empty(): + return + var same := {"t": item.target, "a": item.args} + var plays: Array = ex.plays.call(s, item.player).filter(func(p): return {"t": p.target, "a": p.args} != same) + if plays.is_empty(): + return + var options := [{"label": "Don't copy", "value": null}] + for p in plays: + var label := "%s %s" % [p.target if p.target != null else "no target", Describe.describe_args(s, p.args, item.player)] + options.append({"label": label, "value": {"target": p.target, "args": p.args}}) + State.ask(s, { + "player": item.player, + "kind": "Quantum Coprocessor:copy", + "prompt": "Quantum Coprocessor: copy %s with a different target?" % item.name, + "options": options, + "resume": {"name": "Quantum Coprocessor", "fn": "copy", "data": {"item": item, "qc": qc}}, + }) + + +static func _quantum_copy(s: Dictionary, data: Dictionary, v: Variant) -> void: + if not v: + return + use_hardware(s, data.qc) + s.cards[data.qc].disabledUntil = State.start_of(State.next_turn_of(s, data.item.player)) + State.fired(s, "Quantum Coprocessor", data.item.player) + State.say(s, "Quantum Coprocessor copies %s onto %s." % [data.item.name, v.target if v.target != null else "a new target"]) + var copy: Dictionary = data.item.duplicate() + copy.target = v.target + copy.args = v.args + copy.from = null + CardScripts.of(data.item.name).execution.resolve.call(s, copy) diff --git a/engine/cards/hardware.gd.uid b/engine/cards/hardware.gd.uid new file mode 100644 index 0000000..db847da --- /dev/null +++ b/engine/cards/hardware.gd.uid @@ -0,0 +1 @@ +uid://b4f3qutsfuf6y diff --git a/engine/cards/programs.gd b/engine/cards/programs.gd new file mode 100644 index 0000000..fd6e9a6 --- /dev/null +++ b/engine/cards/programs.gd @@ -0,0 +1,734 @@ +class_name ProgramCards +## Programs (cards/programs.ts). A Program sits on a location its owner controls and its effect is +## local: "this Server" is the location it's on (or where Worm Protocol spreads it). Enemy Anomalies +## are only ever "at" your location while attacking or capturing it. + + +static func _enemy_of(src: Dictionary, r: Dictionary) -> bool: + return r.player != src.controller + + +## The first active source with this name at the location, so duplicates don't double up. +static func _first_here(s: Dictionary, src: Dictionary, loc: String) -> bool: + var named := Query.sources_named(s, src.name, loc) + return not named.is_empty() and Query.same_source(named[0], src) + + +## Destroys an installed Program. Hotfix (first each turn) disables it instead; otherwise Version +## Control returns it to its owner's hand. +static func destroy_program(s: Dictionary, id: int) -> void: + var loc = State.program_location(s, id) + if loc == null: + return + var owner := State.owner_of(s, id) + var here: Array = Query.sources(s).filter(func(x): return x.at == loc and x.controller == owner and x.get("virtual") == null) + var hotfix = null + for x in here: + if x.name == "Hotfix" and State.used_this_turn(s, "hotfix:%d" % x.id) == 0: + hotfix = x + break + if hotfix != null: + State.mark_used(s, "hotfix:%d" % hotfix.id) + s.cards[id].disabledUntil = maxi(s.cards[id].disabledUntil, State.start_of(State.next_turn_of(s, owner))) + State.fired(s, "Hotfix", owner) + State.say(s, "Hotfix: %s is disabled instead of destroyed." % State.name_of(s, id)) + return + State.uninstall_program(s, id) + State.stat(s, "programsLost", owner) + for x in here: + if x.name == "Version Control": + State.fired(s, "Version Control", owner) + State.to_hand(s, id) + State.say(s, "Version Control: %s returns to %s's hand." % [State.name_of(s, id), State.player_name(owner)]) + return + State.to_discard(s, id) + State.say(s, "%s is destroyed." % State.name_of(s, id)) + + +## Installs a Program for free (Replication Routine). +static func _install_free(s: Dictionary, card: int, at: String) -> void: + var p := State.owner_of(s, card) + State.remove_from(s.players[p].hand, card) + s.locations[at].programs.append(card) + s.cards[card].installedTurn = s.turn + State.stat(s, "programsInstalled", p) + State.played(s, State.name_of(s, card), p) + State.say(s, "%s installs %s on %s for free." % [State.player_name(p), State.name_of(s, card), at]) + Query.emit(s, "onInstall", {"card": card, "at": at, "ref": null}) + + +## Negative things on an Anomaly that Error Correction can remove, one at a time, as options. +static func _negatives(s: Dictionary, r: Dictionary) -> Array: + var av := State.anomaly(s, r) + var out := [] + if av.infection > 0: + out.append({"label": "an Infection counter", "value": "infection"}) + if av.bugs > 0: + out.append({"label": "a Bug counter", "value": "bug"}) + if av.permanentInfection > 0: + out.append({"label": "a permanent Infection counter", "value": "permanent"}) + for hw in State.hardware_of(s, r): + if not Query.hardware_active(s, hw): + out.append({"label": "disabled %s" % State.name_of(s, hw), "value": "hw:%d" % hw}) + var worst = _latest_penalty(s, av) + if worst != null: + out.append({"label": "%d Cores from %s" % [worst.cores, worst.source], "value": "mod:%d" % worst.seq}) + if State.running(s, av.rootedUntil): + out.append({"label": "Packet Flood", "value": "rooted"}) + if State.running(s, av.disabledUntil): + out.append({"label": "Disabled", "value": "disabled"}) + return out + + +## The most recent active modifier that lowers an Anomaly's Cores, or null. +static func _latest_penalty(s: Dictionary, av: Dictionary) -> Variant: + var worst = null + for m in State.active_mods(s, av): + if m.cores < 0 and (worst == null or m.seq > worst.seq): + worst = m + return worst + + +static func _remove_negative(s: Dictionary, r: Dictionary, what: String) -> void: + var av := State.anomaly(s, r) + if what == "infection": + av.infection -= 1 + elif what == "bug": + av.bugs -= 1 + elif what == "permanent": + av.permanentInfection -= 1 + elif what == "rooted": + av.rootedUntil = 0 + elif what == "disabled": + av.disabledUntil = 0 + elif what.begins_with("hw:"): + s.cards[what.substr(3).to_int()].disabledUntil = 0 + elif what.begins_with("mod:"): + var seq := what.substr(4).to_int() + av.mods = av.mods.filter(func(m): return m.seq != seq) + + +static func scripts() -> Dictionary: + return { + # Reading: one counter per attack declared on this Server, or per capture of it that wasn't an + # attack. The -2 applies anywhere while this Program is in play, and doesn't stack with copies. + "Recursive Infection": { + "text": "Whenever an enemy Anomaly attacks or breaches this Server, place an Infection counter on it. An Anomaly with 3+ Infection counters has -2 Core.", + "onAttackDeclared": _recursive_attack, + "onBreach": _recursive_breach, + "globalCores": func(s, f): return -2 if State.infection_of(State.anomaly(s, f.ref)) >= 3 else 0, + }, + + # Reading: "owner" is the attacking Anomaly's owner, who picks which of its Hardware is disabled + # for that combat. + "Memory Parasite": { + "text": "Enemy Anomalies attacking this Server have 1 hardware component disabled of the owners choosing.", + "onCombatStart": _parasite_combat_start, + "resume": {"disable": _parasite_disable}, + }, + + # Reading: installing this card counts, so it can bring a second Virus with it. + "Replication Routine": { + "text": "When you install a Virus Program on this Server, you may install a second Virus Program from your hand here for no Bandwidth cost.", + "onInstall": _replication_install, + "resume": {"install": _replication_resume}, + }, + + # Fires on every roll the attacker loses here (with the health rule off, that's every defeat). + "Resource Leech": { + "text": "Whenever an enemy Anomaly takes damage while attacking this Server, gain 3 Gb.", + "onDamage": _leech_damage, + }, + + "Worm Protocol": { + "text": "The localized effects of your other Programs on this Server also apply at one adjacent Server you choose when this is installed.", + "onInstall": _worm_install, + "resume": {"spread": _worm_spread}, + }, + + "Payload Injector": { + "text": "The first Execution you play targeting this Server each round costs 2 less Gb.", + "costMod": _payload_cost, + "onPaid": _payload_paid, + }, + + # Enemy Anomalies are only ever at this location while attacking it. The counter survives defeat. + "Persistent Infection": { + "text": "Whenever an enemy Anomaly takes damage at this Server, place an Infection counter on it permanently.", + "onDamage": _persistent_damage, + }, + + # Reading: your Anomaly attacking from this Server may declare a second attack on another + # adjacent location. Both come from this Server, even if the first one moved it. + "Infinite Loop": { + "text": "If the attacking Anomaly is controlled by the owner of this Program, it may attack a second adjacent Server in the same command.", + "extraAttacks": 1, + }, + + "Stack Overflow": { + "text": "Anomalies you control defending this Server gain +1 Core for each Program installed on this Server (including this one).", + "cores": _stack_overflow_cores, + }, + + # Both players pick at the same time; the attacker's pick stays hidden from the defender. + "Race Condition": { + "text": "During any combat at this Server, both players secretly choose Attack or Defend. If the choices differ, the defender gains a combat bonus of +2 Cores.", + "onCombatStart": _race_combat_start, + "resume": {"pick": _race_pick}, + }, + + "Bloatware": { + "text": "At the start of any combat at this Server, the attacking Anomaly loses 1 Core for each Hardware installed on it.", + "onCombatStart": _bloatware_combat_start, + }, + + "Null Pointer": { + "text": "Once per round, when an enemy Execution would resolve at this Server, it's effect does not occur.", + "negates": _null_pointer_negates, + }, + + # Reading: "Hardware bonuses" are the Cores Hardware adds. + "Stock Rice": { + "text": "Neither Anomaly in a combat that takes place at this Server may use any Hardware bonuses.", + "blocksHardwareInCombat": true, + "onCombatStart": _stock_rice_combat_start, + }, + + # Every lost roll disables a Program until its controller's next command; a destroyed attacker + # lets the owner destroy it instead. + "Overflow Error": { + "text": "When an enemy Anomaly takes damage while attacking this Server, disable one Program its controller has in play until their next command. If the Anomaly was destroyed, you may destroy that Program instead.", + "onDamage": _overflow_damage, + "resume": {"hit": _overflow_hit}, + }, + + # Reading: the copy lasts until your next turn, while this Program is disabled. + "Undefined Behavior": { + "text": "Once per round, copy the localized effect of another Program on another Server. Then disable this Program until your next command.", + "ability": {"uses": _undefined_uses, "resolve": _undefined_resolve}, + }, + + "Packet Loss": { + "text": "When an enemy successfully breaches this Server, its controller discards a card at random.", + "onBreach": _packet_loss_breach, + }, + + # The once-per-turn Hardware abilities are Hot-Swap Bay's and Quantum Coprocessor's. + "Desynchronization": { + "text": "Enemy Anomalies attacking this Server cannot use their Hardware's \"once per round\" abilities during that combat.", + "blocksHardwareAbilities": true, + }, + + # Reading: "each turn" was removed from the card, so this works once per installation. + "Visual Artifact": { + "text": "The first attack made against an Anomaly you control at this Server suffers -1 Core.", + "onCombatStart": _artifact_combat_start, + }, + + # Executions check for this through CardUtil.scope_of(). + "Ghost Process": { + "text": "Your Executions played targeting this Server may also affect Anomalies, Programs, and Hardware at one adjacent Server.", + }, + + # Runs from the engine right after an enemy Execution that targets an Anomaly is played. + "False Positive": { + "text": "When an enemy Execution targets an Anomaly you control at this Server, you may redirect it to another legal Anomaly at another Server.", + "resume": {"offer": _false_positive_offer, "redirect": _false_positive_redirect}, + }, + + "Fragmentation": { + "text": "Executions your opponents play targeting this Server cost +2 Gb.", + "costMod": func(_s, src, pay): return 2 if pay.kind == "execution" and pay.player != src.controller and pay.get("at") == src.at else 0, + "onPaid": func(s, src, _pay): State.fired(s, "Fragmentation", src.controller), + }, + + "Latency Spike": { + "text": "The attacking player cannot play Executions during the first step of any combat at this Server.", + "blocksAttackerExecutions": true, + }, + + # Destroyed means destroyed by an effect (Overflow Error). A captured location's Programs aren't + # destroyed; they're discarded (see Version Control). + "Hotfix": { + "text": "The first Program on this Server that would be destroyed each round is instead disabled until your next command.", + }, + + "Error Correction": { + "text": "At the beginning of your first command each round, remove one negative counter or status from each Anomaly you control at this Server.", + "onTurnStart": _error_correction_turn_start, + "resume": {"fix": _error_correction_fix, "remove": func(s, data, what): _remove_negative(s, data.ref, what)}, + }, + + # Reading: it can sacrifice itself. + "Garbage Collection": { + "text": "Once per round, sacrifice one Program installed on this Server to recover its printed Bandwidth value.", + "ability": {"uses": _garbage_uses, "resolve": _garbage_resolve}, + }, + + "Version Control": { + "text": "When a Program on this Server would be destroyed, or when this Server is captured, return one Program from this Server to your hand instead of discarding it.", + "onCaptured": _version_captured, + "resume": {"save": _version_save}, + }, + + "Rollback Routine": { + "text": "Once per round, undo the most recent temporary stat reduction applied to an Anomaly you control at this Server.", + "ability": {"uses": _rollback_uses, "resolve": _rollback_resolve}, + }, + + "Compatibility Layer": { + "text": "This Server may hold one additional Program beyond the normal limit, and Patch Programs installed here cost 2 less Gb.", + "programSlots": 1, + "costMod": func(s, src, pay): return -2 if pay.kind == "program" and pay.player == src.controller and pay.get("at") == src.at and CardUtil.is_patch(s, pay.card) else 0, + "onPaid": func(s, src, _pay): State.fired(s, "Compatibility Layer", src.controller), + }, + } + + +# Recursive Infection + +static func _recursive_attack(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.to == src.at and _enemy_of(src, ev.ref): + CardUtil.infect(s, ev.ref, 1, "Recursive Infection", src.controller) + + +static func _recursive_breach(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.loc != src.at or not _enemy_of(src, ev.ref): + return + for d in s.declarations: + if d.kind == "attack" and State.same_ref(d.ref, ev.ref) and d.to == ev.loc: + return + CardUtil.infect(s, ev.ref, 1, "Recursive Infection", src.controller) + + +# Memory Parasite + +static func _parasite_combat_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + var c: Dictionary = s.combat + if c.loc != src.at or not _enemy_of(src, c.attacker): + return + var hw: Array = State.hardware_of(s, c.attacker).filter(func(h): return Query.hardware_active(s, h) and not c.suppressed.has(h)) + if hw.is_empty(): + return + State.fired(s, "Memory Parasite", src.controller) + if hw.size() == 1: + c.suppressed.append(hw[0]) + State.say(s, "Memory Parasite disables %s for this combat." % State.name_of(s, hw[0])) + return + State.ask(s, { + "player": c.attacker.player, + "kind": "Memory Parasite:disable", + "prompt": "Memory Parasite: which of your Hardware is disabled for this combat?", + "options": hw.map(func(h): return {"label": State.name_of(s, h), "value": h}), + "resume": {"name": "Memory Parasite", "fn": "disable", "data": null}, + }) + + +static func _parasite_disable(s: Dictionary, _data: Variant, hw: Variant) -> void: + if s.combat != null: + s.combat.suppressed.append(hw) + + +# Replication Routine + +static func _replication_install(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if not src.at or ev.at != src.at or src.get("virtual") != null or not CardUtil.is_virus(s, ev.card): + return + if s.locations[src.at].programs.size() >= Query.program_slots(s, src.at): + return + var hand: Array = s.players[src.controller].hand.filter(func(id): return CardUtil.is_virus(s, id)) + if hand.is_empty(): + return + State.ask(s, { + "player": src.controller, + "kind": "Replication Routine:install", + "prompt": "Replication Routine: install a second Virus Program on %s for free?" % src.at, + "options": [{"label": "No", "value": null}] + CardUtil.card_options(s, hand), + "resume": {"name": "Replication Routine", "fn": "install", "data": {"at": src.at}}, + }) + + +static func _replication_resume(s: Dictionary, data: Dictionary, card: Variant) -> void: + if card == null or not State.controls(s, State.owner_of(s, card), data.at): + return + if s.locations[data.at].programs.size() >= Query.program_slots(s, data.at): + return + State.fired(s, "Replication Routine", State.owner_of(s, card)) + _install_free(s, card, data.at) + + +# Resource Leech, Persistent Infection + +static func _leech_damage(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.loc != src.at or ev.role != "attack" or not _enemy_of(src, ev.ref): + return + State.gain_bandwidth(s, src.controller, 3) + State.fired(s, "Resource Leech", src.controller) + State.say(s, "Resource Leech: %s gains 3 Gb." % State.player_name(src.controller)) + + +static func _persistent_damage(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.loc != src.at or not _enemy_of(src, ev.ref) or State.is_copy(ev.ref): + return + CardUtil.infect(s, ev.ref, 1, "Persistent Infection", src.controller, true) + + +# Worm Protocol + +static func _worm_install(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.card != src.id or src.get("virtual") != null: + return + var near := State.neighbors(s, src.at) + if near.is_empty(): + return + State.ask(s, { + "player": src.controller, + "kind": "Worm Protocol:spread", + "prompt": "Worm Protocol on %s: spread your other Programs' effects to which adjacent location?" % src.at, + "options": near.map(func(l): return {"label": l, "value": l}), + "resume": {"name": "Worm Protocol", "fn": "spread", "data": {"card": src.id}}, + }) + + +static func _worm_spread(s: Dictionary, data: Dictionary, to: Variant) -> void: + s.cards[data.card].wormTo = to + State.fired(s, "Worm Protocol", State.owner_of(s, data.card)) + + +# Payload Injector + +static func _payload_cost(s: Dictionary, src: Dictionary, pay: Dictionary) -> int: + return -2 if pay.kind == "execution" and pay.player == src.controller and pay.get("at") == src.at \ + and State.used_this_turn(s, "payload:%d" % src.id) == 0 else 0 + + +static func _payload_paid(s: Dictionary, src: Dictionary, _pay: Dictionary) -> void: + State.mark_used(s, "payload:%d" % src.id) + State.fired(s, "Payload Injector", src.controller) + + +# Stack Overflow + +static func _stack_overflow_cores(s: Dictionary, src: Dictionary, f: Dictionary) -> int: + if f.role == "defend" and f.at == src.at and f.ref.player == src.controller: + return Query.installed_count(s, src.at) + return 0 + + +# Race Condition + +static func _race_combat_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + var c: Dictionary = s.combat + if c.loc != src.at or not _first_here(s, src, c.loc): + return + State.fired(s, "Race Condition", src.controller) + _ask_race(s, c.attacker.player) + + +static func _race_pick(s: Dictionary, data: Dictionary, pick: Variant) -> void: + var c = s.combat + if c == null or c.ended: + return + c.race[data.player] = pick + var defender: int = c.defenders[0].player if not c.defenders.is_empty() else State.other(c.attacker.player) + if data.player == c.attacker.player: + _ask_race(s, defender) + return + var a = c.race[c.attacker.player] + var d = c.race[defender] + State.say(s, "Race Condition: attacker chose %s, defender chose %s." % [Util.js(a), Util.js(d)]) + if a != d and not c.defenders.is_empty(): + State.add_mod(s, c.defenders[0], 2, "Race Condition", defender, {"combat": c.id}) + State.say(s, "The choices differ: the defender gets +2 Cores.") + + +static func _ask_race(s: Dictionary, player: int) -> void: + State.ask(s, { + "player": player, + "kind": "Race Condition:pick", + "secret": true, + "prompt": "Race Condition: secretly choose Attack or Defend.", + "options": [{"label": "Attack", "value": "attack"}, {"label": "Defend", "value": "defend"}], + "resume": {"name": "Race Condition", "fn": "pick", "data": {"player": player}}, + }) + + +# Bloatware, Stock Rice, Visual Artifact + +static func _bloatware_combat_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + var c: Dictionary = s.combat + if c.loc != src.at or not _enemy_of(src, c.attacker) or Query.bug_immune(s, c.attacker, src.controller): + return + var n: int = State.hardware_of(s, c.attacker).size() + if n == 0: + return + State.add_mod(s, c.attacker, -n, "Bloatware", src.controller, {"combat": c.id}) + State.fired(s, "Bloatware", src.controller) + State.say(s, "Bloatware: %s loses %d Core%s." % [State.anomaly_name(s, c.attacker), n, "" if n == 1 else "s"]) + + +static func _stock_rice_combat_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + if s.combat.loc == src.at: + State.fired(s, "Stock Rice", src.controller) + + +static func _artifact_combat_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + var c: Dictionary = s.combat + if c.loc != src.at or s.cards[src.id].get("spent", false): + return + var guarding := false + for d in c.defenders: + if d.player == src.controller: + guarding = true + if not guarding: + return + s.cards[src.id].spent = true + State.add_mod(s, c.attacker, -1, "Visual Artifact", src.controller, {"combat": c.id}) + State.fired(s, "Visual Artifact", src.controller) + State.say(s, "Visual Artifact: %s gets -1 Core." % State.anomaly_name(s, c.attacker)) + + +# Null Pointer + +static func _null_pointer_negates(s: Dictionary, src: Dictionary, item: Dictionary) -> bool: + if item.player == src.controller or item.target != src.at or State.used_this_turn(s, "null:%d" % src.id) > 0: + return false + State.mark_used(s, "null:%d" % src.id) + State.fired(s, "Null Pointer", src.controller) + State.say(s, "Null Pointer: %s has no effect." % item.name) + return true + + +# Overflow Error + +static func _overflow_damage(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.loc != src.at or ev.role != "attack" or not _enemy_of(src, ev.ref): + return + var theirs := [] + for l in GameMap.LOCATIONS: + if State.controls(s, ev.ref.player, l): + for id in CardUtil.programs_on(s, l): + if Query.can_target_program(s, id, src.controller): + theirs.append(id) + if theirs.is_empty(): + return + State.fired(s, "Overflow Error", src.controller) + var options := [] + for id in theirs: + var where := "%s on %s" % [State.name_of(s, id), State.program_location(s, id)] + if ev.destroyed: + options.append({"label": "Destroy %s" % where, "value": {"card": id, "mode": "destroy"}}) + options.append({"label": "Disable %s" % where, "value": {"card": id, "mode": "disable"}}) + State.ask(s, { + "player": src.controller, + "kind": "Overflow Error:hit", + "prompt": "Overflow Error: destroy or disable one of their Programs." if ev.destroyed else "Overflow Error: disable one of their Programs.", + "options": options, + "resume": {"name": "Overflow Error", "fn": "hit", "data": null}, + }) + + +static func _overflow_hit(s: Dictionary, _data: Variant, v: Variant) -> void: + if State.program_location(s, v.card) == null: + return + if v.mode == "destroy": + destroy_program(s, v.card) + else: + var until := State.start_of(State.next_turn_of(s, State.owner_of(s, v.card))) + s.cards[v.card].disabledUntil = maxi(s.cards[v.card].disabledUntil, until) + + +# Undefined Behavior + +static func _undefined_uses(s: Dictionary, src: Dictionary) -> Array: + if src.kind != "program" or src.get("virtual") != null: + return [] + var out := [] + for l in GameMap.LOCATIONS: + if l == src.at: + continue + for id in CardUtil.programs_on(s, l): + if State.name_of(s, id) != "Undefined Behavior" and Query.can_target_program(s, id, src.controller): + out.append({"card": id}) + return out + + +static func _undefined_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var card: int = item.args.card + if State.program_location(s, card) == null: + return + var until := State.start_of(State.next_turn_of(s, src.controller)) + s.seq += 1 + s.virtuals.append({"id": s.seq, "name": State.name_of(s, card), "controller": src.controller, "at": src.at, "until": until, "installed": false, "from": card}) + s.cards[src.id].disabledUntil = maxi(s.cards[src.id].disabledUntil, until) + State.fired(s, "Undefined Behavior", src.controller) + State.say(s, "Undefined Behavior on %s copies %s and shuts itself off until %s's next turn." % [src.at, State.name_of(s, card), State.player_name(src.controller)]) + + +# Packet Loss + +static func _packet_loss_breach(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.loc != src.at or not _enemy_of(src, ev.ref): + return + var hand: Array = s.players[ev.ref.player].hand + if hand.is_empty(): + return + var card: int = hand[Rng.rand_int(s.rng, hand.size())] + State.remove_from(hand, card) + State.to_discard(s, card) + State.fired(s, "Packet Loss", src.controller) + State.say(s, "Packet Loss: %s discards %s at random." % [State.player_name(ev.ref.player), State.name_of(s, card)]) + + +# False Positive + +static func _false_positive_offer(s: Dictionary, data: Dictionary, _value: Variant) -> void: + if data.index >= s.stack.size(): + return + var item: Dictionary = s.stack[data.index] + var ex: Dictionary = CardScripts.of(item.name).get("execution", {}) + var hit: Array = ex.targetsAnomalies.call(s, item) if ex.has("targetsAnomalies") else [] + var guarded = null + for r in hit: + if r.player == item.player: + continue + var at = State.anomaly(s, r).at + for x in Query.sources(s): + if x.name == "False Positive" and x.at == at and x.controller == r.player: + guarded = r + break + if guarded != null: + break + if ex.is_empty() or guarded == null: + return + var from = State.anomaly(s, guarded).at + var options := [{"label": "Leave it", "value": null}] + for play in ex.plays.call(s, item.player): + var refs: Array = ex.targetsAnomalies.call(s, {"player": item.player, "target": play.target, "args": play.args}) if ex.has("targetsAnomalies") else [] + if refs.is_empty(): + continue + var away := true + for r in refs: + if State.anomaly(s, r).at == from or State.same_ref(r, guarded): + away = false + if not away: + continue + var whom := State.anomaly_name(s, play.args.ref) if play.args.get("ref") != null else State.name_of(s, play.args.get("card", -1)) + options.append({"label": "Redirect to %s on %s" % [whom, Util.js(play.target)], "value": {"index": data.index, "target": play.target, "args": play.args}}) + if options.size() == 1: + return + State.ask(s, { + "player": guarded.player, + "kind": "False Positive:redirect", + "prompt": "False Positive: redirect %s away from %s?" % [item.name, State.anomaly_name(s, guarded)], + "options": options, + "resume": {"name": "False Positive", "fn": "redirect", "data": null}, + }) + + +static func _false_positive_redirect(s: Dictionary, _data: Variant, v: Variant) -> void: + if v == null or v.index >= s.stack.size(): + return + var item: Dictionary = s.stack[v.index] + item.target = v.target + item.args = v.args + State.fired(s, "False Positive", State.other(item.player)) + + +# Error Correction + +static func _error_correction_turn_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + if s.active != src.controller: + return + var tasks := [] + for r in State.refs_in_play(s, src.controller): + if State.anomaly(s, r).at == src.at: + tasks.append(State.later("Error Correction", "fix", {"ref": r})) + State.push_tasks(s, tasks) + + +static func _error_correction_fix(s: Dictionary, data: Dictionary, _value: Variant) -> void: + var list := _negatives(s, data.ref) + if list.is_empty(): + return + State.fired(s, "Error Correction", data.ref.player) + if list.size() == 1: + _remove_negative(s, data.ref, list[0].value) + State.say(s, "Error Correction removes %s from %s." % [list[0].label, State.anomaly_name(s, data.ref)]) + return + State.ask(s, { + "player": data.ref.player, + "kind": "Error Correction:remove", + "prompt": "Error Correction: remove what from %s?" % State.anomaly_name(s, data.ref), + "options": list, + "resume": {"name": "Error Correction", "fn": "remove", "data": {"ref": data.ref}}, + }) + + +# Garbage Collection + +static func _garbage_uses(s: Dictionary, src: Dictionary) -> Array: + if src.kind != "program": + return [] + return s.locations[src.at].programs.map(func(card): return {"card": card}) + + +static func _garbage_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var card: int = item.args.card + if State.program_location(s, card) != src.at: + return + State.uninstall_program(s, card) + State.to_discard(s, card) + State.stat(s, "programsLost", src.controller) + State.gain_bandwidth(s, src.controller, State.def_of(s, card).bandwidth) + State.fired(s, "Garbage Collection", src.controller) + State.say(s, "Garbage Collection sacrifices %s for %d Gb." % [State.name_of(s, card), State.def_of(s, card).bandwidth]) + + +# Version Control + +static func _version_captured(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.loc != src.at or src.get("virtual") != null: + return + var here: Array = s.locations[ev.loc].programs + if here.is_empty(): + return + State.ask(s, { + "player": src.controller, + "kind": "Version Control:save", + "prompt": "Version Control: %s is being captured. Return which Program to your hand?" % ev.loc, + "options": here.map(func(id): return {"label": State.name_of(s, id), "value": id}), + "resume": {"name": "Version Control", "fn": "save", "data": null}, + }) + + +static func _version_save(s: Dictionary, _data: Variant, card: Variant) -> void: + if State.uninstall_program(s, card) == null: + return + State.to_hand(s, card) + State.fired(s, "Version Control", State.owner_of(s, card)) + State.say(s, "Version Control returns %s to %s's hand." % [State.name_of(s, card), State.player_name(State.owner_of(s, card))]) + + +# Rollback Routine + +static func _rollback_uses(s: Dictionary, src: Dictionary) -> Array: + if src.kind != "program": + return [] + var out := [] + for r in State.refs_in_play(s, src.controller): + if State.anomaly(s, r).at == src.at and _latest_penalty(s, State.anomaly(s, r)) != null: + out.append({"ref": r}) + return out + + +static func _rollback_resolve(s: Dictionary, item: Dictionary, src: Dictionary) -> void: + var av := State.anomaly(s, item.args.ref) + if av.at != src.at: + return + var last = _latest_penalty(s, av) + if last == null: + return + av.mods = av.mods.filter(func(m): return m.seq != last.seq) + State.fired(s, "Rollback Routine", src.controller) + State.say(s, "Rollback Routine undoes %d Cores from %s on %s." % [last.cores, last.source, State.anomaly_name(s, item.args.ref)]) diff --git a/engine/cards/programs.gd.uid b/engine/cards/programs.gd.uid new file mode 100644 index 0000000..0b9a0ba --- /dev/null +++ b/engine/cards/programs.gd.uid @@ -0,0 +1 @@ +uid://q4cltmsskkvf diff --git a/engine/cards/servers.gd b/engine/cards/servers.gd new file mode 100644 index 0000000..aec114a --- /dev/null +++ b/engine/cards/servers.gd @@ -0,0 +1,195 @@ +class_name ServerCards +## Servers (cards/servers.ts). A Server's ability belongs to the player who controls its location and +## applies at that location, unless the text says otherwise. + + +static func scripts() -> Dictionary: + return { + "High Bandwidth Server": {"text": "Add additional 4 Gb to resource total", "bandwidthOnPlace": 4}, + "Power Server": {"text": "Add additional 4 Gb to resource total", "bandwidthOnPlace": 4}, + "Server Farm": { + "text": "Add 4 Gb to resource total and 2 Cores to any Anomaly", + "bandwidthOnPlace": 4, + "cores": _core_bonus.bind(2), + }, + "MultiCore Server": {"text": "Add 2 Cores to any Anomalies", "cores": _core_bonus.bind(2)}, + "Cloud Compute": {"text": "Add 4 Cores to any Anomalies", "cores": _core_bonus.bind(4)}, + "Cluster Server": {"text": "Up to 2 Anomalies can defend this Server", "capacity": 2}, + "Pingable Server": {"text": "Up to 2 Anomalies can defend this Server", "capacity": 2}, + + # Reading: once per turn, at any time, make a copy of your Anomaly based here (Carbon NanoBots' + # copy rules). The copy enters play on any location you control with room. + "Backup Server": { + "text": "Duplicate Anomaly based at this Server", + "ability": {"uses": _backup_uses, "resolve": _backup_resolve}, + }, + + "Upgraded Hardware": { + "text": "Hardware upgrades cost 2 less Gb to install", + "costMod": _upgraded_cost, + "onPaid": _fired_by_controller.bind("Upgraded Hardware"), + }, + + "Network Throttle": { + "text": "Firewalls cost 1 less Gb to install", + "costMod": _throttle_cost, + "onPaid": _fired_by_controller.bind("Network Throttle"), + }, + + # Reading: when placed, pick one adjacent Server (either player's) and gain its ability for as + # long as this card stays. A copied Bandwidth bonus is paid right away. + "Duplicate Server": { + "text": "Copy one adjacent Server ability", + "onPlaced": _duplicate_placed, + "resume": {"copy": _duplicate_copy}, + }, + + "Protected Server": { + "text": "Add 2 Gb if defending this Server", + "onCombatStart": _protected_combat_start, + }, + + # Reading: applies to every draw after the opening hand, once per card drawn. + "Callable Server": { + "text": "When drawing a card, you may choose to place it on the bottom of the deck and draw another", + "onDraw": _callable_draw, + "resume": {"redraw": _callable_redraw}, + }, + } + + +## Core bonus for the controller's Anomaly standing on this Server (attacking from it or defending it). +static func _core_bonus(_s: Dictionary, src: Dictionary, f: Dictionary, n: int) -> int: + return n if f.at == src.at and f.ref.player == src.controller else 0 + + +static func _fired_by_controller(s: Dictionary, src: Dictionary, _pay: Dictionary, card_name: String) -> void: + State.fired(s, card_name, src.controller) + + +# Backup Server + +static func _backup_uses(s: Dictionary, src: Dictionary) -> Array: + var p: int = src.controller + if not Query.can_copy(s, p): + return [] + var spots: Array = GameMap.LOCATIONS.filter(func(l): return Query.has_room(s, p, l)) + var out := [] + for r in State.refs_in_play(s, p): + if not State.is_copy(r) and State.anomaly(s, r).at == src.at and State.anomaly(s, State.copy_of(r)).at == null: + for to in spots: + out.append({"ref": r, "to": to}) + return out + + +static func _backup_resolve(s: Dictionary, item: Dictionary, _src: Dictionary) -> void: + var r: Dictionary = item.args.ref + var to: String = item.args.to + if State.anomaly(s, r).at == null or State.anomaly(s, State.copy_of(r)).at != null or not Query.can_copy(s, r.player) \ + or not Query.has_room(s, r.player, to): + return + State.fired(s, "Backup Server", r.player) + Flow.create_copy(s, r, to) + + +# Upgraded Hardware, Network Throttle + +static func _upgraded_cost(_s: Dictionary, src: Dictionary, pay: Dictionary) -> int: + return -2 if pay.kind == "hardware" and pay.player == src.controller and pay.get("at") == src.at else 0 + + +static func _throttle_cost(_s: Dictionary, src: Dictionary, pay: Dictionary) -> int: + if pay.kind != "firewall" or pay.player != src.controller: + return 0 + var line: Dictionary = GameMap.LINE_BY_ID[pay.line] + return -1 if line.a == src.at or line.b == src.at else 0 + + +# Duplicate Server + +static func _duplicate_placed(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.card != src.id or src.get("virtual") != null: + return + var names := [] + for n in State.neighbors(s, src.at): + var sv = s.locations[n].server + if sv != null and State.name_of(s, sv) != "Duplicate Server" and not names.has(State.name_of(s, sv)): + names.append(State.name_of(s, sv)) + if names.is_empty(): + return + State.ask(s, { + "player": src.controller, + "kind": "Duplicate Server:copy", + "prompt": "Duplicate Server on %s: copy which adjacent Server?" % src.at, + "options": names.map(func(n): return {"label": n, "value": n}), + "resume": {"name": "Duplicate Server", "fn": "copy", "data": {"card": src.id, "player": src.controller}}, + }) + + +static func _duplicate_copy(s: Dictionary, data: Dictionary, server_name: String) -> void: + s.cards[data.card].copies = server_name + var p: int = data.player + State.fired(s, "Duplicate Server", p) + State.say(s, "Duplicate Server copies %s." % server_name) + var bonus: int = scripts().get(server_name, {}).get("bandwidthOnPlace", 0) + if bonus: + State.gain_bandwidth(s, p, bonus, "bandwidthFromCaptures") + State.say(s, "%s gains %d Gb from the copied ability." % [State.player_name(p), bonus]) + + +# Protected Server + +static func _protected_combat_start(s: Dictionary, src: Dictionary, _ev: Variant) -> void: + var c: Dictionary = s.combat + if c.loc != src.at: + return + var defending := false + for d in State.defenders_at(s, c.loc): + if d.player == src.controller: + defending = true + if not defending: + return + State.gain_bandwidth(s, src.controller, 2) + State.fired(s, "Protected Server", src.controller) + State.say(s, "Protected Server: %s gains 2 Gb for defending." % State.player_name(src.controller)) + + +# Callable Server + +static func _callable_draw(s: Dictionary, src: Dictionary, ev: Dictionary) -> void: + if ev.player != src.controller or s.players[ev.player].deck.is_empty(): + return + var first = null + for x in Query.sources_named(s, "Callable Server"): + if x.controller == ev.player: + first = x + break + if first == null or not Query.same_source(first, src): + return + if not s.players[ev.player].hand.has(ev.card): + return + var nm := State.name_of(s, ev.card) + State.ask(s, { + "player": ev.player, + "kind": "Callable Server:redraw", + "secret": true, + "prompt": "Callable Server: keep %s, or put it on the bottom and draw another?" % nm, + "options": [ + {"label": "Keep %s" % nm, "value": false}, + {"label": "Bottom %s and draw again" % nm, "value": true}, + ], + "resume": {"name": "Callable Server", "fn": "redraw", "data": {"player": ev.player, "card": ev.card}}, + }) + + +static func _callable_redraw(s: Dictionary, data: Dictionary, again: Variant) -> void: + if not again: + return + var pl: Dictionary = s.players[data.player] + if not State.remove_from(pl.hand, data.card): + return + pl.deck.append(data.card) + State.fired(s, "Callable Server", data.player) + Flow.draw_now(s, data.player) + s.stats.cardsDrawn[data.player] -= 1 + State.say(s, "%s bottoms a card and draws again." % State.player_name(data.player)) diff --git a/engine/cards/servers.gd.uid b/engine/cards/servers.gd.uid new file mode 100644 index 0000000..cb4812d --- /dev/null +++ b/engine/cards/servers.gd.uid @@ -0,0 +1 @@ +uid://cs1kmjh8ijwvv diff --git a/engine/cards/util.gd b/engine/cards/util.gd new file mode 100644 index 0000000..4c64a54 --- /dev/null +++ b/engine/cards/util.gd @@ -0,0 +1,106 @@ +class_name CardUtil +## Helpers shared by card scripts (cards/util.ts). + + +## Locations where `p` has Ghost Process working, as a Dictionary used as a set. +static func ghosts_of(s: Dictionary, p: int) -> Dictionary: + var out := {} + for x in Query.sources(s): + if x.name == "Ghost Process" and x.controller == p: + out[x.at] = true + return out + + +## Locations an Execution played on `target` can reach: Ghost Process adds one adjacent location. +## Pass `ghosts` (from ghosts_of) when calling it for many targets. +static func scope_of(s: Dictionary, p: int, target: String, ghosts: Variant = null) -> Array: + if ghosts == null: + ghosts = ghosts_of(s, p) + return [target] + State.neighbors(s, target) if ghosts.has(target) else [target] + + +static func mine(s: Dictionary, p: int, loc: String) -> Array: + return State.at_server(s, loc).filter(func(r): return r.player == p) + + +## Active, installed Programs on a location. +static func programs_on(s: Dictionary, loc: String) -> Array: + return s.locations[loc].programs.filter(func(id): return Query.program_active(s, id)) + + +static func active_hardware(s: Dictionary, ids: Array) -> Array: + return ids.filter(func(id): return Query.hardware_active(s, id)) + + +## Places Bug counters: like Infection counters, for Bug cards. No card places them yet. ECC Memory +## stops opponents from placing them. +static func add_bugs(s: Dictionary, r: Dictionary, n: int, source: String, by: int) -> bool: + if Query.bug_immune(s, r, by): + State.say(s, "ECC Memory blocks %s's Bug counters on %s." % [source, State.anomaly_name(s, r)]) + State.fired(s, "ECC Memory", r.player) + return false + State.anomaly(s, r).bugs += n + State.fired(s, source, by) + State.say(s, "%s: %s gets %d Bug counter%s (%d total)." % [source, State.anomaly_name(s, r), n, "" if n == 1 else "s", State.anomaly(s, r).bugs]) + return true + + +static func infect(s: Dictionary, r: Dictionary, n: int, source: String, by: int, permanent := false) -> void: + var av := State.anomaly(s, r) + if permanent: + av.permanentInfection += n + else: + av.infection += n + State.fired(s, source, by) + State.say(s, "%s: %s gets %s %sInfection counter%s (%d total)." % [source, State.anomaly_name(s, r), "an" if n == 1 else str(n), "permanent " if permanent else "", "" if n == 1 else "s", av.infection + av.permanentInfection]) + + +## One option per distinct card name. +static func card_options(s: Dictionary, ids: Array) -> Array: + var seen := {} + var out := [] + for id in ids: + var nm := State.name_of(s, id) + if seen.has(nm): + continue + seen[nm] = true + out.append({"label": nm, "value": id}) + return out + + +static func is_virus(s: Dictionary, id: int) -> bool: + var d := State.def_of(s, id) + return d.kind == "program" and d.type == "V" + + +static func is_patch(s: Dictionary, id: int) -> bool: + var d := State.def_of(s, id) + return d.kind == "program" and d.type == "P" + + +static func whose(p: int) -> String: + return State.player_name(p) + + +## Distinct non-empty subsets of up to 3 items. +static func subsets(items: Array) -> Array: + var out := [] + var n := mini(items.size(), 3) + for mask in range(1, 1 << n): + var sub := [] + for i in n: + if mask & (1 << i): + sub.append(items[i]) + out.append(sub) + return out + + +static func src_label(s: Dictionary, src: Dictionary) -> String: + if src.kind == "anomaly": + var d := State.def_of(s, src.id) + return "%s (%s)" % [Util.js(d.ability.name if d.has("ability") else null), src.name] + return src.name + + +static func every_anomaly_in_play(s: Dictionary) -> Array: + return State.refs_in_play(s, 0) + State.refs_in_play(s, 1) diff --git a/engine/cards/util.gd.uid b/engine/cards/util.gd.uid new file mode 100644 index 0000000..504f32a --- /dev/null +++ b/engine/cards/util.gd.uid @@ -0,0 +1 @@ +uid://dgxib28v7i72s diff --git a/engine/csv.gd b/engine/csv.gd new file mode 100644 index 0000000..313f88e --- /dev/null +++ b/engine/csv.gd @@ -0,0 +1,62 @@ +class_name Csv +## Minimal RFC 4180 parser (csv.ts): quoted fields, "" escapes, and commas or newlines inside quotes. + + +static func parse(text: String) -> Array: + var rows := [] + var row := [] + var field := "" + var quoted := false + var n := text.length() + var i := 0 + while i < n: + var ch := text[i] + if quoted: + if ch != "\"": + field += ch + elif i + 1 < n and text[i + 1] == "\"": + field += "\"" + i += 1 + else: + quoted = false + elif ch == "\"": + quoted = true + elif ch == ",": + row.append(field) + field = "" + elif ch == "\n" or ch == "\r": + if ch == "\r" and i + 1 < n and text[i + 1] == "\n": + i += 1 + row.append(field) + rows.append(row) + row = [] + field = "" + else: + field += ch + i += 1 + if field != "" or row.size() > 0: + row.append(field) + rows.append(row) + return rows + + +## Rows keyed by header name, skipping blank lines. +static func parse_objects(text: String) -> Array: + var rows := parse(text) + if rows.is_empty(): + return [] + var header: Array = rows[0] + var out := [] + for r in rows.slice(1): + var blank := true + for f in r: + if f != "": + blank = false + break + if blank: + continue + var obj := {} + for i in header.size(): + obj[header[i]] = r[i] if i < r.size() else "" + out.append(obj) + return out diff --git a/engine/csv.gd.uid b/engine/csv.gd.uid new file mode 100644 index 0000000..1a0e083 --- /dev/null +++ b/engine/csv.gd.uid @@ -0,0 +1 @@ +uid://dopecc2vmjwva diff --git a/engine/deck.gd b/engine/deck.gd new file mode 100644 index 0000000..73569b7 --- /dev/null +++ b/engine/deck.gd @@ -0,0 +1,55 @@ +class_name Deck +## Deck lists (deck.ts). A deck list is {anomalies, servers, main}: lists of card names. `main` holds +## the Executions, Hardware and Programs (and Anomalies, when recruiting). + +const MAIN_KINDS := ["program", "hardware", "execution"] + + +## Problems with a deck list; empty when it's legal. +static func validate_deck(pool: Dictionary, deck: Dictionary, rules: Dictionary) -> Array: + var errors := [] + var part := func(label: String, names: Array, kinds: Array, size: int) -> void: + if names.size() != size: + errors.append("%s: %d cards, needs %d" % [label, names.size(), size]) + for n in names: + var card = pool.by_name.get(n) + if card == null: + errors.append("%s: unknown card \"%s\"" % [label, n]) + elif not kinds.has(card.kind): + errors.append("%s: \"%s\" is a %s" % [label, n, card.kind]) + part.call("Anomalies", deck.anomalies, ["anomaly"], Rules.anomalies_outside(rules)) + part.call("Servers", deck.servers, ["server"], rules.deck.servers) + var main_kinds: Array = MAIN_KINDS + ["anomaly"] if rules.recruit.on else MAIN_KINDS + part.call("Deck", deck.main, main_kinds, rules.deck.main) + var copies := {} + for n in deck.anomalies + deck.servers + deck.main: + copies[n] = copies.get(n, 0) + 1 + for n in copies: + if copies[n] > rules.deck.maxCopies: + errors.append("%d copies of \"%s\", max %d" % [copies[n], n, rules.deck.maxCopies]) + return errors + + +## A random legal deck: every card in the pool is equally likely, up to the copy limit. `include` +## (a Callable taking a card def) limits the pool. +static func random_deck(pool: Dictionary, rng: Dictionary, rules: Dictionary, include := Callable()) -> Variant: + var sample := func(kinds: Array, size: int) -> Array: + var names := [] + for c in pool.all: + if kinds.has(c.kind) and (not include.is_valid() or include.call(c)): + for i in rules.deck.maxCopies: + names.append(c.name) + if names.size() < size: + Util.fail("Not enough %s cards for a deck" % "/".join(kinds)) + return [] + return Rng.shuffle(rng, names).slice(0, size) + if rules.recruit.on: + var k: int = rules.recruit.anomaliesInDeck + var anomalies: Array = sample.call(["anomaly"], 1 + k) + var servers: Array = sample.call(["server"], rules.deck.servers) + var rest: Array = sample.call(MAIN_KINDS, rules.deck.main - k) + return {"anomalies": anomalies.slice(0, 1), "servers": servers, "main": Rng.shuffle(rng, anomalies.slice(1) + rest)} + var anomalies: Array = sample.call(["anomaly"], rules.deck.anomalies) + var servers: Array = sample.call(["server"], rules.deck.servers) + var main: Array = sample.call(MAIN_KINDS, rules.deck.main) + return {"anomalies": anomalies, "servers": servers, "main": main} diff --git a/engine/deck.gd.uid b/engine/deck.gd.uid new file mode 100644 index 0000000..9315265 --- /dev/null +++ b/engine/deck.gd.uid @@ -0,0 +1 @@ +uid://dcqsdsw3lbfaw diff --git a/engine/describe.gd b/engine/describe.gd new file mode 100644 index 0000000..5550ba3 --- /dev/null +++ b/engine/describe.gd @@ -0,0 +1,176 @@ +class_name Describe +## Readable labels for actions, for people choosing them (describe.ts): the move list and prompts. +## Labels are written for the deciding player: "your" things are unmarked, the opponent's say whose +## they are. Nothing here names a card the decider can't see. + +## Default for the `me` arguments: label for whoever decides now. Pass null for no viewer. +const DECIDER := -1 + +const STEP_NAMES := {"deploy": "Deploy", "play": "Play", "attack": "Attack", "resolve": "Resolve", "playAgain": "Play again"} + +static var _paren_re := RegEx.create_from_string(" \\((.*)\\)$") + + +## "A2–B1" for a line id like "A2-B1". +static func line_name(line: String) -> String: + var l = GameMap.LINE_BY_ID.get(line) + return "%s–%s" % [l.a, l.b] if l != null else line + + +static func _me(s: Dictionary, me: Variant) -> Variant: + return RulesEngine.decider(s) if me is int and me == DECIDER else me + + +## "Anomaly 2 (Glitch)", or "the copy of Anomaly 2 (Glitch)"; the opponent's say "North's". +static func ref_name(s: Dictionary, r: Dictionary, me: Variant = DECIDER) -> String: + me = _me(s, me) + var n: int = State.original_of(r).slot + var card: int = State.anomaly(s, r).card + var nm := "face down" if card < 0 or not State.anomaly(s, State.original_of(r)).faceUp else State.name_of(s, card) + var whose := "%s's " % State.player_name(r.player) if me != null and r.player != me else "" + return ("%scopy of Anomaly %d (%s)" if r.slot > 4 else "%sAnomaly %d (%s)") % [whose, n, nm] + + +## Where a card is, for telling two same-named cards apart: " on C2", " on Anomaly 1 (Glitch)", +## " from hand". +static func _card_where(s: Dictionary, id: int, me: Variant) -> String: + var loc = State.program_location(s, id) + if loc != null: + return " on %s" % loc + var r = State.wearer_of(s, id) + if r != null: + return " on %s" % ref_name(s, r, me) + var pl: Dictionary = s.players[s.cards[id].owner] + if pl.hand.has(id): + return " from hand" + if pl.discard.has(id): + return " from the discard pile" + return "" + + +static func _card_name(s: Dictionary, id: int, me: Variant) -> String: + if id < 0: + return State.name_of(s, id) + var owner: int = s.cards[id].owner + var whose := "%s's " % State.player_name(owner) if me != null and owner != me else "" + return "%s%s%s" % [whose, State.name_of(s, id), _card_where(s, id, me)] + + +## Execution and Ability arguments: "Anomaly 2 (Glitch) → C1", "destroy Overclocked CPU on …". +static func describe_args(s: Dictionary, a: Dictionary, me: Variant = DECIDER, to_word := "at") -> String: + me = _me(s, me) + var parts := [] + if a.get("heal", false): + parts.append("heal this Anomaly") + if a.get("ref") != null: + parts.append(ref_name(s, a.ref, me)) + if a.get("card") != null: + var nm := _card_name(s, a.card, me) + if a.get("mode"): + parts.append("%s %s" % [a.mode, nm]) + elif a.get("cards") != null: + parts.append("swap out %s" % nm) + else: + parts.append(nm) + if a.get("cards") != null and not a.cards.is_empty(): + var names := ", ".join(a.cards.map(func(id): return _card_name(s, id, me))) + parts.append("%s%s" % ["for " if a.get("card") != null else "", names]) + if a.get("to"): + parts.append("→ %s" % a.to if a.get("ref") != null else "%s %s" % [to_word, a.to]) + if a.get("k") != null: + parts.append("reroll dice showing %d or less" % a.k) + return " ".join(parts) + + +static func _gb(n: int) -> String: + return " (%d Gb)" % n + + +## A label for one of the current legal actions, e.g. "Play Execute: Force Reboot on D2 (5 Gb)". +static func describe_action(s: Dictionary, a: Dictionary) -> String: + var me = RulesEngine.decider(s) + if me == null: + me = s.active + var cost := RulesEngine.action_cost(s, a) + match a.type: + "end": + if s.step == "playAgain": + return "End command" if s.rules.commands.on else "End turn" + if s.step == "attack": + return "End Attack step and resolve" + return "End %s step" % STEP_NAMES[s.step] + "pass": + return "Pass" + "choose": + var o = s.choice.options[a.index] if s.choice != null and a.index < s.choice.options.size() else null + var label: String = o.label if o != null else "Option %d" % (a.index + 1) + return label + (_gb(o.cost) if o != null and o.get("cost", 0) else "") + "place": + var r := State.ref(me, a.slot) + var av := State.anomaly(s, r) + if av.at == null: + return "Place %s on %s" % [ref_name(s, r, me), a.to] + return "Move %s %s → %s" % [ref_name(s, r, me), av.at, a.to] + "recall": + var r := State.ref(me, a.slot) + var hurt := Query.health_of(s, r) - Query.health_left(s, r) if s.rules.health.on else 0 + return "Recall %s from %s%s" % [ref_name(s, r, me), State.anomaly(s, r).at, ", healing %d" % hurt if hurt else ""] + "advance": + var r := State.ref(me, a.slot) + return "Advance %s %s → %s" % [ref_name(s, r, me), State.anomaly(s, r).at, a.to] + "attack": + var r := State.ref(me, a.slot) + return "Attack %s with %s from %s" % [a.to, ref_name(s, r, me), State.anomaly(s, r).at] + "clearFirewall": + return "Clear the Lv %d Firewall on %s%s" % [s.firewalls[a.line], line_name(a.line), _gb(cost)] + "firewall": + if s.firewalls.get(a.line, 0): + return "Upgrade the Firewall on %s to Lv %d%s" % [line_name(a.line), a.level, _gb(cost)] + return "Place a Lv %d Firewall on %s%s" % [a.level, line_name(a.line), _gb(cost)] + "salvage": + return "Salvage %s (+%d Gb)" % [State.name_of(s, a.card), State.def_of(s, a.card).bandwidth] + "installHardware": + return "Install %s on %s%s" % [State.name_of(s, a.card), ref_name(s, State.ref(me, a.slot), me), _gb(cost)] + "recruit": + var old := State.anomaly(s, State.ref(me, a.slot)) + var retiring := ", retiring %s" % State.name_of(s, old.card) if old.card >= 0 else "" + return "Recruit %s as Anomaly %d%s%s" % [State.name_of(s, a.card), a.slot, retiring, _gb(cost)] + "buyAnomaly": + var sale = RulesEngine.anomaly_for_sale(s, me) + return "Buy Anomaly %d (face down)%s" % [a.slot, _gb(sale.price if sale != null else cost)] + "installProgram": + return "Install %s on %s%s" % [State.name_of(s, a.card), a.at, _gb(cost)] + "play": + # Packet Flood and Purge name the location they hit; it's the target unless Ghost Process widens it. + var args_text := "" + if a.args.get("to") == a.target and a.args.get("ref") == null: + var shown: Dictionary = a.args.duplicate() + shown.erase("to") + args_text = describe_args(s, shown, me) + else: + args_text = describe_args(s, a.args, me) + var on := " on %s" % a.target if a.target else "" + var from := ", performed by %s" % a.from if a.from else "" + return "Play %s%s%s%s%s" % [State.name_of(s, a.card), on, ": %s" % args_text if args_text else "", from, _gb(cost)] + "activate": + var src = RulesEngine.ability_source(s, a.card, a.name) + var d := State.def_of(s, a.card) + var label := "" + if src != null and src.kind == "anomaly" and src.get("ref") != null: + var ability_name: String = d.ability.name if d.has("ability") else a.name + label = "%s (%s)" % [ability_name, _paren_re.sub(ref_name(s, src.ref, me), ", $1")] + elif a.name != d.name: + label = "%s (copied by %s)" % [a.name, d.name] + else: + label = a.name + var where := "" + if src != null and src.kind == "hardware" and src.get("ref") != null: + where = " on %s" % ref_name(s, src.ref, me) + elif src != null and src.kind != "anomaly" and src.at: + where = " on %s" % src.at + var args_text := describe_args(s, a.args, me, "→") + var joined := "" + if args_text: + joined = (" " if args_text.begins_with("→") else ": ") + args_text + return "Use %s%s%s%s" % [label, where, joined, _gb(cost) if cost else ""] + return Util.fail("Unknown action type %s" % a.type) diff --git a/engine/describe.gd.uid b/engine/describe.gd.uid new file mode 100644 index 0000000..a93412e --- /dev/null +++ b/engine/describe.gd.uid @@ -0,0 +1 @@ +uid://dlfmtcv7a0urk diff --git a/engine/engine.gd b/engine/engine.gd new file mode 100644 index 0000000..15bb839 --- /dev/null +++ b/engine/engine.gd @@ -0,0 +1,1050 @@ +class_name RulesEngine +## Files TCG rules engine (engine.ts, rules.md). The state is plain data. `decider` says who must +## act, `legal_actions` lists what they may do, and `apply_action` does it. Between decisions the +## engine runs queued tasks (combat, captures, card triggers) until it needs a player again: a turn +## step, a response window, or a choice a card asks for. +## +## An action is a Dictionary shaped like the TS Action union, e.g. {type: "end"}, +## {type: "attack", slot, to} or {type: "play", card, target, args, from}. `action_key` gives each a +## stable string, the same as TS's, so game records replay in either engine. + +## No limit, for executionActions and abilityActions (TS uses Infinity). +const NO_LIMIT := 1 << 60 + + +## Combat Cores for an Anomaly standing on `at`, outside any combat. For bots pricing an attack. +## `at` defaults to where it stands (pass "" for that), `loc` to `at` when defending. +static func anomaly_cores(s: Dictionary, p: int, slot: int, role: String, at: Variant = "", loc: Variant = "") -> int: + if at is String and at == "": + at = s.players[p].anomalies[slot - 1].at + if loc is String and loc == "": + loc = at if role == "defend" else null + return Query.cores_of(s, {"ref": State.ref(p, slot), "role": role, "at": at, "loc": loc, "combat": null}) + + +## The first defender on a location, if any. +static func defender_at(s: Dictionary, loc: String) -> Variant: + var d := State.defenders_at(s, loc) + return null if d.is_empty() else d[0] + + +# --------------------------------------------------------------------------------------------- +# Setup + +static func _new_stats() -> Dictionary: + var out := {} + for k in Types.STAT_KEYS: + out[k] = [0, 0] + return out + + +## Recruit rule: an Anomaly's printed Bandwidth is its price, which is also what it salvages for. +static func _with_price(def: Dictionary, rules: Dictionary) -> Dictionary: + if not rules.recruit.on or def.kind != "anomaly": + return def + var priced := def.duplicate() + priced.bandwidth = rules.recruit.price + rules.recruit.pricePerCore * def.cores + return priced + + +## Recruit rule: slots `p` can recruit into. The first empty one while there's room, or any Anomaly +## to retire. +static func recruit_slots(s: Dictionary, p: int) -> Array: + var avs: Array = s.players[p].anomalies.slice(0, 4) + var out := [] + var empty := -1 + for i in avs.size(): + if avs[i].card < 0: + empty = i + break + if empty >= 0 and Query.anomaly_room(s, p): + out.append(empty + 1) + for i in avs.size(): + var declared := false + for d in s.declarations: + if d.ref.player == p and State.original_of(d.ref).slot == i + 1: + declared = true + if avs[i].card >= 0 and not declared: + out.append(i + 1) + return out + + +## Buy-Anomalies rule: the next Anomaly `p` can buy, as {slot, price}, or null. +static func anomaly_for_sale(s: Dictionary, p: int) -> Variant: + if not s.rules.buyAnomalies.on: + return null + var i := -1 + for k in 4: + if not s.players[p].anomalies[k].faceUp: + i = k + break + return null if i < 1 else {"slot": i + 1, "price": s.rules.buyAnomalies.prices[i - 1]} + + +static func _new_anomaly(card: int, face_up: bool, copy_of: Variant) -> Dictionary: + return { + "card": card, + "faceUp": face_up, + "at": null, + "hardware": [], + "damage": 0, + "placed": false, + "advanced": false, + "attacks": 0, + "infection": 0, + "bugs": 0, + "permanentInfection": 0, + "mods": [], + "disabledUntil": 0, + "rootedUntil": 0, + "breachedTurn": 0, + "copyOf": copy_of, + "createdTurn": 0, + "unlockedTurn": 0, + } + + +## Starts a game from {pool, decks: [deck, deck], seed, rules?, log?}. A deck is {anomalies, servers, +## main}, lists of card names. Returns null (and records an error) if a deck is illegal. +static func create_game(o: Dictionary) -> Variant: + var pool: Dictionary = o.pool + var decks: Array = o.decks + var rules: Dictionary = o.get("rules", Rules.defaults()) + for p in 2: + var errors := Deck.validate_deck(pool, decks[p], rules) + if not errors.is_empty(): + return Util.fail("%s deck is illegal:\n %s" % [State.player_name(p), "\n ".join(errors)]) + GameMap.use_board(rules.board) + var rng := Rng.make(o.seed) + var locations := {} + for loc in GameMap.LOCATIONS: + locations[loc] = {"owner": null, "server": null, "programs": [], "rootAccess": [0, 0]} + var s := { + "rules": rules, + "rng": rng, + "defs": {}, + "cards": [], + "players": [], + "locations": locations, + "firewalls": {}, + "firstPlayer": 0, + "active": 0, + "turn": 0, + "clock": 0, + "step": "deploy", + "declarations": [], + "tasks": [], + "stack": [], + "choice": null, + "combat": null, + "virtuals": [], + "used": {}, + "seq": 0, + "over": false, + "winner": null, + "endReason": null, + "stats": _new_stats(), + "cardUse": {}, + "log": [] if o.get("log", false) else null, + } + var add := func(card_name: String, owner: int) -> int: + s.defs[card_name] = _with_price(pool.by_name[card_name], rules) + var id: int = s.cards.size() + s.cards.append({"id": id, "name": card_name, "owner": owner, "disabledUntil": 0, "ignoredUntil": 0, "installedTurn": 0}) + return id + for p in 2: + var deck: Dictionary = decks[p] + # Recruit rule: slots after the starting Anomaly begin empty (-1). + var anomalies := Rng.shuffle(rng, deck.anomalies.map(func(n): return add.call(n, p))) + var slots := [] + for i in 4: + slots.append(anomalies[i] if i < anomalies.size() else -1) + var main := Rng.shuffle(rng, deck.main.map(func(n): return add.call(n, p))) + var servers := Rng.shuffle(rng, deck.servers.map(func(n): return add.call(n, p))) + var avs := [] + for i in 4: + avs.append(_new_anomaly(slots[i], slots[i] >= 0 and i < rules.startingAnomalies, null)) + for i in 4: + avs.append(_new_anomaly(slots[i], false, i + 1)) + s.players.append({ + "bandwidth": 0, + "hand": [], + "deck": main, + "discard": [], + "serverPile": servers, + "anomalies": avs, + "unlockedLevel": 1, + }) + for p in 2: + var me: Dictionary = s.players[p] + var start: Dictionary = s.locations[GameMap.START_LOC[p]] + var server: int = me.serverPile.pop_front() + start.owner = p + start.server = server + me.bandwidth = rules.startingBandwidth + CardScripts.of(s.cards[server].name).get("bandwidthOnPlace", 0) + State.played(s, s.cards[server].name, p) + for i in rules.openingHand: + Flow.draw_now(s, p) + State.say(s, "%s starts on %s with %d Gb. Anomaly 1: %s." % [State.player_name(p), State.name_of(s, server), me.bandwidth, State.name_of(s, me.anomalies[0].card)], {"tag": "game", "player": p}) + s.firstPlayer = Rng.rand_int(rng, 2) + s.active = s.firstPlayer + var p2 := State.other(s.firstPlayer) + var second: Dictionary = s.players[p2] + second.bandwidth += rules.secondPlayer.bandwidth + for av in second.anomalies.slice(0, rules.startingAnomalies + rules.secondPlayer.anomalies): + av.faceUp = av.card >= 0 + for i in rules.secondPlayer.cards: + Flow.draw_now(s, p2) + if rules.secondPlayer.locations > 0: + # The location next to the starting Server, with a Server from the pile: no Bandwidth, no unlock. + var line: Dictionary = GameMap.LINES_AT[GameMap.START_LOC[p2]][0] + var L: Dictionary = s.locations[GameMap.other_end(line, GameMap.START_LOC[p2])] + L.owner = p2 + L.server = second.serverPile.pop_front() + State.played(s, s.cards[L.server].name, p2) + s.stats.cardsDrawn = [0, 0] + State.say(s, "%s goes first." % State.player_name(s.firstPlayer), {"tag": "game", "player": s.firstPlayer}) + _begin_turn(s, not rules.firstTurn.draw) + run(s) + return s + + +static func _begin_turn(s: Dictionary, skip_draw: bool) -> void: + var cmd: bool = s.rules.commands.on + if s.turn >= s.rules.maxTurns * (s.rules.commands.perPlayer if cmd else 1): + s.over = true + s.endReason = "turnLimit" + State.say(s, "Turn limit reached: draw (South %d, North %d locations)." % [State.grid_count(s, 0), State.grid_count(s, 1)], {"tag": "game"}) + return + s.turn += 1 + s.clock = State.start_of(s.turn) + # Command rule: a player's turn is their commands in a round, so its refreshes come at the first. + var fresh: bool = not cmd or State.first_command(s, s.turn) + if not cmd or State.round_of(s, s.turn) != State.round_of(s, s.turn - 1): + s.used = {} + _tidy(s) + var me: Dictionary = s.players[s.active] + if fresh: + for av in me.anomalies: + av.placed = false + av.advanced = false + av.attacks = 0 + s.declarations = [] + s.step = "deploy" + var title := ("Round %d, command %d" % [State.round_of(s, s.turn), s.turn]) if cmd else "Turn %d" % s.turn + State.say(s, "\n— %s: %s (%d Gb, %d cards, %d locations) —" % [title, State.player_name(s.active), me.bandwidth, me.hand.size(), State.grid_count(s, s.active)], {"tag": "turn", "player": s.active}) + var draws: int = s.rules.drawPerTurn + (s.rules.secondPlayer.firstDraw if s.turn == 2 else 0) + if fresh and not skip_draw: + Flow.draw_cards(s, s.active, draws) + if fresh: + Query.emit(s, "onTurnStart", null) + + +## Command rule: this game turn's command is spent (an advance or attack is declared). +static func _command_spent(s: Dictionary) -> bool: + return s.rules.commands.on and not s.declarations.is_empty() + + +## Command rule: an Anomaly unlocked this round waits in its slot until the next round. +static func _waits_for_round(s: Dictionary, av: Dictionary) -> bool: + return s.rules.commands.on and av.at == null and av.unlockedTurn > 0 \ + and State.round_of(s, av.unlockedTurn) == State.round_of(s, s.turn) + + +static func _end_turn(s: Dictionary) -> void: + s.clock = State.end_of(s.turn) + # Push Update: the extra Hardware leaves at the end of its controller's turn. + for pl in s.players: + for av in pl.anomalies: + for hw in av.hardware.duplicate(): + var until = s.cards[hw].get("pushedUntil") + if until != null and not State.running(s, until): + State.remove_from(av.hardware, hw) + State.to_discard(s, hw) + State.say(s, "%s (Push Update) is discarded." % State.name_of(s, hw)) + _tidy(s) + s.active = State.commander_of(s, s.turn + 1) if s.rules.commands.on else State.other(s.active) + _begin_turn(s, false) + + +## Drops expired statuses so the state stays small. Status checks don't rely on this. +static func _tidy(s: Dictionary) -> void: + s.virtuals = s.virtuals.filter(func(v): return State.running(s, v.until)) + for pl in s.players: + for av in pl.anomalies: + av.mods = av.mods.filter(func(m): return m.has("combat") or State.running(s, m.get("until", 0))) + + +# --------------------------------------------------------------------------------------------- +# Who decides + +## The player who must act now, or null when the game is over. +static func decider(s: Dictionary) -> Variant: + if s.over: + return null + if s.choice != null: + return s.choice.player + if not s.tasks.is_empty() and s.tasks[0].t == "window": + return s.tasks[0].priority + return s.active + + +## The open response window, when the decider is responding, or null. +static func open_window(s: Dictionary) -> Variant: + if s.choice == null and not s.tasks.is_empty() and s.tasks[0].t == "window": + return s.tasks[0] + return null + + +# --------------------------------------------------------------------------------------------- +# Legal actions + +static func _targeted(s: Dictionary, loc: String) -> bool: + for d in s.declarations: + if d.to == loc: + return true + return false + + +## Grid locations `p` may advance to: unowned or undefended enemy, next to its territory. +static func advance_targets(s: Dictionary, p: int) -> Array: + return GameMap.GRID.filter(func(loc): + var owner = s.locations[loc].owner + if owner == p or _targeted(s, loc): + return false + if owner != null and not State.defenders_at(s, loc).is_empty(): + return false + for line in GameMap.LINES_AT[loc]: + if State.is_open(s, line) and State.controls(s, p, GameMap.other_end(line, loc)): + return true + return false) + + +## Infinite Loop lets an Anomaly attacking from its location attack twice. +static func max_attacks(s: Dictionary, r: Dictionary) -> int: + var at = State.anomaly(s, r).at + var extra := 0 + for x in Query.sources(s): + if x.at == at and x.controller == r.player: + extra = maxi(extra, CardScripts.of(x.name).get("extraAttacks", 0)) + return 1 + extra + + +static func attack_targets(s: Dictionary, r: Dictionary) -> Array: + var av := State.anomaly(s, r) + if not av.faceUp or av.at == null or av.advanced or av.attacks >= max_attacks(s, r) or not State.can_act(s, r) or State.fresh_copy(s, r): + return [] + var opp := State.other(r.player) + var out := [] + for line in GameMap.LINES_AT[av.at]: + if not State.is_open(s, line): + continue + var to := GameMap.other_end(line, av.at) + if not GameMap.is_start(to) and State.controls(s, opp, to) and not State.defenders_at(s, to).is_empty() and not _targeted(s, to): + out.append(to) + return out + + +static func _push_clears(s: Dictionary, p: int, out: Array) -> void: + for line_id in s.firewalls: + var level: int = s.firewalls[line_id] + var l: Dictionary = GameMap.LINE_BY_ID[line_id] + if (State.controls(s, p, l.a) or State.controls(s, p, l.b)) and State.firewall_cost(s, level) <= s.players[p].bandwidth: + out.append({"type": "clearFirewall", "line": line_id}) + + +## Whether a first-turn rule variant stops p playing cards from hand right now. +static func _cards_blocked(s: Dictionary, p: int) -> bool: + return s.turn == 1 and p == s.firstPlayer and not s.rules.firstTurn.cards + + +## Latency Spike: the attacking player can't play Executions before the roll. +static func _latency_blocked(s: Dictionary, p: int) -> bool: + var c = s.combat + var w = open_window(s) + if c == null or c.ended or w == null or w.kind != "preRoll" or c.attacker.player != p: + return false + return not Query.enemy_flag_at(s, c.loc, p, func(sc): return sc.get("blocksAttackerExecutions", false)).is_empty() + + +## Force Reboot: a Server that can't perform Executions for the rest of the turn. +static func exec_blocked(s: Dictionary, loc: String) -> bool: + return State.used_this_turn(s, "noExec:%s" % loc) > 0 + + +## Servers worth naming as an Execution's performer: null (any of your Servers), plus each Server +## where one of your Anomalies wears Hardware that cares (Dedicated GPU, Quantum Coprocessor). +static func _performers(s: Dictionary, p: int) -> Array: + var out := [null] + for r in State.refs_in_play(s, p): + var at: String = State.anomaly(s, r).at + if State.is_copy(r) or not State.controls(s, p, at) or exec_blocked(s, at): + continue + var cares := Query.wears(s, r, func(sc): return sc.get("executionPower", 0) or sc.get("copiesExecutions", false)) + if not cares.is_empty() and not out.has(at): + out.append(at) + return out + + +## Dedicated GPU: extra effect for Executions performed by `from`, from its Anomalies' Hardware. +static func execution_power(s: Dictionary, p: int, from: Variant) -> int: + if from == null: + return 0 + var n := 0 + for r in State.refs_in_play(s, p): + if State.is_copy(r) or State.anomaly(s, r).at != from: + continue + for hw in Query.wears(s, r, func(sc): return sc.get("executionPower", 0)): + n += CardScripts.of(s.cards[hw].name).executionPower + return n + + +## Enemy Anomalies an Execution targets. `item` needs player, target, args and name. +static func execution_hostiles(s: Dictionary, item: Dictionary) -> Array: + var ex: Dictionary = CardScripts.of(item.name).get("execution", {}) + if not ex.has("targetsAnomalies"): + return [] + return ex.targetsAnomalies.call(s, item).filter(func(r): return r.player != item.player) + + +static func execution_cost(s: Dictionary, p: int, card: int, target: Variant, args: Dictionary, all: Variant = null) -> int: + var hostile := execution_hostiles(s, {"player": p, "target": target, "args": args, "name": s.cards[card].name}) + return Query.cost_of(s, {"kind": "execution", "player": p, "card": card, "at": target, "hostile": hostile}, all) + + +## Execution plays for `p`. `budget` "now" keeps plays affordable with current Bandwidth; +## "reachable" also counts Salvage; "any" ignores Bandwidth. +static func execution_actions(s: Dictionary, p: int, budget: String, limit := NO_LIMIT) -> Array: + var out := [] + if _latency_blocked(s, p) or _cards_blocked(s, p): + return out + var seen := {} + var who = null + var all = null + for card in s.players[p].hand: + var card_name: String = s.cards[card].name + if seen.has(card_name): + continue + seen[card_name] = true + var ex: Dictionary = CardScripts.of(card_name).get("execution", {}) + if ex.is_empty(): + continue + var cap: int = NO_LIMIT + if budget == "now": + cap = s.players[p].bandwidth + elif budget == "reachable": + cap = Query.reachable_bandwidth(s, p, card) + if budget != "any" and State.def_of(s, card).bandwidth - 3 > cap: + continue # no discount is bigger than 2 + if all == null: + all = Query.sources(s) + for play in ex.plays.call(s, p): + if execution_cost(s, p, card, play.target, play.args, all) > cap: + continue + if who == null: + who = _performers(s, p) + for from in who: + out.append({"type": "play", "card": card, "target": play.target, "args": play.args, "from": from}) + if out.size() >= limit: + return out + return out + + +static func ability_source(s: Dictionary, card: int, ability_name: String) -> Variant: + for x in Query.sources(s): + if x.id == card and x.name == ability_name and activatable(x) and CardScripts.of(x.name).has("ability"): + return x + return null + + +static func ability_cost(s: Dictionary, src: Dictionary) -> int: + if src.kind == "anomaly": + var d := State.def_of(s, src.id) + return d.ability.cost if d.has("ability") else 0 + return CardScripts.of(src.name).get("ability", {}).get("cost", 0) + + +## Sources whose ability can be activated: real cards, plus Server abilities Duplicate Server copies. +static func activatable(src: Dictionary) -> bool: + return src.get("virtual") == null or src.virtual == -2 + + +static func ability_key(src: Dictionary) -> String: + return "ability:%d:%s" % [src.id, src.name] + + +## Whether an ability source may be used now (once per turn, not disabled, Desynchronization). +static func ability_ready(s: Dictionary, src: Dictionary) -> bool: + var ab: Dictionary = CardScripts.of(src.name).get("ability", {}) + if ab.is_empty() or not activatable(src): + return false + if src.kind == "anomaly" and not State.can_act(s, src.ref): + return false + if src.kind == "hardware": + if HardwareCards.hardware_uses_left(s, src.id) <= 0: + return false + return not (ab.get("hardwareOncePerTurn", false) and Query.desynced(s, src.ref)) + return State.used_this_turn(s, ability_key(src)) == 0 + + +static func _extra_cost(s: Dictionary, src: Dictionary, args: Dictionary) -> int: + var ab: Dictionary = CardScripts.of(src.name).ability + return ab.extraCost.call(s, src, args) if ab.has("extraCost") else 0 + + +static func ability_actions(s: Dictionary, p: int, budget: String, limit := NO_LIMIT) -> Array: + var out := [] + var cap: int = NO_LIMIT + if budget == "now": + cap = s.players[p].bandwidth + elif budget == "reachable": + cap = Query.reachable_bandwidth(s, p) + for src in Query.sources(s): + if src.controller != p or not CardScripts.of(src.name).has("ability") or not ability_ready(s, src): + continue + var ab: Dictionary = CardScripts.of(src.name).ability + var base := ability_cost(s, src) + if base > cap: + continue + for args in ab.uses.call(s, src): + if base + _extra_cost(s, src, args) > cap: + continue + out.append({"type": "activate", "card": src.id, "name": src.name, "args": args}) + if out.size() >= limit: + return out + return out + + +static func _has_response(s: Dictionary, p: int) -> bool: + return not execution_actions(s, p, "reachable", 1).is_empty() or not ability_actions(s, p, "reachable", 1).is_empty() + + +static func hardware_cost(s: Dictionary, card: int, r: Dictionary, all: Variant = null) -> int: + return Query.cost_of(s, {"kind": "hardware", "player": r.player, "card": card, "ref": r, "at": State.anomaly(s, r).at}, all) + + +static func program_cost(s: Dictionary, p: int, card: int, at: String, all: Variant = null) -> int: + return Query.cost_of(s, {"kind": "program", "player": p, "card": card, "at": at}, all) + + +static func place_firewall_cost(s: Dictionary, p: int, line: String, level: int, all: Variant = null) -> int: + return Query.cost_of(s, {"kind": "firewall", "player": p, "line": line, "level": level}, all) + + +## Whether Hardware can go on an Anomaly now (Expansion Slots permitting). +static func can_wear(s: Dictionary, card: int, r: Dictionary) -> bool: + if State.is_copy(r) or State.anomaly(s, r).at == null: + return false + return CardScripts.of(s.cards[card].name).get("noSlot", false) or Query.slots_free(s, r) > 0 + + +static func legal_actions(s: Dictionary) -> Array: + var p = decider(s) + if p == null: + return [] + var me: Dictionary = s.players[p] + var salvage := [] + for card in me.hand: + salvage.append({"type": "salvage", "card": card}) + + if s.choice != null: + var options := [] + for index in s.choice.options.size(): + if s.choice.options[index].get("cost", 0) <= me.bandwidth: + options.append({"type": "choose", "index": index}) + return options + salvage + if open_window(s) != null: + return [{"type": "pass"}] + salvage + execution_actions(s, p, "now") + ability_actions(s, p, "now") + + var out := [{"type": "end"}] + salvage + if s.step == "resolve": + return out + out.append_array(execution_actions(s, p, "now")) + out.append_array(ability_actions(s, p, "now")) + + if s.step == "deploy": + var placement_open: bool = s.declarations.is_empty() + var targets := [] if s.turn == 1 and not s.rules.firstTurn.advance else advance_targets(s, p) + for i in me.anomalies.size(): + var av: Dictionary = me.anomalies[i] + var r := State.ref(p, i + 1) + if not av.faceUp or av.advanced or av.attacks > 0: + continue + if av.at != null and not State.can_act(s, r): + continue + if placement_open and not av.placed and not _waits_for_round(s, av): + for to in GameMap.LOCATIONS: + if to != av.at and Query.has_room(s, p, to): + out.append({"type": "place", "slot": i + 1, "to": to}) + if s.rules.health.on and s.rules.health.recall and av.at != null and not State.is_copy(r): + out.append({"type": "recall", "slot": i + 1}) + if av.at != null and not State.fresh_copy(s, r) and not _command_spent(s): + for to in targets: + out.append({"type": "advance", "slot": i + 1, "to": to}) + _push_clears(s, p, out) + elif s.step == "attack": + for i in me.anomalies.size(): + if _command_spent(s): + continue + for to in attack_targets(s, State.ref(p, i + 1)): + out.append({"type": "attack", "slot": i + 1, "to": to}) + _push_clears(s, p, out) + else: + var seen := {} + var all := Query.sources(s) + for card in ([] if _cards_blocked(s, p) else me.hand): + var d := State.def_of(s, card) + if seen.has(d.name): + continue + seen[d.name] = true + if d.kind == "hardware": + for r in State.refs_in_play(s, p): + if can_wear(s, card, r) and hardware_cost(s, card, r, all) <= me.bandwidth: + out.append({"type": "installHardware", "card": card, "slot": r.slot}) + elif d.kind == "anomaly" and s.rules.recruit.on: + if d.bandwidth <= me.bandwidth: + for slot in recruit_slots(s, p): + out.append({"type": "recruit", "card": card, "slot": slot}) + elif d.kind == "program": + for at in GameMap.LOCATIONS: + if State.controls(s, p, at) and s.locations[at].programs.size() < Query.program_slots(s, at) \ + and program_cost(s, p, card, at, all) <= me.bandwidth: + out.append({"type": "installProgram", "card": card, "at": at}) + var sale = anomaly_for_sale(s, p) + if sale != null and sale.price <= me.bandwidth: + out.append({"type": "buyAnomaly", "slot": sale.slot}) + for line in GameMap.LINES: + if not line.gateway or not (State.controls(s, p, line.a) or State.controls(s, p, line.b)): + continue + for level in range(s.firewalls.get(line.id, 0) + 1, s.rules.firewallCost.size() + 1): + if place_firewall_cost(s, p, line.id, level, all) <= me.bandwidth: + out.append({"type": "firewall", "line": line.id, "level": level}) + return out + + +## Bandwidth an action costs, before any Salvage. +static func action_cost(s: Dictionary, a: Dictionary) -> int: + var p = decider(s) + if p == null: + p = s.active + match a.type: + "firewall": + return place_firewall_cost(s, p, a.line, a.level) + "clearFirewall": + return State.firewall_cost(s, s.firewalls.get(a.line, 0)) + "installHardware": + return hardware_cost(s, a.card, State.ref(p, a.slot)) + "recruit": + return State.def_of(s, a.card).bandwidth + "buyAnomaly": + var sale = anomaly_for_sale(s, p) + return sale.price if sale != null else 0 + "installProgram": + return program_cost(s, p, a.card, a.at) + "play": + return execution_cost(s, p, a.card, a.target, a.args) + "activate": + var src = ability_source(s, a.card, a.name) + return ability_cost(s, src) + _extra_cost(s, src, a.args) if src != null else 0 + "choose": + if s.choice != null and a.index < s.choice.options.size(): + return s.choice.options[a.index].get("cost", 0) + return 0 + return 0 + + +static func _args_key(a: Dictionary) -> String: + var parts := [ + "%d.%d" % [a.ref.player, a.ref.slot] if a.get("ref") != null else "", + str(a.card) if a.get("card") != null else "", + ",".join(a.cards.map(func(id): return str(id))) if a.get("cards") != null else "", + a.get("to", "") if a.get("to") != null else "", + a.get("mode", "") if a.get("mode") != null else "", + str(a.k) if a.get("k") != null else "", + ] + return "|".join(parts) + + +## Stable identity for comparing actions, the same string as TS's actionKey. +static func action_key(a: Dictionary) -> String: + match a.type: + "end", "pass": + return a.type + "choose": + return "choose:%d" % a.index + "place", "advance", "attack": + return "%s:%d:%s" % [a.type, a.slot, a.to] + "recall": + return "recall:%d" % a.slot + "clearFirewall": + return "clear:%s" % a.line + "firewall": + return "firewall:%s:%d" % [a.line, a.level] + "salvage": + return "salvage:%d" % a.card + "installHardware": + return "hw:%d:%d" % [a.card, a.slot] + "recruit": + return "recruit:%d:%d" % [a.card, a.slot] + "buyAnomaly": + return "buy:%d" % a.slot + "installProgram": + return "prog:%d:%s" % [a.card, a.at] + "play": + return "play:%d:%s:%s:%s" % [a.card, Util.js(a.target), _args_key(a.args), Util.js(a.from)] + "activate": + return "act:%d:%s:%s" % [a.card, a.name, _args_key(a.args)] + return Util.fail("Unknown action type %s" % a.type) + + +# --------------------------------------------------------------------------------------------- +# Applying actions + +## Opens (or continues) a response window after `actor` declares or plays something. +static func _respond_to(s: Dictionary, actor: int, base: int) -> void: + var w = open_window(s) + if w != null: + w.passes = 1 + w.priority = State.other(actor) + return + State.push_tasks(s, [{"t": "window", "kind": "response", "priority": State.other(actor), "passes": 1, "base": base, "resolving": false}]) + + +## Applies `a` for the deciding player, then runs the game until the next decision. Pass `legal` when +## you already have the current legal actions. Returns false (and records an error) if `a` isn't legal. +static func apply_action(s: Dictionary, a: Dictionary, legal: Variant = null) -> bool: + if legal == null: + legal = legal_actions(s) + var key := action_key(a) + var found := false + for x in legal: + if action_key(x) == key: + found = true + break + if not found: + Util.fail("Illegal action at turn %d: %s" % [s.turn, key]) + return false + var p: int = decider(s) + var me: Dictionary = s.players[p] + var who := State.player_name(p) + + match a.type: + "end": + _end_step(s) + "pass": + var w: Dictionary = open_window(s) + w.passes += 1 + w.priority = State.other(w.priority) + "choose": + var ch: Dictionary = s.choice + var option: Dictionary = ch.options[a.index] + s.choice = null + var meta := {"tag": "choice", "player": p} + if ch.get("secret", false): + meta.to = p + meta.public = "%s makes a secret choice (%s)." % [who, ch.kind.split(":")[0]] + State.say(s, "%s chooses: %s." % [who, option.label], meta) + var resume: Dictionary = CardScripts.of(ch.resume.name).get("resume", {}) + if not resume.has(ch.resume.fn): + Util.fail("No resume %s.%s" % [ch.resume.name, ch.resume.fn]) + else: + resume[ch.resume.fn].call(s, ch.resume.data, option.value) + "buyAnomaly": + var price: int = anomaly_for_sale(s, p).price + var av: Dictionary = me.anomalies[a.slot - 1] + me.bandwidth -= price + State.stat(s, "bandwidthOnAnomalies", p, price) + State.stat(s, "anomaliesBought", p) + av.faceUp = true + State.say(s, "%s buys Anomaly %d: %s (-%d Gb, now %d)." % [who, a.slot, State.name_of(s, av.card), price, me.bandwidth], {"tag": "card", "player": p}) + "recruit": + var cost: int = State.def_of(s, a.card).bandwidth + var av: Dictionary = me.anomalies[a.slot - 1] + if av.card >= 0: + Flow.retire_anomaly(s, State.ref(p, a.slot)) + State.remove_from(me.hand, a.card) + me.bandwidth -= cost + State.stat(s, "bandwidthOnCards", p, cost) + State.stat(s, "anomaliesRecruited", p) + State.played(s, State.name_of(s, a.card), p) + av.merge(_new_anomaly(a.card, true, null), true) + me.anomalies[a.slot + 3].card = a.card + State.say(s, "%s recruits %s as Anomaly %d (-%d Gb, now %d)." % [who, State.name_of(s, a.card), a.slot, cost, me.bandwidth], {"tag": "card", "player": p}) + "salvage": + var gain: int = State.def_of(s, a.card).bandwidth + State.remove_from(me.hand, a.card) + State.to_discard(s, a.card) + me.bandwidth += gain + State.stat(s, "bandwidthFromSalvage", p, gain) + State.stat(s, "cardsSalvaged", p) + State.say(s, "%s salvages %s (+%d Gb, now %d)." % [who, State.name_of(s, a.card), gain, me.bandwidth], {"tag": "card", "player": p}) + "place": + var av: Dictionary = me.anomalies[a.slot - 1] + var r := State.ref(p, a.slot) + var text := "%s places %s on %s." % [who, State.anomaly_name(s, r), a.to] if av.at == null \ + else "%s moves %s %s → %s." % [who, State.anomaly_name(s, r), av.at, a.to] + State.say(s, text, {"tag": "move", "player": p, "loc": a.to, "ref": r}) + av.at = a.to + av.placed = true + "recall": + Flow.recall_anomaly(s, State.ref(p, a.slot)) + "advance", "attack": + var r := State.ref(p, a.slot) + var av := State.anomaly(s, r) + var second: bool = a.type == "attack" and av.attacks > 0 + if a.type == "advance": + av.advanced = true + else: + av.attacks += 1 + s.declarations.append({"kind": a.type, "ref": r, "to": a.to, "from": av.at, "second": second}) + var text := "%s: %s advances to %s." % [who, State.anomaly_name(s, r), a.to] if a.type == "advance" \ + else "%s: %s attacks %s from %s%s." % [who, State.anomaly_name(s, r), a.to, av.at, " (Infinite Loop)" if second else ""] + State.say(s, text, {"tag": "move", "player": p, "loc": a.to, "ref": r}) + _respond_to(s, p, s.stack.size()) + if a.type == "attack": + Query.emit(s, "onAttackDeclared", {"ref": r, "to": a.to}) + "clearFirewall": + var level: int = s.firewalls[a.line] + var cost := State.firewall_cost(s, level) + me.bandwidth -= cost + State.stat(s, "bandwidthOnFirewalls", p, cost) + s.firewalls.erase(a.line) + State.stat(s, "firewallsCleared", p) + State.say(s, "%s clears the Lv %d Firewall on %s (-%d Gb)." % [who, level, a.line, cost], {"tag": "firewall", "player": p}) + "firewall": + var before: int = s.firewalls.get(a.line, 0) + var cost := Query.pay(s, {"kind": "firewall", "player": p, "line": a.line, "level": a.level}, "bandwidthOnFirewalls") + s.firewalls[a.line] = a.level + State.stat(s, "firewallsUpgraded" if before else "firewallsPlaced", p) + var text := "%s upgrades the Firewall on %s to Lv %d (-%d Gb)." % [who, a.line, a.level, cost] if before \ + else "%s places a Lv %d Firewall on %s (-%d Gb)." % [who, a.level, a.line, cost] + State.say(s, text, {"tag": "firewall", "player": p}) + "installHardware": + var r := State.ref(p, a.slot) + var cost := Query.pay(s, {"kind": "hardware", "player": p, "card": a.card, "ref": r, "at": State.anomaly(s, r).at}, "bandwidthOnCards") + State.remove_from(me.hand, a.card) + State.anomaly(s, r).hardware.append(a.card) + s.cards[a.card].installedTurn = s.turn + State.stat(s, "hardwareInstalled", p) + State.played(s, State.name_of(s, a.card), p) + State.say(s, "%s installs %s on %s (-%d Gb)." % [who, State.name_of(s, a.card), State.anomaly_name(s, r), cost], {"tag": "card", "player": p, "ref": r, "loc": State.anomaly(s, r).at}) + _respond_to(s, p, s.stack.size()) + Query.emit(s, "onInstall", {"card": a.card, "at": State.anomaly(s, r).at, "ref": r}) + "installProgram": + var cost := Query.pay(s, {"kind": "program", "player": p, "card": a.card, "at": a.at}, "bandwidthOnCards") + State.remove_from(me.hand, a.card) + s.locations[a.at].programs.append(a.card) + s.cards[a.card].installedTurn = s.turn + State.stat(s, "programsInstalled", p) + State.played(s, State.name_of(s, a.card), p) + State.say(s, "%s installs %s on %s (-%d Gb)." % [who, State.name_of(s, a.card), a.at, cost], {"tag": "card", "player": p, "loc": a.at}) + _respond_to(s, p, s.stack.size()) + Query.emit(s, "onInstall", {"card": a.card, "at": a.at, "ref": null}) + "play": + var card_name := State.name_of(s, a.card) + var hostile := execution_hostiles(s, {"player": p, "target": a.target, "args": a.args, "name": card_name}) + var cost := Query.pay(s, {"kind": "execution", "player": p, "card": a.card, "at": a.target, "hostile": hostile}, "bandwidthOnCards") + State.remove_from(me.hand, a.card) + var item := { + "kind": "execution", "player": p, "card": a.card, "name": card_name, "target": a.target, "args": a.args, + "from": a.from, "power": execution_power(s, p, a.from), + } + s.stack.append(item) + if item.power > 0: + State.fired(s, "Dedicated GPU", p) + State.stat(s, "executionsPlayed", p) + State.played(s, card_name, p) + var on := " on %s" % a.target if a.target else "" + var from := " from %s" % a.from if a.from else "" + State.say(s, "%s plays %s%s%s (-%d Gb)." % [who, card_name, on, from, cost], {"tag": "card", "player": p, "loc": a.target}) + _respond_to(s, p, s.stack.size() - 1) + if not hostile.is_empty(): + State.push_tasks(s, [{"t": "call", "name": "False Positive", "fn": "offer", "data": {"index": s.stack.size() - 1}}]) + "activate": + var src: Dictionary = ability_source(s, a.card, a.name) + var cost := ability_cost(s, src) + _extra_cost(s, src, a.args) + me.bandwidth -= cost + State.stat(s, "bandwidthOnAbilities", p, cost) + if src.kind == "hardware": + HardwareCards.use_hardware(s, src.id) + else: + State.mark_used(s, ability_key(src)) + var label: String = "%s (%s)" % [State.def_of(s, src.id).ability.name, src.name] if src.kind == "anomaly" else src.name + s.stack.append({"kind": "ability", "player": p, "card": src.id, "name": src.name, "target": null, "args": a.args, "from": null, "power": 0}) + State.stat(s, "abilitiesUsed", p) + if src.kind == "anomaly": + State.played(s, src.name, p) + var paid := " (-%d Gb)" % cost if cost else "" + State.say(s, "%s uses %s%s." % [who, label, paid], {"tag": "card", "player": p, "loc": src.at, "ref": src.get("ref")}) + _respond_to(s, p, s.stack.size() - 1) + run(s) + return true + + +static func _end_step(s: Dictionary) -> void: + match s.step: + "deploy": + s.step = "play" + "play": + s.step = "attack" + "attack": + s.step = "resolve" + var tasks := [] + for index in s.declarations.size(): + tasks.append({"t": "declaration", "index": index}) + tasks.append({"t": "afterResolve"}) + State.push_tasks(s, tasks) + "playAgain": + State.push_tasks(s, [{"t": "endTurn"}]) + + +# --------------------------------------------------------------------------------------------- +# Running tasks + +static func _combat_live(s: Dictionary) -> bool: + return s.combat != null and not s.combat.ended + + +## Runs queued tasks until a player must decide or the game ends. +static func run(s: Dictionary) -> void: + var guard := 0 + while not s.over and s.choice == null: + guard += 1 + if guard > 100000: + Util.fail("Engine stuck at turn %d" % s.turn) + return + if s.tasks.is_empty(): + return + var task: Dictionary = s.tasks[0] + if task.t == "window": + if _window_waits(s, task): + return + continue + s.tasks.pop_front() + _execute(s, task) + + +## Advances a response window. Returns true when a player has priority and must decide. +static func _window_waits(s: Dictionary, w: Dictionary) -> bool: + if w.resolving: + if s.stack.size() > w.base: + _resolve_top(s) + return false + w.resolving = false + if w.kind == "response" or not _combat_live(s): + s.tasks.pop_front() + return false + # Something changed the combat: both players may react again. + w.passes = 0 + w.priority = s.combat.attacker.player + if w.passes >= 2 or (w.kind != "response" and not _combat_live(s)): + if s.stack.size() > w.base: + w.resolving = true + return false + s.tasks.pop_front() + return false + if not _has_response(s, w.priority): + w.passes += 1 + w.priority = State.other(w.priority) + return false + return true + + +static func _resolve_top(s: Dictionary) -> void: + var item: Dictionary = s.stack.pop_back() + var script := CardScripts.of(item.name) + if item.kind == "execution": + State.to_discard(s, item.card) + for src in Query.sources(s): + var sc := CardScripts.of(src.name) + if sc.has("negates") and sc.negates.call(s, src, item): + return + if item.from: + State.push_tasks(s, [{"t": "call", "name": "Quantum Coprocessor", "fn": "offer", "data": {"item": item}}]) + script.execution.resolve.call(s, item) + return + var src = ability_source(s, item.card, item.name) + if src == null: + State.say(s, "%s's ability fizzles: it's no longer in play." % item.name) + return + script.ability.resolve.call(s, item, src) + + +static func _execute(s: Dictionary, task: Dictionary) -> void: + match task.t: + "declaration": + Flow.resolve_declaration(s, task.index) + "afterResolve": + s.step = "playAgain" + "combat": + Flow.combat_stage(s, task.stage) + "defeat": + Flow.defeat(s, task.ref, task.loc, task.role) + "capture": + if task.stage == "hooks": + Flow.capture_hooks(s, task.ref, task.loc, task.how) + else: + Flow.capture_main(s, task.ref, task.loc, task.how) + "hook": + if not Query.still_active(s, task.src): + return + var sc := CardScripts.of(task.src.name) + if sc.has(task.hook): + sc[task.hook].call(s, task.src, task.data) + "call": + var resume: Dictionary = CardScripts.of(task.name).get("resume", {}) + if not resume.has(task.fn): + Util.fail("No script function %s.%s" % [task.name, task.fn]) + return + resume[task.fn].call(s, task.data, null) + "draw": + Flow.draw_task(s, task.player) + "endTurn": + _end_turn(s) + + +# --------------------------------------------------------------------------------------------- +# Player views + +## What player `p` can see. Hidden cards become -1: the opponent's hand, both decks and Server piles, +## and face-down Anomalies. The RNG is blanked so bots can't predict dice, the opponent's choices are +## hidden, and only open windows are kept from the task queue. Everything else is shared with the +## real state, so treat a view as read-only. +static func view_for(s: Dictionary, p: int) -> Dictionary: + var hide := func(ids: Array) -> Array: + var out := [] + out.resize(ids.size()) + out.fill(-1) + return out + var players := [] + for i in s.players.size(): + var pl: Dictionary = s.players[i] + var v := pl.duplicate() + v.hand = pl.hand.duplicate() if i == p else hide.call(pl.hand) + v.deck = hide.call(pl.deck) + v.serverPile = hide.call(pl.serverPile) + v.discard = pl.discard.duplicate() + v.anomalies = pl.anomalies.map(func(av): + var c: Dictionary = av.duplicate() + c.hardware = av.hardware.duplicate() + c.card = av.card if av.faceUp else -1 + return c) + players.append(v) + var choice = s.choice + if choice != null and choice.player != p: + choice = choice.duplicate() + if choice.get("secret", false): + choice.prompt = "%s: %s is choosing." % [choice.kind.split(":")[0], State.player_name(choice.player)] + choice.options = choice.options.map(func(_o): return {"label": "?", "value": null}) + var combat = null + if s.combat != null: + combat = s.combat.duplicate() + combat.race = [s.combat.race[0] if p == 0 else null, s.combat.race[1] if p == 1 else null] + var view := s.duplicate() + view.rng = {"s": 0} + view.log = null + view.players = players + view.choice = choice + view.combat = combat + view.tasks = s.tasks.filter(func(t): return t.t == "window") + return view diff --git a/engine/engine.gd.uid b/engine/engine.gd.uid new file mode 100644 index 0000000..fb580c4 --- /dev/null +++ b/engine/engine.gd.uid @@ -0,0 +1 @@ +uid://cfxcxi5k1le8x diff --git a/engine/flow.gd b/engine/flow.gd new file mode 100644 index 0000000..cade509 --- /dev/null +++ b/engine/flow.gd @@ -0,0 +1,540 @@ +class_name Flow +## The parts of a turn that run on their own once started (flow.ts): resolving declarations, +## combat, defeat, capture and drawing. Card scripts call into these too (Trace Route starts a +## combat, Disconnect pulls an Anomaly out of one). + +## Lets an app see each combat as it happens, since a whole combat can run inside one +## apply_action. Called with (s, stage) after a combat starts ("start"), after the roll ("roll"), +## before the result is applied, with the final dice ("result"), and when it ends ("end"). Unset in +## the sim and tests. +static var combat_watch := Callable() + + +# --------------------------------------------------------------------------------------------- +# Drawing + +static func draw_cards(s: Dictionary, p: int, n: int) -> void: + var tasks := [] + for i in n: + tasks.append({"t": "draw", "player": p}) + State.push_tasks(s, tasks) + + +## Draws one card without "when drawing" effects. Returns it, or null for an empty deck. +static func draw_now(s: Dictionary, p: int) -> Variant: + var pl: Dictionary = s.players[p] + if pl.deck.is_empty(): + return null + var card: int = pl.deck.pop_front() + pl.hand.append(card) + State.stat(s, "cardsDrawn", p) + return card + + +static func draw_task(s: Dictionary, p: int) -> void: + var card = draw_now(s, p) + if card != null: + Query.emit(s, "onDraw", {"player": p, "card": card}) + + +# --------------------------------------------------------------------------------------------- +# Anomalies leaving and entering play + +static func _clear_status(av: Dictionary) -> void: + av.infection = 0 + av.bugs = 0 + av.mods = [] + av.disabledUntil = 0 + av.rootedUntil = 0 + av.damage = 0 + + +## A copy leaves play. It has no Hardware of its own. +static func remove_copy(s: Dictionary, r: Dictionary) -> void: + var cp := State.anomaly(s, r) + if cp.at == null: + return + State.say(s, "%s is removed." % State.anomaly_name(s, r), {"tag": "move", "player": r.player, "ref": r}) + _clear_status(cp) + cp.permanentInfection = 0 + cp.at = null + cp.faceUp = false + drop_from_combat(s, r) + + +## Recruit rule: an Anomaly recruited over leaves for the discard pile with its Hardware, and its +## copy leaves play. +static func retire_anomaly(s: Dictionary, r: Dictionary) -> void: + var av := State.anomaly(s, r) + remove_copy(s, State.copy_of(r)) + if not av.hardware.is_empty(): + State.stat(s, "hardwareLost", r.player, av.hardware.size()) + for hw in av.hardware: + State.to_discard(s, hw) + var from := " from %s" % av.at if av.at else "" + State.say(s, "%s retires %s%s." % [State.player_name(r.player), State.anomaly_name(s, r), from], {"tag": "card", "player": r.player, "ref": r}) + drop_from_combat(s, r) + State.to_discard(s, av.card) + State.stat(s, "anomaliesRetired", r.player) + + +## The loser of a combat goes back to its slot. Its Hardware is discarded unless `keep_hardware`, +## and its counters and effects are removed (Persistent Infection's counters stay). +static func knock_out(s: Dictionary, r: Dictionary, loc: String, role: String, keep_hardware: bool) -> void: + var av := State.anomaly(s, r) + if av.at == null: + return + if State.is_copy(r): + remove_copy(s, r) + else: + if not keep_hardware and not av.hardware.is_empty(): + var names := ", ".join(av.hardware.map(func(h): return State.name_of(s, h))) + State.say(s, "%s loses %s." % [State.player_name(r.player), names], {"tag": "combat", "player": r.player, "ref": r, "loc": loc}) + State.stat(s, "hardwareLost", r.player, av.hardware.size()) + for hw in av.hardware: + State.to_discard(s, hw) + av.hardware = [] + _clear_status(av) + av.at = null + State.say(s, "%s returns to its slot." % State.anomaly_name(s, r), {"tag": "combat", "player": r.player, "ref": r, "loc": loc}) + remove_copy(s, State.copy_of(r)) + State.stat(s, "anomaliesDestroyed", r.player) + Query.emit(s, "onDefeat", {"ref": r, "loc": loc, "role": role}) + + +## Health rule: an Anomaly returns to its slot by its owner's choice, as its placement for the +## round. It heals fully and keeps its Hardware; like a defeat, its counters and effects come off +## (Persistent Infection's stay) and its copy leaves play. +static func recall_anomaly(s: Dictionary, r: Dictionary) -> void: + var av := State.anomaly(s, r) + if av.at == null: + return + var healed: int = av.damage + var healing := ", healing %d damage" % healed if healed else "" + State.say(s, "%s recalls %s from %s to its slot%s." % [State.player_name(r.player), State.anomaly_name(s, r), av.at, healing], {"tag": "move", "player": r.player, "ref": r, "loc": av.at}) + _clear_status(av) + av.at = null + av.placed = true + remove_copy(s, State.copy_of(r)) + State.stat(s, "recalls", r.player) + + +## Places a copy of `original` on `to`. +static func create_copy(s: Dictionary, original: Dictionary, to: String) -> void: + var r := State.copy_of(original) + var cp := State.anomaly(s, r) + cp.merge({ + "card": State.anomaly(s, original).card, + "faceUp": true, + "at": to, + "hardware": [], + "damage": 0, + "placed": false, + "advanced": false, + "attacks": 0, + "infection": 0, + "bugs": 0, + "permanentInfection": 0, + "mods": [], + "disabledUntil": 0, + "rootedUntil": 0, + "breachedTurn": 0, + "createdTurn": s.turn, + }, true) + State.say(s, "%s creates %s on %s." % [State.player_name(r.player), State.anomaly_name(s, r), to], {"tag": "card", "player": r.player, "ref": r, "loc": to}) + + +## Moves an Anomaly by a card effect. Callers check the move is legal. +static func move_anomaly(s: Dictionary, r: Dictionary, to: String) -> void: + var av := State.anomaly(s, r) + State.say(s, "%s moves %s → %s." % [State.anomaly_name(s, r), av.at, to], {"tag": "move", "player": r.player, "ref": r, "loc": to}) + av.at = to + + +# --------------------------------------------------------------------------------------------- +# Step 5: declarations + +static func resolve_declaration(s: Dictionary, index: int) -> void: + var d: Dictionary = s.declarations[index] + var p: int = d.ref.player + var av := State.anomaly(s, d.ref) + var who := State.anomaly_name(s, d.ref) + if av.at == null: + return + if State.is_rooted(s, d.ref) or State.is_disabled_anomaly(s, d.ref): + State.say(s, "%s can't move, so its %s on %s fails." % [who, d.kind, d.to], {"tag": "move", "player": p, "ref": d.ref, "loc": d.to}) + return + if State.controls(s, p, d.to): + return + var defended := not State.defenders_at(s, d.to).is_empty() + var how := "capturesUnowned" if s.locations[d.to].owner == null else "capturesUndefended" + if d.kind == "advance": + var reachable := false + for n in State.neighbors(s, d.to): + if State.controls(s, p, n): + reachable = true + if not reachable: + State.say(s, "%s can no longer reach %s." % [who, d.to], {"tag": "move", "player": p, "ref": d.ref, "loc": d.to}) + return + if defended: + State.start_combat(s, d.ref, av.at, d.to, "advance") + else: + State.push_capture(s, d.ref, d.to, how) + return + if (not d.second and av.at != d.from) or not State.controls(s, p, d.from) or not State.adjacent(s, d.from, d.to): + State.say(s, "%s's attack on %s fails: it's no longer in position." % [who, d.to], {"tag": "move", "player": p, "ref": d.ref, "loc": d.to}) + return + if defended: + State.start_combat(s, d.ref, d.from, d.to, "attack") + else: + State.push_capture(s, d.ref, d.to, how) + + +# --------------------------------------------------------------------------------------------- +# Combat + +static func _roll(s: Dictionary, n: int) -> Array: + var out := [] + for i in n: + out.append(State.roll_die(s)) + return out + + +static func _side_totals(c: Dictionary) -> Dictionary: + var def_total := 0 + for d in c.defenders: + def_total += Util.sum(c.dice.get(State.ref_key(d), [])) + return {"atk": Util.sum(c.dice.get(State.ref_key(c.attacker), [])), "def": def_total} + + +static func _dice_text(s: Dictionary, c: Dictionary) -> String: + var one := func(r): + var dice: Array = c.dice.get(State.ref_key(r), []) + return "%s [%s]" % [State.name_of(s, State.anomaly(s, r).card), ",".join(dice.map(func(v): return str(v)))] + var t := _side_totals(c) + return "%s=%d vs %s=%d" % [one.call(c.attacker), t.atk, " + ".join(c.defenders.map(one)), t.def] + + +## Rolls every fighter's dice, rerolling all of them on a tie (under the health rule a tie stands). +static func _roll_all(s: Dictionary, c: Dictionary) -> void: + while true: + for r in State.fighters_of(c): + c.dice[State.ref_key(r)] = _roll(s, Query.cores_of(s, Query.fighter_of(s, r))) + var t := _side_totals(c) + if t.atk != t.def or s.rules.health.on: + break + c.ties += 1 + c.rolled = true + + +# --------------------------------------------------------------------------------------------- +# Damage (health rule) + +## Health text for the combat log, e.g. "7/10 Health". +static func health_text(s: Dictionary, r: Dictionary) -> String: + return "%d/%d Health" % [Query.health_left(s, r), Query.health_of(s, r)] + + +## Deals `n` damage to an Anomaly. Returns true if that destroys it (its damage reaches its Health). +static func damage_anomaly(s: Dictionary, r: Dictionary, n: int) -> bool: + var av := State.anomaly(s, r) + if av.at == null or n <= 0: + return false + av.damage += n + var dead: bool = av.damage >= Query.health_of(s, r) + var how := " and is destroyed" if dead else " (%s)" % health_text(s, r) + State.say(s, "%s takes %d damage%s." % [State.anomaly_name(s, r), n, how], {"tag": "combat", "player": r.player, "ref": r, "amount": n, "loc": av.at}) + return dead + + +## The attacker splits `n` damage among the defenders. The engine picks the split that destroys the +## most defenders, weakest first, and puts what's left on the weakest survivor. Returns the hits as +## {ref, amount, destroyed}. +static func _allocate_damage(s: Dictionary, defenders: Array, n: int) -> Array: + var order := Util.sorted_by(defenders, func(r): return Query.health_left(s, r)) + var hits := [] + for i in order.size(): + if n <= 0: + break + var d: Dictionary = order[i] + var left := Query.health_left(s, d) + var hit := left if n >= left else (n if i == order.size() - 1 else 0) + if hit == 0: + # Can't destroy this one: dump the rest on the weakest. + var first = null + for h in hits: + if State.ref_key(h.ref) == State.ref_key(order[0]): + first = h + break + damage_anomaly(s, order[0], n) + if first != null: + first.amount += n + else: + hits.append({"ref": order[0], "amount": n, "destroyed": false}) + break + n -= hit + hits.append({"ref": d, "amount": hit, "destroyed": damage_anomaly(s, d, hit)}) + return hits + + +## Tells the cards that an Anomaly lost a roll (Resource Leech, Overflow Error, Persistent Infection). +static func _emit_damage(s: Dictionary, r: Dictionary, loc: String, role: String, amount: int, destroyed: bool) -> void: + Query.emit(s, "onDamage", {"ref": r, "loc": loc, "role": role, "amount": amount, "destroyed": destroyed}) + + +## Health rule: the loser of the roll takes the difference as damage; destroyed Anomalies are defeated. +static func _resolve_damage(s: Dictionary, c: Dictionary, t: Dictionary) -> void: + if t.atk == t.def: + c.ties += 1 + State.stat(s, "combatsTied", c.attacker.player) + State.say(s, "Tie, %d to %d: a stalemate. Nobody takes damage." % [t.atk, t.def], {"tag": "combat", "loc": c.loc}) + return + var margin: int = absi(t.atk - t.def) + var attacker_wins: bool = t.atk > t.def + var defender: int = s.locations[c.loc].owner + var winner: int = c.attacker.player if attacker_wins else defender + State.say(s, "%s wins the roll, %d to %d: %d damage." % [State.player_name(winner), t.atk, t.def, margin], {"tag": "combat", "player": winner, "loc": c.loc}) + State.stat(s, "damageDealt", winner, margin) + if attacker_wins: + State.stat(s, "attacksWon", c.attacker.player) + var hits := _allocate_damage(s, c.defenders, margin) + var tasks := [] + var destroyed := 0 + for h in hits: + if h.destroyed: + destroyed += 1 + tasks.append({"t": "defeat", "ref": h.ref, "loc": c.loc, "role": "defend"}) + if destroyed == c.defenders.size(): + tasks.append({"t": "capture", "ref": c.attacker, "loc": c.loc, "stage": "hooks", "how": "capturesInCombat"}) + else: + State.say(s, "%s holds." % c.loc, {"tag": "combat", "player": defender, "loc": c.loc}) + State.push_tasks(s, tasks) + # Pushed last, so the damage hooks run before the defeats. + for h in hits: + _emit_damage(s, h.ref, c.loc, "defend", h.amount, h.destroyed) + else: + var dead := damage_anomaly(s, c.attacker, margin) + if dead: + State.push_tasks(s, [{"t": "defeat", "ref": c.attacker, "loc": c.loc, "role": "attack"}]) + _emit_damage(s, c.attacker, c.loc, "attack", margin, dead) + + +## Cores that change after the roll change the dice: each Core gained rolls one more die, and each +## Core lost removes that Anomaly's highest die. +static func sync_dice(s: Dictionary, c: Dictionary) -> void: + if not c.rolled: + return + for r in State.fighters_of(c): + var key := State.ref_key(r) + var dice: Array = c.dice.get(key, []) + var want := Query.cores_of(s, Query.fighter_of(s, r)) + while dice.size() < want: + dice.append(State.roll_die(s)) + if dice.size() > want: + dice.sort() + dice.resize(want) + c.dice[key] = dice + + +## Current dice totals {atk, def}, after syncing to Core changes. +static func combat_totals(s: Dictionary) -> Dictionary: + var c: Dictionary = s.combat + sync_dice(s, c) + return _side_totals(c) + + +## Stops the current combat with no winner. +static func end_combat(s: Dictionary, why: String) -> void: + var c = s.combat + if c == null or c.ended: + return + c.ended = true + State.stat(s, "combatsEnded", c.attacker.player) + State.say(s, "The combat at %s ends: %s." % [c.loc, why], {"tag": "combat", "loc": c.loc}) + + +## Takes an Anomaly out of the current combat. If the attacker leaves, the combat ends. If the last +## defender leaves, the attacker takes the location as undefended. +static func drop_from_combat(s: Dictionary, r: Dictionary) -> void: + var c = s.combat + if c == null or c.ended: + return + if State.same_ref(c.attacker, r): + end_combat(s, "%s left it" % State.anomaly_name(s, r)) + return + var i := -1 + for k in c.defenders.size(): + if State.same_ref(c.defenders[k], r): + i = k + break + if i < 0: + return + c.defenders.remove_at(i) + c.dice.erase(State.ref_key(r)) + if c.defenders.is_empty(): + end_combat(s, "no defender is left") + if State.anomaly(s, c.attacker).at != null: + State.push_capture(s, c.attacker, c.loc, "capturesUndefended") + + +static func combat_stage(s: Dictionary, stage: String) -> void: + var c = s.combat + if c == null: + return + _run_stage(s, c, stage) + # "result" is watched inside _run_stage, before the damage. + if (stage == "start" or stage == "roll" or stage == "end") and combat_watch.is_valid(): + combat_watch.call(s, stage) + + +static func _run_stage(s: Dictionary, c: Dictionary, stage: String) -> void: + if stage == "cleanup": + for r in State.fighters_of(c): + var av := State.anomaly(s, r) + av.mods = av.mods.filter(func(m): return m.get("combat") != c.id) + s.combat = null + return + if stage == "end": + State.push_tasks(s, [{"t": "combat", "stage": "cleanup"}]) + if c.rolled or c.ended: + Query.emit(s, "onCombatEnd", null) + return + if c.ended: + return + if stage == "start": + State.stat(s, "attacks", c.attacker.player) + var sides := Query.side_cores(s) + var hp := func(r): return ", %s" % health_text(s, r) if s.rules.health.on else "" + var defs := " and ".join(c.defenders.map(func(d): return "%s%s" % [State.anomaly_name(s, d), hp.call(d)])) + State.say(s, "Combat at %s: %s (%d Cores, from %s%s) vs %s (%d Cores)." % [c.loc, State.anomaly_name(s, c.attacker), sides.atk, c.origin, hp.call(c.attacker), defs, sides.def], {"tag": "combat", "player": c.attacker.player, "loc": c.loc, "ref": c.attacker}) + Query.emit(s, "onCombatStart", null) + return + if stage == "roll": + # Static Core effects count as firing once per combat. + var credited := {} + var credit := func(card_name, p): + var k := "%s:%d" % [card_name, p] + if not credited.has(k): + credited[k] = true + State.fired(s, card_name, p) + for r in State.fighters_of(c): + Query.cores_of(s, Query.fighter_of(s, r), credit) + _roll_all(s, c) + var ties := " after %d tie reroll(s)" % c.ties if c.ties else "" + State.say(s, "Roll: %s%s." % [_dice_text(s, c), ties], {"tag": "combat", "loc": c.loc}) + return + # result + var t := combat_totals(s) + if combat_watch.is_valid(): + combat_watch.call(s, "result") + if s.rules.health.on: + _resolve_damage(s, c, t) + return + if t.atk == t.def: + c.ties += 1 + _roll_all(s, c) + State.say(s, "Tie, so both sides reroll: %s." % _dice_text(s, c), {"tag": "combat", "loc": c.loc}) + State.push_tasks(s, [ + State._window("postRoll", c.attacker.player, s.stack.size()), + {"t": "combat", "stage": "result"}, + ]) + return + var attacker_wins: bool = t.atk > t.def + var winner: int = c.attacker.player if attacker_wins else s.locations[c.loc].owner + State.say(s, "%s wins the combat, %d to %d." % [State.player_name(winner), t.atk, t.def], {"tag": "combat", "player": winner, "loc": c.loc}) + if attacker_wins: + State.stat(s, "attacksWon", c.attacker.player) + var tasks := [] + for r in c.defenders: + tasks.append({"t": "defeat", "ref": r, "loc": c.loc, "role": "defend"}) + tasks.append({"t": "capture", "ref": c.attacker, "loc": c.loc, "stage": "hooks", "how": "capturesInCombat"}) + State.push_tasks(s, tasks) + # Without the health rule a lost roll destroys, so the damage hooks fire with the full Health. + for r in c.defenders: + _emit_damage(s, r, c.loc, "defend", Query.health_left(s, r), true) + else: + State.push_tasks(s, [{"t": "defeat", "ref": c.attacker, "loc": c.loc, "role": "attack"}]) + _emit_damage(s, c.attacker, c.loc, "attack", Query.health_left(s, c.attacker), true) + + +# --------------------------------------------------------------------------------------------- +# Defeat + +static func defeat(s: Dictionary, r: Dictionary, loc: String, role: String) -> void: + var av := State.anomaly(s, r) + if av.at == null: + return + if not State.is_copy(r): + # Redundant Power Supply, then RAID Array, may save the Hardware. + var savers: Array = av.hardware.filter(func(hw): + return Query.hardware_active(s, hw) and CardScripts.of(s.cards[hw].name).has("onWearerDefeated")) + savers = Util.sorted_by(savers, func(hw): return CardScripts.of(s.cards[hw].name).get("savePriority", 0)) + for hw in savers: + if CardScripts.of(s.cards[hw].name).onWearerDefeated.call(s, hw, {"ref": r, "loc": loc, "role": role}): + return + knock_out(s, r, loc, role, false) + + +# --------------------------------------------------------------------------------------------- +# Capture + +static func capture_hooks(s: Dictionary, r: Dictionary, loc: String, how: String) -> void: + var p: int = r.player + if State.anomaly(s, r).at == null or State.controls(s, p, loc) or GameMap.is_start(loc): + return + State.push_tasks(s, [{"t": "capture", "ref": r, "loc": loc, "stage": "main", "how": how}]) + var prev = s.locations[loc].owner + if prev != null and prev != p: + State.anomaly(s, r).breachedTurn = s.turn + Query.emit(s, "onCaptured", {"ref": r, "loc": loc}) + Query.emit(s, "onBreach", {"ref": r, "loc": loc}) + + +static func capture_main(s: Dictionary, r: Dictionary, loc: String, how: String) -> void: + var p: int = r.player + var me: Dictionary = s.players[p] + var L: Dictionary = s.locations[loc] + if State.anomaly(s, r).at == null or State.controls(s, p, loc): + return + var previous = L.owner + if L.server != null: + State.reset_card(s, L.server) + s.players[s.cards[L.server].owner].serverPile.append(L.server) + if previous != null and not L.programs.is_empty(): + State.stat(s, "programsLost", previous, L.programs.size()) + for prog in L.programs: + State.to_discard(s, prog) + L.programs = [] + L.owner = p + L.server = me.serverPile.pop_front() if not me.serverPile.is_empty() else null + State.anomaly(s, r).at = loc + + var level := GameMap.level_for(p, loc) + var turn1 = s.rules.firstTurn if s.turn == 1 else null + var bonus: int = 0 if L.server == null else CardScripts.of(s.cards[L.server].name).get("bandwidthOnPlace", 0) + var no_capture_bandwidth: bool = turn1 != null and turn1.captureBandwidth == false + var bandwidth: int = (0 if no_capture_bandwidth else s.rules.levelBandwidth[level]) + bonus + State.gain_bandwidth(s, p, bandwidth, "bandwidthFromCaptures") + State.stat(s, how, p) + var from := "" if previous == null else " from %s" % State.player_name(previous) + var server := "no Server" if L.server == null else State.name_of(s, L.server) + State.say(s, "%s captures %s%s (Lv %d) with %s: +%d Gb (now %d)." % [State.player_name(p), loc, from, level, server, bandwidth, me.bandwidth], {"tag": "capture", "player": p, "loc": loc}) + + var unlocks: bool = not s.rules.recruit.on and not s.rules.buyAnomalies.on + if unlocks and level > me.unlockedLevel and not (turn1 != null and turn1.unlock == false): + me.unlockedLevel = level + for i in 4: + var av: Dictionary = me.anomalies[i] + if i < level and not av.faceUp: + av.faceUp = true + av.unlockedTurn = s.turn + State.say(s, "%s unlocks Anomaly %d: %s." % [State.player_name(p), i + 1, State.name_of(s, av.card)], {"tag": "capture", "player": p, "loc": loc}) + if State.grid_count(s, p) >= s.rules.winLocations: + s.over = true + s.winner = p + s.endReason = "win" + State.say(s, "%s wins with %d locations." % [State.player_name(p), State.grid_count(s, p)], {"tag": "game", "player": p}) + return + if L.server != null: + State.played(s, State.name_of(s, L.server), p) + Query.emit(s, "onPlaced", {"card": L.server}) diff --git a/engine/flow.gd.uid b/engine/flow.gd.uid new file mode 100644 index 0000000..57da692 --- /dev/null +++ b/engine/flow.gd.uid @@ -0,0 +1 @@ +uid://bgu4e1y4tm1rn diff --git a/engine/invariants.gd b/engine/invariants.gd new file mode 100644 index 0000000..49780b4 --- /dev/null +++ b/engine/invariants.gd @@ -0,0 +1,97 @@ +class_name Invariants +## Rule invariants (invariants.ts): checks a state is consistent. Used by tests and the +## conformance runner's --check. + + +## Rule violations in a state; empty when it's consistent. +static func check(s: Dictionary) -> Array: + var errors := [] + var zone := {} + var put := func(id: int, where: String) -> void: + if zone.has(id): + var nm = s.cards[id].name if id >= 0 and id < s.cards.size() else null + errors.append("card %d (%s) is in both %s and %s" % [id, Util.js(nm), zone[id], where]) + zone[id] = where + + for p in s.players.size(): + var pl: Dictionary = s.players[p] + var own := func(ids: Array, where: String) -> void: + for id in ids: + put.call(id, "p%d.%s" % [p, where]) + if s.cards[id].owner != p: + errors.append("p%d.%s holds the opponent's card %d" % [p, where, id]) + own.call(pl.hand, "hand") + own.call(pl.deck, "deck") + own.call(pl.discard, "discard") + own.call(pl.serverPile, "serverPile") + if pl.bandwidth < 0: + errors.append("p%d has %d Gb" % [p, pl.bandwidth]) + var count := {} + for i in pl.anomalies.size(): + var av: Dictionary = pl.anomalies[i] + var slot: int = i + 1 + var r := State.ref(p, slot) + if slot <= 4: + if av.card >= 0 or not s.rules.recruit.on: + own.call([av.card], "anomaly%d" % slot) + elif av.at != null or not av.hardware.is_empty(): + errors.append("p%d empty slot %d is in use" % [p, slot]) + own.call(av.hardware, "anomaly%d.hardware" % slot) + var ported: Array = av.hardware.filter(func(h): + return not CardScripts.of(s.cards[h].name).get("noSlot", false) and not s.cards[h].has("pushedUntil")) + if av.card >= 0 and ported.size() > Query.slots_total(s, r): + errors.append("p%d Anomaly %d is over its slots" % [p, slot]) + else: + if not av.hardware.is_empty(): + errors.append("p%d copy %d has Hardware of its own" % [p, slot - 4]) + if av.at != null and pl.anomalies[i - 4].at == null: + errors.append("p%d copy %d is in play without its original" % [p, slot - 4]) + if av.card != pl.anomalies[i - 4].card: + errors.append("p%d copy %d doesn't match its original" % [p, slot - 4]) + if av.damage < 0: + errors.append("p%d Anomaly %d has negative damage" % [p, slot]) + if av.at == null: + if av.damage != 0: + errors.append("p%d Anomaly %d is in its slot with %d damage" % [p, slot, av.damage]) + continue + if not av.faceUp: + errors.append("p%d Anomaly %d is in play face down" % [p, slot]) + # A destroyed Anomaly may still stand there while its defeat is being resolved (RAID Array's choice). + var dying: bool = s.choice != null + for t in s.tasks: + if t.t == "defeat" and t.ref.player == p and t.ref.slot == slot: + dying = true + if s.rules.health.on and not dying and av.damage >= Query.health_of(s, r): + errors.append("p%d Anomaly %d is in play with no Health left" % [p, slot]) + if not State.controls(s, p, av.at): + errors.append("p%d Anomaly %d is on %s, which it doesn't control" % [p, slot, av.at]) + count[av.at] = count.get(av.at, 0) + 1 + for loc in count: + if count[loc] > Query.capacity(s, loc): + errors.append("p%d has %d Anomalies on %s" % [p, count[loc], loc]) + var total := 0 + for i in pl.anomalies.size(): + if (i < 4 and pl.anomalies[i].card >= 0) or (i >= 4 and pl.anomalies[i].at != null): + total += 1 + if s.rules.recruit.on and total > 4: + errors.append("p%d has %d Anomalies, counting copies" % [p, total]) + + for loc in GameMap.LOCATIONS: + var L: Dictionary = s.locations[loc] + if L.server != null: + put.call(L.server, "%s.server" % loc) + for id in L.programs: + put.call(id, "%s.programs" % loc) + if L.owner == null and (L.server != null or not L.programs.is_empty()): + errors.append("%s is unowned but has cards" % loc) + var layers: int = L.programs.filter(func(id): return s.cards[id].name == "Compatibility Layer").size() + if L.programs.size() > s.rules.maxProgramsPerLocation + layers: + errors.append("%s has too many Programs" % loc) + for item in s.stack: + if item.kind == "execution": + put.call(item.card, "stack") + if zone.size() != s.cards.size(): + errors.append("%d cards are missing from every zone" % (s.cards.size() - zone.size())) + if s.choice != null and s.choice.options.is_empty(): + errors.append("choice %s has no options" % s.choice.kind) + return errors diff --git a/engine/invariants.gd.uid b/engine/invariants.gd.uid new file mode 100644 index 0000000..396bf1c --- /dev/null +++ b/engine/invariants.gd.uid @@ -0,0 +1 @@ +uid://beajrwd7n855u diff --git a/engine/map.gd b/engine/map.gd new file mode 100644 index 0000000..38409b5 --- /dev/null +++ b/engine/map.gd @@ -0,0 +1,142 @@ +class_name GameMap +## The playmats (map.ts). Location ids follow the diagram in rules.md: S1 is South's start, S2 is +## North's. A line is {id, a, b, gateway}; lines with a gateway can hold a Firewall. +## +## The current board lives in static vars. RulesEngine.create_game switches it with use_board, so a +## process plays one board at a time, as in TS. + +const START_LOC: Array[String] = ["S1", "S2"] + +## Boards by name: {grid, lines: [[a, b, gateway], ...], win}. The grid is row by row from South's +## side; the row is the letter (A is South's first row). `win` is the grid locations needed to win. +static var BOARDS: Dictionary = {} + +static var GRID: Array = [] +static var LOCATIONS: Array = [] +static var LINES: Array = [] +static var LINE_BY_ID: Dictionary = {} +static var LINES_AT: Dictionary = {} +static var _row_count := 0 + + +static func _static_init() -> void: + BOARDS = { + "classic": _classic(), + # 4×4, each start joins the middle two squares of its first row. + "grid4": _squares([2, 3]), + # 4×4, each start joins all four squares of its first row. + "grid4-wide": _squares([1, 2, 3, 4]), + # 4×4, each start joins one square: A2 for South, D3 for North. + "grid4-one": _squares([2]), + # Three lanes, linked only across the middle row; every line between locations has a gateway. + "lanes": _lanes(true), + # Three lanes, but only the two middle cross-links can be firewalled. + "lanes-open": _lanes(false), + } + use_board("classic") + + +## The playmat in rules.md: rows of 3, 2, 3, 2, 3, entered from the middle of each end row. +static func _classic() -> Dictionary: + return { + "grid": ["A1", "A2", "A3", "B1", "B2", "C1", "C2", "C3", "D1", "D2", "E1", "E2", "E3"], + "lines": [ + ["S1", "A2", false], + ["A1", "A2", true], ["A2", "A3", true], + ["A1", "B1", true], ["A2", "B1", true], ["A2", "B2", true], ["A3", "B2", true], + ["B1", "C1", true], ["B1", "C2", true], ["B2", "C2", true], ["B2", "C3", true], + ["C1", "D1", true], ["C2", "D1", true], ["C2", "D2", true], ["C3", "D2", true], + ["D1", "E1", true], ["D1", "E2", true], ["D2", "E2", true], ["D2", "E3", true], + ["E1", "E2", true], ["E2", "E3", true], + ["S2", "E2", false], + ], + "win": 10, + } + + +## A 4×4 grid of squares, rows A–D, columns 1–4, joined side to side (not diagonally), with a +## gateway on every line between squares. Each start joins the listed squares of its first row; +## North's are South's rotated 180°. Win with 12 of the 16. +static func _squares(south_entries: Array) -> Dictionary: + var rows := ["A", "B", "C", "D"] + var grid := [] + for r in rows: + for c in [1, 2, 3, 4]: + grid.append("%s%d" % [r, c]) + var lines := [] + for c in south_entries: + lines.append(["S1", "A%d" % c, false]) + for i in rows.size(): + var r: String = rows[i] + for c in range(1, 5): + if c < 4: + lines.append(["%s%d" % [r, c], "%s%d" % [r, c + 1], true]) + if i < 3: + lines.append(["%s%d" % [r, c], "%s%d" % [rows[i + 1], c], true]) + for c in south_entries: + lines.append(["S2", "D%d" % (5 - c), false]) + return {"grid": grid, "lines": lines, "win": 12} + + +## Three lanes of five rows, A–E, joined to each other only across the middle row (C1–C2–C3). Each +## start joins the first location of every lane. With `lane_gateways` false the lane lines can't be +## firewalled, so only the two middle cross-links can. Win with 11 of the 15. +static func _lanes(lane_gateways: bool) -> Dictionary: + var rows := ["A", "B", "C", "D", "E"] + var grid := [] + for r in rows: + for c in [1, 2, 3]: + grid.append("%s%d" % [r, c]) + var lines := [] + for c in [1, 2, 3]: + lines.append(["S1", "A%d" % c, false]) + for i in rows.size() - 1: + for c in range(1, 4): + lines.append(["%s%d" % [rows[i], c], "%s%d" % [rows[i + 1], c], lane_gateways]) + lines.append(["C1", "C2", true]) + lines.append(["C2", "C3", true]) + for c in range(1, 4): + lines.append(["S2", "E%d" % c, false]) + return {"grid": grid, "lines": lines, "win": 11} + + +static func use_board(board_name: String) -> void: + if not BOARDS.has(board_name): + Util.fail("Unknown board \"%s\". Boards: %s" % [board_name, ", ".join(BOARDS.keys())]) + return + var board: Dictionary = BOARDS[board_name] + GRID = board.grid + LOCATIONS = [START_LOC[0]] + GRID + [START_LOC[1]] + LINES = [] + for l in board.lines: + LINES.append({"id": "%s-%s" % [l[0], l[1]], "a": l[0], "b": l[1], "gateway": l[2]}) + LINE_BY_ID = {} + for l in LINES: + LINE_BY_ID[l.id] = l + LINES_AT = {} + for loc in LOCATIONS: + LINES_AT[loc] = LINES.filter(func(l): return l.a == loc or l.b == loc) + var rows := {} + for loc in GRID: + rows[loc[0]] = true + _row_count = rows.size() + + +static func other_end(line: Dictionary, loc: String) -> String: + return line.b if line.a == loc else line.a + + +static func is_start(loc: String) -> bool: + return loc == START_LOC[0] or loc == START_LOC[1] + + +## A location's level for the player capturing it: your first row is Lv 1, counting up to the far +## row (Lv 5 on the classic board, Lv 4 on the 4×4 ones). Your own start is Lv 1. +static func level_for(p: int, loc: String) -> int: + if loc == START_LOC[p]: + return 1 + var row := "ABCDE".find(loc[0]) + if row < 0 or row >= _row_count: + Util.fail("No level for %s from player %d" % [loc, p]) + return 1 + return row + 1 if p == 0 else _row_count - row diff --git a/engine/map.gd.uid b/engine/map.gd.uid new file mode 100644 index 0000000..e9b02b6 --- /dev/null +++ b/engine/map.gd.uid @@ -0,0 +1 @@ +uid://bo6yu1gb8qako diff --git a/engine/odds.gd b/engine/odds.gd new file mode 100644 index 0000000..1f98e57 --- /dev/null +++ b/engine/odds.gd @@ -0,0 +1,62 @@ +class_name Odds +## Dice odds (odds.ts): the exact distribution of a sum of d6, and combat chances from it. + +static var _cache := {} +static var _roll_cache := {} + + +## Distribution of the sum of n d6, as probability by total. +static func _sum_distribution(n: int) -> Dictionary: + var dist := {0: 1.0} + for i in n: + var next := {} + for total in dist: + for face in range(1, 7): + next[total + face] = next.get(total + face, 0.0) + dist[total] / 6.0 + dist = next + return dist + + +## Exact chance that `atk` Cores beat `def` Cores, with ties rerolled. +static func win_chance(atk: int, def: int) -> float: + var key := "%d:%d" % [atk, def] + if _cache.has(key): + return _cache[key] + var win := 0.0 + var lose := 0.0 + var a := _sum_distribution(maxi(1, atk)) + var d := _sum_distribution(maxi(1, def)) + for sa in a: + for sd in d: + if sa > sd: + win += a[sa] * d[sd] + elif sa < sd: + lose += a[sa] * d[sd] + var chance := win / (win + lose) + _cache[key] = chance + return chance + + +## One roll of `atk` Cores against `def` Cores: {win, tie, lose} chances (no rerolls), and the +## expected damage to the defenders (damageDealt) and to the attacker (damageTaken) under the health +## rule, where the margin is the damage. +static func roll_odds(atk: int, def: int) -> Dictionary: + var key := "%d:%d" % [atk, def] + if _roll_cache.has(key): + return _roll_cache[key] + var out := {"win": 0.0, "tie": 0.0, "lose": 0.0, "damageDealt": 0.0, "damageTaken": 0.0} + var a := _sum_distribution(maxi(1, atk)) + var d := _sum_distribution(maxi(1, def)) + for sa in a: + for sd in d: + var p: float = a[sa] * d[sd] + if sa > sd: + out.win += p + out.damageDealt += p * (sa - sd) + elif sa < sd: + out.lose += p + out.damageTaken += p * (sd - sa) + else: + out.tie += p + _roll_cache[key] = out + return out diff --git a/engine/odds.gd.uid b/engine/odds.gd.uid new file mode 100644 index 0000000..36f3a03 --- /dev/null +++ b/engine/odds.gd.uid @@ -0,0 +1 @@ +uid://dag5epbussjc diff --git a/engine/play.gd b/engine/play.gd new file mode 100644 index 0000000..cf5734c --- /dev/null +++ b/engine/play.gd @@ -0,0 +1,46 @@ +class_name Play +## Plays whole games between bots (play.ts), for batch runs and tests. + +const MAX_ACTIONS := 200000 + + +## Bot makers by name. Each takes a seed and returns a bot (see RandomBot). The greedy bots ignore it. +static func bots() -> Dictionary: + return { + "random": func(seed: int): return RandomBot.new(seed), + "greedy": func(_seed: int): return GreedyBot.new(), + "nocards": func(_seed: int): return GreedyBot.new({"useCards": false}), + } + + +## The decks a game with this seed is dealt when none are given, from the cards `include` allows. +static func deal(pool: Dictionary, seed: int, rules: Dictionary, include := Callable()) -> Array: + var deck_rng := Rng.make(seed ^ 0x9e3779b9) + return [Deck.random_deck(pool, deck_rng, rules, include), Deck.random_deck(pool, deck_rng, rules, include)] + + +## Plays one game to the end from {pool, bots: [maker, maker], seed, decks?, rules?, log?, check?}. +## The same options and seed always produce the same game. Returns the final state, or null if the +## engine failed (see Util.errors). +static func play_game(o: Dictionary) -> Variant: + var rules: Dictionary = o.get("rules", Rules.defaults()) + var decks: Array = o.get("decks", deal(o.pool, o.seed, rules)) + var s = RulesEngine.create_game({"pool": o.pool, "decks": decks, "seed": o.seed, "rules": rules, "log": o.get("log", false)}) + if s == null: + return null + var players := [o.bots[0].call(o.seed * 2 + 1), o.bots[1].call(o.seed * 2 + 2)] + var n := 0 + while not s.over: + n += 1 + if n > MAX_ACTIONS: + return Util.fail("Game with seed %d didn't finish in %d actions" % [o.seed, MAX_ACTIONS]) + var p: int = RulesEngine.decider(s) + var legal := RulesEngine.legal_actions(s) + var action: Dictionary = players[p].choose(RulesEngine.view_for(s, p), legal, p) + if not RulesEngine.apply_action(s, action, legal): + return null + if o.get("check", false): + var errors := Invariants.check(s) + if not errors.is_empty(): + return Util.fail("Seed %d, turn %d:\n %s" % [o.seed, s.turn, "\n ".join(errors)]) + return s diff --git a/engine/play.gd.uid b/engine/play.gd.uid new file mode 100644 index 0000000..68c5ff2 --- /dev/null +++ b/engine/play.gd.uid @@ -0,0 +1 @@ +uid://ds2hvnuq3xelq diff --git a/engine/query.gd b/engine/query.gd new file mode 100644 index 0000000..82d89bf --- /dev/null +++ b/engine/query.gd @@ -0,0 +1,402 @@ +class_name Query +## Questions about the current state that depend on card effects (query.ts): what's in play, Cores, +## costs, capacity and protection. +## +## A Source (something with an effect in play) is {kind, id, name, controller, at} plus `ref` for +## Anomalies and Hardware and `virtual` for copied effects; see types.ts. A Fighter (an Anomaly as +## it fights, or would fight) is {ref, role, at, loc, combat}. + +## Health when no value is printed and no override is set. +const FALLBACK_HEALTH := 10 + + +static func program_active(s: Dictionary, id: int) -> bool: + var c: Dictionary = s.cards[id] + return not State.running(s, c.disabledUntil) and not State.running(s, c.ignoredUntil) + + +static func hardware_active(s: Dictionary, id: int) -> bool: + return not State.running(s, s.cards[id].disabledUntil) + + +## Recruit rule: `p` has fewer than 4 Anomalies, counting copies. Always true without the rule. +static func anomaly_room(s: Dictionary, p: int) -> bool: + if not s.rules.recruit.on: + return true + var avs: Array = s.players[p].anomalies + var n := 0 + for i in avs.size(): + if (i < 4 and avs[i].card >= 0) or (i >= 4 and avs[i].at != null): + n += 1 + return n < 4 + + +## Whether `p` may make a copy now: the copy-rule switches, and room under the recruit rule. +static func can_copy(s: Dictionary, p: int) -> bool: + var c: Dictionary = s.rules.copies + return c.allowed and (not c.needAnomaly2 or s.players[p].anomalies[1].faceUp) and anomaly_room(s, p) + + +## Everything with an effect in play right now. +static func sources(s: Dictionary) -> Array: + var out := [] + for loc in GameMap.LOCATIONS: + var L: Dictionary = s.locations[loc] + if L.owner == null: + continue + if L.server != null: + var c: Dictionary = s.cards[L.server] + out.append({"kind": "server", "id": L.server, "name": c.name, "controller": L.owner, "at": loc}) + if c.get("copies"): + out.append({"kind": "server", "id": L.server, "name": c.copies, "controller": L.owner, "at": loc, "virtual": -2}) + var live: Array = L.programs.filter(func(id): return program_active(s, id)) + for id in live: + out.append({"kind": "program", "id": id, "name": s.cards[id].name, "controller": L.owner, "at": loc}) + for w in live: + var to = s.cards[w].get("wormTo") if s.cards[w].name == "Worm Protocol" else null + if not to: + continue + for id in live: + if id != w: + out.append({"kind": "program", "id": id, "name": s.cards[id].name, "controller": L.owner, "at": to, "virtual": -1}) + for v in s.virtuals: + if State.running(s, v.until): + out.append({"kind": "program", "id": v.from, "name": v.name, "controller": v.controller, "at": v.at, "virtual": v.id}) + for p in [0, 1]: + for r in State.refs_in_play(s, p): + if State.is_copy(r): + continue + var av := State.anomaly(s, r) + out.append({"kind": "anomaly", "id": av.card, "name": s.cards[av.card].name, "controller": p, "at": av.at, "ref": r}) + for hw in av.hardware: + if hardware_active(s, hw): + out.append({"kind": "hardware", "id": hw, "name": s.cards[hw].name, "controller": p, "at": av.at, "ref": r}) + return out + + +static func same_source(a: Dictionary, b: Dictionary) -> bool: + if a.id != b.id or a.name != b.name or a.at != b.at or a.get("virtual") != b.get("virtual"): + return false + var ra = a.get("ref") + var rb = b.get("ref") + return (ra == null and rb == null) or State.same_ref(ra, rb) + + +static func still_active(s: Dictionary, src: Dictionary) -> bool: + for x in sources(s): + if same_source(x, src): + return true + return false + + +## Active sources with this card name (including copies) applying at `loc`, or anywhere for null. +static func sources_named(s: Dictionary, card_name: String, loc: Variant = null) -> Array: + return sources(s).filter(func(x): return x.name == card_name and (loc == null or x.at == loc)) + + +## Queues `hook` for every source whose script has it. +static func emit(s: Dictionary, hook: String, data: Variant) -> void: + var tasks := [] + for src in sources(s): + if CardScripts.of(src.name).has(hook): + tasks.append({"t": "hook", "hook": hook, "src": src, "data": data}) + State.push_tasks(s, tasks) + + +# --------------------------------------------------------------------------------------------- +# Capacity + +## How many of its owner's Anomalies a location holds (Cluster Server, Pingable Server: 2). +static func capacity(s: Dictionary, loc: String) -> int: + var sv = s.locations[loc].server + if sv == null or s.locations[loc].owner == null: + return 1 + var c: Dictionary = s.cards[sv] + var copied: int = CardScripts.of(c.copies).get("capacity", 1) if c.get("copies") else 1 + return maxi(1, maxi(CardScripts.of(c.name).get("capacity", 1), copied)) + + +## Whether `p` can put another Anomaly on `loc`. +static func has_room(s: Dictionary, p: int, loc: String) -> bool: + if not State.controls(s, p, loc): + return false + # Nothing enters a location mid-combat (a copy, or an Anomaly moved by Disconnect). + if s.combat != null and not s.combat.ended and s.combat.loc == loc: + return false + var n := 0 + for r in State.refs_in_play(s, p): + if State.anomaly(s, r).at == loc: + n += 1 + return n < capacity(s, loc) + + +## Program slots on a location: 2, plus active Programs that add slots (Compatibility Layer). +static func program_slots(s: Dictionary, loc: String) -> int: + var n: int = s.rules.maxProgramsPerLocation + for id in s.locations[loc].programs: + if program_active(s, id): + n += CardScripts.of(s.cards[id].name).get("programSlots", 0) + return n + + +## Programs installed on a location, counting copies that count as installed (Process Clone). +static func installed_count(s: Dictionary, loc: String) -> int: + var n: int = s.locations[loc].programs.size() + for v in s.virtuals: + if v.installed and v.at == loc and State.running(s, v.until): + n += 1 + return n + + +static func slots_used(s: Dictionary, r: Dictionary) -> int: + var n := 0 + for id in State.anomaly(s, r).hardware: + if not CardScripts.of(s.cards[id].name).get("noSlot", false): + n += 1 + return n + + +## Expansion Slots an Anomaly has: printed, plus Hardware that adds some (Network Interface Upgrade). +static func slots_total(s: Dictionary, r: Dictionary) -> int: + var av := State.anomaly(s, r) + var n: int = State.def_of(s, av.card).slots + for id in av.hardware: + n += CardScripts.of(s.cards[id].name).get("extraSlots", 0) + return n + + +static func slots_free(s: Dictionary, r: Dictionary) -> int: + return slots_total(s, r) - slots_used(s, r) + + +## Whether a Hardware takes an Expansion Slot: Network Interface Upgrade and Hardware pushed on over +## the limit don't. +static func takes_slot(s: Dictionary, id: int) -> bool: + return not CardScripts.of(s.cards[id].name).get("noSlot", false) and not s.cards[id].has("pushedUntil") + + +## Whether an Anomaly's Hardware fits its Expansion Slots, with `out` taken off and `into` put on. +static func slots_fit(s: Dictionary, r: Dictionary, out: Variant = null, into: Variant = null) -> bool: + var av := State.anomaly(s, r) + var hw: Array = av.hardware.filter(func(id): return id != out) + if into != null: + hw.append(into) + var total: int = State.def_of(s, av.card).slots + var taken := 0 + for id in hw: + total += CardScripts.of(s.cards[id].name).get("extraSlots", 0) + if takes_slot(s, id): + taken += 1 + return taken <= total + + +# --------------------------------------------------------------------------------------------- +# Cores + +## Where an Anomaly would fight from, as a fighter, with the current combat if it's in it. +static func fighter_of(s: Dictionary, r: Dictionary) -> Dictionary: + var c = s.combat + var av := State.anomaly(s, r) + if c != null and not c.ended: + if State.same_ref(c.attacker, r): + return {"ref": r, "role": "attack", "at": c.origin, "loc": c.loc, "combat": c} + for d in c.defenders: + if State.same_ref(d, r): + return {"ref": r, "role": "defend", "at": c.loc, "loc": c.loc, "combat": c} + return {"ref": r, "role": null, "at": av.at, "loc": null, "combat": null} + + +## Hardware on an Anomaly (a copy uses its original's) whose script passes `flag`, if active. +static func wears(s: Dictionary, r: Dictionary, flag: Callable) -> Array: + return State.hardware_of(s, r).filter(func(hw): + return hardware_active(s, hw) and flag.call(CardScripts.of(s.cards[hw].name))) + + +## Opponents' Bug effects can't touch an Anomaly wearing ECC Memory. +static func bug_immune(s: Dictionary, r: Dictionary, by: int) -> bool: + return by != r.player and not wears(s, r, func(sc): return sc.get("bugImmunity", false)).is_empty() + + +## Active sources with a script flag at a location, from a player other than `p`. +static func enemy_flag_at(s: Dictionary, loc: String, p: int, flag: Callable) -> Array: + return sources(s).filter(func(x): return x.at == loc and x.controller != p and flag.call(CardScripts.of(x.name))) + + +## Stock Rice: no Hardware bonuses in a combat at its location. +static func _hardware_blocked(s: Dictionary, f: Dictionary, all: Array) -> bool: + if not f.loc or f.role == null: + return false + for x in all: + if x.at == f.loc and CardScripts.of(x.name).get("blocksHardwareInCombat", false) and not bug_immune(s, f.ref, x.controller): + return true + return false + + +## Desynchronization: an attacker can't use once-per-turn Hardware abilities in a combat there. +static func desynced(s: Dictionary, r: Dictionary) -> bool: + var c = s.combat + if c == null or c.ended or not State.same_ref(c.attacker, r): + return false + return not enemy_flag_at(s, c.loc, r.player, func(sc): return sc.get("blocksHardwareAbilities", false)).is_empty() + + +# --------------------------------------------------------------------------------------------- +# Health (health rule) + +## Health rule: the damage that destroys an Anomaly. Printed Health (or the rules' override), plus +## active Hardware that adds Health. A copy has its original's Health. +static func health_of(s: Dictionary, r: Dictionary) -> int: + var av := State.anomaly(s, r) + var n: int = s.rules.health.override + if n == 0: + n = 0 if av.card < 0 else State.def_of(s, av.card).health + if n == 0: + n = FALLBACK_HEALTH + for hw in State.hardware_of(s, r): + if hardware_active(s, hw): + n += CardScripts.of(s.cards[hw].name).get("health", 0) + return maxi(1, n) + + +## Health rule: Health an Anomaly has left. +static func health_left(s: Dictionary, r: Dictionary) -> int: + return health_of(s, r) - State.anomaly(s, r).damage + + +## Combat Cores for a fighter. `credit` is called with (name, player) for every card that changed the +## total, so the card report can count static effects (Stack Overflow, Server bonuses) as firing. +## `detail`, when given, collects every part of the total as {source, kind, controller, cores}, the +## printed Cores first. The total is at least 1. +static func cores_of(s: Dictionary, f: Dictionary, credit := Callable(), detail: Variant = null) -> int: + var av := State.anomaly(s, f.ref) + var d: Dictionary = State.def_of(s, av.card) + var n: int = d.cores + if detail != null: + detail.append({"source": d.name, "kind": "anomaly", "controller": f.ref.player, "cores": n}) + var all := sources(s) + if not _hardware_blocked(s, f, all): + for hw in State.hardware_of(s, f.ref): + if not hardware_active(s, hw) or (f.combat != null and f.combat.suppressed.has(hw)): + continue + var hw_name: String = s.cards[hw].name + var sc := CardScripts.of(hw_name) + if sc.has("cores"): + var src := {"kind": "hardware", "id": hw, "name": hw_name, "controller": f.ref.player, "at": f.at, "ref": f.ref} + n += _part(sc.cores.call(s, src, f), hw_name, f.ref.player, "hardware", credit, detail) + var counted := {} + for src in all: + if src.kind == "hardware": + continue + var sc := CardScripts.of(src.name) + if sc.has("cores"): + n += _part(sc.cores.call(s, src, f), src.name, src.controller, src.kind, credit, detail) + if sc.has("globalCores") and not counted.has(src.name): + counted[src.name] = true + n += _part(sc.globalCores.call(s, f), src.name, src.controller, src.kind, credit, detail) + for m in State.active_mods(s, av): + n += m.cores + if m.cores != 0 and detail != null: + detail.append({"source": m.source, "kind": "modifier", "controller": m.by, "cores": m.cores}) + return maxi(1, n) + + +## One part of a Core total: reports it to `credit` and `detail`, and returns it. +static func _part(delta: int, src_name: String, p: int, kind: String, credit: Callable, detail: Variant) -> int: + if delta != 0: + if credit.is_valid(): + credit.call(src_name, p) + if detail != null: + detail.append({"source": src_name, "kind": kind, "controller": p, "cores": delta}) + return delta + + +## Cores for each side of the current combat: {atk, def}. +static func side_cores(s: Dictionary) -> Dictionary: + var c: Dictionary = s.combat + var def_total := 0 + for d in c.defenders: + def_total += cores_of(s, fighter_of(s, d)) + return {"atk": cores_of(s, fighter_of(s, c.attacker)), "def": def_total} + + +# --------------------------------------------------------------------------------------------- +# Costs +# +# A Payment is {kind, player} plus what it's for: card, at (a Program's location or an Execution's +# target), ref (a Hardware's wearer), line and level (a Firewall), hostile (enemy Anomalies an +# Execution targets). kind is "program", "hardware", "execution", "firewall" or "ability". + +static func _base_cost(s: Dictionary, payment: Dictionary) -> int: + if payment.kind == "firewall": + return State.firewall_cost(s, payment.get("level", 0)) + return 0 if payment.get("card") == null else State.def_of(s, payment.card).bandwidth + + +## Bandwidth a payment costs after every discount and surcharge in play. Pass `all` (the current +## sources) when pricing many payments against the same state. +static func cost_of(s: Dictionary, payment: Dictionary, all: Variant = null) -> int: + var n := _base_cost(s, payment) + for src in (all if all != null else sources(s)): + var sc := CardScripts.of(src.name) + if sc.has("costMod"): + n += sc.costMod.call(s, src, payment) + return maxi(0, n) + + +## Pays for something, using up once-per-turn discounts. Returns the amount paid. +static func pay(s: Dictionary, payment: Dictionary, stat_key: String) -> int: + var n := _base_cost(s, payment) + var touched := [] + for src in sources(s): + var sc := CardScripts.of(src.name) + var d: int = sc.costMod.call(s, src, payment) if sc.has("costMod") else 0 + if d != 0: + n += d + touched.append(src) + var cost := maxi(0, n) + if cost > s.players[payment.player].bandwidth: + Util.fail("Can't afford %d Gb" % cost) + s.players[payment.player].bandwidth -= cost + State.stat(s, stat_key, payment.player, cost) + for src in touched: + var sc := CardScripts.of(src.name) + if sc.has("onPaid"): + sc.onPaid.call(s, src, payment) + return cost + + +## Bandwidth a player could have for a payment: current Bandwidth plus the Salvage value of the rest +## of the hand. +static func reachable_bandwidth(s: Dictionary, p: int, except: Variant = null) -> int: + var pl: Dictionary = s.players[p] + var n: int = pl.bandwidth + for id in pl.hand: + if id != except and id >= 0: + n += State.def_of(s, id).bandwidth + return n + + +# --------------------------------------------------------------------------------------------- +# Protection + +## Hardware Sandbox: opponents can't target the Program it protects (Execute: Root Access lifts it). +static func is_protected(s: Dictionary, program: int, by: int) -> bool: + var owner: int = s.cards[program].owner + if by == owner: + return false + var loc = null + for l in GameMap.LOCATIONS: + if s.locations[l].programs.has(program): + loc = l + break + if loc != null and State.running(s, s.locations[loc].rootAccess[by]): + return false + for x in sources(s): + if x.kind == "hardware" and x.name == "Hardware Sandbox" and s.cards[x.id].get("protects") == program \ + and loc != null and x.at == loc and x.controller == owner: + return true + return false + + +static func can_target_program(s: Dictionary, program: int, by: int) -> bool: + return not is_protected(s, program, by) diff --git a/engine/query.gd.uid b/engine/query.gd.uid new file mode 100644 index 0000000..0602ee8 --- /dev/null +++ b/engine/query.gd.uid @@ -0,0 +1 @@ +uid://dgi5af1g3vslf diff --git a/engine/rng.gd b/engine/rng.gd new file mode 100644 index 0000000..ff09b4f --- /dev/null +++ b/engine/rng.gd @@ -0,0 +1,48 @@ +class_name Rng +## Seeded Mulberry32 (rng.ts). The state is a Dictionary `{s}` kept in the GameState, so a cloned +## state carries its RNG along, which keeps every game reproducible from its seed. +## +## GDScript ints are 64-bit, so every step is masked to 32 bits to match JS's Math.imul and `>>> 0`. + +const M := 0xFFFFFFFF + + +static func make(seed: int) -> Dictionary: + return {"s": seed & M} + + +## The low 32 bits of a * b, for a and b in 0..2^32 - 1, without overflowing 64 bits. +static func _imul(a: int, b: int) -> int: + return ((a & 0xFFFF) * b + ((((a >> 16) * b) & 0xFFFF) << 16)) & M + + +static func next_float(r: Dictionary) -> float: + r.s = (r.s + 0x6d2b79f5) & M + var t: int = r.s + t = _imul(t ^ (t >> 15), t | 1) + t = t ^ ((t + _imul(t ^ (t >> 7), t | 61)) & M) + return float((t ^ (t >> 14)) & M) / 4294967296.0 + + +static func rand_int(r: Dictionary, n: int) -> int: + return floori(next_float(r) * n) + + +static func d6(r: Dictionary) -> int: + return 1 + rand_int(r, 6) + + +static func pick(r: Dictionary, items: Array) -> Variant: + return items[rand_int(r, items.size())] + + +## Shuffles `items` in place (Fisher–Yates, as in TS) and returns it. +static func shuffle(r: Dictionary, items: Array) -> Array: + var i := items.size() - 1 + while i > 0: + var j := rand_int(r, i + 1) + var tmp = items[i] + items[i] = items[j] + items[j] = tmp + i -= 1 + return items diff --git a/engine/rng.gd.uid b/engine/rng.gd.uid new file mode 100644 index 0000000..970328d --- /dev/null +++ b/engine/rng.gd.uid @@ -0,0 +1 @@ +uid://dg4kiual5kl37 diff --git a/engine/rules.gd b/engine/rules.gd new file mode 100644 index 0000000..68186fd --- /dev/null +++ b/engine/rules.gd @@ -0,0 +1,109 @@ +class_name Rules +## Every number from rules.md that a rule variant might change (rules.ts). A rules Dictionary is +## shaped like the TS RulesConfig; the field docs are there. Pass a modified copy to +## RulesEngine.create_game to A/B test a rule. + + +## The current rules, as a fresh Dictionary. +static func defaults() -> Dictionary: + return { + "board": "classic", + "startingBandwidth": 4, + "openingHand": 7, + "drawPerTurn": 1, + "winLocations": 10, + "maxTurns": 200, + "levelBandwidth": {1: 4, 2: 4, 3: 4, 4: 4, 5: 4}, + "firewallCost": [2, 4, 8], + "maxProgramsPerLocation": 2, + "deck": {"anomalies": 4, "servers": 20, "main": 45, "maxCopies": 2}, + "startingAnomalies": 1, + "firstTurn": {"draw": true, "advance": true, "captureBandwidth": true, "unlock": true, "cards": true}, + "secondPlayer": {"bandwidth": 0, "anomalies": 0, "cards": 0, "firstDraw": 0, "locations": 0}, + "recruit": {"on": false, "anomaliesInDeck": 3, "price": 6, "pricePerCore": 0}, + "buyAnomalies": {"on": false, "prices": [8, 12, 16]}, + "copies": {"allowed": true, "waitATurn": false, "needAnomaly2": false}, + "commands": {"on": true, "perPlayer": 2, "leads": "F", "snake": true}, + "health": {"on": true, "override": 0, "recall": true}, + } + + +## Rules read from JSON (a trace, a game record): numbers back to ints, and levelBandwidth keyed by +## int level. +static func from_json(d: Dictionary) -> Dictionary: + var r: Dictionary = Util.ints(d) + var lb := {} + for k in r.levelBandwidth: + lb[int(k)] = r.levelBandwidth[k] + r.levelBandwidth = lb + return r + + +## Anomalies kept outside the main deck: all of them, or just the starting one when recruiting. +static func anomalies_outside(rules: Dictionary) -> int: + return 1 if rules.recruit.on else rules.deck.anomalies + + +## A copy of `rules` with one setting changed, from text like "winLocations=9", +## "secondPlayer.bandwidth=4", "firstTurn.advance=false" or "levelBandwidth=4,4,4,4,4" (Lv 1 to 5). +## "board=grid4" also sets winLocations to 12, so give a winLocations after it to change that. +## Returns null (and records an error) for a bad spec. +static func with_rule(rules: Dictionary, spec: String) -> Variant: + var m := RegEx.create_from_string("^([\\w.]+)=(.+)$").search(spec) + if m == null: + return Util.fail("Rule \"%s\" should look like name=value" % spec) + var key := m.get_string(1) + var raw := m.get_string(2) + var next := rules.duplicate(true) + var path := key.split(".") + var obj: Dictionary = next + for part in path.slice(0, -1): + if not (obj.get(part) is Dictionary): + return Util.fail("Unknown rule \"%s\"" % key) + obj = obj[part] + var last := path[path.size() - 1] + var old = obj.get(last) + if key == "board": + if not GameMap.BOARDS.has(raw): + return Util.fail("Unknown board \"%s\". Boards: %s" % [raw, ", ".join(GameMap.BOARDS.keys())]) + obj.board = raw + obj.winLocations = GameMap.BOARDS[raw].win + elif old is int or old is float: + var n = _num(key, raw) + if n == null: + return null + obj[last] = n + elif old is String: + obj[last] = raw + elif old is bool: + if raw != "true" and raw != "false": + return Util.fail("Rule \"%s\" needs true or false" % key) + obj[last] = raw == "true" + elif key == "levelBandwidth": + var lb := {} + var parts := raw.split(",") + for i in parts.size(): + var n = _num(key, parts[i]) + if n == null: + return null + lb[i + 1] = n + obj[last] = lb + elif old is Array: + var out := [] + for x in raw.split(","): + var n = _num(key, x) + if n == null: + return null + out.append(n) + obj[last] = out + else: + return Util.fail("Unknown rule \"%s\"" % key) + return next + + +static func _num(key: String, x: String) -> Variant: + if x.is_valid_int(): + return int(x) + if x.is_valid_float(): + return float(x) + return Util.fail("Rule \"%s\" needs numbers, got \"%s\"" % [key, x]) diff --git a/engine/rules.gd.uid b/engine/rules.gd.uid new file mode 100644 index 0000000..37598a8 --- /dev/null +++ b/engine/rules.gd.uid @@ -0,0 +1 @@ +uid://dg244m0aio8ur diff --git a/engine/scripts.gd b/engine/scripts.gd new file mode 100644 index 0000000..ef8e79c --- /dev/null +++ b/engine/scripts.gd @@ -0,0 +1,71 @@ +class_name CardScripts +## Card scripts: what each card does, in one place per card (scripts.ts). The engine calls into them +## at fixed points (hooks). Every script records the card text it was written for, so an edited card +## in cards.csv is reported instead of silently simulated with the old wording. +## +## A script is a Dictionary keyed like the TS Script interface; every key but `text` is optional. +## Values are numbers and flags (bandwidthOnPlace, capacity, programSlots, noSlot, extraSlots, health, +## extraAttacks, blocksHardwareInCombat, blocksHardwareAbilities, blocksAttackerExecutions, +## bugImmunity, executionPower, copiesExecutions, savePriority) or Callables, always called with the +## arguments listed here: +## +## cores(s, src, fighter) -> int globalCores(s, fighter) -> int +## costMod(s, src, payment) -> int onPaid(s, src, payment) +## (s, src, data) for each hook in HOOKS; data is null where TS passes none +## onWearerDefeated(s, hw, ev) -> bool negates(s, src, item) -> bool +## ability: {cost?, hardwareOncePerTurn?, uses(s, src) -> Array of args, +## resolve(s, item, src), extraCost?(s, src, args) -> int} +## execution: {plays(s, p) -> Array of {target, args}, resolve(s, item), +## targetsAnomalies?(s, item) -> Array of refs} +## resume: {fn name: Callable(s, data, value)}, continuations after a choice or a delayed task + +const HOOKS: Array[String] = [ + "onTurnStart", "onDraw", "onAttackDeclared", "onBreach", "onCaptured", "onPlaced", "onInstall", + "onCombatStart", "onDefeat", "onDamage", "onCombatEnd", +] + +## Returned for cards with no script, so lookups don't need a null check. +const NONE := {} + +static var _registry: Dictionary = {} + + +## All scripts by card name. Built on first use. +static func all() -> Dictionary: + if _registry.is_empty(): + for group in [ServerCards.scripts(), ProgramCards.scripts(), HardwareCards.scripts(), + ExecutionCards.scripts(), AnomalyCards.scripts()]: + _registry.merge(group, true) + return _registry + + +## The script for a card name, or an empty Dictionary. +static func of(card_name: Variant) -> Dictionary: + return all().get(card_name, NONE) + + +static func is_implemented(card: Dictionary) -> bool: + return all().has(card.name) + + +## The text a card's script checks: the Ability for Anomalies, the description for everything else. +static func scripted_text(card: Dictionary) -> String: + if card.kind == "anomaly": + return card.ability.text.strip_edges() if card.has("ability") else "" + return card.text.strip_edges() + + +## Scripts whose card is missing from, or worded differently in, the CSV; and cards with no script. +static func stale_scripts(pool: Dictionary) -> Array: + var warnings := [] + var scripts := all() + for card_name in scripts: + var card = pool.by_name.get(card_name) + if card == null: + warnings.append("%s: has a script but isn't in cards.csv" % card_name) + elif scripted_text(card) != scripts[card_name].text: + warnings.append("%s: card text changed; the script was written for \"%s\"" % [card_name, scripts[card_name].text]) + for card in pool.all: + if not is_implemented(card): + warnings.append("%s: no script yet" % card.name) + return warnings diff --git a/engine/scripts.gd.uid b/engine/scripts.gd.uid new file mode 100644 index 0000000..c6186ba --- /dev/null +++ b/engine/scripts.gd.uid @@ -0,0 +1 @@ +uid://cm83bbjxm0dcx diff --git a/engine/state.gd b/engine/state.gd new file mode 100644 index 0000000..d2bdac5 --- /dev/null +++ b/engine/state.gd @@ -0,0 +1,487 @@ +class_name State +## Small helpers for reading and changing a game state (state.ts). Nothing here knows about +## individual cards, so both the engine and the card scripts can use it. +## +## A state `s` is the TS GameState as Dictionaries and Arrays, with the same keys. An Anomaly ref +## is {player, slot}: slots 1–4 are the printed Anomalies and slot k + 4 is the copy of Anomaly k. + + +static func other(p: int) -> int: + return 1 if p == 0 else 0 + + +static func def_of(s: Dictionary, id: int) -> Dictionary: + return s.defs[s.cards[id].name] + + +static func name_of(s: Dictionary, id: int) -> String: + return "a hidden card" if id < 0 else s.cards[id].name + + +static func owner_of(s: Dictionary, id: int) -> int: + return s.cards[id].owner + + +static func controls(s: Dictionary, p: int, loc: String) -> bool: + return s.locations[loc].owner == p + + +static func is_open(s: Dictionary, line: Dictionary) -> bool: + return not s.firewalls.get(line.id, 0) + + +## Bandwidth to place, upgrade to, or clear a Firewall of `level`, before discounts; 0 for no Firewall. +static func firewall_cost(s: Dictionary, level: int) -> int: + var costs: Array = s.rules.firewallCost + return costs[level - 1] if level >= 1 and level <= costs.size() else 0 + + +static func grid_count(s: Dictionary, p: int) -> int: + var n := 0 + for loc in GameMap.GRID: + if controls(s, p, loc): + n += 1 + return n + + +## Rolls a d6 (or takes the next rigged result). +static func roll_die(s: Dictionary) -> int: + var rigged = s.get("rigged") + if rigged != null and not rigged.is_empty(): + return rigged.pop_front() + return Rng.d6(s.rng) + + +## Adds a line to the play-by-play. `meta` tags what it's about; give `to` and `public` when the +## line names cards only one player may see, and the other player reads `public` instead. Null +## values are left out, as TS leaves out undefined ones. +static func say(s: Dictionary, msg: String, meta := {}) -> void: + if s.log == null: + return + var line := {"text": msg} + for k in meta: + if meta[k] != null: + line[k] = meta[k] + s.log.append(line) + + +## The play-by-play as `viewer` may read it, or every line in full for null. +static func log_for(s: Dictionary, viewer: Variant) -> Array: + var out := [] + for l in (s.log if s.log != null else []): + if viewer == null or not l.has("to") or l.to == viewer: + out.append(l.text) + else: + out.append(l.get("public", "")) + return out + + +static func stat(s: Dictionary, key: String, p: int, n := 1) -> void: + s.stats[key][p] += n + + +static func _use(s: Dictionary, card_name: String) -> Dictionary: + if not s.cardUse.has(card_name): + s.cardUse[card_name] = {"played": [0, 0], "fired": [0, 0]} + return s.cardUse[card_name] + + +## Counts a card being played, installed or activated. +static func played(s: Dictionary, card_name: String, p: int) -> void: + _use(s, card_name).played[p] += 1 + + +## Counts a card's effect happening. +static func fired(s: Dictionary, card_name: String, p: int) -> void: + _use(s, card_name).fired[p] += 1 + + +# --------------------------------------------------------------------------------------------- +# Time + +static func end_of_turn(s: Dictionary) -> int: + return 2 * s.turn + 1 + + +static func start_of(turn: int) -> int: + return 2 * turn + + +static func end_of(turn: int) -> int: + return 2 * turn + 1 + + +## The turn number of `p`'s next turn (not the current one). Under the command rule, their next command. +static func next_turn_of(s: Dictionary, p: int) -> int: + if not s.rules.commands.on: + return s.turn + 2 if s.active == p else s.turn + 1 + var t: int = s.turn + 1 + while commander_of(s, t) != p: + t += 1 + return t + + +# Command rule: game turns are commands. A round is 2 × perPlayer of them, alternating players, +# and the lead alternates by round. +static func _commands_per_round(s: Dictionary) -> int: + return 2 * s.rules.commands.perPlayer + + +## Command rule: who takes game turn `turn`. +static func commander_of(s: Dictionary, turn: int) -> int: + var leads: String = s.rules.commands.leads + var snake: bool = s.rules.commands.snake + var per := _commands_per_round(s) + var round_no := Util.floordiv(turn - 1, per) + var i := (turn - 1) % per + var mark := "" + if leads == "thue": + mark = "FS"[Util.popcount(round_no) % 2] + else: + mark = leads[posmod(round_no, leads.length())] + if mark != "F" and mark != "S": + Util.fail("commands.leads should use F and S, or be \"thue\": \"%s\"" % leads) + var lead: int = s.firstPlayer if mark == "F" else other(s.firstPlayer) + var leads_this := (i % 4 == 0 or i % 4 == 3) if snake else i % 2 == 0 + return lead if leads_this else other(lead) + + +## Command rule: the round game turn `turn` belongs to, from 1. +static func round_of(s: Dictionary, turn: int) -> int: + return Util.floordiv(turn - 1, _commands_per_round(s)) + 1 + + +## Command rule: whether `turn` is its commander's first command of the round. +static func first_command(s: Dictionary, turn: int) -> bool: + return (turn - 1) % _commands_per_round(s) < 2 + + +## Rounds played so far: both players taking a turn (or all their commands). +static func rounds_played(s: Dictionary) -> int: + return round_of(s, s.turn) if s.rules.commands.on else ceili(s.turn / 2.0) + + +static func running(s: Dictionary, until: int) -> bool: + return until > s.clock + + +## Once-per-turn bookkeeping. Returns how many times `key` was used this turn. +static func used_this_turn(s: Dictionary, key: String) -> int: + return s.used.get(key, 0) + + +static func mark_used(s: Dictionary, key: String) -> void: + s.used[key] = s.used.get(key, 0) + 1 + + +# --------------------------------------------------------------------------------------------- +# Anomalies + +static func ref(p: int, slot: int) -> Dictionary: + return {"player": p, "slot": slot} + + +static func ref_key(r: Dictionary) -> String: + return "%d:%d" % [r.player, r.slot] + + +static func same_ref(a: Variant, b: Variant) -> bool: + return a != null and b != null and a.player == b.player and a.slot == b.slot + + +static func anomaly(s: Dictionary, r: Dictionary) -> Dictionary: + return s.players[r.player].anomalies[r.slot - 1] + + +static func is_copy(r: Dictionary) -> bool: + return r.slot > 4 + + +## The printed Anomaly a ref belongs to (a copy's original). +static func original_of(r: Dictionary) -> Dictionary: + return ref(r.player, r.slot - 4) if r.slot > 4 else r + + +static func copy_of(r: Dictionary) -> Dictionary: + return ref(r.player, original_of(r).slot + 4) + + +static func in_play(s: Dictionary, r: Dictionary) -> bool: + return anomaly(s, r).at != null + + +static func anomaly_def(s: Dictionary, r: Dictionary) -> Dictionary: + return def_of(s, anomaly(s, r).card) + + +static func anomaly_name(s: Dictionary, r: Dictionary) -> String: + var n: int = original_of(r).slot + var card: int = anomaly(s, r).card + var nm := "?" if card < 0 else name_of(s, card) + return ("the copy of Anomaly %d (%s)" if is_copy(r) else "Anomaly %d (%s)") % [n, nm] + + +## Every Anomaly of `p` in play, originals first. +static func refs_in_play(s: Dictionary, p: int) -> Array: + var out := [] + var avs: Array = s.players[p].anomalies + for i in avs.size(): + if avs[i].at != null: + out.append(ref(p, i + 1)) + return out + + +## Anomalies standing on `loc`. Only the location's owner can have Anomalies there. +static func anomalies_at(s: Dictionary, loc: String) -> Array: + var owner = s.locations[loc].owner + if owner == null: + return [] + return refs_in_play(s, owner).filter(func(r): return anomaly(s, r).at == loc) + + +static func defenders_at(s: Dictionary, loc: String) -> Array: + return anomalies_at(s, loc) + + +## Hardware that counts for an Anomaly. A copy uses its original's Hardware. +static func hardware_of(s: Dictionary, r: Dictionary) -> Array: + return anomaly(s, original_of(r)).hardware + + +## The Anomaly wearing a Hardware card, if it's installed. +static func wearer_of(s: Dictionary, hw: int) -> Variant: + var p := owner_of(s, hw) + var avs: Array = s.players[p].anomalies + for i in avs.size(): + if avs[i].hardware.has(hw): + return ref(p, i + 1) + return null + + +static func is_rooted(s: Dictionary, r: Dictionary) -> bool: + return running(s, anomaly(s, r).rootedUntil) + + +static func is_disabled_anomaly(s: Dictionary, r: Dictionary) -> bool: + return running(s, anomaly(s, r).disabledUntil) + + +## Copy-rule variant: a copy made this player-turn can't advance or attack yet. It can still defend. +static func fresh_copy(s: Dictionary, r: Dictionary) -> bool: + return is_copy(r) and s.rules.copies.waitATurn and anomaly(s, r).createdTurn == s.turn + + +## Can act: advance, attack, move, use its Ability. +static func can_act(s: Dictionary, r: Dictionary) -> bool: + return in_play(s, r) and not is_rooted(s, r) and not is_disabled_anomaly(s, r) + + +## Temporary modifiers that currently apply to an Anomaly. +static func active_mods(s: Dictionary, av: Dictionary) -> Array: + return av.mods.filter(func(m): + if m.has("combat"): + return s.combat != null and s.combat.id == m.combat + return running(s, m.get("until", 0))) + + +## Adds a temporary Core modifier. `scope` is {combat: id} or {until: clock}. +static func add_mod(s: Dictionary, r: Dictionary, cores: int, source: String, by: int, scope: Dictionary) -> void: + s.seq += 1 + var m := {"seq": s.seq, "cores": cores, "source": source, "by": by} + m.merge(scope) + anomaly(s, r).mods.append(m) + + +static func infection_of(av: Dictionary) -> int: + return av.infection + av.permanentInfection + + +# --------------------------------------------------------------------------------------------- +# Combat + +static func in_combat(s: Dictionary, r: Dictionary) -> bool: + var c = s.combat + if c == null or c.ended: + return false + if same_ref(c.attacker, r): + return true + for d in c.defenders: + if same_ref(d, r): + return true + return false + + +## The other side of the current combat from `r`'s point of view. +static func opponents_in_combat(s: Dictionary, r: Dictionary) -> Array: + var c = s.combat + if c == null or c.ended: + return [] + if same_ref(c.attacker, r): + return c.defenders.duplicate() + for d in c.defenders: + if same_ref(d, r): + return [c.attacker] + return [] + + +static func fighters_of(c: Dictionary) -> Array: + return [c.attacker] + c.defenders + + +## Anomalies "at" a location for card text: the ones standing there, plus an enemy attacking it in +## the current combat. +static func at_server(s: Dictionary, loc: String) -> Array: + var out := anomalies_at(s, loc) + var c = s.combat + if c != null and not c.ended and c.loc == loc: + var found := false + for r in out: + if same_ref(r, c.attacker): + found = true + if not found: + out.append(c.attacker) + return out + + +# --------------------------------------------------------------------------------------------- +# Map + +## Locations joined to `loc` by a line with no Firewall. +static func neighbors(s: Dictionary, loc: String) -> Array: + var out := [] + for l in GameMap.LINES_AT[loc]: + if is_open(s, l): + out.append(GameMap.other_end(l, loc)) + return out + + +static func adjacent(s: Dictionary, a: String, b: String) -> bool: + return neighbors(s, a).has(b) + + +# --------------------------------------------------------------------------------------------- +# Cards moving between zones + +## Clears play-time status when a card leaves play. +static func reset_card(s: Dictionary, id: int) -> void: + var c: Dictionary = s.cards[id] + c.disabledUntil = 0 + c.ignoredUntil = 0 + c.erase("wormTo") + c.erase("protects") + c.erase("copies") + c.erase("spent") + c.erase("pushedUntil") + + +static func to_discard(s: Dictionary, id: int) -> void: + reset_card(s, id) + s.players[owner_of(s, id)].discard.append(id) + + +static func to_hand(s: Dictionary, id: int) -> void: + reset_card(s, id) + s.players[owner_of(s, id)].hand.append(id) + + +static func remove_from(list: Array, id: int) -> bool: + var i := list.find(id) + if i < 0: + return false + list.remove_at(i) + return true + + +## Takes an installed Program off its location. Returns where it was, or null. +static func uninstall_program(s: Dictionary, id: int) -> Variant: + for loc in s.locations: + if remove_from(s.locations[loc].programs, id): + return loc + return null + + +static func uninstall_hardware(s: Dictionary, id: int) -> Variant: + var r = wearer_of(s, id) + if r != null: + remove_from(anomaly(s, r).hardware, id) + return r + + +static func program_location(s: Dictionary, id: int) -> Variant: + for loc in s.locations: + if s.locations[loc].programs.has(id): + return loc + return null + + +static func gain_bandwidth(s: Dictionary, p: int, n: int, key := "bandwidthFromEffects") -> void: + if n <= 0: + return + s.players[p].bandwidth += n + stat(s, key, p, n) + + +# --------------------------------------------------------------------------------------------- +# Tasks and choices + +## Queues tasks to run next, in the order given. +static func push_tasks(s: Dictionary, tasks: Array) -> void: + var queue: Array = s.tasks + for i in range(tasks.size() - 1, -1, -1): + queue.push_front(tasks[i]) + + +## Asks a player to choose. The game waits until they do. +static func ask(s: Dictionary, choice: Dictionary) -> void: + if s.choice != null: + Util.fail("Two choices at once: %s and %s" % [s.choice.kind, choice.kind]) + return + if choice.options.is_empty(): + Util.fail("Choice %s has no options" % choice.kind) + return + s.choice = choice + + +## Runs a script function after the current task, like a choice would. +static func later(card_name: String, fn: String, data: Variant = null) -> Dictionary: + return {"t": "call", "name": card_name, "fn": fn, "data": data} + + +static func _window(kind: String, priority: int, base: int) -> Dictionary: + return {"t": "window", "kind": kind, "priority": priority, "passes": 0, "base": base, "resolving": false} + + +static func start_combat(s: Dictionary, attacker: Dictionary, origin: String, loc: String, kind: String) -> Dictionary: + s.seq += 1 + var combat := { + "id": s.seq, + "loc": loc, + "attacker": attacker, + "origin": origin, + "defenders": defenders_at(s, loc), + "kind": kind, + "dice": {}, + "rolled": false, + "ended": false, + "suppressed": [], + "race": [null, null], + "ties": 0, + } + s.combat = combat + push_tasks(s, [ + {"t": "combat", "stage": "start"}, + _window("preRoll", attacker.player, s.stack.size()), + {"t": "combat", "stage": "roll"}, + _window("postRoll", attacker.player, s.stack.size()), + {"t": "combat", "stage": "result"}, + {"t": "combat", "stage": "end"}, + ]) + return combat + + +static func push_capture(s: Dictionary, r: Dictionary, loc: String, how: String) -> void: + push_tasks(s, [{"t": "capture", "ref": r, "loc": loc, "stage": "hooks", "how": how}]) + + +static func player_name(p: int) -> String: + return Types.PLAYER_NAMES[p] diff --git a/engine/state.gd.uid b/engine/state.gd.uid new file mode 100644 index 0000000..3e18a74 --- /dev/null +++ b/engine/state.gd.uid @@ -0,0 +1 @@ +uid://ctm5cbbm4d3bk diff --git a/engine/types.gd b/engine/types.gd new file mode 100644 index 0000000..851c1e1 --- /dev/null +++ b/engine/types.gd @@ -0,0 +1,47 @@ +class_name Types +## Constants from the TS engine's types.ts. +## +## The game state is plain Dictionaries and Arrays shaped exactly like the TS GameState's JSON, with +## the same keys (see godot-plan.md §3), so these are the only "types" the port needs. The shapes are +## documented in files-tcg/sim/src/types.ts. + +## 0 = South (starts on S1), 1 = North (starts on S2). +const PLAYER_NAMES: Array[String] = ["South", "North"] + +## Status timers count half-turns: the clock is 2T at the start of player-turn T and 2T + 1 at its +## end. A status with `until: n` is active while the clock is below n. +const FOREVER := 1000000000 + +const STAT_KEYS: Array[String] = [ + "capturesUnowned", + "capturesUndefended", + "capturesInCombat", + "attacks", + "attacksWon", + "combatsTied", + "damageDealt", + "anomaliesDestroyed", + "recalls", + "combatsEnded", + "firewallsPlaced", + "firewallsUpgraded", + "firewallsCleared", + "bandwidthFromCaptures", + "bandwidthFromSalvage", + "bandwidthFromEffects", + "bandwidthOnFirewalls", + "bandwidthOnCards", + "bandwidthOnAbilities", + "cardsSalvaged", + "cardsDrawn", + "hardwareInstalled", + "hardwareLost", + "programsInstalled", + "programsLost", + "executionsPlayed", + "abilitiesUsed", + "anomaliesRecruited", + "anomaliesRetired", + "anomaliesBought", + "bandwidthOnAnomalies", +] diff --git a/engine/types.gd.uid b/engine/types.gd.uid new file mode 100644 index 0000000..a79bb5f --- /dev/null +++ b/engine/types.gd.uid @@ -0,0 +1 @@ +uid://deyqnc662phe1 diff --git a/engine/util.gd b/engine/util.gd new file mode 100644 index 0000000..d40e8b8 --- /dev/null +++ b/engine/util.gd @@ -0,0 +1,109 @@ +class_name Util +## Helpers for the places where GDScript and TypeScript differ (godot-plan.md §3, "Porting +## hazards"): errors, stable sorting, ordered sets, floor division and JS-style formatting. + +## Engine errors so far. TS throws; GDScript has no exceptions, so failures are recorded here and +## pushed to the debugger, and tests check this is still empty. +static var errors: Array[String] = [] +## Set while the bot tries out a card on a copy of its view (GreedyBot simulate): failures are still +## recorded, so the bot can tell, but not pushed to the debugger. +static var quiet := false + +## Reports an engine error (where TS throws). Returns null so callers can `return Util.fail(...)`. +static func fail(msg: String) -> Variant: + if not quiet: + push_error(msg) + errors.append(msg) + return null + + +## A copy of `items` sorted by `key` (a Callable returning an int for an item), keeping the order of +## ties. TS's Array.sort is stable; sort_custom isn't. +static func sorted_by(items: Array, key: Callable) -> Array: + var keyed := [] + for i in items.size(): + keyed.append([key.call(items[i]), i, items[i]]) + keyed.sort_custom(func(a, b): return a[0] < b[0] or (a[0] == b[0] and a[1] < b[1])) + var out := [] + for k in keyed: + out.append(k[2]) + return out + + +## A copy of `items` sorted like TS's `[...items].sort(cmp)`: `cmp(a, b)` returns a number, negative +## when a goes first, and ties keep their order. +static func sorted_cmp(items: Array, cmp: Callable) -> Array: + var keyed := [] + for i in items.size(): + keyed.append([i, items[i]]) + keyed.sort_custom(func(a, b): + var c: float = cmp.call(a[1], b[1]) + return c < 0 or (c == 0 and a[0] < b[0])) + var out := [] + for k in keyed: + out.append(k[1]) + return out + + +## Distinct values in first-seen order, like [...new Set(items)]. +static func uniq(items: Array) -> Array: + var seen := {} + var out := [] + for x in items: + if not seen.has(x): + seen[x] = true + out.append(x) + return out + + +static func sum(items: Array) -> int: + var t := 0 + for x in items: + t += x + return t + + +## Floor division, like Math.floor(a / b). GDScript's int division truncates toward zero. +static func floordiv(a: int, b: int) -> int: + return (a - posmod(a, b)) / b + + +static func popcount(n: int) -> int: + var c := 0 + while n > 0: + c += n & 1 + n >>= 1 + return c + + +## A value as a JS template string shows it: null is "null", not "". +static func js(v: Variant) -> String: + if v == null: + return "null" + return str(v) + + +## Concatenates arrays into a new one, like [...a, ...b]. +static func concat(a: Array, b: Array) -> Array: + var out := a.duplicate() + out.append_array(b) + return out + + +## JSON numbers as ints. JSON.parse_string returns every number as a float, while the engine's state +## holds only ints; whole floats become ints, recursively. Use on traces, records and saves. +static func ints(v: Variant) -> Variant: + match typeof(v): + TYPE_FLOAT: + return int(v) if v == floorf(v) and absf(v) < 9.0e15 else v + TYPE_ARRAY: + var out := [] + for x in v: + out.append(ints(x)) + return out + TYPE_DICTIONARY: + var out := {} + for k in v: + out[k] = ints(v[k]) + return out + return v diff --git a/engine/util.gd.uid b/engine/util.gd.uid new file mode 100644 index 0000000..cb896cc --- /dev/null +++ b/engine/util.gd.uid @@ -0,0 +1 @@ +uid://ct6brxi508dhp diff --git a/godot-plan.md b/godot-plan.md new file mode 100644 index 0000000..df94e44 --- /dev/null +++ b/godot-plan.md @@ -0,0 +1,425 @@ +# Godot Plan: Files TCG as a 3D Tabletop Game + +_Prepared 2026-10-01 against rules v0.9, the simulator in `files-tcg/sim/` and the browser app in +`files-tcg/app/`._ + +This plan moves Files TCG from the browser app into Godot 4.7 as a 3D game played on a +physical-looking table. Decisions made so far: + +| Decision | Choice | +| --- | --- | +| Look | A physical tabletop: the playmat on a table, 3D cards, and dice that really roll | +| Rules engine | Ported to GDScript now, so the game runs without Node or a browser | +| Long term | Online PvP, a desktop release, a deck builder, and a tutorial and campaign | + +The work comes in milestones. M1–M5 reach what the browser app does today: one person plays the bot, +with every rule and card working. M6–M9 add the new goals. + +## 1. Starting Point + +**The TypeScript side.** `sim/` holds a deterministic rules engine, one script per card for all 83 +Set 1 cards, and the greedy bot. `app/` is a Preact layer over it. Its controller (`match.ts`) and +its click-to-act mapping (`moves.ts`) have no DOM code. This is what gets ported: + +| Part | TS files | Lines | +| --- | --- | --- | +| Core engine | `engine`, `flow`, `query`, `state`, `rules`, `map`, `rng`, `csv`, `cards`, `scripts`, `describe`, `invariants`, `deck`, `odds` | ~3,200 (plus ~370 of types) | +| Card scripts | `cards/*.ts` | ~1,950 | +| Bots | `bots/greedy`, `eval`, `random` | ~1,300 | +| Controller | `app/src/match`, `moves`, `replay` | ~600 | +| Tests (as fixtures, see §2) | `sim/test/*` | ~2,300 | + +**The Godot side.** `~/test` is an empty Godot 4.7.2 project named "Test". It uses Forward+ and Jolt +Physics, has no scenes or scripts yet, and isn't under version control. The installed Godot is the +standard build, so scripting is in GDScript. Export templates are installed. + +**Why the port is practical.** The engine was built in ways that carry straight over: + +- **The state is plain data.** That makes it easy to clone (undo, the bot, player views), save, + send over a network, and compare between the two engines. +- **The UI never builds a move.** It picks from `legalActions(s)`, and `applyAction(s, a)` runs the + game to the next decision. The 3D table works the same way, so no rules live in the table code. +- **Card prompts store what happens next as data** (`{ name, fn, data }`), not as closures. In + GDScript that becomes a `call()` on the card's script. +- **The RNG is seeded Mulberry32** and lives in the state, so a seed and a list of moves replay + exactly, in either engine. +- **`viewFor(s, p)` already hides the opponent's cards.** Online play needs exactly that. + +## 2. Two Engines + +Porting now means two copies of the rules while v0.9 is still changing. `rules.md` was last revised +on 2026-09-29, and the 52 Set 2 cards have no scripts yet. The plan handles that with one rule and +one tool. + +**The rule: TypeScript stays the reference until the rules freeze.** Rule and card changes happen in +the sim first, as they do now. There, a batch run of thousands of games is quick, and GDScript is +much slower at that. The change is then ported. When the rules freeze, decide whether GDScript +becomes the only engine (decision 2). + +**The tool: conformance traces.** + +- **A trace is a game record plus the engine state after every action.** A new `--trace ` + option on the sim CLI writes them for any bots, decks and rule variants. +- **A headless Godot runner** (`godot --headless --script res://tests/conformance.gd`) replays each + trace through the GDScript engine. It stops at the first difference and prints the action and + the field, for example `after attack 2→C2: players[1].anomalies[0].damage ts=4 gd=3`. +- **It also compares the legal actions** at every step (as sets), and checks that the GDScript + greedy bot picks the same move the TS one did. +- **The TS test `Table` gets a record mode**, so its rule and card tests also become fixtures: the + arranged state, the actions, and the expected state. +- **Browser app game records replay in Godot**, since the action keys are the same. Real playtests + become traces too. + +**How a rule change goes:** + +1. Make it in `sim/`, with tests and batch runs, as now. +2. Regenerate the traces. The Godot runner fails wherever the behaviour changed. +3. Port the change until the runner passes. + +Both engines keep the card-text check, so a reworded card in `cards.csv` flags the TS script and the +GDScript one. + +## 3. Architecture + +``` +files-tcg/godot/ res:// (see decision 1) + data/ cards.csv, decks/*.json, exported card faces (synced from the repo, see M0) + engine/ the GDScript port: types, rng, csv, cards, map, rules, state, query, flow, + engine, describe, invariants, deck, odds, scripts + cards/ servers, programs, hardware, executions, anomalies, util + bots/ greedy, eval, random + match/ controller: match, moves, replay, records, scenarios + table/ 3D: table, camera rig, playmat, card, piles, tokens, firewall, dice, hand + present/ event queue that turns engine events into animations + ui/ 2D: HUD, prompts, card inspector, panels, menus, deck builder + tests/ conformance runner, fixtures, unit tests +``` + +**`engine/` and `match/` use no nodes or scenes.** They're plain `RefCounted` classes and static +functions, so they run headless: in tests, on a worker thread for the bot, and later on a PvP +server. + +### State + +**The state is Dictionaries and Arrays shaped exactly like the TS state's JSON**, with the same +keys. A deep copy is one native `duplicate(true)`, which is quick enough for undo, bot lookahead and +player views. Saving and sending it is free. It compares field by field with TS traces. And the port +stays close to line-by-line, which matters most while both engines are maintained. The cost is +that field names aren't checked when scripts are parsed. The conformance runner and debug-build +invariant checks cover that. Typed classes are the alternative (decision 3). + +### Porting hazards + +Where TS and GDScript differ in ways that break determinism quietly: + +| In TypeScript | In GDScript | Do this | +| --- | --- | --- | +| `Array.sort` is stable | `sort_custom` isn't | Use a stable sort helper (index as tiebreak). There are 18 sorts, and several have ties: defender order in `flow.ts` and the bot's move ranking. | +| `/` always gives a float | `int / int` truncates | `Math.ceil(x / 2)` (RAID Array) becomes `ceili(x / 2.0)` | +| Mulberry32 uses 32-bit `Math.imul` and `>>> 0` | ints are 64-bit | Mask with `& 0xFFFFFFFF`, and test the first 10,000 values against TS | +| `[]` is truthy | an empty Array is falsy | Port every `if (x)` on an array or string deliberately | +| Closures can reassign outer `let`s | lambdas capture locals by value | Hold that state in an Array or Dictionary | +| `??` and `?.` | not available | Write explicit null checks | +| `JSON.parse` keeps ints | `JSON.parse_string` returns every number as a float | Normalize ints when loading traces and records; use `var_to_bytes` for Godot saves | +| `` `${5}` `` is `5` | `str(5.0)` is `5.0` | Keep ints as ints, or log lines and action keys drift | + +### Events for animation + +One `applyAction` can draw a card, run a combat, capture a location and fire triggers before the +next decision. The table has to show that as a sequence. The GDScript engine therefore adds +`s.events`, a list of structured events: drew, moved card, placed, combat started, rolled, rerolled, +damaged, destroyed, captured, Firewall changed, Bandwidth changed, and counter changed. Most zone +changes already go through helpers in `state.ts` (`toHand`, `toDiscard`, `gainBandwidth` and so on), +so events are emitted in a handful of places. They're filtered per player like the log +(`events_for(s, p)`), and they stay out of conformance, because TS doesn't have them. + +The presenter plays them in order, then snaps the table to `view_for(s, you)`. A missed or +mis-drawn animation therefore never leaves the table showing the wrong state. + +### Seams for later + +- **A `MatchController` interface**: `view()`, `legal_moves()` and `act(move)`, plus `events` and + `changed` signals. M2 builds `LocalMatch`, with the engine in-process and the bot on a worker + thread. M8 adds `RemoteMatch` with the same interface, so the table doesn't change for PvP. +- **Scenarios.** The port of the TS `Table` helper (arranged boards, rigged dice) serves the card + fixtures in M3 and the tutorial in M7. + +## 4. The 3D Table + +| Piece | What it is | +| --- | --- | +| Table and camera | A seat view angled over your side, a zoom onto a location, and a top-down view on a key for reading the board | +| Playmat | Generated from `map.gd` like `layout.ts`, so the 4×4 and lane boards work too. Locations, gateways, starts and row levels are drawn on it, and each location and gateway can be clicked. | +| Cards | One `Card3D` scene: a thin box with front and back materials, moving between zones (deck, hand, Server pile, discard, location, worn) | +| Card faces | The exported card images, which match print, with one texture per card. Each card name gets one face material made from a shared base and cached, so copies share it. See Card rendering below. | +| Anomalies | Their card on the location, with Hardware tucked under it and a damage dial. Copies get a marker. | +| Counters and status | Infection and Bug tokens, disabled shown as a card turned sideways, a rooted marker, and +1/−1 Core chips for temporary changes | +| Firewalls | Wall pieces on gateways, taller for each level | +| Piles | Deck, Server pile and discard as stacks sized by count. Discards can be browsed. | +| Bandwidth | A counter on the table, mirrored in the HUD | +| Hands | Yours fanned in front of the camera, the bot's face down across the table | + +**Card rendering.** The table, playmat and card assets already exist, and the faces are exported +from the Cider templates. The models are 20× real size (1 unit is 5 cm): a card is 1.27 × 1.778 +units, and the playmat a 36 × 30 in mat. Dice physics will need gravity scaled to match. + +- **One `Card3D` scene for every card.** Its mesh has two surfaces: the face, and the back with + the edges. Every card shares one back material. +- **One face material per card name**, made from the card shader the first time it's needed and + cached by the static `CardFaces` class (`table/card_faces.gd`). Two copies of a card share it. Per-instance shader + uniforms can't hold textures, which is why the face needs its own material. +- **Per-card state goes in `instance uniform`s** (highlight, dimming a disabled card), so it never + duplicates a material. Counters, the damage dial and markers are separate small meshes, so faces + stay static and shared. +- **A face is only assigned while you can see it.** The bot's hand and face-down cards use the + back only, which matches what `view_for` reveals. +- **Piles are one stack mesh sized by count.** A `Card3D` is spawned when a card leaves the pile, + so a match has about 50–80 live cards, not 138. +- **Quality comes from the import settings, not the layout.** Turn mipmaps on, use VRAM Compressed + with High Quality (BC7 on desktop), and use anisotropic filtering at 16×. The 750×1050 print + size is fine: Godot pads it to 752×1052 for compression without resampling. Faces loaded from + code skip Godot's "used in 3D" auto-detection, so each face's `.import` file sets those + settings. `tools/name_card_faces.py` writes them, and renames the export's `front-NNNN.png` + files to card names (they come out in `cards.csv` row order). +- **No atlas.** An atlas needs padding against mipmap bleed, hits the 16384 px limit, and has to be + loaded whole. A `Texture2DArray` with a layer index per instance is the upgrade path if + profiling ever asks for one material across all cards. + +**Acting works as it does in the app.** Pick a source, its targets glow (teal for moves, red for +attacks), and click one. `moves.gd` ports `moves.ts` unchanged. Every clickable 3D object +registers under the same keys (`hand:`, `anomaly::`, `loc:`, +`gate:`), so click-to-act maps straight across. A small menu covers several moves on one +target, and an action bar holds End, Pass and prompts. Dragging from the hand can come later. + +**Anything with text is 2D.** Hovering a card shows it large (right-click pins it), and the combat +panel, log, info, move list and prompts are all 2D. The 3D table shows where things are; the 2D +layer is for reading. + +**Dice show the engine's numbers.** The engine rolls; the table only acts it out. A tool script +records a few dozen settled throws with Jolt in the editor. At runtime each die plays one of them, +with its mesh rotated so the face that lands up shows the engine's number. The same approach covers +rerolls (Bit Flip), dice added or removed after the roll when Cores change, and the 3+ Bug counter +rule. If baked throws don't look good, the fallback is a tumbling tween. This gets a spike in M4. + +**Pacing.** A game asks each player about 367 decisions and opens about 43 response windows in the +bot's commands. The stops setting and step skipping from `match.ts` carry over. Animation speed +gets a setting that includes instant, and a click skips the current animation. + +## 5. Milestones + +### M0. Setup + +- Move the project into `files-tcg/godot/` (decision 1), put it under git, and rename it "Files + TCG". +- Add a sync script that copies `cards.csv`, the deck presets and the exported card faces into + `godot/data/`. The conformance runner fails if the copies are stale. +- Import the table, playmat and card assets, with the card-face import settings from §4. +- Set up the folder layout, the headless runner, and a test addon (GUT or gdUnit4) for unit tests. + +**Done when** `godot --headless` runs an empty conformance suite. + +### M1. Core engine + +- Port in dependency order: `rng`, `csv`, `cards`, `map`, `rules`, `state`, `query`, the script + registry, `flow`, `engine`, `describe`, `invariants`, `deck`, `odds`. Then the random bot. +- In TS, add `--trace`, plus a way to deal random decks from a limited card list. +- Stage A traces use the `Table` helper's small decks (a plain Server, a filler Hardware and four + Anomalies). Only a few card scripts are needed to check the turn loop, combat, captures, + Firewalls and Bandwidth. + +**Done when** the RNG matches TS and 1,000 random-vs-random Stage A traces replay with no +difference. + +### M2. Table vertical slice + +- The table, built with your existing assets: the playmat placed to match the map, `Card3D` with + the exported faces, clicking, the hand, the camera, the action bar and prompts, and the hover + inspector. +- `LocalMatch` with the random bot. The table snaps to the view after every action, with no + animation yet. + +**Done when** you can play a whole Stage A game against the random bot by clicking, and a port of +the app's "every legal move can be reached by clicking" test passes against the 3D table. + +This tests the biggest design unknown, whether a 3D table reads well, early. The card port carries +on alongside it. + +### M3. Every card and the greedy bot + +- Port the card scripts in groups: Servers, Hardware, Programs, Executions, Anomalies. Each group's + traces deal decks from the cards ported so far (with `deck.maxCopies` raised). +- Add record mode to the TS `Table` helper and run its tests as fixtures. +- Port the greedy bot, `eval` and the bot styles. Check bot conformance, measure its speed (the TS + bot's slowest move is 1.3 ms; expect GDScript to be one to two orders of magnitude slower), and + run it on the `WorkerThreadPool`. + +**Done when** traces show no difference for random, greedy and nocards bots on full Set 1 decks, +for every `Table` fixture, and for a sample of browser app records. + +### M4. Presentation + +- Events in the engine, and the presenter queue. +- Card movement, Anomaly unlock flips, Firewall placement and counters. +- Combat staging: the camera moves in, the attacker slides up, dice land in the tray, totals show, + and damage turns the dials. Captures flip the Server and send Programs to the discard. +- An openly licensed font for the 2D UI (Consolas can't be shipped). +- The dice spike, then baked throws. +- A first pass at sound, and a lighting and material pass on the table and playmat. + +### M5. Browser app parity + +- Port the rest of `match.ts`: stops, skipping empty steps, End command, held-key stops, undo in + playtest mode, and invariant checks. +- Port `replay.ts`. Game records import and export in the app's format. Save and resume. +- Add the 2D panels: combat (Cores by source, odds, dice), info, log with filters, and the move list. +- A start screen with side, seed, decks, bot style and rule variants, and a settings screen. + +**Done when** everything under "Playing" in `app/README.md` works. The browser app can then be +retired, or kept as a playtest tool (decision 4). + +### M6. Deck builder + +- Browse the collection by type, set and cost. +- A deck editor that runs `validate_deck` as you build. +- Import and export the app's deck JSON and pasted lists. The presets come from `decks/*.json`. + Decks are saved in `user://`. +- Collection limits and unlocks only if the campaign wants them. + +### M7. Tutorial and campaign + +- **A scenario format**: an arranged board (from the `Table` port), rigged dice, scripted bot moves, + and guided prompts that limit which moves are offered. The tutorial follows `QUICKSTART.md`. +- **The campaign**: a run of bot opponents built from `GreedyParams` presets and fixed decks. Wins + can unlock cards for the deck builder. + +### M8. Online PvP + +- **One machine holds the real game.** It sends each player `view_for` and `events_for`, and + accepts action keys only if they're in `legal_actions`. Hidden cards mean clients can't each run + the full game themselves. This uses Godot's high-level multiplayer over ENet or WebSocket. +- `RemoteMatch` implements `MatchController`. +- **Response windows** get a timer. Stops run on the client. The engine already skips windows where + a player has nothing they could play. +- **Reconnecting** resends the current view. A game record lets the host rebuild a game. +- Who hosts is decision 5. + +### M9. Desktop release + +- Export presets for Linux, Windows and macOS. Steam via GodotSteam, or itch via butler. +- Settings for resolution, audio and animation speed, plus the app's color-blind-safe owner colors. +- Check the rights to the card art and fonts, and check the game name and card terms (the + 2026-09-30 renames were made for this reason). +- Store assets. Bug reports attach the game record. + +**Order.** M2 can start once M1's Stage A works, then M2, M3 and M4 interleave. M6 and M7 don't +depend on M8, so a single-player release (M9 after M7) can ship before PvP. + +## 6. Sizes + +| Milestone | Size | Main work | +| --- | --- | --- | +| M0 Setup | S | Repo, sync, runner | +| M1 Core engine | L | ~3,200 lines ported, trace tooling | +| M2 Vertical slice | L | Table, cards, clicking, hand, camera | +| M3 Cards and bot | XL | ~1,950 lines of card scripts, ~1,300 of bot, fixtures | +| M4 Presentation | L | Events, animation, card faces, dice, art, sound | +| M5 Parity | M | ~600 lines of controller, panels, screens | +| M6 Deck builder | M | | +| M7 Tutorial and campaign | M–L | Scenario system, content | +| M8 Online PvP | L | Networking, timers, hosting | +| M9 Release | M | Exports, store, rights | + +The sizes are relative. M1 shows how fast TypeScript ports to GDScript, so firm them up after it. + +## 7. Risks + +- **The engines drift apart.** Card readings marked ⚠ in `rules.md` will change, and Set 2 is + unscripted. Traces and the card-text check catch drift, but every rule change costs a port until + the freeze. +- **Quiet porting differences.** The table in §3 covers the known ones. The runner reports the + first differing field, so each one takes minutes to find, not days. +- **Bot speed in GDScript.** If greedy is too slow even on a thread, profile `eval` first, since it + holds most of the combat math. +- **3D readability.** Thirteen locations full of cards, counters and Firewalls can get cluttered. + M2 tests this before any art is made, and the top-down view and 2D inspector are the fallbacks. +- **Pacing.** Animations multiply the cost of hundreds of decisions per game. Stops, skipping and + an instant setting are in from the start. +- **Card faces go stale.** Faces are exported from the Cider templates, so a card edit in + `cards.csv` needs a re-export. The sync script keeps a hash of each card's CSV row and flags any + face exported before the row last changed. +- **Scope.** Each long-term goal is a project on its own. The order in §5 lets the single-player + game ship first. + +## 8. Open Decisions for the Owner + +1. **Repo.** Move this project into `files-tcg/godot/`, so the cards, art, reference engine and + traces share one commit history? Recommended. +2. **After the freeze.** Retire the TS engine, with batch runs moving to headless Godot, or keep TS + for balance runs and maintain both? +3. **State shape.** Dictionaries shaped like the TS JSON (recommended, see §3), or typed classes, + which add field checking and autocomplete at the cost of hand-written clone and serialize code + and a harder trace comparison? +4. **The browser app after M5.** Retire it, or keep it for quick playtests and replays? +5. **PvP hosting.** One player hosts (cheap, but the host's machine holds the hidden cards), or a + dedicated headless server? +6. **Set 2.** Write its scripts in TS first, as now, or only in GDScript once the port is done? + +## 9. First Steps + +1. Settle decision 1, then do M0: git, the move, the sync script, the headless runner. +2. Add `--trace` to the sim and generate Stage A traces. +3. Port `rng` and check its output against TS, then `csv`, `cards`, `map` and `rules`. +4. Port `state`, `query`, `flow` and `engine` until Stage A traces pass. +5. Start the table with your existing assets as soon as the engine can run a Stage A game. + +## 10. Progress + +**2026-10-01: the rules engine and every Set 1 card script are ported** (M1, plus M3's card port). + +- **`res://engine/`** mirrors `sim/src/` file for file: `rng`, `csv`, `cards`, `map` (`GameMap`), + `rules`, `state`, `query`, `scripts` (`CardScripts`), `flow`, `engine` (`RulesEngine`, since + `Engine` is a Godot singleton), `describe`, `invariants`, `deck`, `odds`, `play`, `types`, `util`, + `cards/*` and `bots/random`. The state is TS-shaped Dictionaries (decision 3 as recommended). +- **Traces.** `sim/src/trace.ts` is a new file in the sim (the CLI is untouched). + `tools/make_traces.sh` writes 1,000 random-vs-random games with every card under the main rules, + and 100 more that also check the move-list labels. `res://tests/conformance.gd` replays them. +- **Result.** All 1,100 games match TS at every step: 1.68 M steps, each comparing the legal actions + in order, the state, the log, the decider's view, the random bot's pick and (for the 100) the + labels, with invariants checked too. The RNG check covers 10,000 values for 4 seeds. +- **Speed.** A random game takes about 0.44 s in GDScript and 17 ms in TS, about 26× slower. +- **Data.** `tools/sync_data.py` copies `cards.csv` into `data/`. The runner refuses traces made + from a different CSV. +- **Not ported yet:** the `Table` test helper and its fixtures (M3), and engine events for + animation (M4). + +**2026-10-01: the greedy bot is ported and the game is playable** (M2, plus M3's bot port). + +- **The bot.** `engine/bots/eval.gd` (`BotEval`) and `greedy.gd` (`GreedyBot`, with the app's bot + styles in `GreedyBot.STYLES`) port `eval.ts` and `greedy.ts`. `Play.bots()` has `greedy` and + `nocards`. `tools/make_traces.sh` takes set names and adds three greedy sets. +- **Bot conformance.** The bot picks the same move as TS at every step of 850 games, about + 331,000 steps: greedy vs greedy, greedy vs random, random vs greedy, and nocards vs greedy. + `main` and `labels` still match after the change. +- **Bot speed** (`tests/bot_speed.gd`). A `choose()` takes 0.63 ms on average and 6.8 ms at the 99th + percentile; the slowest seen was 17 ms, in a post-roll combat-trick window. That's 0.4 s of bot + time per game. The game runs it on a `WorkerThreadPool` thread. While it thinks, nothing changes the + match and the main thread doesn't call `Odds`, whose caches fill without locks. +- **The controller.** `match/local_match.gd` (`LocalMatch`) ports the core of `match.ts`: the + stops setting, skipping empty steps, End command, held-Shift stops and the combat readout. Undo, + records and replays are still M5. `match/moves.gd` ports `moves.ts` unchanged. +- **The table.** `table/game_table.gd` builds the playmat from `GameMap`, laid out by + `table/board_layout.gd`. It draws the location tiles (`tile.gdshader`, tinted by owner), lines, + gateways and Firewall walls, and puts every visible card in place as a `Card3D` that slides to its + spot. Each player's Anomaly slots and piles sit beside their start, and the bot's hand lies past + the far edge. Your hand is held in front of the camera. Readouts like Cores and Health are 2D + tags pinned to the table. The camera fits the mat between the panels, in a seat view or a + top-down one. +- **The HUD and game.** `ui/hud.gd` holds the panels, the action bar, the source and response menu, + the choice dialog, the inspector, the Log, Combat and Moves tabs, and the new-game, settings and + game-over dialogs. `scenes/game.tscn` is the main scene and ties them together. +- **The M2 test** (`tests/table_smoke.gd`). Whole games through the game scene, a random player + against the greedy bot. Before each of your decisions it checks that every legal move has a screen + spot, clear of the panels, where a raycast click hits its source, and another for its target. + Every move was reachable in 50 games across both seats, at 16:9 and square screens, with the + bot on its thread or not. +- **Fonts.** The 2D text and tags use the system's DejaVu fonts for now; the release font is M4. diff --git a/icon.svg b/icon.svg new file mode 100644 index 0000000..c6bbb7d --- /dev/null +++ b/icon.svg @@ -0,0 +1 @@ + diff --git a/icon.svg.import b/icon.svg.import new file mode 100644 index 0000000..6b2eeeb --- /dev/null +++ b/icon.svg.import @@ -0,0 +1,43 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d257ffddlidy4" +path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://icon.svg" +dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/match/local_match.gd b/match/local_match.gd new file mode 100644 index 0000000..04e5b9e --- /dev/null +++ b/match/local_match.gd @@ -0,0 +1,339 @@ +class_name LocalMatch +extends RefCounted +## The game controller for one person against the bot, in-process (app/src/match.ts). It holds the +## real state and runs the bot. The table only ever sees view() and picks moves from legal(). +## Everything here is plain GDScript with no nodes, so tests can drive it headlessly. +## +## The bot's move is split in two so the table can run the thinking on a worker thread: +## bot_think() only reads the state, bot_apply() changes it. bot_step() does both. + +signal changed + +## When the game waits for you to respond to the bot: "combat" (in combat only), "all" or "never". +const STOPS: Array[String] = ["combat", "all", "never"] +const DEFAULT_OPTIONS := {"autoSkip": true, "stops": "combat", "checkInvariants": false} + +var pool: Dictionary +## {seed, human, decks: [deck, deck], rules: ["K=V", ...], bot: GreedyParams-shaped Dictionary} +var setup: Dictionary +var rules: Dictionary +var human: int +var bot_side: int +var s: Dictionary +## Every action applied so far, as action keys (yours, the bot's and the automatic ones). +var actions: Array[String] = [] +var options: Dictionary +## Invariant errors found, when checking is on. +var errors: Array[String] = [] +## Set while a key is held: stop at the next response window whatever the stops setting says. +var hold_stop := false +## Every combat so far, the current or latest last. See _snap_combat for the shape. +var combats: Array = [] +## Bumped on every change, so the table knows when to redraw. +var version := 0 + +var bot: Object +## End command: the game turn being ended, or -1. +var _ending := -1 +var _view_cache := {"version": -1, "view": {}} +var _legal_cache := {"version": -1, "legal": []} +var _log_cache := {"version": -1, "lines": []} + + +## `bot` picks the bot's moves (a GreedyBot, RandomBot or anything with choose(view, actions, me)). +func _init(card_pool: Dictionary, match_setup: Dictionary, the_bot: Object, opts := {}) -> void: + pool = card_pool + setup = match_setup + rules = rules_from(setup.get("rules", [])) + human = setup.human + bot_side = State.other(human) + options = DEFAULT_OPTIONS.duplicate() + options.merge(opts, true) + bot = the_bot + s = RulesEngine.create_game({"pool": pool, "decks": setup.decks, "seed": setup.seed, "rules": rules, "log": true}) + _settle() + + +## The rules from `K=V` overrides on the defaults. +static func rules_from(specs: Array) -> Dictionary: + var r := Rules.defaults() + for spec in specs: + if spec.strip_edges() != "": + r = Rules.with_rule(r, spec.strip_edges()) + return r + + +## Random legal decks for both players, seeded like the sim's playGame. +static func random_decks(card_pool: Dictionary, seed: int, match_rules: Dictionary) -> Array: + return Play.deal(card_pool, seed, match_rules) + + +# --------------------------------------------------------------------------------------------- +# Reading + +func is_over() -> bool: + return s.over + + +func decider() -> Variant: + return RulesEngine.decider(s) + + +func human_to_act() -> bool: + return RulesEngine.decider(s) == human + + +func bot_to_act() -> bool: + return RulesEngine.decider(s) == bot_side + + +## What the human may see. Read-only. +func view() -> Dictionary: + if _view_cache.version != version: + _view_cache = {"version": version, "view": RulesEngine.view_for(s, human)} + return _view_cache.view + + +## Your legal moves, or none while the bot decides. +func legal() -> Array: + if not human_to_act(): + return [] + if _legal_cache.version != version: + _legal_cache = {"version": version, "legal": RulesEngine.legal_actions(s)} + return _legal_cache.legal + + +## The play-by-play as you may read it. +func log_text() -> Array: + return State.log_for(s, human) + + +## Log lines with their tags, with private text swapped for what you may read. Read-only. +func log_lines() -> Array: + if _log_cache.version == version: + return _log_cache.lines + var text := log_text() + var out := [] + var lines: Array = s.log if s.log != null else [] + for i in lines.size(): + var l: Dictionary = lines[i].duplicate() + l.text = text[i] + l.erase("to") + l.erase("public") + out.append(l) + _log_cache = {"version": version, "lines": out} + return out + + +## The current or latest combat, or null. +func combat() -> Variant: + return combats.back() if not combats.is_empty() else null + + +func record() -> Dictionary: + return {"version": 1, "setup": setup, "actions": actions.duplicate()} + + +func ending_command() -> bool: + return _ending >= 0 + + +# --------------------------------------------------------------------------------------------- +# Acting + +## Your move. It must be one of legal(). +func act(a: Dictionary) -> void: + if not human_to_act(): + Util.fail("It isn't your decision") + return + _ending = -1 + _apply(a, legal()) + _settle() + _changed() + + +## Ends steps until your command is over. Stops if a prompt or response window comes up for you. +func end_command() -> void: + if not human_to_act() or s.choice != null or RulesEngine.open_window(s) != null: + return + _ending = s.turn + _settle() + _changed() + + +## The bot's next move, without making it. Only reads the state, so it can run on a thread while +## nothing else changes the match. +func bot_think() -> Dictionary: + var lgl := RulesEngine.legal_actions(s) + var a: Dictionary = bot.choose(RulesEngine.view_for(s, bot_side), lgl, bot_side) + return {"action": a, "legal": lgl} + + +## Makes a move from bot_think(), if it's still the bot's decision. +func bot_apply(thought: Dictionary) -> bool: + if not bot_to_act(): + return false + _apply(thought.action, thought.legal) + _settle() + _changed() + return true + + +## One bot move, if it's the bot's decision. Returns whether it moved. +func bot_step() -> bool: + if not bot_to_act(): + return false + return bot_apply(bot_think()) + + +## Runs the bot until you must decide or the game ends. For tests and instant bot speed. +func run_bot(limit := 100000) -> void: + var n := 0 + while bot_to_act(): + n += 1 + if n > limit: + Util.fail("The bot made %d moves in a row" % limit) + return + bot_step() + + +func set_options(o: Dictionary) -> void: + options.merge(o, true) + _settle() + _changed() + + +## Re-checks automatic moves, e.g. after a held key is released. +func poke() -> void: + var before := actions.size() + _settle() + if actions.size() != before: + _changed() + + +func _changed() -> void: + version += 1 + changed.emit() + + +func _apply(a: Dictionary, lgl: Array) -> void: + Flow.combat_watch = _watch + RulesEngine.apply_action(s, a, lgl) + Flow.combat_watch = Callable() + actions.append(RulesEngine.action_key(a)) + version += 1 + if options.checkInvariants: + for e in Invariants.check(s): + errors.append("Move %d (%s), turn %d: %s" % [actions.size(), RulesEngine.action_key(a), s.turn, e]) + var last = combat() + if last != null and not last.done: + # A capture in combat can win the game before the combat's end stage. + if s.over: + last.stage = "end" + last.done = true + elif s.combat != null and s.combat.id == last.id: + combats[-1] = _snap_combat(last.stage) + + +## Makes the moves the settings make for you: skipping empty steps, passing, End command. +func _settle() -> void: + var guard := 0 + while human_to_act(): + guard += 1 + if guard > 10000: + Util.fail("The automatic moves are stuck in a loop") + return + var auto = _automatic() + if auto == null: + break + _apply(auto, legal()) + if _ending >= 0 and (s.over or s.turn != _ending): + _ending = -1 + + +## The move the settings make for you now, if any. +func _automatic() -> Variant: + if s.choice != null: + _ending = -1 + return null + var lgl := legal() + var w = RulesEngine.open_window(s) + if w != null: + if _passes_for(w.kind): + return _find(lgl, "pass") + _ending = -1 + return null + if _ending >= 0: + if s.turn == _ending: + return _find(lgl, "end") + _ending = -1 + if options.autoSkip and lgl.all(func(a): return a.type == "end" or a.type == "salvage"): + return _find(lgl, "end") + return null + + +static func _find(lgl: Array, type: String) -> Variant: + for a in lgl: + if a.type == type: + return a + return null + + +## Whether the stops setting passes this response window for you. +func _passes_for(kind: String) -> bool: + if hold_stop: + return false + match options.stops: + "all": + return false + "never": + return true + # In combat only: the bot's Executions, Abilities, installs and declarations outside combat pass. + return kind == "response" and not (s.combat != null and not s.combat.ended) + + +func _watch(_s: Dictionary, stage: String) -> void: + var c: Dictionary = s.combat + var last = combat() + if stage == "start" or last == null or last.id != c.id: + var info := _snap_combat(stage) + info.logFrom = maxi(0, (s.log.size() if s.log != null else 1) - 1) + combats.append(info) + return + # After the damage, keep the Cores and dice from the result: the fighters may be gone by now. + if stage == "end": + last.ended = c.ended + last.stage = stage + last.done = true + else: + combats[-1] = _snap_combat(stage) + + +## The current combat as the readout shows it: {id, loc, kind, attacker, defenders, rolled, ended, +## stage, done, logFrom}, where a fighter is {ref, cores, parts, dice, health, healthLeft}. Call only +## while there is a combat. +func _snap_combat(stage: String) -> Dictionary: + var c: Dictionary = s.combat + var last = combat() + var prev = last if last != null and last.id == c.id else null + var info := func(r: Dictionary) -> Dictionary: + var parts := [] + var cores := Query.cores_of(s, Query.fighter_of(s, r), Callable(), parts) + var in_play := State.anomaly(s, r).at != null + return { + "ref": r, "cores": cores, "parts": parts, "dice": c.dice.get(State.ref_key(r), []).duplicate(), + "health": Query.health_of(s, r) if in_play else 0, "healthLeft": Query.health_left(s, r) if in_play else 0, + } + var defenders := [] + for d in c.defenders: + defenders.append(info.call(d)) + # Defenders who left keep their last numbers, so the readout still shows who was there. + if prev != null: + for d in prev.defenders: + if not c.defenders.any(func(x): return State.same_ref(x, d.ref)): + defenders.append(d) + return { + "id": c.id, "loc": c.loc, "kind": c.kind, "attacker": info.call(c.attacker), "defenders": defenders, + "rolled": c.rolled, "ended": c.ended, "stage": stage, "done": false, + "logFrom": prev.logFrom if prev != null else maxi(0, (s.log.size() if s.log != null else 1) - 1), + } diff --git a/match/local_match.gd.uid b/match/local_match.gd.uid new file mode 100644 index 0000000..0a99833 --- /dev/null +++ b/match/local_match.gd.uid @@ -0,0 +1 @@ +uid://dqd0wfs2yhvau diff --git a/match/moves.gd b/match/moves.gd new file mode 100644 index 0000000..abf08c4 --- /dev/null +++ b/match/moves.gd @@ -0,0 +1,140 @@ +class_name Moves +## Turns the legal actions into moves the table can show (app/src/moves.ts): a label, a cost, a +## group for the move list, and for click-to-act a source (what you pick first) and a target (what +## you click to play it). The table never builds an action; it only filters and labels the +## engine's list. +## +## Keys for things on the table: +## - `hand:` a card in your hand +## - `anomaly::` an Anomaly (on the board, or in its slot when it isn't in play) +## - `loc:` a location +## - `gate:` a gateway between two locations +## - `none` no target: the move is listed on its source's menu +## - `bar` the action bar (End, Pass, choices) + +const GROUP_ORDER: Array[String] = ["Turn", "Place and move", "Advance", "Attack", "Hardware", "Program", "Execution", "Ability", "Recruit", "Anomalies", "Firewalls", "Salvage"] + +static var _ref_re := RegEx.create_from_string("^anomaly:(\\d):(\\d)$") + + +static func anomaly_key(r: Dictionary) -> String: + return "anomaly:%d:%d" % [r.player, r.slot] + + +static func loc_key(loc: String) -> String: + return "loc:" + loc + + +static func gate_key(line: String) -> String: + return "gate:" + line + + +static func hand_key(card_name: String) -> String: + return "hand:" + card_name + + +## An Anomaly ref from an `anomaly:` key, or null. +static func ref_of_key(key: String) -> Variant: + var m := _ref_re.search(key) + return State.ref(int(m.get_string(1)), int(m.get_string(2))) if m != null else null + + +## Where a card on the board is: its location, or its wearer. +static func _card_spot(s: Dictionary, id: int) -> String: + var loc = State.program_location(s, id) + if loc != null: + return loc_key(loc) + var r = State.wearer_of(s, id) + if r != null: + return anomaly_key(r) + return "none" + + +static func _source_and_target(s: Dictionary, a: Dictionary, me: int) -> Array: + match a.type: + "end", "pass", "choose": + return ["bar", "none", "Turn"] + "place", "advance", "attack": + var group := "Attack" if a.type == "attack" else "Advance" if a.type == "advance" else "Place and move" + return [anomaly_key(State.ref(me, a.slot)), loc_key(a.to), group] + "recall": + return [anomaly_key(State.ref(me, a.slot)), "none", "Place and move"] + "clearFirewall", "firewall": + return [gate_key(a.line), "none", "Firewalls"] + "salvage": + return [hand_key(State.name_of(s, a.card)), "none", "Salvage"] + "installHardware": + return [hand_key(State.name_of(s, a.card)), anomaly_key(State.ref(me, a.slot)), "Hardware: " + State.name_of(s, a.card)] + "recruit": + return [hand_key(State.name_of(s, a.card)), anomaly_key(State.ref(me, a.slot)), "Recruit: " + State.name_of(s, a.card)] + "buyAnomaly": + return [anomaly_key(State.ref(me, a.slot)), "none", "Anomalies"] + "installProgram": + return [hand_key(State.name_of(s, a.card)), loc_key(a.at), "Program: " + State.name_of(s, a.card)] + "play": + # Executions target a Server; with no target, the Anomaly or card they name. + var target := "none" + if a.target: + target = loc_key(a.target) + elif a.args.get("ref") != null: + target = anomaly_key(a.args.ref) + elif a.args.get("card") != null: + target = _card_spot(s, a.args.card) + return [hand_key(State.name_of(s, a.card)), target, "Execution: " + State.name_of(s, a.card)] + "activate": + var src = RulesEngine.ability_source(s, a.card, a.name) + var source := "none" + if src != null and src.get("ref") != null: + source = anomaly_key(src.ref) + elif src != null and src.get("at"): + source = loc_key(src.at) + var target := "none" + if a.args.get("to"): + target = loc_key(a.args.to) + elif a.args.get("ref") != null: + target = anomaly_key(a.args.ref) + elif a.args.get("card") != null: + target = _card_spot(s, a.args.card) + var d := State.def_of(s, a.card) + var ability_name: String = d.ability.name if src != null and src.kind == "anomaly" and d.has("ability") else a.name + # A target that is the source itself (a card on the same Anomaly) is listed on the source's menu. + return [source, "none" if target == source else target, "Ability: " + ability_name] + return ["none", "none", "Other"] + + +## The legal actions as moves, with duplicate labels (interchangeable copies of a card) dropped. +## A move is {action, key, label, cost, group, source, target}. +static func moves_of(s: Dictionary, legal: Array, me: int) -> Array: + var seen := {} + var out := [] + for a in legal: + var label := Describe.describe_action(s, a) + if seen.has(label): + continue + seen[label] = true + var st := _source_and_target(s, a, me) + out.append({"action": a, "key": RulesEngine.action_key(a), "label": label, "cost": RulesEngine.action_cost(s, a), + "source": st[0], "target": st[1], "group": st[2]}) + return out + + +static func _group_rank(g: String) -> int: + var i := GROUP_ORDER.find(g.split(":")[0]) + return GROUP_ORDER.size() if i < 0 else i + + +## Moves grouped for the move list, in a steady order: an Array of [group, moves]. +static func group_moves(moves: Array) -> Array: + var groups := {} + for m in moves: + if not groups.has(m.group): + groups[m.group] = [] + groups[m.group].append(m) + var out := [] + for g in groups: + out.append([g, groups[g]]) + out.sort_custom(func(x, y): + var rx := _group_rank(x[0]) + var ry := _group_rank(y[0]) + return rx < ry or (rx == ry and x[0] < y[0])) + return out diff --git a/match/moves.gd.uid b/match/moves.gd.uid new file mode 100644 index 0000000..fe81c6c --- /dev/null +++ b/match/moves.gd.uid @@ -0,0 +1 @@ +uid://drttefx21d4c diff --git a/node_3d.tscn b/node_3d.tscn new file mode 100644 index 0000000..53c15db --- /dev/null +++ b/node_3d.tscn @@ -0,0 +1,10 @@ +[gd_scene format=3 uid="uid://cvyw43rbl3tnc"] + +[sub_resource type="BoxMesh" id="BoxMesh_cog68"] +size = Vector3(6.239807, 1, 5.4589233) + +[node name="Node3D" type="Node3D" unique_id=574481969] + +[node name="MeshInstance3D" type="MeshInstance3D" parent="." unique_id=762611390] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.11294556, 0, -0.08407593) +mesh = SubResource("BoxMesh_cog68") diff --git a/project.godot b/project.godot new file mode 100644 index 0000000..a0cec0c --- /dev/null +++ b/project.godot @@ -0,0 +1,31 @@ +; Engine configuration file. +; It's best edited using the editor UI and not directly, +; since the parameters that go here are not all obvious. +; +; Format: +; [section] ; section goes between [] +; param=value ; assign values to parameters + +config_version=5 + +[application] + +config/name="Files TCG" +run/main_scene="res://scenes/game.tscn" +config/features=PackedStringArray("4.7", "Forward Plus") +config/icon="res://icon.svg" + +[display] + +window/size/viewport_width=1600 +window/size/viewport_height=900 +window/stretch/mode="canvas_items" +window/stretch/aspect="expand" + +[physics] + +3d/physics_engine="Jolt Physics" + +[rendering] + +rendering_device/driver.windows="d3d12" diff --git a/scenes/game.gd b/scenes/game.gd new file mode 100644 index 0000000..5273a53 --- /dev/null +++ b/scenes/game.gd @@ -0,0 +1,398 @@ +extends Node +## One game against the bot: the LocalMatch, the 3D table and the HUD, and the click-to-act logic +## between them (app/src/ui/game.tsx). You pick a source (a card in hand, an Anomaly, a gateway, a +## location) and then one of its glowing targets; the Moves tab lists everything else. +## +## The bot thinks on a WorkerThreadPool thread. While it does, nothing changes the match, the +## table only reads it, and nothing here calls Odds, whose caches the bot fills without locks +## (see _thinking()). + +var pool: Dictionary +var match_: LocalMatch +var table: GameTable +var hud: Hud +var settings := {"stops": "combat", "autoSkip": true, "checkInvariants": false, "botDelay": 0.45} + +## The picked source key, or "". +var selected := "" +var moves: Array = [] +var _moves_version := -1 +var _bot_task := -1 +var _bot_thought := {} +var _bot_wait := 0.0 +var _paused := false +var _hover_seen := {} +var _combat_seen := 0 +## Log lines already turned into table pop-ups. +var _log_seen := 0 + + +func _ready() -> void: + pool = Cards.load_cards() + table = GameTable.new() + add_child(table) + hud = Hud.new() + add_child(hud) + hud.set_settings(settings) + hud.move_chosen.connect(_play) + hud.source_picked.connect(func(key): _select(key)) + hud.cancel_pressed.connect(_cancel) + hud.end_command_pressed.connect(_end_command) + hud.view_toggled.connect(func(): table.toggle_view()) + hud.new_game_requested.connect(start_game) + hud.settings_changed.connect(_on_settings) + var args := OS.get_cmdline_user_args() + var seed := randi_range(1, 999999) + var i := args.find("--seed") + if i >= 0 and i + 1 < args.size(): + seed = int(args[i + 1]) + start_game({"seed": seed, "human": 0, "style": "greedy"}) + if args.find("--seed") < 0: + hud.show_start({"seed": seed, "cancel": true}) + + +## Starts a game from {seed, human, style}. +func start_game(opts: Dictionary) -> void: + _join_bot() + var rules := LocalMatch.rules_from([]) + var style: String = opts.get("style", "greedy") + var params: Dictionary = GreedyBot.STYLES[style].params + var setup := { + "seed": opts.seed, "human": opts.get("human", 0), "decks": LocalMatch.random_decks(pool, opts.seed, rules), + "rules": [], "bot": params, "style": style, + } + match_ = LocalMatch.new(pool, setup, GreedyBot.new(params), {"stops": settings.stops, "autoSkip": settings.autoSkip, "checkInvariants": settings.checkInvariants}) + match_.changed.connect(_on_changed) + selected = "" + _moves_version = -1 + _combat_seen = 0 + _bot_wait = 0.0 + _log_seen = match_.log_lines().size() + hud.reset_for_new_game() + table.set_seat(match_.human, true) + _on_changed() + + +func _on_settings(s: Dictionary) -> void: + settings = s + if match_ != null and _bot_task < 0: + match_.set_options({"stops": s.stops, "autoSkip": s.autoSkip, "checkInvariants": s.checkInvariants}) + + +# --------------------------------------------------------------------------------------------- +# The bot + +func _process(delta: float) -> void: + if match_ == null: + return + if _bot_task >= 0: + if WorkerThreadPool.is_task_completed(_bot_task): + WorkerThreadPool.wait_for_task_completion(_bot_task) + _bot_task = -1 + _bot_wait = 0.0 + match_.bot_apply(_bot_thought) + elif not _paused and not match_.is_over() and match_.bot_to_act() and not hud.modal_open(): + _bot_wait += delta + if _bot_wait >= settings.botDelay: + var m := match_ + _bot_task = WorkerThreadPool.add_task(func(): _bot_thought = m.bot_think(), false, "bot") + if table.hovered != _hover_seen: + _hover_seen = table.hovered.duplicate() + _inspect(_hover_seen) + _refresh() + + +## Waits for a bot move in progress and drops it (for a new game). +func _join_bot() -> void: + if _bot_task >= 0: + WorkerThreadPool.wait_for_task_completion(_bot_task) + _bot_task = -1 + + +func _thinking() -> bool: + return _bot_task >= 0 + + +# --------------------------------------------------------------------------------------------- +# Drawing + +func _on_changed() -> void: + if _moves_version != match_.version: + _moves_version = match_.version + moves = Moves.moves_of(match_.view(), match_.legal(), match_.human) + # Drop a selection that no longer has moves. + if selected != "" and not moves.any(func(mv): return mv.source == selected): + selected = "" + hud.hide_popover() + var c = match_.combat() + if c != null and c.id != _combat_seen: + _combat_seen = c.id + hud.show_combat_tab() + _refresh() + _pop_new_lines() + + +## Shows what the newest log lines did on the table: damage, roll results, captures. Several from +## one move come one after another; after a long run of moves at once, only the last few show. +func _pop_new_lines() -> void: + var lines := match_.log_lines() + var pops := [] + for i in range(_log_seen, lines.size()): + var l: Dictionary = lines[i] + var loc = l.get("loc") + if loc == null or not BoardLayout.at.has(loc): + continue + var at: Vector3 = BoardLayout.at[loc] + var p = l.get("player") + var color: Color = GameTable.OWNER_COLORS[p].lightened(0.3) if p != null else Color("#d7dee6") + if l.get("ref") != null and l.get("amount") != null: + pops.append(func(delay): table.pop_damage(l.ref, l.amount, l.text.contains("destroyed"), loc, delay)) + elif l.get("tag") == "capture" and l.text.contains(" captures "): + pops.append(func(delay): + table.flash_capture(loc, p) + table.pop_text(at, "%s takes %s" % [State.player_name(p), loc], color, delay)) + elif l.get("tag") == "combat" and l.text.contains(" wins the roll"): + var t := _roll_score(l.text) + pops.append(func(delay): table.pop_text(at, "%s wins %s" % [State.player_name(p), t], color, delay)) + elif l.get("tag") == "combat" and l.text.begins_with("Tie,"): + pops.append(func(delay): table.pop_text(at, "Stalemate", color, delay)) + elif l.get("tag") == "combat" and l.text.contains(" ends: "): + pops.append(func(delay): table.pop_text(at, "Combat ends", Color("#ffb454"), delay)) + _log_seen = lines.size() + pops = pops.slice(maxi(0, pops.size() - 5)) + for i in pops.size(): + pops[i].call(i * 0.45) + + +static var _roll_re := RegEx.create_from_string("wins the roll, (\\d+) to (\\d+)") + + +## "14–7" from "North wins the roll, 7 to 14: 7 damage.", the winner's total first. +static func _roll_score(text: String) -> String: + var m := _roll_re.search(text) + if m == null: + return "" + var a := int(m.get_string(1)) + var b := int(m.get_string(2)) + return "%d–%d" % [maxi(a, b), mini(a, b)] + + +func _refresh() -> void: + var v := match_.view() + var marks := _marks(v) + table.sync(v, marks) + hud.refresh({"match": match_, "view": v, "moves": moves, "selected": selected, "marks": marks, + "thinking": _thinking(), "paused": _paused, "preview": _preview(v)}) + + +## How each key glows: the combat, your sources, and the selected source's targets. +func _marks(v: Dictionary) -> Dictionary: + var marks := {} + var c = match_.combat() + if c != null and not c.done: + marks[Moves.loc_key(c.loc)] = "fight" + var my_choice: bool = match_.human_to_act() and v.choice != null + if my_choice: + return marks + var in_window: bool = match_.human_to_act() and RulesEngine.open_window(v) != null + # Salvage is always there, so only other moves make a card glow. + for mv in moves: + if mv.source != "bar" and mv.source != "none" and mv.action.type != "salvage": + marks[mv.source] = "respond" if in_window else "source" + if selected != "": + marks[selected] = "selected" + for mv in moves: + if mv.source == selected and mv.target != "none": + marks[mv.target] = "attack" if mv.action.type == "attack" else "target" + return marks + + +## The odds of the attack you'd make by clicking the hovered location. +func _preview(v: Dictionary) -> String: + if selected == "" or _thinking() or _hover_seen.is_empty(): + return "" + for mv in moves: + if mv.source == selected and mv.target == _hover_seen.key and mv.action.type == "attack": + var me := match_.human + var from = State.anomaly(v, State.ref(me, mv.action.slot)).at + var to: String = mv.action.to + var atk := RulesEngine.anomaly_cores(v, me, mv.action.slot, "attack", from, to) + var def := 0 + for r in State.anomalies_at(v, to): + def += RulesEngine.anomaly_cores(v, r.player, r.slot, "defend", to, to) + var o := Odds.roll_odds(atk, def) + return "%d vs %d Cores: win %d%%, tie %d%%, lose %d%%. Average damage %.1f dealt, %.1f taken." % [ + atk, def, roundi(o.win * 100), roundi(o.tie * 100), roundi(o.lose * 100), o.damageDealt, o.damageTaken] + return "" + + +func _inspect(h: Dictionary) -> void: + if h.is_empty(): + return + var v := match_.view() + var key: String = h.key + var card: String = h.card + var text := "" + var r = Moves.ref_of_key(key) + if r != null: + var av := State.anomaly(v, r) + if card == "" and av.card >= 0 and State.anomaly(v, State.original_of(r)).faceUp: + card = State.name_of(v, av.card) + # The card pointed at (the Anomaly, or Hardware it wears), then the Anomaly's state. + text = _anomaly_info(v, r) + if card != "": + text = _card_info(v, card) + "\n\n" + text + elif key.begins_with("loc:"): + var loc := key.substr(4) + if card == "": + var server = v.locations[loc].server + card = State.name_of(v, server) if server != null else "" + text = (_card_info(v, card) + "\n\n" if card != "" else "") + _location_info(v, loc) + elif key.begins_with("gate:"): + var line := key.substr(5) + var level: int = v.firewalls.get(line, 0) + text = "[b]Gateway %s[/b]\n" % Describe.line_name(line) + text += "A Lv %d Firewall blocks this line. Clearing it costs %d Gb." % [level, State.firewall_cost(v, level)] if level else "Open: no Firewall." + elif card != "": + text = _card_info(v, card) + elif key.begins_with("pile:"): + var parts := key.split(":") + var pl: Dictionary = v.players[int(parts[1])] + text = "[b]%s's %s[/b]\n%d cards in hand, %d in the deck, %d Servers in the pile, %d in the discard pile." % [ + State.player_name(int(parts[1])), parts[2], pl.hand.size(), pl.deck.size(), pl.serverPile.size(), pl.discard.size()] + hud.inspect({"art": card, "text": text}) + + +static func _card_info(v: Dictionary, card: String) -> String: + var d: Dictionary = v.defs.get(card, {}) + if d.is_empty(): + return "[b]%s[/b]" % card + var out := "[b]%s[/b]\n[color=#7d8a97]%s%s · %d Gb[/color]" % [d.name, d.kind.capitalize(), " (%s)" % d.type if d.type != "" else "", d.bandwidth] + if d.kind == "anomaly": + out += "\n%d Cores · %d Health · %d Expansion Slots" % [d.cores, d.health, d.slots] + if d.text != "": + out += "\n" + d.text + if d.has("ability"): + out += "\n[b]%s[/b]%s: %s" % [d.ability.name, " (%d Gb)" % d.ability.cost if d.ability.cost else "", d.ability.text] + return out + + +static func _anomaly_info(v: Dictionary, r: Dictionary) -> String: + var av := State.anomaly(v, r) + var out := "[b]%s[/b]" % Describe.ref_name(v, r, null) + out += "\n%s" % ("on %s" % av.at if av.at != null else "in its slot") + var badge := GameTable.badge_text(v, r) + if badge != "": + out += " · " + badge + if not av.hardware.is_empty(): + out += "\nHardware: " + ", ".join(av.hardware.map(func(h): return State.name_of(v, h))) + return out + + +static func _location_info(v: Dictionary, loc: String) -> String: + var L: Dictionary = v.locations[loc] + var out := "[b]%s[/b]" % loc + if L.owner == null: + out += " · open" + else: + out += " · held by %s" % State.player_name(L.owner) + if not GameMap.is_start(loc): + out += " · Lv %d for South, Lv %d for North" % [GameMap.level_for(0, loc), GameMap.level_for(1, loc)] + if not L.programs.is_empty(): + out += "\nPrograms: " + ", ".join(L.programs.map(func(id): return State.name_of(v, id))) + var here := State.anomalies_at(v, loc) + if not here.is_empty(): + out += "\nAnomalies: " + ", ".join(here.map(func(x): return Describe.ref_name(v, x, null))) + return out + + +# --------------------------------------------------------------------------------------------- +# Acting + +func _play(mv: Dictionary) -> void: + selected = "" + hud.hide_popover() + if match_.human_to_act() and match_.legal().has(mv.action): + match_.act(mv.action) + else: + _refresh() + + +func _select(key: String) -> void: + selected = key if moves.any(func(mv): return mv.source == key) else "" + _refresh() + + +func _cancel() -> void: + selected = "" + hud.hide_popover() + _refresh() + + +func _end_command() -> void: + selected = "" + match_.end_command() + + +func _pick(key: String, at: Vector2) -> void: + if hud.popover_open(): + hud.hide_popover() + return + var v := match_.view() + if match_.human_to_act() and v.choice != null: + return + if selected != "": + var hits := moves.filter(func(mv): return mv.source == selected and mv.target == key) + if hits.size() == 1: + _play(hits[0]) + return + if hits.size() > 1: + hud.show_popover(hits, at) + return + if key == selected: + _cancel() + return + _select(key) + + +func _unhandled_input(e: InputEvent) -> void: + if match_ == null: + return + if e is InputEventMouseButton and e.pressed: + if e.button_index == MOUSE_BUTTON_LEFT: + _pick(table.hovered.get("key", "none"), e.position) + elif e.button_index == MOUSE_BUTTON_RIGHT: + _cancel() + elif e.button_index == MOUSE_BUTTON_WHEEL_UP: + table.zoom(0.92) + elif e.button_index == MOUSE_BUTTON_WHEEL_DOWN: + table.zoom(1.08) + elif e is InputEventKey: + if e.keycode == KEY_SHIFT: + match_.hold_stop = e.pressed + if not e.pressed and _bot_task < 0: + match_.poke() + return + if not e.pressed or e.echo: + return + match e.keycode: + KEY_ESCAPE: + if hud.modal_open() and match_.view().choice == null and not match_.is_over(): + hud.close_modal() + _cancel() + KEY_SPACE: + var v := match_.view() + if v.choice == null and not hud.modal_open(): + for t in ["pass", "end"]: + var hit := moves.filter(func(mv): return mv.action.type == t) + if not hit.is_empty(): + _play(hit[0]) + break + KEY_ENTER, KEY_KP_ENTER: + if not hud.modal_open(): + _end_command() + KEY_T: + table.toggle_view() + KEY_P: + _paused = not _paused + _refresh() diff --git a/scenes/game.gd.uid b/scenes/game.gd.uid new file mode 100644 index 0000000..147df4b --- /dev/null +++ b/scenes/game.gd.uid @@ -0,0 +1 @@ +uid://cfv7h7j58adlm diff --git a/scenes/game.tscn b/scenes/game.tscn new file mode 100644 index 0000000..42e67ef --- /dev/null +++ b/scenes/game.tscn @@ -0,0 +1,6 @@ +[gd_scene format=3] + +[ext_resource type="Script" path="res://scenes/game.gd" id="1_game"] + +[node name="Game" type="Node"] +script = ExtResource("1_game") diff --git a/table/board_layout.gd b/table/board_layout.gd new file mode 100644 index 0000000..a45074c --- /dev/null +++ b/table/board_layout.gd @@ -0,0 +1,91 @@ +class_name BoardLayout +## Where things sit on the table, in world units (1 unit is 5 cm, see godot-plan.md §4). Worked out +## from the current board's rows like app/src/layout.ts: a row is the letter of a location id, the +## starts sit beyond the first and last rows, and each row is centred. South's side is +z and +## North's is -z; the camera sits on your side, so the world never turns around. + +## The playmat (assets/playmat.glb): 36 × 30 in, its top face at y = 0. +const MAT_SIZE := Vector2(18.288, 15.24) +const CARD_SIZE := Vector2(1.27, 1.778) +## Height of a card lying on the mat, and between stacked cards. +const CARD_Y := 0.006 +const LAYER := 0.0105 +## Gap between card centres side by side. +const CARD_STEP := 1.36 + +static var at: Dictionary = {} +static var row_pitch := 0.0 +static var col_pitch := 0.0 +static var tile_size := Vector2.ZERO +static var _built_for := "" + + +## Recomputes the positions for GameMap's current board, if it changed. +static func update() -> void: + var key := ",".join(GameMap.LOCATIONS) + if key == _built_for: + return + _built_for = key + var rows := [] + for loc in GameMap.GRID: + if not rows.has(loc[0]): + rows.append(loc[0]) + rows.sort() + var widest := 0 + for r in rows: + widest = maxi(widest, GameMap.GRID.filter(func(l): return l[0] == r).size()) + row_pitch = MAT_SIZE.y / (rows.size() + 2) + col_pitch = minf(6.0, (MAT_SIZE.x - 0.5) / widest) + tile_size = Vector2(col_pitch - 0.4, row_pitch - 0.12) + at = {} + var row_z := func(i: int) -> float: return (rows.size() + 1) * row_pitch / 2.0 - i * row_pitch + for i in rows.size(): + var locs: Array = GameMap.GRID.filter(func(l): return l[0] == rows[i]) + locs.sort_custom(func(a, b): return int(a.substr(1)) < int(b.substr(1))) + for j in locs.size(): + at[locs[j]] = Vector3((j - (locs.size() - 1) / 2.0) * col_pitch, 0, row_z.call(i + 1)) + at[GameMap.START_LOC[0]] = Vector3(0, 0, row_z.call(0)) + at[GameMap.START_LOC[1]] = Vector3(0, 0, row_z.call(rows.size() + 1)) + + +## Midpoint of a line between two locations. +static func line_mid(line: Dictionary) -> Vector3: + return (at[line.a] + at[line.b]) / 2.0 + + +## A location's Server card, at the tile's left end as seen from South. +static func server_spot(loc: String) -> Vector3: + return at[loc] + Vector3(-tile_size.x / 2 + CARD_SIZE.x / 2 + 0.08, CARD_Y, 0) + + +## Programs overlap in a short row at the tile's right end, the newest on top. +static func program_spot(loc: String, i: int, n: int) -> Vector3: + var right: float = at[loc].x + tile_size.x / 2 - CARD_SIZE.x / 2 - 0.08 + var step := 0.42 + return Vector3(right - (n - 1 - i) * step, CARD_Y + i * LAYER, at[loc].z) + + +## A player's Anomaly slots, deck, Server pile and discard, on the mat beside their start: the +## slots to its left (slot 4 nearest), the piles to its right, as the owner sees them. North's +## mirror South's through the centre. The bot's hand lies face down past the far edge of the mat. +static func zone_spot(p: int, zone: String, slot := 0) -> Vector3: + var row_z: float = at[GameMap.START_LOC[0]].z + var inner := tile_size.x / 2 + 0.2 + CARD_SIZE.x / 2 + var spot := Vector3.ZERO + match zone: + "slot": + spot = Vector3(-(inner + (4 - slot) * CARD_STEP), CARD_Y, row_z) + "deck": + spot = Vector3(inner, 0, row_z) + "serverPile": + spot = Vector3(inner + CARD_STEP, 0, row_z) + "discard": + spot = Vector3(inner + 2 * CARD_STEP, 0, row_z) + "hand": + spot = Vector3(0, CARD_Y, MAT_SIZE.y / 2 + CARD_SIZE.y / 2 + 0.6) + return spot if p == 0 else Vector3(-spot.x, spot.y, -spot.z) + + +## Yaw so a card reads the right way up for player p (North's cards face North). +static func yaw_for(p: int) -> float: + return 0.0 if p == 0 else PI diff --git a/table/board_layout.gd.uid b/table/board_layout.gd.uid new file mode 100644 index 0000000..bf7b572 --- /dev/null +++ b/table/board_layout.gd.uid @@ -0,0 +1 @@ +uid://cef3u18hxw1yy diff --git a/table/card.gdshader b/table/card.gdshader new file mode 100644 index 0000000..40dbcc9 --- /dev/null +++ b/table/card.gdshader @@ -0,0 +1,40 @@ +shader_type spatial; + +// Every surface of a card: its face, its back and its edge. CardFaces makes one material per card +// face and shares one back and one edge material between all cards. What changes per card on the +// table (highlight, dimming) is an instance uniform, so it never needs a material of its own. + +uniform sampler2D albedo_texture : source_color, hint_default_white, filter_linear_mipmap_anisotropic, repeat_disable; +uniform vec4 albedo_color : source_color = vec4(1.0); +uniform float roughness : hint_range(0.0, 1.0) = 0.55; +// card.glb's UVs run along the card's length instead of its width: Blender turns the image a +// quarter turn in its material, and Godot drops that on import. swap_uv turns them back, and +// mirror_u flips the back, which is seen from the other side. See CardFaces.FIX_GLB_UVS. +uniform bool swap_uv = false; +uniform bool mirror_u = false; +// Faces and backs glow mostly at their border; the edge glows all over. +uniform bool rim_glow = true; + +// rgb is the color, a the strength. +instance uniform vec4 highlight : source_color = vec4(0.0); +// 0 is normal, 1 dark gray: disabled Hardware and Programs. +instance uniform float dim = 0.0; + +void fragment() { + vec2 uv = swap_uv ? vec2(UV.y, 1.0 - UV.x) : UV; + if (mirror_u) { + uv.x = 1.0 - uv.x; + } + vec3 color = texture(albedo_texture, uv).rgb * albedo_color.rgb; + vec3 gray = vec3(dot(color, vec3(0.299, 0.587, 0.114))); + ALBEDO = mix(color, gray * 0.45, dim); + ROUGHNESS = roughness; + SPECULAR = 0.35; + + float glow = 1.0; + if (rim_glow) { + float border = min(min(uv.x, 1.0 - uv.x), min(uv.y, 1.0 - uv.y)); + glow = mix(0.12, 1.6, 1.0 - smoothstep(0.0, 0.07, border)); + } + EMISSION = highlight.rgb * highlight.a * glow; +} diff --git a/table/card.gdshader.uid b/table/card.gdshader.uid new file mode 100644 index 0000000..17b27db --- /dev/null +++ b/table/card.gdshader.uid @@ -0,0 +1 @@ +uid://bbo6i23801c3c diff --git a/table/card_3d.gd b/table/card_3d.gd new file mode 100644 index 0000000..7e89dff --- /dev/null +++ b/table/card_3d.gd @@ -0,0 +1,123 @@ +@tool +class_name Card3D +extends Node3D +## A card on the table. Every card uses this one scene: showing a different card only swaps the +## face material, which CardFaces shares between all copies of that card. The origin is the +## card's center, so it flips and turns in place. + +## Surfaces of the card mesh in assets/card.glb. +const FACE := 0 +const BACK := 1 +const EDGE := 2 +## Half the card's thickness: a card at this height lies on the table. +const REST_HEIGHT := 0.005 +## Seconds a card takes to slide to a new spot. +const GLIDE_TIME := 0.28 + +## Every card jumps instead of sliding (for tests). +static var instant := false + +## The card's name, as in cards.csv. Leave it empty for a card you can't see, such as one in the +## bot's hand: both sides then show the back. +@export var card_name := "": + set(value): + if value == card_name and _mesh != null: + return + card_name = value + _apply_materials() + +## Face up or face down: a half turn around the card's long axis. +@export var face_up := true: + set(value): + face_up = value + rotation.z = 0.0 if value else PI + +## Glow for legal targets and selections. Alpha is the strength; 0 is off. +@export var highlight := Color(0, 0, 0, 0): + set(value): + if value == highlight: + return + highlight = value + _apply_uniforms() + +## Grays the card out, for disabled Hardware and Programs. 0 is normal, 1 dark gray. +@export_range(0.0, 1.0) var dim := 0.0: + set(value): + if value == dim: + return + dim = value + _apply_uniforms() + +## What clicking or hovering this card means to the table, e.g. "loc:C2" or "hand:Hotfix" (see +## Moves). Empty: not clickable. +var pick_key := "": + set(value): + pick_key = value + if _body != null: + _body.set_meta("key", value) + _body.input_ray_pickable = value != "" + _body.collision_layer = 1 if value != "" else 0 + +var _mesh: MeshInstance3D +var _body: StaticBody3D +var _tween: Tween +## Where the last glide was headed, so an unchanged target doesn't restart it. +var _goal := Transform3D() +var _goal_set := false + + +func _ready() -> void: + _mesh = $Model.find_children("*", "MeshInstance3D")[0] + _apply_materials() + _apply_uniforms() + if not Engine.is_editor_hint(): + _body = StaticBody3D.new() + var shape := CollisionShape3D.new() + var box := BoxShape3D.new() + box.size = Vector3(1.27, 0.02, 1.778) + shape.shape = box + _body.add_child(shape) + _body.set_meta("card", self) + add_child(_body) + pick_key = pick_key + + +## Whether the card casts shadows. Off for cards held up to the camera. +func set_shadows(on: bool) -> void: + if _mesh != null: + _mesh.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_ON if on else GeometryInstance3D.SHADOW_CASTING_SETTING_OFF + + +## Whether the card has been sent anywhere yet (a new card has no spot until its first glide). +func has_goal() -> bool: + return _goal_set + + +## Slides the card to `xf` (in its parent's space), or jumps there when `instant`. +func glide(xf: Transform3D, instant := false) -> void: + if _goal_set and _goal.is_equal_approx(xf): + return + _goal = xf + _goal_set = true + if _tween != null: + _tween.kill() + if instant or Card3D.instant or not is_inside_tree(): + transform = xf + return + _tween = create_tween().set_trans(Tween.TRANS_CUBIC).set_ease(Tween.EASE_OUT) + _tween.tween_property(self, "transform", xf, GLIDE_TIME) + + +func _apply_materials() -> void: + if _mesh == null: + return + _mesh.set_surface_override_material(FACE, CardFaces.face(card_name)) + _mesh.set_surface_override_material(BACK, CardFaces.back()) + _mesh.set_surface_override_material(EDGE, CardFaces.edge()) + + +func _apply_uniforms() -> void: + if _mesh == null: + return + _mesh.set_instance_shader_parameter("highlight", highlight) + _mesh.set_instance_shader_parameter("dim", dim) diff --git a/table/card_3d.gd.uid b/table/card_3d.gd.uid new file mode 100644 index 0000000..9ea9bfc --- /dev/null +++ b/table/card_3d.gd.uid @@ -0,0 +1 @@ +uid://b47t4cmjjxcg1 diff --git a/table/card_3d.tscn b/table/card_3d.tscn new file mode 100644 index 0000000..31a88e3 --- /dev/null +++ b/table/card_3d.tscn @@ -0,0 +1,9 @@ +[gd_scene format=3] + +[ext_resource type="Script" path="res://table/card_3d.gd" id="1_script"] +[ext_resource type="PackedScene" uid="uid://clev2vv7vrkql" path="res://assets/card.glb" id="2_model"] + +[node name="Card3D" type="Node3D"] +script = ExtResource("1_script") + +[node name="Model" parent="." instance=ExtResource("2_model")] diff --git a/table/card_faces.gd b/table/card_faces.gd new file mode 100644 index 0000000..e259e9c --- /dev/null +++ b/table/card_faces.gd @@ -0,0 +1,65 @@ +@tool +class_name CardFaces +## Card materials, made on first use and shared. Each card name gets one face material, so every +## copy of a card uses the same one, and all cards share one back and one edge material. +## +## A card's face is res://assets/cards/.png. The slug is the name in lowercase with each run +## of other characters turned into "-": "Carbon NanoBots" is carbon-nanobots, and "Execute: Force +## Reboot" is execute-force-reboot. Faces need the import settings in godot-plan.md §4 (VRAM +## Compressed, High Quality, mipmaps); copy the .import file of an existing face. + +const CARD_DIR := "res://assets/cards/" +const BACK_TEXTURE := CARD_DIR + "card-back.png" +const SHADER := preload("res://table/card.gdshader") +## Edge color, from card.glb's CardBase material. +const EDGE_COLOR := Color(0.051, 0.049, 0.055) +## card.glb's face and back UVs are a quarter turn out (see card.gdshader). Set this to false +## once they're fixed in Blender. +const FIX_GLB_UVS := true + +static var _faces: Dictionary[String, ShaderMaterial] = {} +static var _back: ShaderMaterial +static var _edge: ShaderMaterial +static var _slug_re := RegEx.create_from_string("[^a-z0-9]+") + + +static func slug(card_name: String) -> String: + return _slug_re.sub(card_name.to_lower(), "-", true).lstrip("-").rstrip("-") + + +## The face material for a card. A card you can't see ("") and a card with no face image yet +## show the back. +static func face(card_name: String) -> ShaderMaterial: + if card_name.is_empty(): + return back() + if not _faces.has(card_name): + var path := CARD_DIR + slug(card_name) + ".png" + if ResourceLoader.exists(path): + _faces[card_name] = _material(load(path), false) + else: + push_warning("No card face for %s at %s" % [card_name, path]) + _faces[card_name] = back() + return _faces[card_name] + + +static func back() -> ShaderMaterial: + if _back == null: + _back = _material(load(BACK_TEXTURE), true) + return _back + + +static func edge() -> ShaderMaterial: + if _edge == null: + _edge = _material(null, false) + _edge.set_shader_parameter("albedo_color", EDGE_COLOR) + _edge.set_shader_parameter("rim_glow", false) + return _edge + + +static func _material(texture: Texture2D, is_back: bool) -> ShaderMaterial: + var m := ShaderMaterial.new() + m.shader = SHADER + m.set_shader_parameter("albedo_texture", texture) + m.set_shader_parameter("swap_uv", FIX_GLB_UVS) + m.set_shader_parameter("mirror_u", FIX_GLB_UVS and is_back) + return m diff --git a/table/card_faces.gd.uid b/table/card_faces.gd.uid new file mode 100644 index 0000000..61be0cc --- /dev/null +++ b/table/card_faces.gd.uid @@ -0,0 +1 @@ +uid://dmgdlkbkythwm diff --git a/table/game_table.gd b/table/game_table.gd new file mode 100644 index 0000000..6eab22a --- /dev/null +++ b/table/game_table.gd @@ -0,0 +1,900 @@ +class_name GameTable +extends Node3D +## The 3D table: the playmat with its locations, lines, gateways and Firewalls, and every card you +## can see (godot-plan.md §4). sync() snaps it to a player view, so no rule lives here. Clicking +## and hovering report the same keys as Moves (`loc:C2`, `anomaly:0:1`, `hand:Hotfix`, `gate:A2-B1`). + +const CARD_SCENE := preload("res://table/card_3d.tscn") +const PLAYMAT_SCENE := preload("res://table/playmat.tscn") +const TILE_SHADER := preload("res://table/tile.gdshader") + +## Okabe–Ito sky blue and orange, as in the browser app: they stay apart for color-blind players. +const OWNER_COLORS: Array[Color] = [Color("#56b4e9"), Color("#e69f00")] +const MARK_COLORS := { + "source": Color("#2de2c4"), "respond": Color("#ffb454"), "selected": Color("#ffffff"), + "target": Color("#2de2c4"), "attack": Color("#ff5c7a"), "fight": Color("#ff5c7a"), +} +const MARK_STRENGTH := {"source": 1.0, "respond": 1.2, "selected": 2.0, "target": 1.5, "attack": 1.8, "fight": 1.2} +const FIREWALL_COLORS: Array[Color] = [Color("#ffb454"), Color("#ff7a45"), Color("#ff3d3d")] + +## Your hand, held in front of the camera: distance and how much of a card shows at the bottom. +const HAND_DISTANCE := 9.0 +const HAND_SHOWN := 0.62 +## Screen space the 2D panels cover, in pixels at the 1600 × 900 base size. The camera fits the +## mat into what's left. +const PANEL_LEFT := 300.0 +const PANEL_RIGHT := 345.0 +const PANEL_TOP := 48.0 +const PANEL_BOTTOM := 150.0 +## Hardware peeks out from under its wearer by this much each. +const HARDWARE_PEEK := 0.3 +const PROGRAM_STEP := 0.42 +const BOT_HAND_SHOWN := 14 +## Seconds a pop-up stays, and a capture pulse lasts. +const POP_TIME := 2.2 +const FLASH_TIME := 1.4 +## Pop-ups showing at once; a new one past this drops the oldest. +const MAX_POPS := 6 + +var camera: Camera3D +## The player sitting at the table (whose hand is held up, whose side the camera is on). +var me := 0 +## "seat" (angled over your side) or "top" (straight down). +var view_mode := "seat" +## What the mouse is over: {key, card} (card is the card name for the inspector, or ""), or {}. +var hovered := {} + +var _hand_root: Node3D +var _board: Node3D +var _cards_root: Node3D +var _tile_material: ShaderMaterial +var _tiles := {} +var _gates := {} +var _lines := {} +var _cards := {} +var _piles := {} +var _hover_body: Object = null +## Your hand's cards in hand order. +var _hand_order: Array[Card3D] = [] +var _zoom := 1.0 +var _cam_tween: Tween +var _view: Dictionary = {} +var _font: SystemFont +var _tag_font: SystemFont +var _overlay: Control +## 2D readouts pinned to points on the table: key → {box, label, world, used}. +var _tags := {} +## Pop-ups rising from the table (damage, roll results): {label, world, born}. +var _pops: Array = [] +## Tiles pulsing after a capture: location → {color, born}. +var _flashes := {} +var _last_marks := {} + + +func _ready() -> void: + _font = SystemFont.new() + _font.font_names = PackedStringArray(["DejaVu Sans", "Noto Sans", "sans-serif"]) + _tag_font = SystemFont.new() + _tag_font.font_names = PackedStringArray(["DejaVu Sans Mono", "Adwaita Mono", "monospace"]) + _build_room() + var layer := CanvasLayer.new() + layer.layer = 0 + add_child(layer) + _overlay = Control.new() + _overlay.set_anchors_preset(Control.PRESET_FULL_RECT) + _overlay.mouse_filter = Control.MOUSE_FILTER_IGNORE + layer.add_child(_overlay) + _board = Node3D.new() + _board.name = "Board" + add_child(_board) + _cards_root = Node3D.new() + _cards_root.name = "Cards" + add_child(_cards_root) + _build_board() + set_seat(me, true) + get_viewport().size_changed.connect(func(): _place_camera(true)) + + +# --------------------------------------------------------------------------------------------- +# Building + +func _build_room() -> void: + var env := Environment.new() + env.background_mode = Environment.BG_COLOR + env.background_color = Color(0.035, 0.035, 0.045) + env.ambient_light_source = Environment.AMBIENT_SOURCE_COLOR + env.ambient_light_color = Color(0.72, 0.75, 0.82) + env.ambient_light_energy = 0.85 + env.tonemap_mode = Environment.TONE_MAPPER_FILMIC + env.glow_enabled = true + env.glow_intensity = 0.4 + env.glow_hdr_threshold = 1.2 + var we := WorldEnvironment.new() + we.environment = env + add_child(we) + + var sun := DirectionalLight3D.new() + sun.light_color = Color(0.9, 0.87, 0.82) + sun.light_energy = 1.35 + sun.shadow_enabled = true + sun.directional_shadow_max_distance = 60.0 + add_child(sun) + sun.look_at_from_position(Vector3(6, 20, 9), Vector3.ZERO, Vector3.UP) + + # The table under the mat: dark wood. + var top := MeshInstance3D.new() + var box := BoxMesh.new() + box.size = Vector3(64, 1, 52) + top.mesh = box + var wood := StandardMaterial3D.new() + wood.albedo_color = Color(0.16, 0.105, 0.07) + wood.roughness = 0.62 + top.material_override = wood + top.position = Vector3(0, -0.6, 0) + add_child(top) + + add_child(PLAYMAT_SCENE.instantiate()) + + camera = Camera3D.new() + camera.fov = 45.0 + camera.far = 200.0 + add_child(camera) + camera.current = true + _hand_root = Node3D.new() + _hand_root.name = "Hand" + camera.add_child(_hand_root) + + +func _build_board() -> void: + BoardLayout.update() + _tile_material = ShaderMaterial.new() + _tile_material.shader = TILE_SHADER + _tile_material.set_shader_parameter("size", BoardLayout.tile_size) + _tile_material.render_priority = -1 + var plane := PlaneMesh.new() + plane.size = BoardLayout.tile_size + + var line_material := StandardMaterial3D.new() + line_material.albedo_color = Color(0.85, 0.88, 0.92, 0.32) + line_material.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA + line_material.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED + line_material.render_priority = -2 + var half := BoardLayout.tile_size / 2.0 + for line in GameMap.LINES: + var a: Vector3 = BoardLayout.at[line.a] + var b: Vector3 = BoardLayout.at[line.b] + var d := b - a + var len := d.length() + var t0 := _exit_t(d, half) + var t1 := 1.0 - _exit_t(-d, half) + if t1 <= t0: + continue + var seg := MeshInstance3D.new() + var m := BoxMesh.new() + m.size = Vector3(0.07, 0.002, len * (t1 - t0)) + seg.mesh = m + seg.material_override = line_material + seg.position = a + d * (t0 + t1) / 2.0 + Vector3(0, 0.002, 0) + seg.rotation.y = atan2(d.x, d.z) + seg.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF + _board.add_child(seg) + _lines[line.id] = seg + if line.gateway: + _gates[line.id] = _make_gate(line, seg.rotation.y) + + # Printed card spots beside each start: Anomaly slots and piles. + var spot_material := ShaderMaterial.new() + spot_material.shader = TILE_SHADER + var spot_size := BoardLayout.CARD_SIZE + Vector2(0.14, 0.14) + spot_material.set_shader_parameter("size", spot_size) + spot_material.set_shader_parameter("radius", 0.1) + spot_material.set_shader_parameter("edge_width", 0.04) + spot_material.render_priority = -1 + var spot_plane := PlaneMesh.new() + spot_plane.size = spot_size + for p in [0, 1]: + var spots := [] + for slot in range(1, 5): + spots.append(BoardLayout.zone_spot(p, "slot", slot)) + for zone in ["deck", "serverPile", "discard"]: + spots.append(BoardLayout.zone_spot(p, zone)) + var names := ["1", "2", "3", "4", "DECK", "SERVERS", "DISCARD"] + for i in spots.size(): + var at: Vector3 = spots[i] + # The spot's name, printed in the gap between it and the first row. + var name := _flat_label(34) + name.text = names[i] + name.modulate = Color(OWNER_COLORS[p], 0.75) + name.rotation.y = BoardLayout.yaw_for(p) + var inward := -1.0 if p == 0 else 1.0 + name.position = Vector3(at.x, 0.004, at.z + inward * (BoardLayout.CARD_SIZE.y / 2 + 0.17)) + _board.add_child(name) + var m := MeshInstance3D.new() + m.mesh = spot_plane + m.material_override = spot_material + m.position = Vector3(at.x, 0.003, at.z) + m.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF + _board.add_child(m) + m.set_instance_shader_parameter("fill_color", Color(OWNER_COLORS[p], 0.06)) + m.set_instance_shader_parameter("edge_color", Color(OWNER_COLORS[p], 0.5)) + + for loc in GameMap.LOCATIONS: + var tile := MeshInstance3D.new() + tile.mesh = plane + tile.material_override = _tile_material + tile.position = BoardLayout.at[loc] + Vector3(0, 0.003, 0) + tile.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF + _board.add_child(tile) + var body := StaticBody3D.new() + var shape := CollisionShape3D.new() + var bs := BoxShape3D.new() + bs.size = Vector3(BoardLayout.tile_size.x, 0.01, BoardLayout.tile_size.y) + shape.shape = bs + body.add_child(shape) + body.set_meta("key", Moves.loc_key(loc)) + tile.add_child(body) + var label := _flat_label(64) + label.position = BoardLayout.at[loc] + Vector3(BoardLayout.tile_size.x / 2 - 1.0, 0.004, 0) + _board.add_child(label) + _tiles[loc] = {"mesh": tile, "label": label} + + +## How far along d (from a tile's centre) the segment leaves a tile of half-size `half`. +static func _exit_t(d: Vector3, half: Vector2) -> float: + var tx := INF if is_zero_approx(d.x) else half.x / absf(d.x) + var tz := INF if is_zero_approx(d.z) else half.y / absf(d.z) + return minf(tx, tz) + 0.012 + + +func _make_gate(line: Dictionary, yaw: float) -> Dictionary: + var at := BoardLayout.line_mid(line) + var diamond := MeshInstance3D.new() + var dm := PlaneMesh.new() + dm.size = Vector2(0.34, 0.34) + diamond.mesh = dm + var mat := StandardMaterial3D.new() + mat.albedo_color = Color(0.85, 0.88, 0.92, 0.55) + mat.transparency = BaseMaterial3D.TRANSPARENCY_ALPHA + mat.emission_enabled = true + mat.emission = Color.BLACK + mat.render_priority = -1 + diamond.material_override = mat + diamond.position = at + Vector3(0, 0.004, 0) + diamond.rotation.y = PI / 4 + diamond.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF + _board.add_child(diamond) + + var wall := MeshInstance3D.new() + var wm := BoxMesh.new() + wm.size = Vector3(1.0, 1.0, 0.14) + wall.mesh = wm + var wall_mat := StandardMaterial3D.new() + wall_mat.albedo_color = FIREWALL_COLORS[0] + wall_mat.emission_enabled = true + wall_mat.emission = FIREWALL_COLORS[0] + wall_mat.emission_energy_multiplier = 0.35 + wall_mat.roughness = 0.4 + wall.material_override = wall_mat + wall.position = at + wall.rotation.y = yaw + wall.visible = false + _board.add_child(wall) + var body := StaticBody3D.new() + var shape := CollisionShape3D.new() + var bs := BoxShape3D.new() + bs.size = Vector3(0.7, 0.4, 0.7) + shape.shape = bs + body.add_child(shape) + body.position = at + Vector3(0, 0.2, 0) + body.set_meta("key", Moves.gate_key(line.id)) + _board.add_child(body) + return {"diamond": diamond, "mat": mat, "wall": wall, "wall_mat": wall_mat, "at": at} + + +func _flat_label(size: int) -> Label3D: + var l := Label3D.new() + l.font = _font + l.font_size = size + l.pixel_size = 0.004 + l.rotation.x = -PI / 2 + l.modulate = Color(0.85, 0.88, 0.92, 0.8) + l.outline_size = 0 + l.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER + return l + + +# --------------------------------------------------------------------------------------------- +# Camera + +## Sits player `p` at the table: the camera on their side, their hand held up. +func set_seat(p: int, instant := false) -> void: + me = p + _place_camera(instant) + + +func toggle_view() -> void: + view_mode = "top" if view_mode == "seat" else "seat" + _place_camera(false) + + +func zoom(by: float) -> void: + _zoom = clampf(_zoom * by, 0.55, 1.5) + _place_camera(false) + + +func _place_camera(instant: bool) -> void: + var xf := _fit_camera() + if _cam_tween != null: + _cam_tween.kill() + if instant: + camera.transform = xf + else: + _cam_tween = create_tween().set_trans(Tween.TRANS_CUBIC).set_ease(Tween.EASE_IN_OUT) + _cam_tween.tween_property(camera, "transform", xf, 0.45) + + +## The camera spot that fits the mat (and the bot's hand past it) into the screen the panels leave +## free, from your side: angled for "seat", straight down for "top". Tries a few aim points and +## keeps the closest camera that fits, then applies the zoom. +func _fit_camera() -> Transform3D: + var side := 1.0 if me == 0 else -1.0 + var vp := get_viewport().get_visible_rect().size + var sx := vp.x / 1600.0 + var sy := vp.y / 900.0 + var region := Rect2(PANEL_LEFT * sx, PANEL_TOP * sy, vp.x - (PANEL_LEFT + PANEL_RIGHT) * sx, vp.y - (PANEL_TOP + PANEL_BOTTOM) * sy) + var hx := BoardLayout.MAT_SIZE.x / 2 + var hz := BoardLayout.MAT_SIZE.y / 2 + var points := [Vector3(-hx, 0, -hz), Vector3(hx, 0, -hz), Vector3(-hx, 0, hz), Vector3(hx, 0, hz), + Vector3(-3.5, 0, -(hz + 1.8) * side), Vector3(3.5, 0, -(hz + 1.8) * side)] + var top := view_mode == "top" + var pitch := deg_to_rad(89.0 if top else 56.0) + var dir := Vector3(0, sin(pitch), cos(pitch) * side) + var up := Vector3(0, 0, -side) if top else Vector3.UP + var saved := camera.transform + var best := Transform3D() + var best_d := INF + for i in 13: + var target := Vector3(0, 0, (i - 6) * 0.6 * side) + var lo := 5.0 + var hi := 80.0 + for _k in 22: + var d := (lo + hi) / 2.0 + camera.transform = Transform3D(Basis.IDENTITY, target + dir * d).looking_at(target, up) + var fits := true + for pt in points: + if not region.has_point(camera.unproject_position(pt)): + fits = false + break + if fits: + hi = d + else: + lo = d + if hi < best_d: + best_d = hi + best = Transform3D(Basis.IDENTITY, target + dir * hi * _zoom).looking_at(target, up) + camera.transform = saved + return best + + +# --------------------------------------------------------------------------------------------- +# Picking + +func _physics_process(_delta: float) -> void: + var mouse := get_viewport().get_mouse_position() + var from := camera.project_ray_origin(mouse) + var to := from + camera.project_ray_normal(mouse) * 150.0 + var q := PhysicsRayQueryParameters3D.create(from, to) + var hit := get_world_3d().direct_space_state.intersect_ray(q) + var body: Object = hit.get("collider") + # Nothing on the table is under the mouse while it's over a panel. + if get_viewport().gui_get_hovered_control() != null: + body = null + if body == _hover_body: + return + var was_hand := _is_hand_body(_hover_body) + _hover_body = body + if body == null or not body.has_meta("key"): + hovered = {} + else: + var card = body.get_meta("card") if body.has_meta("card") else null + hovered = {"key": body.get_meta("key"), "card": card.card_name if card != null else ""} + if was_hand or _is_hand_body(body): + _layout_hand() + + +func _is_hand_body(body: Object) -> bool: + if body == null or not is_instance_valid(body) or not body.has_meta("card"): + return false + var card: Node = body.get_meta("card") + return card.get_parent() == _hand_root + + +# --------------------------------------------------------------------------------------------- +# Syncing to a view + +## Snaps the table to `view` (as seen by `me`), with `marks` from key to a mark name (see +## MARK_COLORS). +func sync(v: Dictionary, marks: Dictionary) -> void: + _view = v + _last_marks = marks + for k in _tags: + _tags[k].used = false + _sync_tiles(v, marks) + _sync_gates(v, marks) + var want := {} + _want_board_cards(v, want) + _want_zones(v, want) + _apply_cards(want, marks) + _layout_hand() + for k in _tags.keys(): + if not _tags[k].used: + _tags[k].box.queue_free() + _tags.erase(k) + _place_tags() + + +func _sync_tiles(v: Dictionary, marks: Dictionary) -> void: + for loc in GameMap.LOCATIONS: + var tile: MeshInstance3D = _tiles[loc].mesh + var owner = v.locations[loc].owner + var fill := Color(1, 1, 1, 0.018) + var edge := Color(0.82, 0.85, 0.9, 0.4) + if owner != null: + fill = Color(OWNER_COLORS[owner], 0.075) + edge = Color(OWNER_COLORS[owner], 0.85) + var glow := 0.0 + var mark = marks.get(Moves.loc_key(loc)) + if mark != null: + edge = MARK_COLORS[mark] + glow = MARK_STRENGTH[mark] + tile.set_instance_shader_parameter("fill_color", fill) + tile.set_instance_shader_parameter("edge_color", edge) + tile.set_instance_shader_parameter("glow", glow) + var label: Label3D = _tiles[loc].label + if GameMap.is_start(loc): + label.text = "%s · %s" % [loc, "your start" if loc == GameMap.START_LOC[me] else "start"] + else: + label.text = "%s · Lv %d" % [loc, GameMap.level_for(me, loc)] + label.rotation.y = 0.0 if me == 0 else PI + + +func _sync_gates(v: Dictionary, marks: Dictionary) -> void: + for line_id in _gates: + var g: Dictionary = _gates[line_id] + var level: int = v.firewalls.get(line_id, 0) + var mark = marks.get(Moves.gate_key(line_id)) + var mat: StandardMaterial3D = g.mat + if mark != null: + mat.albedo_color = MARK_COLORS[mark] + mat.emission = MARK_COLORS[mark] * MARK_STRENGTH[mark] + else: + mat.albedo_color = Color(0.85, 0.88, 0.92, 0.55) if level == 0 else Color(FIREWALL_COLORS[level - 1], 0.9) + mat.emission = Color.BLACK + var wall: MeshInstance3D = g.wall + wall.visible = level > 0 + if level > 0: + var h := 0.22 + 0.2 * level + wall.scale = Vector3(1, h, 1) + wall.position.y = h / 2.0 + var c := FIREWALL_COLORS[mini(level, FIREWALL_COLORS.size()) - 1] + g.wall_mat.albedo_color = c + g.wall_mat.emission = c + _tag("gate:" + line_id, "Lv %d" % level, c.lightened(0.3), g.at + Vector3(0, h + 0.1, 0), true) + var seg: MeshInstance3D = _lines[line_id] + seg.transparency = 0.6 if level > 0 else 0.0 + + +## Cards on the mat: Servers, Programs, Anomalies in play and their Hardware. +func _want_board_cards(v: Dictionary, want: Dictionary) -> void: + var standing := {} + for p in [0, 1]: + for r in State.refs_in_play(v, p): + var at: String = State.anomaly(v, r).at + if not standing.has(at): + standing[at] = [] + standing[at].append(r) + for loc in GameMap.LOCATIONS: + var L: Dictionary = v.locations[loc] + var owner = L.owner + var yaw := BoardLayout.yaw_for(owner if owner != null else 0) + if L.server != null: + var name := State.name_of(v, L.server) + want["card:%d" % L.server] = {"name": name, "pos": BoardLayout.server_spot(loc), "yaw": yaw, + "key": Moves.loc_key(loc)} + var progs: Array = L.programs + for i in progs.size(): + var id: int = progs[i] + var name := State.name_of(v, id) + var pos := BoardLayout.program_spot(loc, i, progs.size()) + want["card:%d" % id] = {"name": name, "pos": pos, "yaw": yaw, "key": Moves.loc_key(loc), + "dim": 0.0 if Query.program_active(v, id) else 0.7} + var refs: Array = standing.get(loc, []) + if refs.is_empty(): + continue + # Lay the Anomalies out between the Server and the Programs, each with its Hardware. + var widths := [] + var total := 0.0 + for r in refs: + var w := BoardLayout.CARD_SIZE.x + (0.0 if State.is_copy(r) else State.hardware_of(v, r).size() * HARDWARE_PEEK) + widths.append(w) + total += w + var left := BoardLayout.server_spot(loc).x + BoardLayout.CARD_SIZE.x / 2 + 0.1 + var right: float = BoardLayout.at[loc].x + BoardLayout.tile_size.x / 2 - 0.08 + if not progs.is_empty(): + right -= BoardLayout.CARD_SIZE.x + (progs.size() - 1) * PROGRAM_STEP + 0.05 + var gap := 0.09 + var room: float = right - left + var squeeze := 1.0 + if total + gap * (refs.size() - 1) > room: + squeeze = maxf(0.3, (room - gap * (refs.size() - 1)) / total) + var x := left + for i in refs.size(): + var r: Dictionary = refs[i] + var w: float = widths[i] * squeeze + var cx: float = x + BoardLayout.CARD_SIZE.x * squeeze / 2.0 + var y := BoardLayout.CARD_Y + 4 * BoardLayout.LAYER + i * BoardLayout.LAYER * 3 + _want_anomaly(v, r, Vector3(cx, y, BoardLayout.at[loc].z), BoardLayout.yaw_for(r.player), want, true) + x += w + gap + + +## An Anomaly card (in play or in its slot) and its Hardware, tucked under it and peeking out to +## its right. +func _want_anomaly(v: Dictionary, r: Dictionary, pos: Vector3, yaw: float, want: Dictionary, in_play: bool) -> void: + var av := State.anomaly(v, r) + var name := State.name_of(v, av.card) if av.card >= 0 and av.faceUp else "" + var key := Moves.anomaly_key(r) + want[key] = {"name": name, "pos": pos, "yaw": yaw + (PI / 2 if in_play and State.is_disabled_anomaly(v, r) else 0.0), + "key": key, "face_down": name == "", "badge": in_play or name != ""} + if State.is_copy(r): + return + var hw: Array = av.hardware + var side := Vector3.RIGHT + for j in hw.size(): + var id: int = hw[j] + var hname := State.name_of(v, id) + var hpos := pos + side * HARDWARE_PEEK * (j + 1) - Vector3(0, BoardLayout.LAYER * (j + 1), 0) + want["card:%d" % id] = {"name": hname, "pos": hpos, "yaw": yaw, "key": key, + "dim": 0.0 if Query.hardware_active(v, id) else 0.7} + + +## Off the mat: Anomaly slots, piles, your hand and the bot's. +func _want_zones(v: Dictionary, want: Dictionary) -> void: + for p in [0, 1]: + var pl: Dictionary = v.players[p] + var yaw := BoardLayout.yaw_for(p) + for i in 4: + var r := State.ref(p, i + 1) + var av := State.anomaly(v, r) + if av.at == null: + _want_anomaly(v, r, BoardLayout.zone_spot(p, "slot", i + 1), yaw, want, false) + _want_pile(p, "deck", pl.deck.size(), -1, want) + _want_pile(p, "serverPile", pl.serverPile.size(), -1, want) + _want_pile(p, "discard", pl.discard.size(), pl.discard.back() if not pl.discard.is_empty() else -1, want) + if p == me: + for id in pl.hand: + var name := State.name_of(v, id) + want["card:%d" % id] = {"name": name, "hand": true, "key": Moves.hand_key(name)} + else: + var n := mini(pl.hand.size(), BOT_HAND_SHOWN) + var base := BoardLayout.zone_spot(p, "hand") + var dir := 1.0 if p == 0 else -1.0 + for i in n: + var off := (i - (n - 1) / 2.0) * 0.55 + want["bothand:%d:%d" % [p, i]] = {"name": "", "pos": base + Vector3(off * dir, i * BoardLayout.LAYER, 0), + "yaw": yaw, "face_down": true, "key": "pile:%d:hand" % p} + + +## A pile: a block as tall as the count, with its top card on it (face up for the discard). +func _want_pile(p: int, zone: String, count: int, top: int, want: Dictionary) -> void: + var spot := BoardLayout.zone_spot(p, zone) + var key := "%d:%s" % [p, zone] + if not _piles.has(key): + _piles[key] = _make_pile(spot) + var pile: Dictionary = _piles[key] + var h := maxf(0.0, (count - 1) * BoardLayout.LAYER) + pile.block.visible = count > 1 + pile.block.scale = Vector3(1, maxf(h, 0.001), 1) + pile.block.position = spot + Vector3(0, h / 2.0, 0) + _tag("pile:" + key, str(count), Color(0.85, 0.88, 0.92), spot + Vector3(0, h, 0)) + if count == 0: + return + var pos := spot + Vector3(0, h + BoardLayout.CARD_Y, 0) + var pick := "pile:%d:%s" % [p, zone] + if top >= 0: + var name := State.name_of(_view, top) + want["card:%d" % top] = {"name": name, "pos": pos, "yaw": BoardLayout.yaw_for(p), "key": pick} + else: + want["%s:top" % key] = {"name": "", "pos": pos, "yaw": BoardLayout.yaw_for(p), "face_down": true, "key": pick} + + +func _make_pile(spot: Vector3) -> Dictionary: + var block := MeshInstance3D.new() + var m := BoxMesh.new() + m.size = Vector3(BoardLayout.CARD_SIZE.x, 1, BoardLayout.CARD_SIZE.y) + block.mesh = m + block.material_override = CardFaces.edge() + block.position = spot + _board.add_child(block) + return {"block": block} + + +## Creates, moves and removes Card3Ds to match `want` (node key → spot). +func _apply_cards(want: Dictionary, marks: Dictionary) -> void: + _hand_order = [] + for key in _cards.keys(): + if not want.has(key): + _cards[key].queue_free() + _cards.erase(key) + for key in want: + var w: Dictionary = want[key] + var card: Card3D = _cards.get(key) + var fresh := card == null + if fresh: + card = CARD_SCENE.instantiate() + _cards[key] = card + var parent: Node = _hand_root if w.get("hand", false) else _cards_root + if card.get_parent() != parent: + if card.get_parent() == null: + parent.add_child(card) + else: + card.reparent(parent, true) + card.set_shadows(parent != _hand_root) + card.card_name = w.name + card.pick_key = w.key + if w.get("hand", false): + _hand_order.append(card) + card.dim = w.get("dim", 0.0) + var mark = marks.get(w.key) if not w.key.begins_with("loc:") else null + # Only the card a hand key names glows, and only an Anomaly's own card, not its Hardware. + if mark != null and w.key.begins_with("anomaly:") and key != w.key: + mark = null + var strength: float = MARK_STRENGTH[mark] * (0.55 if w.get("hand", false) else 1.0) if mark != null else 0.0 + card.highlight = Color(MARK_COLORS[mark], strength) if mark != null else Color(0, 0, 0, 0) + if not w.get("hand", false): + var basis := Basis.from_euler(Vector3(0, w.yaw, PI if w.get("face_down", false) else 0.0)) + var xf := Transform3D(basis, w.pos) + if fresh: + card.transform = xf + card.glide(xf, fresh) + _sync_badge(key, w) + + +## A readout under an Anomaly: Cores, Health and status. +func _sync_badge(key: String, w: Dictionary) -> void: + if not w.get("badge", false): + return + var r = Moves.ref_of_key(key) + if r == null: + return + var toward := 1.0 if me == 0 else -1.0 + var card: Card3D = _cards[key] + _tag(key, badge_text(_view, r), OWNER_COLORS[r.player].lightened(0.3), Vector3(0, 0.05, 0.72 * toward), false, card) + + +## Shows `text` in a small 2D box pinned under the table point `world`, or with `follow`, at +## `world` from that node, so it rides along while a card slides. Tags not set during a sync are +## removed at its end. +func _tag(key: String, text: String, color: Color, world: Vector3, above := false, follow: Node3D = null) -> void: + var t: Dictionary = _tags.get(key, {}) + if t.is_empty(): + var box := PanelContainer.new() + box.mouse_filter = Control.MOUSE_FILTER_IGNORE + var sb := StyleBoxFlat.new() + sb.bg_color = Color(0.02, 0.03, 0.04, 0.78) + sb.set_corner_radius_all(4) + sb.content_margin_left = 5 + sb.content_margin_right = 5 + sb.content_margin_top = 1 + sb.content_margin_bottom = 1 + box.add_theme_stylebox_override("panel", sb) + var label := Label.new() + label.add_theme_font_override("font", _tag_font) + label.add_theme_font_size_override("font_size", 13) + box.add_child(label) + _overlay.add_child(box) + t = {"box": box, "label": label} + _tags[key] = t + t.label.text = text + t.label.add_theme_color_override("font_color", color) + t.world = world + t.above = above + t.used = true + t.follow = follow + t.box.visible = text != "" + + +func _process(_delta: float) -> void: + _place_tags() + _place_pops() + _pulse_tiles() + + +# --------------------------------------------------------------------------------------------- +# Pop-ups + +## Damage over an Anomaly: "−7", or "−7 destroyed". Shows where the card is now, or at `loc` if +## it has left the board. +func pop_damage(r: Dictionary, amount: int, destroyed: bool, loc: Variant, delay := 0.0) -> void: + var card: Card3D = _cards.get(Moves.anomaly_key(r)) + var world: Vector3 + if card != null and not destroyed: + world = card.global_position + elif loc != null and BoardLayout.at.has(loc): + world = BoardLayout.at[loc] + else: + return + pop_text(world, "−%d%s" % [amount, " destroyed" if destroyed else ""], Color("#ff6b6b"), delay, 26) + + +## A short message rising from a table point, e.g. who won a roll. +func pop_text(world: Vector3, text: String, color: Color, delay := 0.0, size := 20) -> void: + var label := Label.new() + label.text = text + label.add_theme_font_override("font", _tag_font) + label.add_theme_font_size_override("font_size", size) + label.add_theme_color_override("font_color", color) + label.add_theme_color_override("font_outline_color", Color(0, 0, 0, 0.95)) + label.add_theme_constant_override("outline_size", 7) + label.mouse_filter = Control.MOUSE_FILTER_IGNORE + label.visible = false + _overlay.add_child(label) + while _pops.size() >= MAX_POPS: + _pops.pop_front().label.queue_free() + _pops.append({"label": label, "world": world, "born": Time.get_ticks_msec() + int(delay * 1000)}) + + +## The location at `loc` pulses in its new owner's color. +func flash_capture(loc: String, p: int) -> void: + if _tiles.has(loc): + _flashes[loc] = {"color": OWNER_COLORS[p], "born": Time.get_ticks_msec()} + + +func _place_pops() -> void: + var now := Time.get_ticks_msec() + for pop in _pops.duplicate(): + var age: float = (now - pop.born) / 1000.0 + var label: Label = pop.label + if age > POP_TIME: + label.queue_free() + _pops.erase(pop) + continue + if age < 0 or camera.is_position_behind(pop.world): + label.visible = false + continue + label.visible = true + label.reset_size() + var sp := camera.unproject_position(pop.world) + label.position = sp - Vector2(label.size.x / 2, label.size.y + 18 + 26 * age) + label.modulate.a = clampf((POP_TIME - age) / 0.6, 0.0, 1.0) + + +func _pulse_tiles() -> void: + if _flashes.is_empty(): + return + var now := Time.get_ticks_msec() + for loc in _flashes.keys(): + var f: Dictionary = _flashes[loc] + var age: float = (now - f.born) / 1000.0 + var tile: MeshInstance3D = _tiles[loc].mesh + if age > FLASH_TIME: + _flashes.erase(loc) + _sync_tiles(_view, _last_marks) + continue + var k := 1.0 - age / FLASH_TIME + tile.set_instance_shader_parameter("edge_color", f.color) + tile.set_instance_shader_parameter("fill_color", Color(f.color, 0.075 + 0.25 * k)) + tile.set_instance_shader_parameter("glow", 2.5 * k) + + +func _place_tags() -> void: + for k in _tags: + var t: Dictionary = _tags[k] + var world: Vector3 = t.world + if t.follow != null and is_instance_valid(t.follow): + world += t.follow.global_position + if t.label.text == "" or camera.is_position_behind(world): + t.box.visible = false + continue + t.box.visible = true + t.box.reset_size() + var p := camera.unproject_position(world) + t.box.position = p - Vector2(t.box.size.x / 2, t.box.size.y if t.above else t.box.size.y * 0.5) + + +## "3⚙ 8/10♥ ☣1": Cores, Health and status for an Anomaly. +static func badge_text(v: Dictionary, r: Dictionary) -> String: + var av := State.anomaly(v, r) + if av.card < 0 or not State.anomaly(v, State.original_of(r)).faceUp: + return "" + var parts := [] + var cores := RulesEngine.anomaly_cores(v, r.player, r.slot, "defend") + parts.append("%d⚙" % cores) + if v.rules.health.on: + if av.at != null: + parts.append("%d/%d♥" % [Query.health_left(v, r), Query.health_of(v, r)]) + else: + parts.append("%d♥" % Query.health_of(v, r)) + var infection := State.infection_of(av) + if infection: + parts.append("☣%d" % infection) + if av.get("bugs", 0): + parts.append("✱%d" % av.bugs) + if av.at != null and State.is_rooted(v, r): + parts.append("⚓") + if av.at != null and State.is_disabled_anomaly(v, r): + parts.append("⏻") + var mods := 0 + for m in State.active_mods(v, av): + mods += m.cores + if mods: + parts.append("%+d" % mods) + if State.is_copy(r): + parts.append("copy") + return " ".join(parts) + + +## Lays out your hand in front of the camera, the hovered card lifted. +func _layout_hand() -> void: + var cards := _hand_order.filter(func(c): return is_instance_valid(c) and not c.is_queued_for_deletion()) + var n := cards.size() + if n == 0: + return + var vp := get_viewport().get_visible_rect().size + var half_h := HAND_DISTANCE * tan(deg_to_rad(camera.fov / 2.0)) + var half_w := half_h * vp.x / vp.y + # Keep clear of the side panels (see the HUD): 300 px on the left, 340 on the right. + var left := -half_w + 2.0 * half_w * 300.0 / vp.x + BoardLayout.CARD_SIZE.x / 2 + var right := half_w - 2.0 * half_w * 340.0 / vp.x - BoardLayout.CARD_SIZE.x / 2 + var step := 1.34 if n == 1 else minf(1.34, (right - left) / (n - 1)) + var mid := (left + right) / 2.0 + var y0 := -half_h + BoardLayout.CARD_SIZE.y * (HAND_SHOWN - 0.5) + var hover_card: Node = _hover_body.get_meta("card") if _hover_body != null and is_instance_valid(_hover_body) and _hover_body.has_meta("card") else null + for i in n: + var c: Card3D = cards[i] + var x := mid + (i - (n - 1) / 2.0) * step + var lift := c == hover_card + var y := y0 + (BoardLayout.CARD_SIZE.y * 0.42 if lift else 0.0) + if c.highlight.a > 0 and not lift: + y += 0.12 + var pos := Vector3(x, y, -HAND_DISTANCE + i * 0.004 + (0.25 if lift else 0.0)) + var xf := Transform3D(Basis(Vector3.RIGHT, PI / 2), pos) + if not c.has_goal(): + # A card just drawn comes up from below. + c.transform = xf.translated(Vector3(0, -2.5, 0)) + c.glide(xf) + + +## A screen point, clear of the side panels, where a click lands on `key`; null if there's none. +## Tries spots across each object with that key and raycasts each, as a click would. For tests. +func screen_point_for(key: String) -> Variant: + var vp := get_viewport().get_visible_rect().size + var sx := vp.x / 1600.0 + var region := Rect2(PANEL_LEFT * sx, PANEL_TOP * vp.y / 900.0, vp.x - (PANEL_LEFT + PANEL_RIGHT) * sx, vp.y) + var points := [] + var grid := func(xf: Transform3D, half: Vector2, y: float) -> void: + for fz in [0.0, -0.6, 0.6, -0.85, 0.85]: + for fx in [0.0, -0.45, 0.45, -0.8, 0.8, -0.95, 0.95]: + points.append(xf * Vector3(fx * half.x, y, fz * half.y)) + if key.begins_with("loc:") and _tiles.has(key.substr(4)): + grid.call(Transform3D(Basis.IDENTITY, BoardLayout.at[key.substr(4)]), BoardLayout.tile_size / 2, 0.004) + elif key.begins_with("gate:") and _gates.has(key.substr(5)): + points.append(_gates[key.substr(5)].at + Vector3(0, 0.05, 0)) + for k in _cards: + var c: Card3D = _cards[k] + if c.pick_key == key and not c.is_queued_for_deletion(): + grid.call(c.global_transform, BoardLayout.CARD_SIZE / 2, 0.006) + for pt in points: + if camera.is_position_behind(pt): + continue + var sp := camera.unproject_position(pt) + if region.has_point(sp) and key_at(sp) == key: + return sp + return null + + +## The key a click at screen point `sp` lands on, or "". +func key_at(sp: Vector2) -> String: + var from := camera.project_ray_origin(sp) + var q := PhysicsRayQueryParameters3D.create(from, from + camera.project_ray_normal(sp) * 150.0) + var body: Object = get_world_3d().direct_space_state.intersect_ray(q).get("collider") + return body.get_meta("key") if body != null and body.has_meta("key") else "" diff --git a/table/game_table.gd.uid b/table/game_table.gd.uid new file mode 100644 index 0000000..e3dd4cf --- /dev/null +++ b/table/game_table.gd.uid @@ -0,0 +1 @@ +uid://isdpnfsvudnh diff --git a/table/playmat.tscn b/table/playmat.tscn new file mode 100644 index 0000000..582a7a2 --- /dev/null +++ b/table/playmat.tscn @@ -0,0 +1,14 @@ +[gd_scene format=3] + +[ext_resource type="PackedScene" uid="uid://dx42gyxom1dlb" path="res://assets/playmat.glb" id="1_model"] +[ext_resource type="Material" uid="uid://br7tudxocdqc5" path="res://assets/playmat.tres" id="2_fabric"] + +[node name="Playmat" type="Node3D"] + +[node name="Model" parent="." instance=ExtResource("1_model")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.021875, 0) + +[node name="Plane_003" parent="Model" index="0"] +surface_material_override/0 = ExtResource("2_fabric") + +[editable path="Model"] diff --git a/table/table_test.tscn b/table/table_test.tscn new file mode 100644 index 0000000..115a77d --- /dev/null +++ b/table/table_test.tscn @@ -0,0 +1,56 @@ +[gd_scene format=3 uid="uid://cuh6mwy60n28k"] + +[ext_resource type="PackedScene" path="res://table/playmat.tscn" id="1_playmat"] +[ext_resource type="PackedScene" path="res://table/card_3d.tscn" id="2_card"] + +[sub_resource type="Environment" id="Environment_table"] +background_mode = 1 +background_color = Color(0.05, 0.05, 0.06, 1) +ambient_light_source = 3 +ambient_light_color = Color(0.75, 0.78, 0.85, 1) +ambient_light_energy = 2.75 +tonemap_mode = 2 + +[node name="TableTest" type="Node3D" unique_id=338861043] + +[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=559579265] +environment = SubResource("Environment_table") + +[node name="Sun" type="DirectionalLight3D" parent="." unique_id=589096806] +transform = Transform3D(0.7527, 0.5583, -0.349, 0, 0.5301, 0.848, 0.6584, -0.6383, 0.399, 0, 10, 0) +light_color = Color(0.8039216, 0.78431374, 0.74509805, 1) +light_energy = 1.2 +shadow_enabled = true +directional_shadow_max_distance = 40.0 + +[node name="Camera3D" type="Camera3D" parent="." unique_id=2122791772] +transform = Transform3D(1, 0, 0, 0, 0.692, 0.722, 0, -0.722, 0.692, 0, 12, 13) +fov = 50.0 + +[node name="Playmat" parent="." unique_id=1119250472 instance=ExtResource("1_playmat")] + +[node name="FaceUp" parent="." unique_id=1997336474 instance=ExtResource("2_card")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.2, 0.005, 3) +card_name = "Corrupt Driver" + +[node name="Highlighted" parent="." unique_id=498496961 instance=ExtResource("2_card")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.6, 0.005, 3) +card_name = "Carbon NanoBots" +highlight = Color(0.1, 0.9, 0.85, 1) + +[node name="Disabled" parent="." unique_id=1106312699 instance=ExtResource("2_card")] +transform = Transform3D(0, 0, 1, 0, 1, 0, -1, 0, 0, 0.4, 0.005, 3) +card_name = "Data Leaker" +dim = 1.0 + +[node name="FaceDown" parent="." unique_id=1293020398 instance=ExtResource("2_card")] +transform = Transform3D(-1, 8.742278e-08, 0, -8.742278e-08, -1, 0, 0, 0, 1, 2.4, 0.005, 3) +card_name = "Carbon NanoBots" +face_up = false + +[node name="Hidden" parent="." unique_id=1124339026 instance=ExtResource("2_card")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0.005, 3) + +[node name="InHand" parent="." unique_id=1321258057 instance=ExtResource("2_card")] +transform = Transform3D(1, 0, 0, 0, 0.692, -0.722, 0, 0.722, 0.692, 0, 4, 8) +card_name = "Execute: Override" diff --git a/table/tile.gdshader b/table/tile.gdshader new file mode 100644 index 0000000..9b3fbc0 --- /dev/null +++ b/table/tile.gdshader @@ -0,0 +1,29 @@ +shader_type spatial; +render_mode blend_mix, depth_draw_opaque, cull_disabled, shadows_disabled, unshaded; + +// A location printed on the playmat: a rounded rectangle with a tinted fill and an edge line. +// One material serves every tile; the owner tint and glow are instance uniforms. + +uniform vec2 size = vec2(5.6, 2.05); +uniform float radius = 0.2; +uniform float edge_width = 0.07; + +instance uniform vec4 fill_color : source_color = vec4(1.0, 1.0, 1.0, 0.06); +instance uniform vec4 edge_color : source_color = vec4(1.0, 1.0, 1.0, 0.45); +// Highlights (legal targets, the combat) light up the edge. +instance uniform float glow = 0.0; + +void fragment() { + vec2 p = (UV - 0.5) * size; + vec2 q = abs(p) - (size * 0.5 - vec2(radius)); + float d = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius; + if (d > 0.0) { + discard; + } + float w = edge_width * (1.0 + glow * 0.8); + float edge = 1.0 - smoothstep(w * 0.5, w, -d); + vec4 c = mix(fill_color, edge_color, edge); + // Unshaded, so the print reads the same under any light; glow brightens the edge for bloom. + ALBEDO = c.rgb * (1.0 + glow * edge * 1.5) + fill_color.rgb * glow * 0.1; + ALPHA = c.a; +} diff --git a/table/tile.gdshader.uid b/table/tile.gdshader.uid new file mode 100644 index 0000000..5a9dd29 --- /dev/null +++ b/table/tile.gdshader.uid @@ -0,0 +1 @@ +uid://dbght6ds1jhrx diff --git a/tests/bot_speed.gd b/tests/bot_speed.gd new file mode 100644 index 0000000..40111e2 --- /dev/null +++ b/tests/bot_speed.gd @@ -0,0 +1,69 @@ +extends SceneTree +## Times the greedy bot: plays greedy-vs-greedy games with every Set 1 card and reports how long +## each choose() call takes. Util.errors must stay empty. +## +## godot --headless --script res://tests/bot_speed.gd -- [--games N] [--seed N] [--bot greedy|nocards] + + +func _init() -> void: + var games := 20 + var first := 1 + var bot := "greedy" + var args := OS.get_cmdline_user_args() + var i := 0 + while i < args.size(): + match args[i]: + "--games": + i += 1 + games = int(args[i]) + "--seed": + i += 1 + first = int(args[i]) + "--bot": + i += 1 + bot = args[i] + i += 1 + var pool := Cards.load_cards() + var rules := Rules.defaults() + var maker: Callable = Play.bots()[bot] + var times := PackedFloat64Array() + var slowest := {"ms": 0.0, "at": ""} + var game_ms := 0.0 + var failed := 0 + for seed in range(first, first + games): + Util.errors.clear() + var s = RulesEngine.create_game({"pool": pool, "decks": Play.deal(pool, seed, rules), "seed": seed, "rules": rules}) + var players := [maker.call(seed * 2 + 1), maker.call(seed * 2 + 2)] + var started := Time.get_ticks_usec() + var n := 0 + while s != null and not s.over and n < Play.MAX_ACTIONS: + n += 1 + var p: int = RulesEngine.decider(s) + var legal := RulesEngine.legal_actions(s) + var view := RulesEngine.view_for(s, p) + var t0 := Time.get_ticks_usec() + var a: Dictionary = players[p].choose(view, legal, p) + var ms := (Time.get_ticks_usec() - t0) / 1000.0 + times.append(ms) + if ms > slowest.ms: + var w = RulesEngine.open_window(s) + var where: String = ("window %s" % w.kind) if w != null else ("choice %s" % s.choice.kind if s.choice != null else "step %s" % s.step) + slowest = {"ms": ms, "at": "seed %d turn %d, %s, picked %s" % [seed, s.turn, where, RulesEngine.action_key(a)]} + if not RulesEngine.apply_action(s, a, legal): + break + game_ms += (Time.get_ticks_usec() - started) / 1000.0 + if s == null or not s.over or not Util.errors.is_empty(): + failed += 1 + print("seed %d: %s" % [seed, "; ".join(Util.errors) if not Util.errors.is_empty() else "didn't finish"]) + times.sort() + var total := 0.0 + for t in times: + total += t + var count := times.size() + print("%s: %d games, %d choose() calls" % [bot, games, count]) + print(" per choose: mean %.3f ms, median %.3f, p99 %.2f, max %.1f" % [ + total / count, times[count / 2], times[mini(count - 1, int(count * 0.99))], times[count - 1]]) + print(" slowest: %s" % slowest.at) + print(" per game: %.0f ms with the engine, %.0f ms in the bot" % [game_ms / games, total / games]) + print(" %d game(s) failed" % failed) + quit(0 if failed == 0 else 1) diff --git a/tests/bot_speed.gd.uid b/tests/bot_speed.gd.uid new file mode 100644 index 0000000..7e55722 --- /dev/null +++ b/tests/bot_speed.gd.uid @@ -0,0 +1 @@ +uid://dmcgqlewqdvx6 diff --git a/tests/conformance.gd b/tests/conformance.gd new file mode 100644 index 0000000..bc53b5a --- /dev/null +++ b/tests/conformance.gd @@ -0,0 +1,284 @@ +extends SceneTree +## Conformance runner (godot-plan.md §2). Replays traces written by the TS sim through the GDScript +## engine, and stops each game at the first step that differs. +## +## godot --headless --script res://tests/conformance.gd -- [options] +## +## --traces DIR a trace set (a folder with an index.json) or a folder of them +## (default res://tests/traces) +## --limit N check at most N games per set +## --check also check rule invariants after every step +## --verbose print every game +## +## Make traces with tools/make_traces.sh, which runs the sim's src/trace.ts. +## +## A step's fingerprint is the action taken, an md5 of the legal action keys in order, of the state +## (sorted-key JSON, without the card defs and log), of the log lines it added, and of the next +## decider's view. A trace made with --full also holds every state, so a difference names the field; +## one made with --labels also checks the move-list labels (Describe). + +const DEFAULT_TRACES := "res://tests/traces" +## Detailed reports printed per set before the rest are only counted. +const MAX_REPORTS := 3 + +var _opts := {"traces": DEFAULT_TRACES, "limit": 0, "check": false, "verbose": false} +var _pool: Dictionary +var _cards_md5 := "" + + +func _init() -> void: + var args := OS.get_cmdline_user_args() + var i := 0 + while i < args.size(): + match args[i]: + "--traces": + i += 1 + _opts.traces = args[i] + "--limit": + i += 1 + _opts.limit = int(args[i]) + "--check": + _opts.check = true + "--verbose": + _opts.verbose = true + _: + printerr("conformance: unknown option %s" % args[i]) + quit(2) + return + i += 1 + quit(_run()) + + +func _run() -> int: + var root: String = ProjectSettings.globalize_path(_opts.traces) if _opts.traces.begins_with("res://") else _opts.traces + var sets := _find_sets(root) + if sets.is_empty(): + print("conformance: no trace sets in %s (folders with an index.json)" % root) + return 1 + _pool = Cards.load_cards() + _cards_md5 = _md5(FileAccess.get_file_as_string(Cards.DEFAULT_CSV)) + var failed := 0 + for dir in sets: + failed += _run_set(dir) + print("conformance: %s" % ("all sets match" if failed == 0 else "%d game(s) differ" % failed)) + return 0 if failed == 0 else 1 + + +func _find_sets(root: String) -> Array: + if FileAccess.file_exists(root.path_join("index.json")): + return [root] + var out := [] + var d := DirAccess.open(root) + if d == null: + return out + var names := d.get_directories() + names.sort() + for n in names: + if FileAccess.file_exists(root.path_join(n).path_join("index.json")): + out.append(root.path_join(n)) + return out + + +func _run_set(dir: String) -> int: + var index: Dictionary = Util.ints(JSON.parse_string(FileAccess.get_file_as_string(dir.path_join("index.json")))) + var set_name := dir.get_file() + if index.get("cards", _cards_md5) != _cards_md5: + print("%s: res://data/cards.csv differs from the CSV the traces were made from. Sync it, or remake the traces." % set_name) + return 1 + if index.has("rngCheck"): + var got := _rng_check(index.rngSeeds) + if got != index.rngCheck: + print("%s: Mulberry32 differs from TS (rng check %s, TS %s)" % [set_name, got, index.rngCheck]) + return 1 + var files := [] + for f in DirAccess.get_files_at(dir): + if f.begins_with("game-") and f.ends_with(".json"): + files.append(f) + files.sort_custom(func(a, b): return _game_no(a) < _game_no(b)) + if _opts.limit > 0: + files = files.slice(0, _opts.limit) + var started := Time.get_ticks_msec() + var failed := 0 + var steps := 0 + for f in files: + var trace: Dictionary = JSON.parse_string(FileAccess.get_file_as_string(dir.path_join(f))) + var result := _check_game(trace, index) + steps += result.steps + if result.error != "": + failed += 1 + if failed <= MAX_REPORTS: + print("%s/%s: %s" % [set_name, f, result.error]) + elif _opts.verbose: + print("%s/%s: ok (%d steps)" % [set_name, f, result.steps]) + var secs := (Time.get_ticks_msec() - started) / 1000.0 + var summary := "%d/%d games match" % [files.size() - failed, files.size()] + print("%s: %s (%d steps, %.1fs)" % [set_name, summary, steps, secs]) + return failed + + +func _rng_check(seeds: Array) -> String: + var lines := [] + for seed in seeds: + var r := Rng.make(seed) + var vals := PackedStringArray() + vals.resize(10000) + for i in 10000: + vals[i] = str(roundi(Rng.next_float(r) * 4294967296.0)) + lines.append(",".join(vals)) + return _md5("\n".join(lines)) + + +## Replays one trace. Returns {steps, error}, with error "" when every step matches. +func _check_game(t: Dictionary, index: Dictionary) -> Dictionary: + var seed: int = int(t.seed) + var rules := Rules.from_json(t.rules) + var decks: Array = t.decks + var hint := _full_hint(seed, index) + var fail := func(step: int, msg: String) -> Dictionary: + return {"steps": step, "error": "seed %d, %s%s" % [seed, msg, hint]} + + # Dealing: the same decks from the same seed. + var include := Callable() + if t.pool is Array: + var names := {} + for n in t.pool: + names[n] = true + include = func(c): return names.has(c.name) + Util.errors.clear() + var dealt := Play.deal(_pool, seed, rules, include) + if dealt != decks: + return fail.call(0, "dealt different decks: %s vs TS %s" % [JSON.stringify(dealt), JSON.stringify(decks)]) + + var s = RulesEngine.create_game({"pool": _pool, "decks": decks, "seed": seed, "rules": rules, "log": true}) + if s == null or not Util.errors.is_empty(): + return fail.call(0, "create_game failed: %s" % "; ".join(Util.errors)) + var initial: Dictionary = t.initial + var diff := _compare(s, t, 0, initial.state, initial.log, s.log, initial.get("view", "")) + if diff != "": + return fail.call(0, "after setup: %s" % diff) + + var makers := Play.bots() + var bots := [] + for i in 2: + var b: String = t.bots[i] + bots.append(makers[b].call(seed * 2 + 1 + i) if makers.has(b) else null) + + var steps: Array = t.steps + for i in steps.size(): + var step: Dictionary = steps[i] + var at := "step %d (%s)" % [i + 1, step.a] + if s.over: + return fail.call(i, "%s: the game is already over" % at) + var p: int = RulesEngine.decider(s) + var legal := RulesEngine.legal_actions(s) + var keys := PackedStringArray() + for a in legal: + keys.append(RulesEngine.action_key(a)) + if _md5("\n".join(keys)) != step.l: + return fail.call(i, "%s: legal actions differ. GDScript has %d:\n %s" % [at, keys.size(), "\n ".join(keys)]) + var k := keys.find(step.a) + if k < 0: + return fail.call(i, "%s: TS's action isn't legal in GDScript" % at) + if step.has("d"): + var labels := PackedStringArray() + for a in legal: + labels.append(Describe.describe_action(s, a)) + if _md5("\n".join(labels)) != step.d: + return fail.call(i, "%s: move labels differ. GDScript has:\n %s" % [at, "\n ".join(labels)]) + if bots[p] != null: + var pick: Dictionary = bots[p].choose(RulesEngine.view_for(s, p), legal, p) + if RulesEngine.action_key(pick) != step.a: + return fail.call(i, "%s: the %s bot picked %s" % [at, t.bots[p], RulesEngine.action_key(pick)]) + var logged: int = s.log.size() + RulesEngine.apply_action(s, legal[k], legal) + if not Util.errors.is_empty(): + return fail.call(i, "%s: engine error: %s" % [at, "; ".join(Util.errors)]) + diff = _compare(s, t, i + 1, step.s, step.g, s.log.slice(logged), step.get("v", "")) + if diff != "": + return fail.call(i, "after %s: %s" % [at, diff]) + if _opts.check: + var errors := Invariants.check(s) + if not errors.is_empty(): + return fail.call(i, "after %s: invariants: %s" % [at, "; ".join(errors)]) + var end: Dictionary = Util.ints(t.end) + var got := {"winner": s.winner, "turn": s.turn, "endReason": s.endReason} + if not s.over or got != end: + return fail.call(steps.size(), "the game ends %s, TS %s" % [JSON.stringify(got), JSON.stringify(end)]) + return {"steps": steps.size(), "error": ""} + + +## Compares the state after step `n` with the trace's fingerprints. Returns "" when they match. +func _compare(s: Dictionary, t: Dictionary, n: int, state_md5: String, log_md5: String, new_lines: Array, view_md5: String) -> String: + var body := _body(s) + if _md5(JSON.stringify(body)) != state_md5: + if t.has("states"): + var want = Util.ints(t.states[n]) + var have = Util.ints(JSON.parse_string(JSON.stringify(body))) + var where := _diff(want, have, "") + return "state differs: %s" % (where if where != "" else "(no field differs; JSON formatting?)") + return "state differs" + if _md5(JSON.stringify(new_lines)) != log_md5: + return "log differs. GDScript wrote:\n %s" % "\n ".join(new_lines.map(func(l): return JSON.stringify(l))) + if view_md5 != "" and not s.over: + var view := _body(RulesEngine.view_for(s, RulesEngine.decider(s))) + if _md5(JSON.stringify(view)) != view_md5: + return "the decider's view differs" + return "" + + +## The state as fingerprinted: without its card defs (fixed for the game) and log (checked by line). +func _body(s: Dictionary) -> Dictionary: + var b := s.duplicate() + b.erase("defs") + b.erase("log") + return b + + +## The first path where two JSON values differ, like "players[1].anomalies[0].damage ts=4 gd=3". +func _diff(want: Variant, have: Variant, path: String) -> String: + if typeof(want) != typeof(have): + return "%s ts=%s gd=%s" % [path, JSON.stringify(want), JSON.stringify(have)] + if want is Dictionary: + var keys: Array = want.keys() + for k in have.keys(): + if not keys.has(k): + keys.append(k) + keys.sort() + for k in keys: + var sub := "%s.%s" % [path, k] if path != "" else str(k) + if not want.has(k): + return "%s ts=(missing) gd=%s" % [sub, JSON.stringify(have[k])] + if not have.has(k): + return "%s ts=%s gd=(missing)" % [sub, JSON.stringify(want[k])] + var d := _diff(want[k], have[k], sub) + if d != "": + return d + return "" + if want is Array: + for i in mini(want.size(), have.size()): + var d := _diff(want[i], have[i], "%s[%d]" % [path, i]) + if d != "": + return d + if want.size() != have.size(): + return "%s length ts=%d gd=%d" % [path, want.size(), have.size()] + return "" + return "" if want == have else "%s ts=%s gd=%s" % [path, JSON.stringify(want), JSON.stringify(have)] + + +func _full_hint(seed: int, index: Dictionary) -> String: + if index.get("full", false): + return "" + var cmd := "node src/trace.ts --out /tmp/trace-full --seed %d -n 1 --full --south %s --north %s" % [seed, index.bots[0], index.bots[1]] + if index.get("pool", "all") != "all": + cmd += " --pool %s" % index.pool + for r in index.get("rules", []): + cmd += " --rule %s" % r + return "\n For the differing field, in files-tcg/sim: %s\n then: --traces /tmp/trace-full" % cmd + + +static func _md5(text: String) -> String: + return text.md5_text().substr(0, 12) + + +static func _game_no(file: String) -> int: + return file.trim_prefix("game-").trim_suffix(".json").to_int() diff --git a/tests/conformance.gd.uid b/tests/conformance.gd.uid new file mode 100644 index 0000000..ea48e41 --- /dev/null +++ b/tests/conformance.gd.uid @@ -0,0 +1 @@ +uid://cofxw7fkedxqj diff --git a/tests/screenshot.gd b/tests/screenshot.gd new file mode 100644 index 0000000..4795d96 --- /dev/null +++ b/tests/screenshot.gd @@ -0,0 +1,88 @@ +extends SceneTree +## Renders the game scene after some moves and saves a screenshot, for checking the look. Needs a +## display (not --headless). +## +## godot --script res://tests/screenshot.gd -- [--seed N] [--moves N] [--out PATH] [--top] [--north] [--select KEY|auto] + +var _game: Node +var _seed := 1 +var _moves := 40 +var _out := "/tmp/files-tcg-shot.png" +var _top := false +var _select := "" +var _human := 0 +var _frames := 0 +var _rng := RandomNumberGenerator.new() + + +func _init() -> void: + var args := OS.get_cmdline_user_args() + var i := 0 + while i < args.size(): + match args[i]: + "--seed": + i += 1 + _seed = int(args[i]) + "--moves": + i += 1 + _moves = int(args[i]) + "--out": + i += 1 + _out = args[i] + "--top": + _top = true + "--north": + _human = 1 + "--select": + i += 1 + _select = args[i] + i += 1 + _rng.seed = _seed + # Don't take keyboard focus or clicks from whatever you're doing while it renders. + DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_NO_FOCUS, true) + _game = load("res://scenes/game.tscn").instantiate() + _game.set_process_unhandled_input(false) + root.add_child.call_deferred(_game) + + +func _process(_delta: float) -> bool: + if not _game.is_node_ready(): + return false + _frames += 1 + if _frames == 2: + _game._paused = true + _game.hud.close_modal() + _game.start_game({"seed": _seed, "human": _human, "style": "greedy"}) + var m: LocalMatch = _game.match_ + var n := 0 + while n < _moves and not m.is_over(): + n += 1 + if m.bot_to_act(): + m.bot_step() + continue + var moves: Array = _game.moves + var others := moves.filter(func(mv): return mv.action.type not in ["end", "pass", "salvage"]) + if not others.is_empty() and _rng.randf() < 0.7: + _game._play(others[_rng.randi() % others.size()]) + else: + var stop := moves.filter(func(mv): return mv.action.type in ["end", "pass"]) + _game._play(stop[0] if not stop.is_empty() else moves[0]) + m.run_bot() + if _top: + _game.table.toggle_view() + if _select == "auto": + # The first hand card with a targeted move. + for mv in _game.moves: + if mv.source.begins_with("hand:") and mv.target != "none": + _select = mv.source + break + if _select != "": + _game._select(_select) + var card := _select.substr(5) if _select.begins_with("hand:") else "" + _game._inspect({"key": _select, "card": card}) + if _frames == 70: + var img := root.get_viewport().get_texture().get_image() + img.save_png(_out) + print("saved %s" % _out) + return true + return false diff --git a/tests/screenshot.gd.uid b/tests/screenshot.gd.uid new file mode 100644 index 0000000..aa03303 --- /dev/null +++ b/tests/screenshot.gd.uid @@ -0,0 +1 @@ +uid://c7keilqyjlpds diff --git a/tests/smoke.gd b/tests/smoke.gd new file mode 100644 index 0000000..da2003a --- /dev/null +++ b/tests/smoke.gd @@ -0,0 +1,40 @@ +extends SceneTree +## Plays random-vs-random games with every Set 1 card and checks the rule invariants after every +## action. Quicker than conformance for catching script errors; conformance checks the results. +## +## godot --headless --script res://tests/smoke.gd -- [--games N] [--seed N] [--rule K=V]... + + +func _init() -> void: + var games := 20 + var first := 1 + var rules := Rules.defaults() + var args := OS.get_cmdline_user_args() + var i := 0 + while i < args.size(): + match args[i]: + "--games": + i += 1 + games = int(args[i]) + "--seed": + i += 1 + first = int(args[i]) + "--rule": + i += 1 + rules = Rules.with_rule(rules, args[i]) + i += 1 + var pool := Cards.load_cards() + for w in CardScripts.stale_scripts(pool): + print("warning: %s" % w) + var started := Time.get_ticks_msec() + var failed := 0 + for seed in range(first, first + games): + Util.errors.clear() + var random: Callable = Play.bots().random + var s = Play.play_game({"pool": pool, "bots": [random, random], "seed": seed, "rules": rules, "check": true}) + if s == null or not Util.errors.is_empty(): + failed += 1 + print("seed %d: %s" % [seed, "; ".join(Util.errors)]) + var secs := (Time.get_ticks_msec() - started) / 1000.0 + print("smoke: %d/%d games ran clean (%.1fs)" % [games - failed, games, secs]) + quit(0 if failed == 0 else 1) diff --git a/tests/smoke.gd.uid b/tests/smoke.gd.uid new file mode 100644 index 0000000..56791b1 --- /dev/null +++ b/tests/smoke.gd.uid @@ -0,0 +1 @@ +uid://caxfhflrwc56n diff --git a/tests/table_smoke.gd b/tests/table_smoke.gd new file mode 100644 index 0000000..9748058 --- /dev/null +++ b/tests/table_smoke.gd @@ -0,0 +1,147 @@ +extends SceneTree +## Plays whole games through the game scene, headless: you are driven by random picks from the +## move list, the bot is the greedy bot. Checks that every legal move can be reached by clicking +## the table: a screen point clear of the panels whose raycast hits the move's source, and one for +## its target (or a button on the source's menu). Also checks that the table builds for every +## view and that nothing raises an engine error. +## +## godot --headless --script res://tests/table_smoke.gd -- [--games N] [--seed N] [--style S] [--threaded] +## +## --threaded lets the game run the bot itself, on its worker thread, as it does in play. + +var _game: Node +var _games := 3 +var _seed := 1 +var _style := "greedy" +var _played := 0 +var _steps := 0 +var _unreachable := {} +var _rng := RandomNumberGenerator.new() +var _started := 0 +var _failed := false +var _threaded := false +## The physics frame to wait for before the next check, so the bodies have moved with the cards. +var _wait := -1 +var _checks := 0 + + +func _init() -> void: + var args := OS.get_cmdline_user_args() + var i := 0 + while i < args.size(): + match args[i]: + "--games": + i += 1 + _games = int(args[i]) + "--seed": + i += 1 + _seed = int(args[i]) + "--style": + i += 1 + _style = args[i] + "--threaded": + _threaded = true + i += 1 + _rng.seed = _seed + Card3D.instant = true + _game = load("res://scenes/game.tscn").instantiate() + root.add_child.call_deferred(_game) + _started = Time.get_ticks_msec() + + +func _process(_delta: float) -> bool: + if _game == null or not _game.is_node_ready(): + return false + if _steps == 0 and _played == 0: + _new_game() + if Engine.get_physics_frames() < _wait: + return false + # Bot moves run until you decide; then wait for physics to catch up before checking. + for n in 200: + var m: LocalMatch = _game.match_ + if m.human_to_act() and not m.is_over() and Util.errors.is_empty(): + if _wait < 0: + _wait = Engine.get_physics_frames() + 2 + return false + _check_reachable(m) + _wait = -1 + if not _step(): + return true + if _threaded and m.bot_to_act(): + return false + if not m.bot_to_act(): + _wait = -1 + return false + return false + + +func _new_game() -> void: + _game._paused = not _threaded + _game.settings.botDelay = 0.0 + _game.hud.close_modal() + _game.start_game({"seed": _seed + _played, "human": _played % 2, "style": _style}) + Util.errors.clear() + + +## One move. Returns false when the run is over. +func _step() -> bool: + var m: LocalMatch = _game.match_ + if not Util.errors.is_empty(): + print("seed %d: engine error: %s" % [m.setup.seed, "; ".join(Util.errors)]) + _failed = true + return _finish() + if m.is_over(): + print("seed %d: %s after %d moves, turn %d" % [m.setup.seed, Hud.status_line(m.view(), m), m.actions.size(), m.s.turn]) + _played += 1 + if _played >= _games: + return _finish() + _new_game() + return true + if m.bot_to_act(): + if _threaded: + return true + _steps += 1 + m.bot_step() + return true + _steps += 1 + _check_reachable(m) + var moves: Array = _game.moves + var others := moves.filter(func(mv): return mv.action.type != "end" and mv.action.type != "pass" and mv.action.type != "salvage") + var pick: Dictionary + if not others.is_empty() and _rng.randf() < 0.6: + pick = others[_rng.randi() % others.size()] + else: + var stop := moves.filter(func(mv): return mv.action.type == "end" or mv.action.type == "pass") + pick = stop[0] if not stop.is_empty() else moves[_rng.randi() % moves.size()] + _game._play(pick) + return true + + +func _check_reachable(_m: LocalMatch) -> void: + _checks += 1 + var table: GameTable = _game.table + var found := {} + for mv in _game.moves: + if mv.source == "bar": + continue + var bad := "" + for key in [mv.source, mv.target]: + if key == "none" or found.has(key): + continue + if table.screen_point_for(key) != null: + found[key] = true + else: + bad = key + break + if bad != "": + var k := "%s (%s → %s, missing %s)" % [mv.group, mv.source.split(":")[0], mv.target.split(":")[0], bad.split(":")[0]] + if not _unreachable.has(k): + _unreachable[k] = mv.label + print("unreachable by clicking: %s: %s [%s]" % [k, mv.label, bad]) + + +func _finish() -> bool: + var secs := (Time.get_ticks_msec() - _started) / 1000.0 + print("table smoke: %d game(s), %d steps, %d click checks, %d unreachable move kinds, %.1fs" % [_played, _steps, _checks, _unreachable.size(), secs]) + quit(1 if _failed or not _unreachable.is_empty() else 0) + return false diff --git a/tests/table_smoke.gd.uid b/tests/table_smoke.gd.uid new file mode 100644 index 0000000..bf883d5 --- /dev/null +++ b/tests/table_smoke.gd.uid @@ -0,0 +1 @@ +uid://dies82ygd3so5 diff --git a/tests/traces/.gdignore b/tests/traces/.gdignore new file mode 100644 index 0000000..e69de29 diff --git a/tools/make_traces.sh b/tools/make_traces.sh new file mode 100755 index 0000000..d894f91 --- /dev/null +++ b/tools/make_traces.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# Regenerates the conformance traces in tests/traces from the TS sim (godot-plan.md §2), then the +# Godot runner checks them: +# godot --headless --script res://tests/conformance.gd +# +# Usage: tools/make_traces.sh [games] [sets...] (default 1000 games; every set) +# tools/make_traces.sh 1000 greedy nocards only the named sets +# SIM points at files-tcg/sim (default ~/Troglodyte-Chamber/files-tcg/sim). +set -euo pipefail + +SIM="${SIM:-$HOME/Troglodyte-Chamber/files-tcg/sim}" +OUT="$(cd "$(dirname "$0")/.." && pwd)/tests/traces" +GAMES="${1:-1000}" +shift || true +ONLY=("$@") + +trace() { # name games args... + local name="$1" games="$2" + shift 2 + if [ ${#ONLY[@]} -gt 0 ] && [[ ! " ${ONLY[*]} " == *" $name "* ]]; then return; fi + (cd "$SIM" && node src/trace.ts --out "$OUT/$name" -n "$games" "$@") +} + +mkdir -p "$OUT" +touch "$OUT/.gdignore" + +# Random-vs-random games with every Set 1 card, under the default rules. +trace main "$GAMES" +# Also checks the move-list labels (describe.ts), which costs more per step. +trace labels 100 --seed 5001 --labels +# The greedy bot (GreedyBot): the runner checks it picks what the TS bot picked at every step. +trace greedy 100 --seed 7001 --south greedy --north greedy +trace greedy-random 50 --seed 8001 --south greedy --north random +trace nocards 50 --seed 9001 --south nocards --north greedy diff --git a/tools/name_card_faces.py b/tools/name_card_faces.py new file mode 100755 index 0000000..ddb0487 --- /dev/null +++ b/tools/name_card_faces.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +"""Renames exported card fronts (front-4985.png, ...) to card-name file names. + +The card export writes one front per card copy, numbered in cards.csv row order. This matches +them up by sorting the numbers, names each file the way CardFaces.slug does ("Execute: Force +Reboot" -> execute-force-reboot.png), and gives each face the card-face import settings. A face +that already exists is replaced, keeping its .import file (and so its uid). + + tools/name_card_faces.py # show what would be renamed + tools/name_card_faces.py --apply # rename + tools/name_card_faces.py --csv PATH --dir PATH +""" +import argparse +import csv +import re +import sys +from pathlib import Path + +PROJECT = Path(__file__).resolve().parent.parent +DEFAULT_CSV = Path.home() / "Troglodyte-Chamber/files-tcg/decks/files-deck-1/cards.csv" +DEFAULT_DIR = PROJECT / "assets/cards" + +IMPORT = """[remap] + +importer="texture" +type="CompressedTexture2D" + +[params] + +compress/mode=2 +compress/high_quality=true +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 +""" + + +def slug(name: str) -> str: + return re.sub(r"[^a-z0-9]+", "-", name.lower()).strip("-") + + +def main() -> int: + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--csv", type=Path, default=DEFAULT_CSV) + ap.add_argument("--dir", type=Path, default=DEFAULT_DIR) + ap.add_argument("--apply", action="store_true", help="rename the files (default: only show the plan)") + args = ap.parse_args() + + with args.csv.open(newline="") as f: + rows = list(csv.DictReader(f)) + # One export per copy, so a card with Count 2 has two fronts. + names = [r["Name"] for r in rows for _ in range(int(r.get("Count") or 1))] + + fronts = sorted(args.dir.glob("front-*.png"), key=lambda p: int(re.search(r"\d+", p.stem).group())) + if len(fronts) != len(names): + print(f"{len(fronts)} fronts in {args.dir}, but {args.csv} has {len(names)} card copies. " + "Export every card, in CSV order, then run this again.", file=sys.stderr) + return 1 + + done: set[str] = set() + for front, name in zip(fronts, names): + target = args.dir / f"{slug(name)}.png" + if target.name in done: + # A later copy of a card that's already named. + print(f"{front.name} -> (copy of {name}, removed)") + if args.apply: + front.unlink() + front.with_suffix(".png.import").unlink(missing_ok=True) + continue + done.add(target.name) + replaced = " (replaces the old face)" if target.exists() else "" + print(f"{front.name} -> {target.name}{replaced}") + if not args.apply: + continue + front.replace(target) + stale = front.with_suffix(".png.import") + target_import = target.with_suffix(".png.import") + if target_import.exists(): + stale.unlink(missing_ok=True) + elif stale.exists(): + # Godot already imported the front: keep its uid, use the card-face settings. + uid = re.search(r'^uid="[^"]+"$', stale.read_text(), re.M) + text = IMPORT.replace('type="CompressedTexture2D"\n', f'type="CompressedTexture2D"\n{uid.group()}\n') if uid else IMPORT + target_import.write_text(text) + stale.unlink() + else: + target_import.write_text(IMPORT) + + if not args.apply: + print("\nNothing renamed yet. Run with --apply to rename.") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/sync_data.py b/tools/sync_data.py new file mode 100755 index 0000000..5885a7a --- /dev/null +++ b/tools/sync_data.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +"""Copies the card data the GDScript engine reads from the files-tcg repo into data/ +(godot-plan.md M0). Run it after editing cards.csv; the conformance runner refuses traces made from +a different CSV. + + tools/sync_data.py copy + tools/sync_data.py --check exit 1 if data/ is stale +""" +import argparse +import filecmp +import shutil +import sys +from pathlib import Path + +PROJECT = Path(__file__).resolve().parent.parent +DEFAULT_REPO = Path.home() / "Troglodyte-Chamber" / "files-tcg" + +# Repo path -> project path. +FILES = { + "decks/files-deck-1/cards.csv": "data/cards.csv", +} + + +def main() -> int: + ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + ap.add_argument("--repo", type=Path, default=DEFAULT_REPO, help="files-tcg checkout") + ap.add_argument("--check", action="store_true", help="only report stale files") + args = ap.parse_args() + + stale = [] + for src_rel, dst_rel in FILES.items(): + src, dst = args.repo / src_rel, PROJECT / dst_rel + if not src.exists(): + print(f"missing in repo: {src}", file=sys.stderr) + return 2 + if dst.exists() and filecmp.cmp(src, dst, shallow=False): + continue + stale.append(dst_rel) + if not args.check: + dst.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(src, dst) + print(f"updated {dst_rel}") + if args.check: + for f in stale: + print(f"stale: {f}") + return 1 if stale else 0 + if not stale: + print("data/ is up to date") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/ui/hud.gd b/ui/hud.gd new file mode 100644 index 0000000..450460c --- /dev/null +++ b/ui/hud.gd @@ -0,0 +1,826 @@ +class_name Hud +extends CanvasLayer +## The 2D layer over the table (godot-plan.md §4, "Anything with text is 2D"): the status bar, +## player panels, the action bar, prompts and menus, the card inspector, and the log, combat and +## move panels. It draws what Game hands it in refresh() and reports clicks as signals; it never +## builds an action. + +signal move_chosen(move: Dictionary) +signal source_picked(key: String) +signal cancel_pressed +signal end_command_pressed +signal view_toggled +signal new_game_requested(opts: Dictionary) +signal settings_changed(settings: Dictionary) + +const LEFT_W := 300 +const RIGHT_W := 340 +const COLORS := { + "bg": Color("#06090dE6"), "panel": Color("#0c1218EE"), "panel2": Color("#111a22"), "line": Color("#1e2a36"), + "text": Color("#d7dee6"), "muted": Color("#7d8a97"), "accent": Color("#2de2c4"), "warn": Color("#ffb454"), + "bad": Color("#ff6b6b"), "attack": Color("#ff5c7a"), +} +const OWNER_HEX: Array[String] = ["#56b4e9", "#e69f00"] +const STEPS := [["deploy", "Deploy"], ["play", "Play"], ["attack", "Attack"], ["playAgain", "Play again"]] +const STAT_LABELS := { + "capturesUnowned": "Open locations captured", "capturesUndefended": "Undefended enemy locations captured", + "capturesInCombat": "Locations won in combat", "attacks": "Attacks", "attacksWon": "Rolls won attacking", + "damageDealt": "Damage dealt", "anomaliesDestroyed": "Anomalies lost", "recalls": "Recalls", + "firewallsPlaced": "Firewalls placed", "bandwidthFromCaptures": "Gb from captures", + "bandwidthFromSalvage": "Gb from Salvage", "bandwidthOnCards": "Gb spent on cards", "cardsSalvaged": "Cards salvaged", + "hardwareInstalled": "Hardware installed", "programsInstalled": "Programs installed", + "executionsPlayed": "Executions played", "abilitiesUsed": "Abilities used", +} + +var theme: Theme +var _root: Control +var _status: Label +var _stack: Label +var _banner_text: RichTextLabel +var _panels: Array[RichTextLabel] = [] +var _steps: Label +var _primary: Button +var _end_command: Button +var _source_menu: PanelContainer +var _source_box: VBoxContainer +var _popover: PanelContainer +var _popover_box: VBoxContainer +var _inspector_art: TextureRect +var _inspector_text: RichTextLabel +var _tabs: TabContainer +var _log: RichTextLabel +var _combat: RichTextLabel +var _moves_box: VBoxContainer +var _modal: Control +var _modal_box: VBoxContainer +var _log_count := -1 +var _moves_version := -1 +var _primary_move := {} +var _art_cache := {} +var _settings := {"stops": "combat", "autoSkip": true, "checkInvariants": false, "botDelay": 0.45} + + +func _ready() -> void: + layer = 1 + theme = _make_theme() + _root = Control.new() + _root.theme = theme + _root.set_anchors_preset(Control.PRESET_FULL_RECT) + _root.mouse_filter = Control.MOUSE_FILTER_IGNORE + add_child(_root) + _build_top() + _build_left() + _build_right() + _build_center() + _modal = Control.new() + _modal.set_anchors_preset(Control.PRESET_FULL_RECT) + _modal.visible = false + _root.add_child(_modal) + + +# --------------------------------------------------------------------------------------------- +# Building + +func _make_theme() -> Theme: + var t := Theme.new() + var font := SystemFont.new() + font.font_names = PackedStringArray(["DejaVu Sans Mono", "Adwaita Mono", "monospace"]) + t.default_font = font + t.default_font_size = 14 + t.set_color("font_color", "Label", COLORS.text) + t.set_color("default_color", "RichTextLabel", COLORS.text) + var panel := _box(COLORS.panel, COLORS.line) + t.set_stylebox("panel", "PanelContainer", panel) + t.set_stylebox("normal", "Button", _box(COLORS.panel2, COLORS.line)) + t.set_stylebox("hover", "Button", _box(Color("#16222c"), COLORS.accent)) + t.set_stylebox("pressed", "Button", _box(Color("#0f2a2a"), COLORS.accent)) + t.set_stylebox("disabled", "Button", _box(Color("#0a0f14"), Color("#141c24"))) + t.set_stylebox("focus", "Button", StyleBoxEmpty.new()) + t.set_color("font_color", "Button", COLORS.text) + t.set_color("font_hover_color", "Button", Color.WHITE) + t.set_color("font_disabled_color", "Button", Color("#3c4652")) + return t + + +static func _box(bg: Color, border: Color, radius := 5) -> StyleBoxFlat: + var b := StyleBoxFlat.new() + b.bg_color = bg + b.border_color = border + b.set_border_width_all(1) + b.set_corner_radius_all(radius) + b.content_margin_left = 9 + b.content_margin_right = 9 + b.content_margin_top = 6 + b.content_margin_bottom = 6 + return b + + +func _build_top() -> void: + var bar := PanelContainer.new() + bar.set_anchors_preset(Control.PRESET_TOP_WIDE) + bar.add_theme_stylebox_override("panel", _box(COLORS.bg, COLORS.line, 0)) + _root.add_child(bar) + var row := HBoxContainer.new() + row.add_theme_constant_override("separation", 14) + bar.add_child(row) + var brand := Label.new() + brand.text = "FILES TCG" + brand.add_theme_color_override("font_color", COLORS.accent) + row.add_child(brand) + _status = Label.new() + row.add_child(_status) + _stack = Label.new() + _stack.add_theme_color_override("font_color", COLORS.warn) + _stack.size_flags_horizontal = Control.SIZE_EXPAND_FILL + _stack.clip_text = true + row.add_child(_stack) + row.add_child(_button("Top view T", func(): view_toggled.emit())) + row.add_child(_button("Settings", show_settings)) + row.add_child(_button("New game", func(): show_start({}))) + + +func _build_left() -> void: + var col := VBoxContainer.new() + col.position = Vector2(8, 44) + col.custom_minimum_size = Vector2(LEFT_W - 16, 0) + col.add_theme_constant_override("separation", 8) + _root.add_child(col) + for i in 2: + var pc := PanelContainer.new() + var rt := _rich() + rt.custom_minimum_size = Vector2(LEFT_W - 34, 0) + pc.add_child(rt) + col.add_child(pc) + _panels.append(rt) + var actions := PanelContainer.new() + var box := VBoxContainer.new() + box.add_theme_constant_override("separation", 6) + actions.add_child(box) + _banner_text = _rich() + _banner_text.custom_minimum_size = Vector2(LEFT_W - 34, 0) + box.add_child(_banner_text) + _steps = Label.new() + _steps.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + box.add_child(_steps) + _primary = _button("", func(): if not _primary_move.is_empty(): move_chosen.emit(_primary_move)) + _primary.custom_minimum_size = Vector2(0, 38) + _primary.add_theme_color_override("font_color", COLORS.accent) + box.add_child(_primary) + _end_command = _button("End command Enter", func(): end_command_pressed.emit()) + box.add_child(_end_command) + col.add_child(actions) + + +func _build_right() -> void: + var col := VBoxContainer.new() + col.anchor_left = 1.0 + col.anchor_right = 1.0 + col.anchor_bottom = 1.0 + col.offset_left = -RIGHT_W + 8 + col.offset_right = -8 + col.offset_top = 44 + col.offset_bottom = -8 + col.add_theme_constant_override("separation", 8) + _root.add_child(col) + var insp := PanelContainer.new() + var ib := HBoxContainer.new() + ib.add_theme_constant_override("separation", 8) + insp.add_child(ib) + _inspector_art = TextureRect.new() + _inspector_art.custom_minimum_size = Vector2(150, 210) + _inspector_art.expand_mode = TextureRect.EXPAND_IGNORE_SIZE + _inspector_art.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED + _inspector_art.visible = false + ib.add_child(_inspector_art) + _inspector_text = _rich() + _inspector_text.size_flags_horizontal = Control.SIZE_EXPAND_FILL + _inspector_text.custom_minimum_size = Vector2(0, 210) + _inspector_text.fit_content = false + _inspector_text.scroll_active = true + _inspector_text.add_theme_font_size_override("normal_font_size", 12) + _inspector_text.add_theme_font_size_override("bold_font_size", 13) + _inspector_text.text = "[color=#7d8a97]Point at a card, an Anomaly, a location or a gateway for its details.[/color]" + ib.add_child(_inspector_text) + col.add_child(insp) + # The picked source's moves, or your responses, between the inspector and the tabs. + _source_menu = PanelContainer.new() + _source_menu.visible = false + _source_menu.add_theme_stylebox_override("panel", _box(Color("#0d1a1c"), COLORS.accent)) + col.add_child(_source_menu) + _source_box = VBoxContainer.new() + _source_menu.add_child(_source_box) + _tabs = TabContainer.new() + _tabs.size_flags_vertical = Control.SIZE_EXPAND_FILL + col.add_child(_tabs) + _log = _rich() + _log.name = "Log" + _log.fit_content = false + _log.scroll_following = true + _log.scroll_active = true + _tabs.add_child(_log) + _combat = _rich() + _combat.name = "Combat" + _combat.fit_content = false + _combat.scroll_active = true + _tabs.add_child(_combat) + var scroll := ScrollContainer.new() + scroll.name = "Moves" + scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED + _moves_box = VBoxContainer.new() + _moves_box.size_flags_horizontal = Control.SIZE_EXPAND_FILL + scroll.add_child(_moves_box) + _tabs.add_child(scroll) + + +func _build_center() -> void: + _popover = PanelContainer.new() + _popover.visible = false + _root.add_child(_popover) + _popover_box = VBoxContainer.new() + _popover.add_child(_popover_box) + + +func _rich() -> RichTextLabel: + var rt := RichTextLabel.new() + rt.bbcode_enabled = true + rt.fit_content = true + rt.scroll_active = false + rt.selection_enabled = false + return rt + + +func _button(text: String, fn: Callable) -> Button: + var b := Button.new() + b.text = text + b.pressed.connect(fn) + b.focus_mode = Control.FOCUS_NONE + return b + + +func _clear(box: Node) -> void: + for c in box.get_children(): + box.remove_child(c) + c.queue_free() + + +# --------------------------------------------------------------------------------------------- +# Drawing + +## Redraws from the game's state. `ctx` holds: match, view, moves, selected, marks, thinking, paused, +## settings, me. +func refresh(ctx: Dictionary) -> void: + var m: LocalMatch = ctx.match + var v: Dictionary = ctx.view + var me: int = m.human + var my_turn := m.human_to_act() + var window = RulesEngine.open_window(v) + var in_window: bool = my_turn and window != null and v.choice == null + var my_choice: bool = my_turn and v.choice != null and v.choice.player == me + _status.text = status_line(v, m) + var items := [] + for it in v.stack: + items.append("%s (%s%s)" % [it.name.trim_prefix("Execute: "), State.player_name(it.player), " → %s" % it.target if it.target else ""]) + _stack.text = "Waiting: " + " ← ".join(items) if not items.is_empty() else "" + + _panels[0].text = _player_panel(v, m.bot_side, me, not my_turn and not v.over) + _panels[1].text = _player_panel(v, me, me, my_turn) + + # The action bar. + if v.active == me: + var parts := [] + for st in STEPS: + var on: bool = v.step == st[0] or (v.step == "resolve" and st[0] == "attack") + parts.append("[%s]" % st[1] if on else st[1]) + _steps.text = " ".join(parts) + else: + _steps.text = "%s's command" % State.player_name(m.bot_side) + _primary_move = {} + for mv in ctx.moves: + if mv.action.type == "pass": + _primary_move = mv + break + if _primary_move.is_empty(): + for mv in ctx.moves: + if mv.action.type == "end": + _primary_move = mv + break + if not _primary_move.is_empty() and v.choice == null: + _primary.text = "%s Space" % _primary_move.label + _primary.disabled = false + else: + _primary.text = "Game over" if v.over else ("%s is deciding…" % State.player_name(m.bot_side) if not my_turn else "Choose an option") + _primary.disabled = true + _end_command.disabled = not my_turn or v.choice != null or window != null or v.active != me + + _banner_text.text = _banner_for(ctx, in_window, my_turn) + _banner_text.visible = _banner_text.text != "" + _draw_source_menu(ctx, in_window, my_choice) + _draw_log(m) + _draw_combat(m, v, ctx) + if _moves_version != m.version: + _moves_version = m.version + _draw_moves(ctx.moves, v.over) + if my_choice: + _show_choice(v, ctx.moves) + elif _modal.visible and _modal.get_meta("kind", "") == "choice": + close_modal() + if v.over and not _modal.visible and not _modal.get_meta("closed_over", false): + _show_game_over(m) + + +static func status_line(v: Dictionary, m: LocalMatch) -> String: + var me := m.human + if v.over: + if v.winner == null: + return "Game over: a draw" + return "Game over: %s" % ("you win" if v.winner == me else "%s wins" % State.player_name(v.winner)) + var round := "Round %d · command %d" % [State.round_of(v, v.turn), v.turn] if v.rules.commands.on else "Turn %d" % v.turn + var whose := "your command" if v.active == me else "%s's command" % State.player_name(v.active) + var deciding := "your decision" if m.human_to_act() else "%s deciding" % State.player_name(m.bot_side) + return "%s · %s · %s step · %s" % [round, whose, Describe.STEP_NAMES[v.step], deciding] + + +func _player_panel(v: Dictionary, p: int, me: int, active: bool) -> String: + var pl: Dictionary = v.players[p] + var c: String = OWNER_HEX[p] + var held := State.grid_count(v, p) + var need: int = v.rules.winLocations + var bar := "■".repeat(held) + "□".repeat(maxi(0, need - held)) + var out := "[color=%s][b]%s[/b][/color] %s%s [b]%d Gb[/b]\n" % [c, State.player_name(p), "you" if p == me else "bot", " ◀" if active else "", pl.bandwidth] + out += "[color=%s]%s[/color] %d/%d locations\n" % [c, bar, held, need] + out += "[color=#7d8a97]hand[/color] %d [color=#7d8a97]deck[/color] %d [color=#7d8a97]discard[/color] %d [color=#7d8a97]Servers[/color] %d\n" % [pl.hand.size(), pl.deck.size(), pl.discard.size(), pl.serverPile.size()] + for i in pl.anomalies.size(): + var av: Dictionary = pl.anomalies[i] + var r := State.ref(p, i + 1) + if i >= 4 and av.at == null: + continue + var name := State.name_of(v, av.card) if av.card >= 0 and State.anomaly(v, State.original_of(r)).faceUp else "face down" + var where: String = av.at if av.at != null else ("in slot" if name != "face down" else "") + var n := "%d′" % (i - 3) if i >= 4 else str(i + 1) + var stats := GameTable.badge_text(v, r) + out += "[color=#7d8a97]%s[/color] %s [color=#7d8a97]%s[/color] %s\n" % [n, name, where, stats] + return out.strip_edges() + + +func _banner_for(ctx: Dictionary, in_window: bool, my_turn: bool) -> String: + var m: LocalMatch = ctx.match + var v: Dictionary = ctx.view + if v.over: + return "" + if in_window: + var w: Dictionary = RulesEngine.open_window(v) + var c = v.combat if v.combat != null and not v.combat.ended else null + var what := "" + var top = v.stack.back() if not v.stack.is_empty() else null + if w.kind == "preRoll" and c != null: + what = "Combat at %s, before the roll" % c.loc + elif w.kind == "postRoll" and c != null: + what = "Combat at %s, after the roll" % c.loc + elif top != null and top.player != m.human: + what = "%s %s %s%s" % [State.player_name(top.player), "plays" if top.kind == "execution" else "uses", top.name, " on %s" % top.target if top.target else ""] + else: + what = _last_by(m, m.bot_side).trim_suffix(".") + if what == "": + what = "A response window is open" + return "[color=#ffb454][b]%s: respond?[/b][/color] Pick a glowing card or Ability, or Space to pass." % what + if my_turn and v.choice == null: + var hint: String = { + "deploy": "Place, move or recall Anomalies, then advance one. A command is one advance or one attack.", + "play": "Play Hardware, Programs and Executions, and build Firewalls.", + "attack": "Attack from a location next to an enemy one.", + "resolve": "", "playAgain": "Play more cards, then end your command.", + }[v.step] + return "[color=#2de2c4][b]Your command.[/b][/color] %s" % hint + if not my_turn: + var last := _last_by(m, m.bot_side) + return "%s %s [color=#7d8a97]%s[/color]" % [State.player_name(m.bot_side), "is paused." if ctx.paused else "is deciding…", last] + return "" + + +static func _last_by(m: LocalMatch, p: int) -> String: + var lines := m.log_lines() + for i in range(lines.size() - 1, maxi(-1, lines.size() - 13), -1): + if lines[i].get("player") == p and lines[i].get("tag") != "turn": + return lines[i].text + return "" + + +func _draw_source_menu(ctx: Dictionary, in_window: bool, my_choice: bool) -> void: + _clear(_source_box) + var v: Dictionary = ctx.view + var selected: String = ctx.selected + _source_menu.visible = false + if my_choice: + return + if selected != "": + var mine := (ctx.moves as Array).filter(func(mv): return mv.source == selected) + var untargeted := mine.filter(func(mv): return mv.target == "none") + var targeted := mine.filter(func(mv): return mv.target != "none") + _source_box.add_child(_title(source_title(v, selected, ctx.match.human))) + if not targeted.is_empty(): + _source_box.add_child(_muted("Click a highlighted %s." % _target_words(targeted))) + if ctx.get("preview", "") != "": + _source_box.add_child(_muted("Attack odds: %s" % ctx.preview)) + for mv in untargeted: + _source_box.add_child(_move_button(mv)) + _source_box.add_child(_button("Cancel Esc", func(): cancel_pressed.emit())) + _source_menu.visible = true + elif in_window: + var by_source := {} + for mv in ctx.moves: + if mv.action.type == "pass" or mv.action.type == "salvage": + continue + if not by_source.has(mv.source): + by_source[mv.source] = [] + by_source[mv.source].append(mv) + _source_box.add_child(_title("Your responses")) + for src in by_source: + var list: Array = by_source[src] + if list.size() == 1: + _source_box.add_child(_move_button(list[0])) + else: + var key: String = src + _source_box.add_child(_button("%s · %d ways" % [source_title(v, key, ctx.match.human), list.size()], func(): source_picked.emit(key))) + if not _primary_move.is_empty(): + _source_box.add_child(_move_button(_primary_move, "Pass Space")) + _source_menu.visible = true + + +func _title(text: String) -> Label: + var l := Label.new() + l.text = text + l.add_theme_color_override("font_color", COLORS.accent) + return l + + +func _muted(text: String) -> Label: + var l := Label.new() + l.text = text + l.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + l.add_theme_color_override("font_color", COLORS.muted) + return l + + +func _move_button(mv: Dictionary, text := "") -> Button: + var b := _button(text if text != "" else mv.label, func(): move_chosen.emit(mv)) + b.alignment = HORIZONTAL_ALIGNMENT_LEFT + b.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + return b + + +static func source_title(v: Dictionary, key: String, me: int) -> String: + var r = Moves.ref_of_key(key) + if r != null: + return Describe.ref_name(v, r, me) + if key.begins_with("hand:"): + return key.substr(5) + if key.begins_with("loc:"): + var loc := key.substr(4) + var server = v.locations[loc].server + return loc + (": %s" % State.name_of(v, server) if server != null else "") + if key.begins_with("gate:"): + return "Gateway %s" % Describe.line_name(key.substr(5)) + return key + + +static func _target_words(moves: Array) -> String: + var words := [] + for mv in moves: + var kind: String = mv.target.split(":")[0] + var w: String = {"loc": "location", "anomaly": "Anomaly", "gate": "gateway", "hand": "card"}.get(kind, kind) + if not words.has(w): + words.append(w) + return " or ".join(words) + + +## A menu of moves at the mouse, for several moves on one target. +func show_popover(moves: Array, at: Vector2) -> void: + _clear(_popover_box) + for mv in moves: + _popover_box.add_child(_move_button(mv)) + _popover_box.add_child(_button("Cancel", hide_popover)) + _popover.visible = true + _popover.reset_size() + var vp := _root.get_viewport_rect().size + _popover.position = Vector2(minf(at.x, vp.x - _popover.size.x - 8), clampf(at.y, 8, vp.y - _popover.size.y - 8)) + + +func hide_popover() -> void: + _popover.visible = false + + +func popover_open() -> bool: + return _popover.visible + + +func _draw_log(m: LocalMatch) -> void: + var lines := m.log_lines() + if lines.size() == _log_count: + return + if lines.size() < _log_count: + _log.clear() + _log_count = 0 + for i in range(maxi(0, _log_count), lines.size()): + var l: Dictionary = lines[i] + if l.text == "": + continue + var color := "#7d8a97" + if l.get("tag") == "turn": + color = "#d7dee6" + elif l.get("player") != null: + color = OWNER_HEX[l.player] + elif l.get("tag") == "combat": + color = "#ff8aa0" + _log.append_text("[color=%s]%s[/color]\n" % [color, _escape(l.text)]) + _log_count = lines.size() + + +static func _escape(t: String) -> String: + return t.replace("[", "[lb]") + + +func _draw_combat(m: LocalMatch, v: Dictionary, ctx: Dictionary) -> void: + var c = m.combat() + if c == null: + _combat.text = "[color=#7d8a97]No combat yet. Combats show here with each side's Cores, dice and damage.[/color]" + return + # This combat's log lines: from its start up to the next combat. + var own := m.log_lines().slice(c.logFrom) + var mine := own + for i in range(1, own.size()): + if own[i].get("tag") == "combat" and own[i].text.begins_with("Combat at"): + mine = own.slice(0, i) + break + var fighter := func(f: Dictionary, role: String) -> String: + var name := Describe.ref_name(v, f.ref, m.human) + var parts := [] + for part in f.parts: + parts.append("%+d %s" % [part.cores, part.source] if part.kind != "anomaly" else "%d %s" % [part.cores, part.source]) + var dice := ", ".join(f.dice.map(func(d): return str(d))) + var out := "[color=%s][b]%s[/b][/color] %s\n [b]%d Cores[/b] [color=#7d8a97]%s[/color]\n" % [ + OWNER_HEX[f.ref.player], role, name, f.cores, ", ".join(parts)] + if dice != "": + out += " dice: %s = [b]%d[/b]\n" % [dice, Util.sum(f.dice)] + var took := 0 + var dead := false + for l in mine: + var r = l.get("ref") + if r != null and l.get("amount") != null and State.same_ref(r, f.ref): + took += l.amount + dead = dead or l.text.contains("destroyed") + if v.rules.health.on and f.health > 0: + out += " %d/%d Health before the result" % [f.healthLeft, f.health] + if took > 0: + out += " [color=#ff6b6b][b]took %d%s[/b][/color]" % [took, ", destroyed" if dead else ""] + out += "\n" + return out + var stage := "ended early" if c.done and c.ended else ("over" if c.done else ("after the roll" if c.rolled else "before the roll")) + var kind: String = "Trace Route" if c.kind == "traceRoute" else c.kind + var out := "[b]Combat at %s[/b] [color=#7d8a97]%s · %s[/color]\n\n" % [c.loc, kind, stage] + out += fighter.call(c.attacker, "Attacker") + for d in c.defenders: + out += "\n" + fighter.call(d, "Defender") + if not c.rolled and not c.done and not ctx.thinking: + var atk: int = c.attacker.cores + var def := 0 + for d in c.defenders: + def += d.cores + var o := Odds.roll_odds(atk, def) + out += "\n[color=#7d8a97]%d vs %d Cores: win %d%% · tie %d%% · lose %d%%\nAverage damage: %.1f to the defender, %.1f to the attacker[/color]\n" % [ + atk, def, roundi(o.win * 100), roundi(o.tie * 100), roundi(o.lose * 100), o.damageDealt, o.damageTaken] + # What happened: the result, damage, captures and cards played in it, after the opening line. + var result := [] + for i in range(1, mine.size()): + var l: Dictionary = mine[i] + if l.text == "" or l.text.begins_with("Roll:"): + continue + if l.get("tag") == "combat" or l.get("tag") == "capture": + var color: String = OWNER_HEX[l.player] if l.get("player") != null else "#d7dee6" + result.append("[color=%s]%s[/color]" % [color, _escape(l.text)]) + if not result.is_empty(): + out += "\n" + "\n".join(result) + _combat.text = out + + +func _draw_moves(moves: Array, over: bool) -> void: + _clear(_moves_box) + if moves.is_empty(): + _moves_box.add_child(_muted("Game over." if over else "Nothing to do until the bot moves.")) + return + for g in Moves.group_moves(moves): + _moves_box.add_child(_title(g[0])) + for mv in g[1]: + _moves_box.add_child(_move_button(mv)) + + +## Shows a card or board object in the inspector: `info` is {art: card name or "", text: bbcode}. +func inspect(info: Dictionary) -> void: + var art: String = info.get("art", "") + _inspector_art.texture = _art(art) if art != "" else null + _inspector_art.visible = art != "" + _inspector_text.text = info.get("text", "") + + +func _art(card_name: String) -> Texture2D: + if not _art_cache.has(card_name): + var path := CardFaces.CARD_DIR + CardFaces.slug(card_name) + ".png" + _art_cache[card_name] = load(path) if ResourceLoader.exists(path) else null + return _art_cache[card_name] + + +func show_log_tab() -> void: + _tabs.current_tab = 0 + + +func show_combat_tab() -> void: + _tabs.current_tab = 1 + + +# --------------------------------------------------------------------------------------------- +# Dialogs + +func _open_modal(kind: String, width := 520) -> VBoxContainer: + _clear(_modal) + _modal.set_meta("kind", kind) + var dim := ColorRect.new() + dim.color = Color(0, 0, 0, 0.45 if kind != "choice" else 0.2) + dim.set_anchors_preset(Control.PRESET_FULL_RECT) + _modal.add_child(dim) + var center := CenterContainer.new() + center.set_anchors_preset(Control.PRESET_FULL_RECT) + _modal.add_child(center) + var pc := PanelContainer.new() + pc.custom_minimum_size = Vector2(width, 0) + center.add_child(pc) + _modal_box = VBoxContainer.new() + _modal_box.add_theme_constant_override("separation", 8) + pc.add_child(_modal_box) + _modal.visible = true + return _modal_box + + +func close_modal() -> void: + _modal.visible = false + _clear(_modal) + _modal.set_meta("kind", "") + + +func modal_open() -> bool: + return _modal.visible + + +func _show_choice(v: Dictionary, moves: Array) -> void: + var key := "%s:%d:%d" % [v.choice.kind, moves.size(), v.seq] + if _modal.visible and _modal.get_meta("choice_key", "") == key: + return + var box := _open_modal("choice", 560) + _modal.set_meta("choice_key", key) + var prompt := Label.new() + prompt.text = v.choice.prompt + prompt.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART + prompt.add_theme_color_override("font_color", COLORS.accent) + box.add_child(prompt) + var options := moves.filter(func(mv): return mv.action.type == "choose") + for mv in options: + box.add_child(_move_button(mv)) + var blocked := [] + for i in v.choice.options.size(): + if not options.any(func(mv): return mv.action.index == i): + var o: Dictionary = v.choice.options[i] + blocked.append("%s (%d Gb)" % [o.label, o.get("cost", 0)]) + if not blocked.is_empty(): + box.add_child(_muted("Not enough Gb for: %s. Salvage a card first." % ", ".join(blocked))) + for mv in moves.filter(func(x): return x.action.type == "salvage"): + box.add_child(_move_button(mv)) + + +func _show_game_over(m: LocalMatch) -> void: + var s := m.s + var me := m.human + var box := _open_modal("over", 560) + var title := "A draw" if s.winner == null else ("You win" if s.winner == me else "%s (the bot) wins" % State.player_name(s.winner)) + box.add_child(_title(title)) + var reason := "%s holds %d locations." % [State.player_name(s.winner), s.rules.winLocations] if s.endReason == "win" else "The turn limit was reached." + box.add_child(_muted("%s Round %d, seed %d." % [reason, State.round_of(s, s.turn), m.setup.seed])) + var grid := GridContainer.new() + grid.columns = 3 + grid.add_theme_constant_override("h_separation", 18) + for t in ["", "%s (you)" % State.player_name(me), "%s (bot)" % State.player_name(m.bot_side)]: + grid.add_child(_title(t)) + for k in Types.STAT_KEYS: + if not STAT_LABELS.has(k) or (s.stats[k][0] == 0 and s.stats[k][1] == 0): + continue + for t in [STAT_LABELS[k], str(s.stats[k][me]), str(s.stats[k][m.bot_side])]: + var l := Label.new() + l.text = t + grid.add_child(l) + box.add_child(grid) + var row := HBoxContainer.new() + row.add_child(_button("New game", func(): show_start({}))) + row.add_child(_button("Rematch", func(): + close_modal() + new_game_requested.emit({"seed": m.setup.seed, "human": m.human, "style": m.setup.get("style", "greedy")}))) + row.add_child(_button("Look at the board", func(): + close_modal() + _modal.set_meta("closed_over", true))) + box.add_child(row) + + +## The new-game dialog. `defaults` may hold seed, human and style. +func show_start(defaults: Dictionary) -> void: + var box := _open_modal("start", 480) + box.add_child(_title("New game against the bot")) + box.add_child(_muted("Both decks are dealt at random from Set 1, from the seed.")) + var grid := GridContainer.new() + grid.columns = 2 + grid.add_theme_constant_override("h_separation", 12) + box.add_child(grid) + var seed_edit := LineEdit.new() + seed_edit.text = str(defaults.get("seed", randi_range(1, 999999))) + seed_edit.custom_minimum_size = Vector2(200, 0) + grid.add_child(_label("Seed")) + grid.add_child(seed_edit) + var side := OptionButton.new() + side.add_item("South (S1)") + side.add_item("North (S2)") + side.selected = defaults.get("human", 0) + grid.add_child(_label("You play")) + grid.add_child(side) + var style := OptionButton.new() + var styles: Dictionary = GreedyBot.STYLES + var keys := styles.keys() + for k in keys: + style.add_item(styles[k].label) + style.selected = maxi(0, keys.find(defaults.get("style", "greedy"))) + grid.add_child(_label("Bot")) + grid.add_child(style) + var about := _muted(styles[keys[style.selected]].about) + box.add_child(about) + style.item_selected.connect(func(i): about.text = styles[keys[i]].about) + var row := HBoxContainer.new() + row.add_child(_button("Start", func(): + var opts := {"seed": int(seed_edit.text) if seed_edit.text.is_valid_int() else randi_range(1, 999999), + "human": side.selected, "style": keys[style.selected]} + close_modal() + new_game_requested.emit(opts))) + if defaults.get("cancel", true): + row.add_child(_button("Cancel", close_modal)) + box.add_child(row) + + +func _label(text: String) -> Label: + var l := Label.new() + l.text = text + return l + + +## Settings: when the game stops for you, skipping, bot speed, invariant checks. +func show_settings(settings := {}) -> void: + if settings.is_empty(): + settings = _settings + var box := _open_modal("settings", 520) + box.add_child(_title("Settings")) + box.add_child(_label("When the game stops for you to respond")) + var stops := OptionButton.new() + var stop_ids := ["combat", "all", "never"] + for label in ["In combat only", "Every opponent move", "Never"]: + stops.add_item(label) + stops.selected = maxi(0, stop_ids.find(settings.stops)) + box.add_child(stops) + box.add_child(_muted("Hold Shift to stop at the next window anyway.")) + var skip := CheckBox.new() + skip.text = "Skip steps where End and Salvage are the only moves" + skip.button_pressed = settings.autoSkip + box.add_child(skip) + var check := CheckBox.new() + check.text = "Check the rule invariants after every move" + check.button_pressed = settings.checkInvariants + box.add_child(check) + var speed_label := _label("") + box.add_child(speed_label) + var speed := HSlider.new() + speed.min_value = 0.0 + speed.max_value = 1.5 + speed.step = 0.05 + speed.value = settings.botDelay + var show_speed := func(x): speed_label.text = "Bot speed: %.2fs per move" % x + show_speed.call(speed.value) + speed.value_changed.connect(show_speed) + box.add_child(speed) + box.add_child(_button("Done", func(): + var out := {"stops": stop_ids[stops.selected], "autoSkip": skip.button_pressed, "checkInvariants": check.button_pressed, "botDelay": speed.value} + _settings = out + close_modal() + settings_changed.emit(out))) + + +func set_settings(settings: Dictionary) -> void: + _settings = settings.duplicate() + + +func reset_for_new_game() -> void: + _log.clear() + _log_count = -1 + _moves_version = -1 + _modal.set_meta("closed_over", false) + hide_popover() diff --git a/ui/hud.gd.uid b/ui/hud.gd.uid new file mode 100644 index 0000000..0d1f8ba --- /dev/null +++ b/ui/hud.gd.uid @@ -0,0 +1 @@ +uid://dmv52kejr6l24