From 72459ab1290ed1861d960fc758365dfe386d2601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Pi=C3=B1ones?= <30808181+dpinones@users.noreply.github.com> Date: Sat, 2 Nov 2024 21:38:29 -0300 Subject: [PATCH] JOPN-464: Integrate adventurer (#20) * wip integrate adventurer * add mock erc721 * add interface * add interface * add use_adventurer * integrate aventurer * update state --- manifests/dev/deployment/manifest.json | 3992 +++++++++++++++------- manifests/dev/deployment/manifest.toml | 82 +- scripts/enviroment.sh | 5 + src/interfaces/erc721.cairo | 7 + src/interfaces/loot_survivor.cairo | 48 + src/lib.cairo | 8 + src/models/data/adventurer.cairo | 10 + src/models/status/game/game.cairo | 4 +- src/models/status/round/adventurer.cairo | 57 + src/models/status/round/beast.cairo | 3 +- src/systems/game_system.cairo | 71 +- src/tests/test_game_play_beast.cairo | 8 +- src/utils/adventurer.cairo | 14 + 13 files changed, 2990 insertions(+), 1319 deletions(-) create mode 100644 src/interfaces/erc721.cairo create mode 100644 src/interfaces/loot_survivor.cairo create mode 100644 src/models/data/adventurer.cairo create mode 100644 src/models/status/round/adventurer.cairo create mode 100644 src/utils/adventurer.cairo diff --git a/manifests/dev/deployment/manifest.json b/manifests/dev/deployment/manifest.json index 7e1c240..dc43b91 100644 --- a/manifests/dev/deployment/manifest.json +++ b/manifests/dev/deployment/manifest.json @@ -1256,8 +1256,8 @@ { "kind": "DojoContract", "address": "0x6a41badee85305fa1aac33488860360c66b60d7f3b204d6e2cd84071dc3c394", - "class_hash": "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5", - "original_class_hash": "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5", + "class_hash": "0x6064cd42481d56780719611f314fd168f59da3e319e4fdaf3606c3483563db0", + "original_class_hash": "0x6064cd42481d56780719611f314fd168f59da3e319e4fdaf3606c3483563db0", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -1424,6 +1424,38 @@ "outputs": [], "state_mutability": "external" }, + { + "type": "function", + "name": "create_reward", + "inputs": [ + { + "name": "game_id", + "type": "core::integer::u32" + }, + { + "name": "reward_index", + "type": "core::integer::u8" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "select_reward", + "inputs": [ + { + "name": "game_id", + "type": "core::integer::u32" + }, + { + "name": "cards_index", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, { "type": "function", "name": "select_deck", @@ -1555,6 +1587,22 @@ ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "use_adventurer", + "inputs": [ + { + "name": "game_id", + "type": "core::integer::u32" + }, + { + "name": "adventurer_id", + "type": "core::integer::u32" + } + ], + "outputs": [], + "state_mutability": "external" } ] }, @@ -1647,7 +1695,10 @@ "play", "discard", "end_turn", + "create_reward", + "select_reward", "select_deck", + "use_adventurer", "select_special_cards", "select_modifier_cards", "discard_effect_card", @@ -1982,8 +2033,8 @@ { "kind": "DojoContract", "address": "0x75602558fd679c49be1a6ccb73e3d6d842f0558e1f41c4013ce109d05a5790f", - "class_hash": "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d", - "original_class_hash": "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d", + "class_hash": "0x4da1956c768854cdfddd16b65b34b7ce24c2c44a2acf60b1f2592475b503fa2", + "original_class_hash": "0x4da1956c768854cdfddd16b65b34b7ce24c2c44a2acf60b1f2592475b503fa2", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -2231,48 +2282,23 @@ "kind": "DojoModel", "members": [ { - "name": "game_id", + "name": "adventurer_id", "type": "u32", "key": true }, { - "name": "beast_id", - "type": "u32", - "key": false - }, - { - "name": "tier", - "type": "u8", - "key": false - }, - { - "name": "level", - "type": "u8", - "key": false - }, - { - "name": "health", - "type": "u32", - "key": false - }, - { - "name": "current_health", - "type": "u32", - "key": false - }, - { - "name": "attack", - "type": "u32", + "name": "owner", + "type": "ContractAddress", "key": false }, { - "name": "type_beast", - "type": "TypeBeast", + "name": "consumed", + "type": "bool", "key": false } ], - "class_hash": "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf", - "original_class_hash": "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf", + "class_hash": "0x79045f9b971b4009a1822c5471f5b54365f86045fbf1ca4745a441195ec8c40", + "original_class_hash": "0x79045f9b971b4009a1822c5471f5b54365f86045fbf1ca4745a441195ec8c40", "abi": [ { "type": "impl", @@ -2638,64 +2664,44 @@ }, { "type": "impl", - "name": "beastImpl", - "interface_name": "jokers_of_neon::models::data::beast::Ibeast" + "name": "adventurer_consumedImpl", + "interface_name": "jokers_of_neon::models::data::adventurer::Iadventurer_consumed" }, { "type": "enum", - "name": "jokers_of_neon::models::data::beast::TypeBeast", + "name": "core::bool", "variants": [ { - "name": "LOOT_SURVIVOR", + "name": "False", "type": "()" }, { - "name": "JOKERS_OF_NEON", + "name": "True", "type": "()" } ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::beast::Beast", + "name": "jokers_of_neon::models::data::adventurer::AdventurerConsumed", "members": [ { - "name": "game_id", - "type": "core::integer::u32" - }, - { - "name": "beast_id", - "type": "core::integer::u32" - }, - { - "name": "tier", - "type": "core::integer::u8" - }, - { - "name": "level", - "type": "core::integer::u8" - }, - { - "name": "health", - "type": "core::integer::u32" - }, - { - "name": "current_health", + "name": "adventurer_id", "type": "core::integer::u32" }, { - "name": "attack", - "type": "core::integer::u32" + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "type_beast", - "type": "jokers_of_neon::models::data::beast::TypeBeast" + "name": "consumed", + "type": "core::bool" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::beast::Ibeast", + "name": "jokers_of_neon::models::data::adventurer::Iadventurer_consumed", "items": [ { "type": "function", @@ -2703,7 +2709,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::beast::Beast" + "type": "jokers_of_neon::models::data::adventurer::AdventurerConsumed" } ], "outputs": [], @@ -2713,31 +2719,61 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::beast::beast::Event", + "name": "jokers_of_neon::models::data::adventurer::adventurer_consumed::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-Beast", - "qualified_path": "jokers_of_neon::models::data::beast::beast", - "manifest_name": "jokers_of_neon-Beast-35a29cda" + "tag": "jokers_of_neon-AdventurerConsumed", + "qualified_path": "jokers_of_neon::models::data::adventurer::adventurer_consumed", + "manifest_name": "jokers_of_neon-AdventurerConsumed-5d6c7696" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "game_id", + "type": "u32", "key": true }, + { + "name": "beast_id", + "type": "u32", + "key": false + }, + { + "name": "tier", + "type": "u8", + "key": false + }, + { + "name": "level", + "type": "u8", + "key": false + }, + { + "name": "health", + "type": "u32", + "key": false + }, + { + "name": "current_health", + "type": "u32", + "key": false + }, { "name": "attack", "type": "u32", "key": false + }, + { + "name": "type_beast", + "type": "TypeBeast", + "key": false } ], - "class_hash": "0x5af087ffc9c3c2437a78b8884eb1bd53eaeb3207a4a68c35fc0c8c4744d12ef", - "original_class_hash": "0x5af087ffc9c3c2437a78b8884eb1bd53eaeb3207a4a68c35fc0c8c4744d12ef", + "class_hash": "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf", + "original_class_hash": "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf", "abi": [ { "type": "impl", @@ -3103,26 +3139,64 @@ }, { "type": "impl", - "name": "beast_attackImpl", - "interface_name": "jokers_of_neon::models::data::events::Ibeast_attack" + "name": "beastImpl", + "interface_name": "jokers_of_neon::models::data::beast::Ibeast" + }, + { + "type": "enum", + "name": "jokers_of_neon::models::data::beast::TypeBeast", + "variants": [ + { + "name": "LOOT_SURVIVOR", + "type": "()" + }, + { + "name": "JOKERS_OF_NEON", + "type": "()" + } + ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::BeastAttack", + "name": "jokers_of_neon::models::data::beast::Beast", "members": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "game_id", + "type": "core::integer::u32" + }, + { + "name": "beast_id", + "type": "core::integer::u32" + }, + { + "name": "tier", + "type": "core::integer::u8" + }, + { + "name": "level", + "type": "core::integer::u8" + }, + { + "name": "health", + "type": "core::integer::u32" + }, + { + "name": "current_health", + "type": "core::integer::u32" }, { "name": "attack", "type": "core::integer::u32" + }, + { + "name": "type_beast", + "type": "jokers_of_neon::models::data::beast::TypeBeast" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ibeast_attack", + "name": "jokers_of_neon::models::data::beast::Ibeast", "items": [ { "type": "function", @@ -3130,7 +3204,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BeastAttack" + "type": "jokers_of_neon::models::data::beast::Beast" } ], "outputs": [], @@ -3140,46 +3214,31 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::beast_attack::Event", + "name": "jokers_of_neon::models::data::beast::beast::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-BeastAttack", - "qualified_path": "jokers_of_neon::models::data::events::beast_attack", - "manifest_name": "jokers_of_neon-BeastAttack-46464e29" + "tag": "jokers_of_neon-Beast", + "qualified_path": "jokers_of_neon::models::data::beast::beast", + "manifest_name": "jokers_of_neon-Beast-35a29cda" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u32", - "key": true - }, - { - "name": "idx", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "blister_pack_id", - "type": "u32", - "key": false - }, - { - "name": "cost", + "name": "attack", "type": "u32", "key": false - }, - { - "name": "purchased", - "type": "bool", - "key": false } ], - "class_hash": "0x5c83fb072bedb835ecfd14432d82495c086e5f2089f390dcf8613da319d7f8e", - "original_class_hash": "0x5c83fb072bedb835ecfd14432d82495c086e5f2089f390dcf8613da319d7f8e", + "class_hash": "0x5af087ffc9c3c2437a78b8884eb1bd53eaeb3207a4a68c35fc0c8c4744d12ef", + "original_class_hash": "0x5af087ffc9c3c2437a78b8884eb1bd53eaeb3207a4a68c35fc0c8c4744d12ef", "abi": [ { "type": "impl", @@ -3545,52 +3604,26 @@ }, { "type": "impl", - "name": "blister_pack_itemImpl", - "interface_name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_item" + "name": "beast_attackImpl", + "interface_name": "jokers_of_neon::models::data::events::Ibeast_attack" }, { - "type": "enum", - "name": "core::bool", - "variants": [ + "type": "struct", + "name": "jokers_of_neon::models::data::events::BeastAttack", + "members": [ { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "jokers_of_neon::models::status::shop::shop::BlisterPackItem", - "members": [ - { - "name": "game_id", - "type": "core::integer::u32" - }, - { - "name": "idx", - "type": "core::integer::u32" - }, - { - "name": "blister_pack_id", - "type": "core::integer::u32" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "cost", + "name": "attack", "type": "core::integer::u32" - }, - { - "name": "purchased", - "type": "core::bool" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_item", + "name": "jokers_of_neon::models::data::events::Ibeast_attack", "items": [ { "type": "function", @@ -3598,7 +3631,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::shop::shop::BlisterPackItem" + "type": "jokers_of_neon::models::data::events::BeastAttack" } ], "outputs": [], @@ -3608,14 +3641,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::status::shop::shop::blister_pack_item::Event", + "name": "jokers_of_neon::models::data::events::beast_attack::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-BlisterPackItem", - "qualified_path": "jokers_of_neon::models::status::shop::shop::blister_pack_item", - "manifest_name": "jokers_of_neon-BlisterPackItem-57733b8c" + "tag": "jokers_of_neon-BeastAttack", + "qualified_path": "jokers_of_neon::models::data::events::beast_attack", + "manifest_name": "jokers_of_neon-BeastAttack-46464e29" }, { "kind": "DojoModel", @@ -3626,18 +3659,28 @@ "key": true }, { - "name": "cards_picked", - "type": "bool", + "name": "idx", + "type": "u32", + "key": true + }, + { + "name": "blister_pack_id", + "type": "u32", "key": false }, { - "name": "cards", - "type": "Span", + "name": "cost", + "type": "u32", + "key": false + }, + { + "name": "purchased", + "type": "bool", "key": false } ], - "class_hash": "0x23d3777b1da18fb7a80a94e5960d6a8cfce27155a0f1d96f579c165524d1e70", - "original_class_hash": "0x23d3777b1da18fb7a80a94e5960d6a8cfce27155a0f1d96f579c165524d1e70", + "class_hash": "0x5c83fb072bedb835ecfd14432d82495c086e5f2089f390dcf8613da319d7f8e", + "original_class_hash": "0x5c83fb072bedb835ecfd14432d82495c086e5f2089f390dcf8613da319d7f8e", "abi": [ { "type": "impl", @@ -4003,8 +4046,8 @@ }, { "type": "impl", - "name": "blister_pack_resultImpl", - "interface_name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_result" + "name": "blister_pack_itemImpl", + "interface_name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_item" }, { "type": "enum", @@ -4022,35 +4065,33 @@ }, { "type": "struct", - "name": "core::array::Span::", - "members": [ - { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "type": "struct", - "name": "jokers_of_neon::models::status::shop::shop::BlisterPackResult", + "name": "jokers_of_neon::models::status::shop::shop::BlisterPackItem", "members": [ { "name": "game_id", "type": "core::integer::u32" }, { - "name": "cards_picked", - "type": "core::bool" + "name": "idx", + "type": "core::integer::u32" }, { - "name": "cards", - "type": "core::array::Span::" + "name": "blister_pack_id", + "type": "core::integer::u32" + }, + { + "name": "cost", + "type": "core::integer::u32" + }, + { + "name": "purchased", + "type": "core::bool" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_result", + "name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_item", "items": [ { "type": "function", @@ -4058,7 +4099,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::shop::shop::BlisterPackResult" + "type": "jokers_of_neon::models::status::shop::shop::BlisterPackItem" } ], "outputs": [], @@ -4068,14 +4109,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::status::shop::shop::blister_pack_result::Event", + "name": "jokers_of_neon::models::status::shop::shop::blister_pack_item::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-BlisterPackResult", - "qualified_path": "jokers_of_neon::models::status::shop::shop::blister_pack_result", - "manifest_name": "jokers_of_neon-BlisterPackResult-2fcefd2c" + "tag": "jokers_of_neon-BlisterPackItem", + "qualified_path": "jokers_of_neon::models::status::shop::shop::blister_pack_item", + "manifest_name": "jokers_of_neon-BlisterPackItem-57733b8c" }, { "kind": "DojoModel", @@ -4086,23 +4127,18 @@ "key": true }, { - "name": "level", - "type": "u32", - "key": true - }, - { - "name": "idx", - "type": "u32", - "key": true + "name": "cards_picked", + "type": "bool", + "key": false }, { - "name": "blister_pack_id", - "type": "u32", + "name": "cards", + "type": "Span", "key": false } ], - "class_hash": "0x7adba2677583267bfddbb599ea6dfbd67c8e62437e8db6696d61c59c34548a0", - "original_class_hash": "0x7adba2677583267bfddbb599ea6dfbd67c8e62437e8db6696d61c59c34548a0", + "class_hash": "0x23d3777b1da18fb7a80a94e5960d6a8cfce27155a0f1d96f579c165524d1e70", + "original_class_hash": "0x23d3777b1da18fb7a80a94e5960d6a8cfce27155a0f1d96f579c165524d1e70", "abi": [ { "type": "impl", @@ -4468,34 +4504,54 @@ }, { "type": "impl", - "name": "buy_blister_pack_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Ibuy_blister_pack_event" + "name": "blister_pack_resultImpl", + "interface_name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_result" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::BuyBlisterPackEvent", + "name": "core::array::Span::", "members": [ { - "name": "game_id", - "type": "core::integer::u32" - }, + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "jokers_of_neon::models::status::shop::shop::BlisterPackResult", + "members": [ { - "name": "level", + "name": "game_id", "type": "core::integer::u32" }, { - "name": "idx", - "type": "core::integer::u32" + "name": "cards_picked", + "type": "core::bool" }, { - "name": "blister_pack_id", - "type": "core::integer::u32" + "name": "cards", + "type": "core::array::Span::" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ibuy_blister_pack_event", + "name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_result", "items": [ { "type": "function", @@ -4503,7 +4559,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyBlisterPackEvent" + "type": "jokers_of_neon::models::status::shop::shop::BlisterPackResult" } ], "outputs": [], @@ -4513,14 +4569,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::buy_blister_pack_event::Event", + "name": "jokers_of_neon::models::status::shop::shop::blister_pack_result::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-BuyBlisterPackEvent", - "qualified_path": "jokers_of_neon::models::data::events::buy_blister_pack_event", - "manifest_name": "jokers_of_neon-BuyBlisterPackEvent-4b403c73" + "tag": "jokers_of_neon-BlisterPackResult", + "qualified_path": "jokers_of_neon::models::status::shop::shop::blister_pack_result", + "manifest_name": "jokers_of_neon-BlisterPackResult-2fcefd2c" }, { "kind": "DojoModel", @@ -4541,23 +4597,13 @@ "key": true }, { - "name": "item_type", - "type": "CardItemType", - "key": true - }, - { - "name": "card_id", + "name": "blister_pack_id", "type": "u32", "key": false - }, - { - "name": "temporary", - "type": "bool", - "key": false } ], - "class_hash": "0x538c2d365f659f08347a9366549a66e77bd8a892e963997ac5f1819221c1f08", - "original_class_hash": "0x538c2d365f659f08347a9366549a66e77bd8a892e963997ac5f1819221c1f08", + "class_hash": "0x7adba2677583267bfddbb599ea6dfbd67c8e62437e8db6696d61c59c34548a0", + "original_class_hash": "0x7adba2677583267bfddbb599ea6dfbd67c8e62437e8db6696d61c59c34548a0", "abi": [ { "type": "impl", @@ -4923,48 +4969,12 @@ }, { "type": "impl", - "name": "buy_card_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Ibuy_card_event" - }, - { - "type": "enum", - "name": "jokers_of_neon::models::status::shop::shop::CardItemType", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Common", - "type": "()" - }, - { - "name": "Modifier", - "type": "()" - }, - { - "name": "Special", - "type": "()" - } - ] - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] + "name": "buy_blister_pack_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Ibuy_blister_pack_event" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::BuyCardEvent", + "name": "jokers_of_neon::models::data::events::BuyBlisterPackEvent", "members": [ { "name": "game_id", @@ -4979,22 +4989,14 @@ "type": "core::integer::u32" }, { - "name": "item_type", - "type": "jokers_of_neon::models::status::shop::shop::CardItemType" - }, - { - "name": "card_id", + "name": "blister_pack_id", "type": "core::integer::u32" - }, - { - "name": "temporary", - "type": "core::bool" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ibuy_card_event", + "name": "jokers_of_neon::models::data::events::Ibuy_blister_pack_event", "items": [ { "type": "function", @@ -5002,7 +5004,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyCardEvent" + "type": "jokers_of_neon::models::data::events::BuyBlisterPackEvent" } ], "outputs": [], @@ -5012,14 +5014,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::buy_card_event::Event", + "name": "jokers_of_neon::models::data::events::buy_blister_pack_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-BuyCardEvent", - "qualified_path": "jokers_of_neon::models::data::events::buy_card_event", - "manifest_name": "jokers_of_neon-BuyCardEvent-2f7801e2" + "tag": "jokers_of_neon-BuyBlisterPackEvent", + "qualified_path": "jokers_of_neon::models::data::events::buy_blister_pack_event", + "manifest_name": "jokers_of_neon-BuyBlisterPackEvent-4b403c73" }, { "kind": "DojoModel", @@ -5040,18 +5042,23 @@ "key": true }, { - "name": "poker_hand", - "type": "PokerHand", + "name": "item_type", + "type": "CardItemType", + "key": true + }, + { + "name": "card_id", + "type": "u32", "key": false }, { - "name": "level_hand", - "type": "u8", + "name": "temporary", + "type": "bool", "key": false } ], - "class_hash": "0x2ef016c9f8776fc5004cf0b7ae709d6ad9c5dbda8903d4fea6cdd6d92d9b1e5", - "original_class_hash": "0x2ef016c9f8776fc5004cf0b7ae709d6ad9c5dbda8903d4fea6cdd6d92d9b1e5", + "class_hash": "0x538c2d365f659f08347a9366549a66e77bd8a892e963997ac5f1819221c1f08", + "original_class_hash": "0x538c2d365f659f08347a9366549a66e77bd8a892e963997ac5f1819221c1f08", "abi": [ { "type": "impl", @@ -5417,66 +5424,48 @@ }, { "type": "impl", - "name": "buy_poker_hand_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Ibuy_poker_hand_event" + "name": "buy_card_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Ibuy_card_event" }, { "type": "enum", - "name": "jokers_of_neon::models::data::poker_hand::PokerHand", + "name": "jokers_of_neon::models::status::shop::shop::CardItemType", "variants": [ { "name": "None", "type": "()" }, { - "name": "RoyalFlush", - "type": "()" - }, - { - "name": "StraightFlush", - "type": "()" - }, - { - "name": "FiveOfAKind", - "type": "()" - }, - { - "name": "FourOfAKind", - "type": "()" - }, - { - "name": "FullHouse", - "type": "()" - }, - { - "name": "Straight", - "type": "()" - }, - { - "name": "Flush", + "name": "Common", "type": "()" }, { - "name": "ThreeOfAKind", + "name": "Modifier", "type": "()" }, { - "name": "TwoPair", + "name": "Special", "type": "()" - }, + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ { - "name": "OnePair", + "name": "False", "type": "()" }, { - "name": "HighCard", + "name": "True", "type": "()" } ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::BuyPokerHandEvent", + "name": "jokers_of_neon::models::data::events::BuyCardEvent", "members": [ { "name": "game_id", @@ -5491,18 +5480,22 @@ "type": "core::integer::u32" }, { - "name": "poker_hand", - "type": "jokers_of_neon::models::data::poker_hand::PokerHand" + "name": "item_type", + "type": "jokers_of_neon::models::status::shop::shop::CardItemType" }, { - "name": "level_hand", - "type": "core::integer::u8" + "name": "card_id", + "type": "core::integer::u32" + }, + { + "name": "temporary", + "type": "core::bool" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ibuy_poker_hand_event", + "name": "jokers_of_neon::models::data::events::Ibuy_card_event", "items": [ { "type": "function", @@ -5510,7 +5503,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyPokerHandEvent" + "type": "jokers_of_neon::models::data::events::BuyCardEvent" } ], "outputs": [], @@ -5520,14 +5513,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::buy_poker_hand_event::Event", + "name": "jokers_of_neon::models::data::events::buy_card_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-BuyPokerHandEvent", - "qualified_path": "jokers_of_neon::models::data::events::buy_poker_hand_event", - "manifest_name": "jokers_of_neon-BuyPokerHandEvent-271c3d94" + "tag": "jokers_of_neon-BuyCardEvent", + "qualified_path": "jokers_of_neon::models::data::events::buy_card_event", + "manifest_name": "jokers_of_neon-BuyCardEvent-2f7801e2" }, { "kind": "DojoModel", @@ -5543,18 +5536,23 @@ "key": true }, { - "name": "reroll_cost", + "name": "idx", "type": "u32", + "key": true + }, + { + "name": "poker_hand", + "type": "PokerHand", "key": false }, { - "name": "reroll_executed", - "type": "bool", + "name": "level_hand", + "type": "u8", "key": false } ], - "class_hash": "0x48551f3cb2ee84945746d10494f3b28eb0ef23121f09861f07e234a1e257ef9", - "original_class_hash": "0x48551f3cb2ee84945746d10494f3b28eb0ef23121f09861f07e234a1e257ef9", + "class_hash": "0x2ef016c9f8776fc5004cf0b7ae709d6ad9c5dbda8903d4fea6cdd6d92d9b1e5", + "original_class_hash": "0x2ef016c9f8776fc5004cf0b7ae709d6ad9c5dbda8903d4fea6cdd6d92d9b1e5", "abi": [ { "type": "impl", @@ -5920,26 +5918,66 @@ }, { "type": "impl", - "name": "buy_reroll_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Ibuy_reroll_event" + "name": "buy_poker_hand_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Ibuy_poker_hand_event" }, { "type": "enum", - "name": "core::bool", + "name": "jokers_of_neon::models::data::poker_hand::PokerHand", "variants": [ { - "name": "False", + "name": "None", "type": "()" }, { - "name": "True", + "name": "RoyalFlush", + "type": "()" + }, + { + "name": "StraightFlush", + "type": "()" + }, + { + "name": "FiveOfAKind", + "type": "()" + }, + { + "name": "FourOfAKind", + "type": "()" + }, + { + "name": "FullHouse", + "type": "()" + }, + { + "name": "Straight", + "type": "()" + }, + { + "name": "Flush", + "type": "()" + }, + { + "name": "ThreeOfAKind", + "type": "()" + }, + { + "name": "TwoPair", + "type": "()" + }, + { + "name": "OnePair", + "type": "()" + }, + { + "name": "HighCard", "type": "()" } ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::BuyRerollEvent", + "name": "jokers_of_neon::models::data::events::BuyPokerHandEvent", "members": [ { "name": "game_id", @@ -5950,18 +5988,22 @@ "type": "core::integer::u32" }, { - "name": "reroll_cost", + "name": "idx", "type": "core::integer::u32" }, { - "name": "reroll_executed", - "type": "core::bool" + "name": "poker_hand", + "type": "jokers_of_neon::models::data::poker_hand::PokerHand" + }, + { + "name": "level_hand", + "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ibuy_reroll_event", + "name": "jokers_of_neon::models::data::events::Ibuy_poker_hand_event", "items": [ { "type": "function", @@ -5969,7 +6011,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyRerollEvent" + "type": "jokers_of_neon::models::data::events::BuyPokerHandEvent" } ], "outputs": [], @@ -5979,14 +6021,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::buy_reroll_event::Event", + "name": "jokers_of_neon::models::data::events::buy_poker_hand_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-BuyRerollEvent", - "qualified_path": "jokers_of_neon::models::data::events::buy_reroll_event", - "manifest_name": "jokers_of_neon-BuyRerollEvent-5231a152" + "tag": "jokers_of_neon-BuyPokerHandEvent", + "qualified_path": "jokers_of_neon::models::data::events::buy_poker_hand_event", + "manifest_name": "jokers_of_neon-BuyPokerHandEvent-271c3d94" }, { "kind": "DojoModel", @@ -5997,38 +6039,23 @@ "key": true }, { - "name": "idx", + "name": "level", "type": "u32", "key": true }, { - "name": "item_type", - "type": "CardItemType", - "key": true - }, - { - "name": "card_id", - "type": "u32", - "key": false - }, - { - "name": "cost", + "name": "reroll_cost", "type": "u32", "key": false }, { - "name": "purchased", - "type": "bool", - "key": false - }, - { - "name": "temporary", + "name": "reroll_executed", "type": "bool", "key": false } ], - "class_hash": "0x70dd3b72cb71dae628531a5f9634320e7800766f1018852b373281ad9f381bd", - "original_class_hash": "0x70dd3b72cb71dae628531a5f9634320e7800766f1018852b373281ad9f381bd", + "class_hash": "0x48551f3cb2ee84945746d10494f3b28eb0ef23121f09861f07e234a1e257ef9", + "original_class_hash": "0x48551f3cb2ee84945746d10494f3b28eb0ef23121f09861f07e234a1e257ef9", "abi": [ { "type": "impl", @@ -6394,30 +6421,8 @@ }, { "type": "impl", - "name": "card_itemImpl", - "interface_name": "jokers_of_neon::models::status::shop::shop::Icard_item" - }, - { - "type": "enum", - "name": "jokers_of_neon::models::status::shop::shop::CardItemType", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Common", - "type": "()" - }, - { - "name": "Modifier", - "type": "()" - }, - { - "name": "Special", - "type": "()" - } - ] + "name": "buy_reroll_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Ibuy_reroll_event" }, { "type": "enum", @@ -6435,41 +6440,29 @@ }, { "type": "struct", - "name": "jokers_of_neon::models::status::shop::shop::CardItem", + "name": "jokers_of_neon::models::data::events::BuyRerollEvent", "members": [ { "name": "game_id", "type": "core::integer::u32" }, { - "name": "idx", - "type": "core::integer::u32" - }, - { - "name": "item_type", - "type": "jokers_of_neon::models::status::shop::shop::CardItemType" - }, - { - "name": "card_id", + "name": "level", "type": "core::integer::u32" }, { - "name": "cost", + "name": "reroll_cost", "type": "core::integer::u32" }, { - "name": "purchased", - "type": "core::bool" - }, - { - "name": "temporary", + "name": "reroll_executed", "type": "core::bool" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::shop::shop::Icard_item", + "name": "jokers_of_neon::models::data::events::Ibuy_reroll_event", "items": [ { "type": "function", @@ -6477,7 +6470,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::shop::shop::CardItem" + "type": "jokers_of_neon::models::data::events::BuyRerollEvent" } ], "outputs": [], @@ -6487,41 +6480,56 @@ }, { "type": "event", - "name": "jokers_of_neon::models::status::shop::shop::card_item::Event", + "name": "jokers_of_neon::models::data::events::buy_reroll_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-CardItem", - "qualified_path": "jokers_of_neon::models::status::shop::shop::card_item", - "manifest_name": "jokers_of_neon-CardItem-1a854299" + "tag": "jokers_of_neon-BuyRerollEvent", + "qualified_path": "jokers_of_neon::models::data::events::buy_reroll_event", + "manifest_name": "jokers_of_neon-BuyRerollEvent-5231a152" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "game_id", + "type": "u32", "key": true }, { - "name": "index", + "name": "idx", "type": "u32", - "key": false + "key": true }, { - "name": "multi", + "name": "item_type", + "type": "CardItemType", + "key": true + }, + { + "name": "card_id", "type": "u32", "key": false }, { - "name": "points", + "name": "cost", "type": "u32", "key": false + }, + { + "name": "purchased", + "type": "bool", + "key": false + }, + { + "name": "temporary", + "type": "bool", + "key": false } ], - "class_hash": "0x25edae79ec31b503664c1ad9da2104d3b0dc4b4611bc3cd7bd613a438ce80b3", - "original_class_hash": "0x25edae79ec31b503664c1ad9da2104d3b0dc4b4611bc3cd7bd613a438ce80b3", + "class_hash": "0x70dd3b72cb71dae628531a5f9634320e7800766f1018852b373281ad9f381bd", + "original_class_hash": "0x70dd3b72cb71dae628531a5f9634320e7800766f1018852b373281ad9f381bd", "abi": [ { "type": "impl", @@ -6887,34 +6895,82 @@ }, { "type": "impl", - "name": "card_score_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Icard_score_event" + "name": "card_itemImpl", + "interface_name": "jokers_of_neon::models::status::shop::shop::Icard_item" + }, + { + "type": "enum", + "name": "jokers_of_neon::models::status::shop::shop::CardItemType", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Common", + "type": "()" + }, + { + "name": "Modifier", + "type": "()" + }, + { + "name": "Special", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::CardScoreEvent", + "name": "jokers_of_neon::models::status::shop::shop::CardItem", "members": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "game_id", + "type": "core::integer::u32" }, { - "name": "index", + "name": "idx", "type": "core::integer::u32" }, { - "name": "multi", + "name": "item_type", + "type": "jokers_of_neon::models::status::shop::shop::CardItemType" + }, + { + "name": "card_id", "type": "core::integer::u32" }, { - "name": "points", + "name": "cost", "type": "core::integer::u32" + }, + { + "name": "purchased", + "type": "core::bool" + }, + { + "name": "temporary", + "type": "core::bool" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Icard_score_event", + "name": "jokers_of_neon::models::status::shop::shop::Icard_item", "items": [ { "type": "function", @@ -6922,7 +6978,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::CardScoreEvent" + "type": "jokers_of_neon::models::status::shop::shop::CardItem" } ], "outputs": [], @@ -6932,31 +6988,41 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::card_score_event::Event", + "name": "jokers_of_neon::models::status::shop::shop::card_item::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-CardScoreEvent", - "qualified_path": "jokers_of_neon::models::data::events::card_score_event", - "manifest_name": "jokers_of_neon-CardScoreEvent-5e073648" + "tag": "jokers_of_neon-CardItem", + "qualified_path": "jokers_of_neon::models::status::shop::shop::card_item", + "manifest_name": "jokers_of_neon-CardItem-1a854299" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "active_ids", - "type": "Span<(u32, bool)>", + "name": "index", + "type": "u32", + "key": false + }, + { + "name": "multi", + "type": "u32", + "key": false + }, + { + "name": "points", + "type": "u32", "key": false } ], - "class_hash": "0x100656d30bb4f9835d1f7c5f04cbffa556d5b6cec46818209426c90fd1ad41d", - "original_class_hash": "0x100656d30bb4f9835d1f7c5f04cbffa556d5b6cec46818209426c90fd1ad41d", + "class_hash": "0x25edae79ec31b503664c1ad9da2104d3b0dc4b4611bc3cd7bd613a438ce80b3", + "original_class_hash": "0x25edae79ec31b503664c1ad9da2104d3b0dc4b4611bc3cd7bd613a438ce80b3", "abi": [ { "type": "impl", @@ -7322,50 +7388,34 @@ }, { "type": "impl", - "name": "challengeImpl", - "interface_name": "jokers_of_neon::models::data::challenge::Ichallenge" - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] + "name": "card_score_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Icard_score_event" }, { "type": "struct", - "name": "core::array::Span::<(core::integer::u32, core::bool)>", + "name": "jokers_of_neon::models::data::events::CardScoreEvent", "members": [ { - "name": "snapshot", - "type": "@core::array::Array::<(core::integer::u32, core::bool)>" - } - ] - }, - { - "type": "struct", - "name": "jokers_of_neon::models::data::challenge::Challenge", - "members": [ + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, { - "name": "game_id", + "name": "index", "type": "core::integer::u32" }, { - "name": "active_ids", - "type": "core::array::Span::<(core::integer::u32, core::bool)>" + "name": "multi", + "type": "core::integer::u32" + }, + { + "name": "points", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::challenge::Ichallenge", + "name": "jokers_of_neon::models::data::events::Icard_score_event", "items": [ { "type": "function", @@ -7373,7 +7423,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::challenge::Challenge" + "type": "jokers_of_neon::models::data::events::CardScoreEvent" } ], "outputs": [], @@ -7383,36 +7433,31 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::challenge::challenge::Event", + "name": "jokers_of_neon::models::data::events::card_score_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-Challenge", - "qualified_path": "jokers_of_neon::models::data::challenge::challenge", - "manifest_name": "jokers_of_neon-Challenge-61873cc7" + "tag": "jokers_of_neon-CardScoreEvent", + "qualified_path": "jokers_of_neon::models::data::events::card_score_event", + "manifest_name": "jokers_of_neon-CardScoreEvent-5e073648" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "game_id", + "type": "u32", "key": true }, { - "name": "player_name", - "type": "felt252", - "key": false - }, - { - "name": "game_id", - "type": "u32", + "name": "active_ids", + "type": "Span<(u32, bool)>", "key": false } ], - "class_hash": "0x21c6b6495f7bb89f6e79396f221ce4a47c8eab4f678e55d51248219648a003c", - "original_class_hash": "0x21c6b6495f7bb89f6e79396f221ce4a47c8eab4f678e55d51248219648a003c", + "class_hash": "0x100656d30bb4f9835d1f7c5f04cbffa556d5b6cec46818209426c90fd1ad41d", + "original_class_hash": "0x100656d30bb4f9835d1f7c5f04cbffa556d5b6cec46818209426c90fd1ad41d", "abi": [ { "type": "impl", @@ -7778,30 +7823,50 @@ }, { "type": "impl", - "name": "challenge_completedImpl", - "interface_name": "jokers_of_neon::models::data::events::Ichallenge_completed" + "name": "challengeImpl", + "interface_name": "jokers_of_neon::models::data::challenge::Ichallenge" }, { - "type": "struct", - "name": "jokers_of_neon::models::data::events::ChallengeCompleted", - "members": [ + "type": "enum", + "name": "core::bool", + "variants": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "False", + "type": "()" }, { - "name": "player_name", - "type": "core::felt252" - }, + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::integer::u32, core::bool)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::integer::u32, core::bool)>" + } + ] + }, + { + "type": "struct", + "name": "jokers_of_neon::models::data::challenge::Challenge", + "members": [ { "name": "game_id", "type": "core::integer::u32" + }, + { + "name": "active_ids", + "type": "core::array::Span::<(core::integer::u32, core::bool)>" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ichallenge_completed", + "name": "jokers_of_neon::models::data::challenge::Ichallenge", "items": [ { "type": "function", @@ -7809,7 +7874,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::ChallengeCompleted" + "type": "jokers_of_neon::models::data::challenge::Challenge" } ], "outputs": [], @@ -7819,36 +7884,36 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::challenge_completed::Event", + "name": "jokers_of_neon::models::data::challenge::challenge::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-ChallengeCompleted", - "qualified_path": "jokers_of_neon::models::data::events::challenge_completed", - "manifest_name": "jokers_of_neon-ChallengeCompleted-510bb1ff" + "tag": "jokers_of_neon-Challenge", + "qualified_path": "jokers_of_neon::models::data::challenge::challenge", + "manifest_name": "jokers_of_neon-Challenge-61873cc7" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "discards", - "type": "u8", + "name": "player_name", + "type": "felt252", "key": false }, { - "name": "plays", - "type": "u8", + "name": "game_id", + "type": "u32", "key": false } ], - "class_hash": "0x60b252cd03fc19cedc1fb08e6295aa77daa96bf9d2ddb405282359f11bee54d", - "original_class_hash": "0x60b252cd03fc19cedc1fb08e6295aa77daa96bf9d2ddb405282359f11bee54d", + "class_hash": "0x21c6b6495f7bb89f6e79396f221ce4a47c8eab4f678e55d51248219648a003c", + "original_class_hash": "0x21c6b6495f7bb89f6e79396f221ce4a47c8eab4f678e55d51248219648a003c", "abi": [ { "type": "impl", @@ -8214,30 +8279,30 @@ }, { "type": "impl", - "name": "challenge_playerImpl", - "interface_name": "jokers_of_neon::models::data::challenge::Ichallenge_player" + "name": "challenge_completedImpl", + "interface_name": "jokers_of_neon::models::data::events::Ichallenge_completed" }, { "type": "struct", - "name": "jokers_of_neon::models::data::challenge::ChallengePlayer", + "name": "jokers_of_neon::models::data::events::ChallengeCompleted", "members": [ { - "name": "game_id", - "type": "core::integer::u32" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "discards", - "type": "core::integer::u8" + "name": "player_name", + "type": "core::felt252" }, { - "name": "plays", - "type": "core::integer::u8" + "name": "game_id", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::challenge::Ichallenge_player", + "name": "jokers_of_neon::models::data::events::Ichallenge_completed", "items": [ { "type": "function", @@ -8245,7 +8310,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::challenge::ChallengePlayer" + "type": "jokers_of_neon::models::data::events::ChallengeCompleted" } ], "outputs": [], @@ -8255,31 +8320,36 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::challenge::challenge_player::Event", + "name": "jokers_of_neon::models::data::events::challenge_completed::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-ChallengePlayer", - "qualified_path": "jokers_of_neon::models::data::challenge::challenge_player", - "manifest_name": "jokers_of_neon-ChallengePlayer-7d4feee6" + "tag": "jokers_of_neon-ChallengeCompleted", + "qualified_path": "jokers_of_neon::models::data::events::challenge_completed", + "manifest_name": "jokers_of_neon-ChallengeCompleted-510bb1ff" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "game_id", + "type": "u32", "key": true }, { - "name": "game_id", - "type": "u32", + "name": "discards", + "type": "u8", + "key": false + }, + { + "name": "plays", + "type": "u8", "key": false } ], - "class_hash": "0x101deece771f5cbf115831a78e13c3e68fcf8a6220ea0f86b9177799a610dd1", - "original_class_hash": "0x101deece771f5cbf115831a78e13c3e68fcf8a6220ea0f86b9177799a610dd1", + "class_hash": "0x60b252cd03fc19cedc1fb08e6295aa77daa96bf9d2ddb405282359f11bee54d", + "original_class_hash": "0x60b252cd03fc19cedc1fb08e6295aa77daa96bf9d2ddb405282359f11bee54d", "abi": [ { "type": "impl", @@ -8645,26 +8715,30 @@ }, { "type": "impl", - "name": "create_game_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Icreate_game_event" + "name": "challenge_playerImpl", + "interface_name": "jokers_of_neon::models::data::challenge::Ichallenge_player" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::CreateGameEvent", + "name": "jokers_of_neon::models::data::challenge::ChallengePlayer", "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, { "name": "game_id", "type": "core::integer::u32" + }, + { + "name": "discards", + "type": "core::integer::u8" + }, + { + "name": "plays", + "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Icreate_game_event", + "name": "jokers_of_neon::models::data::challenge::Ichallenge_player", "items": [ { "type": "function", @@ -8672,7 +8746,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::CreateGameEvent" + "type": "jokers_of_neon::models::data::challenge::ChallengePlayer" } ], "outputs": [], @@ -8682,36 +8756,31 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::create_game_event::Event", + "name": "jokers_of_neon::models::data::challenge::challenge_player::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-CreateGameEvent", - "qualified_path": "jokers_of_neon::models::data::events::create_game_event", - "manifest_name": "jokers_of_neon-CreateGameEvent-17f86ee2" + "tag": "jokers_of_neon-ChallengePlayer", + "qualified_path": "jokers_of_neon::models::data::challenge::challenge_player", + "manifest_name": "jokers_of_neon-ChallengePlayer-7d4feee6" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u32", - "key": true - }, - { - "name": "idx", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "card_id", + "name": "game_id", "type": "u32", "key": false } ], - "class_hash": "0x6214acf8fa0a427d8d2712413c586866a023b5d256e7c5acd3ccfaade2db633", - "original_class_hash": "0x6214acf8fa0a427d8d2712413c586866a023b5d256e7c5acd3ccfaade2db633", + "class_hash": "0x101deece771f5cbf115831a78e13c3e68fcf8a6220ea0f86b9177799a610dd1", + "original_class_hash": "0x101deece771f5cbf115831a78e13c3e68fcf8a6220ea0f86b9177799a610dd1", "abi": [ { "type": "impl", @@ -9077,30 +9146,26 @@ }, { "type": "impl", - "name": "current_hand_cardImpl", - "interface_name": "jokers_of_neon::models::status::round::current_hand_card::Icurrent_hand_card" + "name": "create_game_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Icreate_game_event" }, { "type": "struct", - "name": "jokers_of_neon::models::status::round::current_hand_card::CurrentHandCard", + "name": "jokers_of_neon::models::data::events::CreateGameEvent", "members": [ { - "name": "game_id", - "type": "core::integer::u32" - }, - { - "name": "idx", - "type": "core::integer::u32" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "card_id", + "name": "game_id", "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::round::current_hand_card::Icurrent_hand_card", + "name": "jokers_of_neon::models::data::events::Icreate_game_event", "items": [ { "type": "function", @@ -9108,7 +9173,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::round::current_hand_card::CurrentHandCard" + "type": "jokers_of_neon::models::data::events::CreateGameEvent" } ], "outputs": [], @@ -9118,14 +9183,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::status::round::current_hand_card::current_hand_card::Event", + "name": "jokers_of_neon::models::data::events::create_game_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-CurrentHandCard", - "qualified_path": "jokers_of_neon::models::status::round::current_hand_card::current_hand_card", - "manifest_name": "jokers_of_neon-CurrentHandCard-29753f22" + "tag": "jokers_of_neon-CreateGameEvent", + "qualified_path": "jokers_of_neon::models::data::events::create_game_event", + "manifest_name": "jokers_of_neon-CreateGameEvent-17f86ee2" }, { "kind": "DojoModel", @@ -9141,23 +9206,13 @@ "key": true }, { - "name": "effect_card_id", - "type": "u32", - "key": false - }, - { - "name": "is_temporary", - "type": "bool", - "key": false - }, - { - "name": "remaining", + "name": "card_id", "type": "u32", "key": false } ], - "class_hash": "0x3888b285bfb37fed4b852e2056f5fc8cce5d379014cbcf81ea4496a9269c7fd", - "original_class_hash": "0x3888b285bfb37fed4b852e2056f5fc8cce5d379014cbcf81ea4496a9269c7fd", + "class_hash": "0x6214acf8fa0a427d8d2712413c586866a023b5d256e7c5acd3ccfaade2db633", + "original_class_hash": "0x6214acf8fa0a427d8d2712413c586866a023b5d256e7c5acd3ccfaade2db633", "abi": [ { "type": "impl", @@ -9523,26 +9578,12 @@ }, { "type": "impl", - "name": "current_special_cardsImpl", - "interface_name": "jokers_of_neon::models::status::game::game::Icurrent_special_cards" - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] + "name": "current_hand_cardImpl", + "interface_name": "jokers_of_neon::models::status::round::current_hand_card::Icurrent_hand_card" }, { "type": "struct", - "name": "jokers_of_neon::models::status::game::game::CurrentSpecialCards", + "name": "jokers_of_neon::models::status::round::current_hand_card::CurrentHandCard", "members": [ { "name": "game_id", @@ -9553,22 +9594,14 @@ "type": "core::integer::u32" }, { - "name": "effect_card_id", - "type": "core::integer::u32" - }, - { - "name": "is_temporary", - "type": "core::bool" - }, - { - "name": "remaining", + "name": "card_id", "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::game::game::Icurrent_special_cards", + "name": "jokers_of_neon::models::status::round::current_hand_card::Icurrent_hand_card", "items": [ { "type": "function", @@ -9576,7 +9609,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::game::game::CurrentSpecialCards" + "type": "jokers_of_neon::models::status::round::current_hand_card::CurrentHandCard" } ], "outputs": [], @@ -9586,14 +9619,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::status::game::game::current_special_cards::Event", + "name": "jokers_of_neon::models::status::round::current_hand_card::current_hand_card::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-CurrentSpecialCards", - "qualified_path": "jokers_of_neon::models::status::game::game::current_special_cards", - "manifest_name": "jokers_of_neon-CurrentSpecialCards-11ae0174" + "tag": "jokers_of_neon-CurrentHandCard", + "qualified_path": "jokers_of_neon::models::status::round::current_hand_card::current_hand_card", + "manifest_name": "jokers_of_neon-CurrentHandCard-29753f22" }, { "kind": "DojoModel", @@ -9604,18 +9637,28 @@ "key": true }, { - "name": "index", + "name": "idx", "type": "u32", "key": true }, { - "name": "card_id", + "name": "effect_card_id", + "type": "u32", + "key": false + }, + { + "name": "is_temporary", + "type": "bool", + "key": false + }, + { + "name": "remaining", "type": "u32", "key": false } ], - "class_hash": "0x5e1f44f133a6951fe33a0c0084ce584ee4fd4e5498a3208e6f561096f751ea8", - "original_class_hash": "0x5e1f44f133a6951fe33a0c0084ce584ee4fd4e5498a3208e6f561096f751ea8", + "class_hash": "0x3888b285bfb37fed4b852e2056f5fc8cce5d379014cbcf81ea4496a9269c7fd", + "original_class_hash": "0x3888b285bfb37fed4b852e2056f5fc8cce5d379014cbcf81ea4496a9269c7fd", "abi": [ { "type": "impl", @@ -9981,30 +10024,52 @@ }, { "type": "impl", - "name": "deck_cardImpl", - "interface_name": "jokers_of_neon::models::data::game_deck::Ideck_card" + "name": "current_special_cardsImpl", + "interface_name": "jokers_of_neon::models::status::game::game::Icurrent_special_cards" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::game_deck::DeckCard", + "name": "jokers_of_neon::models::status::game::game::CurrentSpecialCards", "members": [ { "name": "game_id", "type": "core::integer::u32" }, { - "name": "index", + "name": "idx", "type": "core::integer::u32" }, { - "name": "card_id", + "name": "effect_card_id", + "type": "core::integer::u32" + }, + { + "name": "is_temporary", + "type": "core::bool" + }, + { + "name": "remaining", "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::game_deck::Ideck_card", + "name": "jokers_of_neon::models::status::game::game::Icurrent_special_cards", "items": [ { "type": "function", @@ -10012,7 +10077,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::game_deck::DeckCard" + "type": "jokers_of_neon::models::status::game::game::CurrentSpecialCards" } ], "outputs": [], @@ -10022,76 +10087,36 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::game_deck::deck_card::Event", + "name": "jokers_of_neon::models::status::game::game::current_special_cards::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-DeckCard", - "qualified_path": "jokers_of_neon::models::data::game_deck::deck_card", - "manifest_name": "jokers_of_neon-DeckCard-4e65fb96" + "tag": "jokers_of_neon-CurrentSpecialCards", + "qualified_path": "jokers_of_neon::models::status::game::game::current_special_cards", + "manifest_name": "jokers_of_neon-CurrentSpecialCards-11ae0174" }, { "kind": "DojoModel", "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, { "name": "game_id", "type": "u32", - "key": false - }, - { - "name": "round_defeat", - "type": "u32", - "key": false - }, - { - "name": "level_bonus", - "type": "u32", - "key": false - }, - { - "name": "hands_left", - "type": "u32", - "key": false - }, - { - "name": "hands_left_cash", - "type": "u32", - "key": false - }, - { - "name": "discard_left", - "type": "u32", - "key": false - }, - { - "name": "discard_left_cash", - "type": "u32", - "key": false - }, - { - "name": "rage_card_defeated", - "type": "u32", - "key": false + "key": true }, { - "name": "rage_card_defeated_cash", + "name": "index", "type": "u32", - "key": false + "key": true }, { - "name": "total", + "name": "card_id", "type": "u32", "key": false } ], - "class_hash": "0x5a8e5e18e43d39e182e079e0bcc67056e5a2a4bae237350d15e51fee36a5355", - "original_class_hash": "0x5a8e5e18e43d39e182e079e0bcc67056e5a2a4bae237350d15e51fee36a5355", + "class_hash": "0x5e1f44f133a6951fe33a0c0084ce584ee4fd4e5498a3208e6f561096f751ea8", + "original_class_hash": "0x5e1f44f133a6951fe33a0c0084ce584ee4fd4e5498a3208e6f561096f751ea8", "abi": [ { "type": "impl", @@ -10457,62 +10482,30 @@ }, { "type": "impl", - "name": "detail_earned_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Idetail_earned_event" + "name": "deck_cardImpl", + "interface_name": "jokers_of_neon::models::data::game_deck::Ideck_card" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::DetailEarnedEvent", + "name": "jokers_of_neon::models::data::game_deck::DeckCard", "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, { "name": "game_id", "type": "core::integer::u32" }, { - "name": "round_defeat", - "type": "core::integer::u32" - }, - { - "name": "level_bonus", - "type": "core::integer::u32" - }, - { - "name": "hands_left", - "type": "core::integer::u32" - }, - { - "name": "hands_left_cash", - "type": "core::integer::u32" - }, - { - "name": "discard_left", - "type": "core::integer::u32" - }, - { - "name": "discard_left_cash", - "type": "core::integer::u32" - }, - { - "name": "rage_card_defeated", - "type": "core::integer::u32" - }, - { - "name": "rage_card_defeated_cash", + "name": "index", "type": "core::integer::u32" }, { - "name": "total", + "name": "card_id", "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Idetail_earned_event", + "name": "jokers_of_neon::models::data::game_deck::Ideck_card", "items": [ { "type": "function", @@ -10520,7 +10513,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::DetailEarnedEvent" + "type": "jokers_of_neon::models::data::game_deck::DeckCard" } ], "outputs": [], @@ -10530,106 +10523,1607 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::detail_earned_event::Event", + "name": "jokers_of_neon::models::data::game_deck::deck_card::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-DetailEarnedEvent", - "qualified_path": "jokers_of_neon::models::data::events::detail_earned_event", - "manifest_name": "jokers_of_neon-DetailEarnedEvent-40f670e5" + "tag": "jokers_of_neon-DeckCard", + "qualified_path": "jokers_of_neon::models::data::game_deck::deck_card", + "manifest_name": "jokers_of_neon-DeckCard-4e65fb96" }, { "kind": "DojoModel", "members": [ { - "name": "id", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "owner", - "type": "ContractAddress", + "name": "game_id", + "type": "u32", "key": false }, { - "name": "player_name", - "type": "felt252", + "name": "round_defeat", + "type": "u32", "key": false }, { - "name": "player_hp", + "name": "level_bonus", "type": "u32", "key": false }, { - "name": "current_player_hp", + "name": "hands_left", "type": "u32", "key": false }, { - "name": "max_hands", - "type": "u8", + "name": "hands_left_cash", + "type": "u32", "key": false }, { - "name": "max_discard", - "type": "u8", + "name": "discard_left", + "type": "u32", "key": false }, { - "name": "max_jokers", - "type": "u8", + "name": "discard_left_cash", + "type": "u32", "key": false }, { - "name": "player_score", + "name": "rage_card_defeated", "type": "u32", "key": false }, { - "name": "level", + "name": "rage_card_defeated_cash", + "type": "u32", + "key": false + }, + { + "name": "total", "type": "u32", "key": false + } + ], + "class_hash": "0x5a8e5e18e43d39e182e079e0bcc67056e5a2a4bae237350d15e51fee36a5355", + "original_class_hash": "0x5a8e5e18e43d39e182e079e0bcc67056e5a2a4bae237350d15e51fee36a5355", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "detail_earned_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Idetail_earned_event" + }, + { + "type": "struct", + "name": "jokers_of_neon::models::data::events::DetailEarnedEvent", + "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "game_id", + "type": "core::integer::u32" + }, + { + "name": "round_defeat", + "type": "core::integer::u32" + }, + { + "name": "level_bonus", + "type": "core::integer::u32" + }, + { + "name": "hands_left", + "type": "core::integer::u32" + }, + { + "name": "hands_left_cash", + "type": "core::integer::u32" + }, + { + "name": "discard_left", + "type": "core::integer::u32" + }, + { + "name": "discard_left_cash", + "type": "core::integer::u32" + }, + { + "name": "rage_card_defeated", + "type": "core::integer::u32" + }, + { + "name": "rage_card_defeated_cash", + "type": "core::integer::u32" + }, + { + "name": "total", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "jokers_of_neon::models::data::events::Idetail_earned_event", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "jokers_of_neon::models::data::events::DetailEarnedEvent" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "jokers_of_neon::models::data::events::detail_earned_event::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "jokers_of_neon-DetailEarnedEvent", + "qualified_path": "jokers_of_neon::models::data::events::detail_earned_event", + "manifest_name": "jokers_of_neon-DetailEarnedEvent-40f670e5" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "id", + "type": "u32", + "key": true + }, + { + "name": "owner", + "type": "ContractAddress", + "key": false + }, + { + "name": "player_name", + "type": "felt252", + "key": false + }, + { + "name": "player_hp", + "type": "u32", + "key": false + }, + { + "name": "current_player_hp", + "type": "u32", + "key": false + }, + { + "name": "max_hands", + "type": "u8", + "key": false + }, + { + "name": "max_discard", + "type": "u8", + "key": false + }, + { + "name": "max_jokers", + "type": "u8", + "key": false + }, + { + "name": "player_score", + "type": "u32", + "key": false + }, + { + "name": "level", + "type": "u32", + "key": false + }, + { + "name": "len_hand", + "type": "u32", + "key": false + }, + { + "name": "len_max_current_special_cards", + "type": "u32", + "key": false + }, + { + "name": "len_current_special_cards", + "type": "u32", + "key": false + }, + { + "name": "current_jokers", + "type": "u8", + "key": false + }, + { + "name": "state", + "type": "GameState", + "key": false + }, + { + "name": "substate", + "type": "GameSubState", + "key": false + }, + { + "name": "cash", + "type": "u32", + "key": false + } + ], + "class_hash": "0x25c9eb7813071767dcf7069b422a5b8a3895c51346932209f389a63ba62ecae", + "original_class_hash": "0x25c9eb7813071767dcf7069b422a5b8a3895c51346932209f389a63ba62ecae", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "gameImpl", + "interface_name": "jokers_of_neon::models::status::game::game::Igame" + }, + { + "type": "enum", + "name": "jokers_of_neon::models::status::game::game::GameState", + "variants": [ + { + "name": "IN_GAME", + "type": "()" + }, + { + "name": "FINISHED", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "jokers_of_neon::models::status::game::game::GameSubState", + "variants": [ + { + "name": "BEAST", + "type": "()" + }, + { + "name": "OBSTACLE", + "type": "()" + }, + { + "name": "CREATE_LEVEL", + "type": "()" + }, + { + "name": "CREATE_REWARD", + "type": "()" + }, + { + "name": "REWARD_SPECIALS", + "type": "()" + }, + { + "name": "REWARD_CARDS_PACK", + "type": "()" + }, + { + "name": "DRAFT_MODIFIERS", + "type": "()" + }, + { + "name": "DRAFT_SPECIALS", + "type": "()" + }, + { + "name": "DRAFT_DECK", + "type": "()" + }, + { + "name": "DRAFT_ADVENTURER", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "jokers_of_neon::models::status::game::game::Game", + "members": [ + { + "name": "id", + "type": "core::integer::u32" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "player_hp", + "type": "core::integer::u32" + }, + { + "name": "current_player_hp", + "type": "core::integer::u32" + }, + { + "name": "max_hands", + "type": "core::integer::u8" + }, + { + "name": "max_discard", + "type": "core::integer::u8" + }, + { + "name": "max_jokers", + "type": "core::integer::u8" + }, + { + "name": "player_score", + "type": "core::integer::u32" + }, + { + "name": "level", + "type": "core::integer::u32" + }, + { + "name": "len_hand", + "type": "core::integer::u32" + }, + { + "name": "len_max_current_special_cards", + "type": "core::integer::u32" + }, + { + "name": "len_current_special_cards", + "type": "core::integer::u32" + }, + { + "name": "current_jokers", + "type": "core::integer::u8" + }, + { + "name": "state", + "type": "jokers_of_neon::models::status::game::game::GameState" + }, + { + "name": "substate", + "type": "jokers_of_neon::models::status::game::game::GameSubState" + }, + { + "name": "cash", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "jokers_of_neon::models::status::game::game::Igame", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "jokers_of_neon::models::status::game::game::Game" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "jokers_of_neon::models::status::game::game::game::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "jokers_of_neon-Game", + "qualified_path": "jokers_of_neon::models::status::game::game::game", + "manifest_name": "jokers_of_neon-Game-162de85b" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "game_id", + "type": "u32", + "key": true + }, + { + "name": "len", + "type": "u32", + "key": false + }, + { + "name": "round_len", + "type": "u32", + "key": false + } + ], + "class_hash": "0x165c5bd99b1100a2e1a2faaf9a2443d6ca12bc310e2ec39d1ac64eac3555f31", + "original_class_hash": "0x165c5bd99b1100a2e1a2faaf9a2443d6ca12bc310e2ec39d1ac64eac3555f31", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "game_deckImpl", + "interface_name": "jokers_of_neon::models::data::game_deck::Igame_deck" + }, + { + "type": "struct", + "name": "jokers_of_neon::models::data::game_deck::GameDeck", + "members": [ + { + "name": "game_id", + "type": "core::integer::u32" + }, + { + "name": "len", + "type": "core::integer::u32" + }, + { + "name": "round_len", + "type": "core::integer::u32" + } + ] }, { - "name": "len_hand", - "type": "u32", - "key": false + "type": "interface", + "name": "jokers_of_neon::models::data::game_deck::Igame_deck", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "jokers_of_neon::models::data::game_deck::GameDeck" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] }, { - "name": "len_max_current_special_cards", - "type": "u32", - "key": false - }, + "type": "event", + "name": "jokers_of_neon::models::data::game_deck::game_deck::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "jokers_of_neon-GameDeck", + "qualified_path": "jokers_of_neon::models::data::game_deck::game_deck", + "manifest_name": "jokers_of_neon-GameDeck-481bbebe" + }, + { + "kind": "DojoModel", + "members": [ { - "name": "len_current_special_cards", + "name": "game_id", "type": "u32", - "key": false + "key": true }, { - "name": "current_jokers", + "name": "cost_discard", "type": "u8", "key": false }, { - "name": "state", - "type": "GameState", - "key": false - }, - { - "name": "substate", - "type": "GameSubState", + "name": "cost_play", + "type": "u8", "key": false }, { - "name": "cash", - "type": "u32", + "name": "energy_max_player", + "type": "u8", "key": false } ], - "class_hash": "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2", - "original_class_hash": "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2", + "class_hash": "0x4c5166033b50fa2dcbe8dca20d4c219aaf3b4944657affccd16cb08405bf8b5", + "original_class_hash": "0x4c5166033b50fa2dcbe8dca20d4c219aaf3b4944657affccd16cb08405bf8b5", "abi": [ { "type": "impl", @@ -10995,138 +12489,34 @@ }, { "type": "impl", - "name": "gameImpl", - "interface_name": "jokers_of_neon::models::status::game::game::Igame" - }, - { - "type": "enum", - "name": "jokers_of_neon::models::status::game::game::GameState", - "variants": [ - { - "name": "SELECT_DECK", - "type": "()" - }, - { - "name": "SELECT_SPECIAL_CARDS", - "type": "()" - }, - { - "name": "SELECT_MODIFIER_CARDS", - "type": "()" - }, - { - "name": "AT_SHOP", - "type": "()" - }, - { - "name": "IN_GAME", - "type": "()" - }, - { - "name": "FINISHED", - "type": "()" - }, - { - "name": "OPEN_BLISTER_PACK", - "type": "()" - } - ] - }, - { - "type": "enum", - "name": "jokers_of_neon::models::status::game::game::GameSubState", - "variants": [ - { - "name": "BEAST", - "type": "()" - }, - { - "name": "CREATE_LEVEL", - "type": "()" - }, - { - "name": "OBSTACLE", - "type": "()" - } - ] + "name": "game_mode_beastImpl", + "interface_name": "jokers_of_neon::models::data::beast::Igame_mode_beast" }, { "type": "struct", - "name": "jokers_of_neon::models::status::game::game::Game", + "name": "jokers_of_neon::models::data::beast::GameModeBeast", "members": [ { - "name": "id", - "type": "core::integer::u32" - }, - { - "name": "owner", - "type": "core::starknet::contract_address::ContractAddress" - }, - { - "name": "player_name", - "type": "core::felt252" - }, - { - "name": "player_hp", - "type": "core::integer::u32" - }, - { - "name": "current_player_hp", + "name": "game_id", "type": "core::integer::u32" }, { - "name": "max_hands", - "type": "core::integer::u8" - }, - { - "name": "max_discard", + "name": "cost_discard", "type": "core::integer::u8" }, { - "name": "max_jokers", + "name": "cost_play", "type": "core::integer::u8" }, { - "name": "player_score", - "type": "core::integer::u32" - }, - { - "name": "level", - "type": "core::integer::u32" - }, - { - "name": "len_hand", - "type": "core::integer::u32" - }, - { - "name": "len_max_current_special_cards", - "type": "core::integer::u32" - }, - { - "name": "len_current_special_cards", - "type": "core::integer::u32" - }, - { - "name": "current_jokers", + "name": "energy_max_player", "type": "core::integer::u8" - }, - { - "name": "state", - "type": "jokers_of_neon::models::status::game::game::GameState" - }, - { - "name": "substate", - "type": "jokers_of_neon::models::status::game::game::GameSubState" - }, - { - "name": "cash", - "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::game::game::Igame", + "name": "jokers_of_neon::models::data::beast::Igame_mode_beast", "items": [ { "type": "function", @@ -11134,7 +12524,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::game::game::Game" + "type": "jokers_of_neon::models::data::beast::GameModeBeast" } ], "outputs": [], @@ -11144,14 +12534,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::status::game::game::game::Event", + "name": "jokers_of_neon::models::data::beast::game_mode_beast::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-Game", - "qualified_path": "jokers_of_neon::models::status::game::game::game", - "manifest_name": "jokers_of_neon-Game-162de85b" + "tag": "jokers_of_neon-GameModeBeast", + "qualified_path": "jokers_of_neon::models::data::beast::game_mode_beast", + "manifest_name": "jokers_of_neon-GameModeBeast-2eece866" }, { "kind": "DojoModel", @@ -11162,18 +12552,13 @@ "key": true }, { - "name": "len", - "type": "u32", - "key": false - }, - { - "name": "round_len", + "name": "challenge_id", "type": "u32", "key": false } ], - "class_hash": "0x165c5bd99b1100a2e1a2faaf9a2443d6ca12bc310e2ec39d1ac64eac3555f31", - "original_class_hash": "0x165c5bd99b1100a2e1a2faaf9a2443d6ca12bc310e2ec39d1ac64eac3555f31", + "class_hash": "0x40f2a16a814460d5105e655f240e0ef22171fdbb3f04fdf727511d5703316e2", + "original_class_hash": "0x40f2a16a814460d5105e655f240e0ef22171fdbb3f04fdf727511d5703316e2", "abi": [ { "type": "impl", @@ -11539,30 +12924,26 @@ }, { "type": "impl", - "name": "game_deckImpl", - "interface_name": "jokers_of_neon::models::data::game_deck::Igame_deck" + "name": "item_challenge_completedImpl", + "interface_name": "jokers_of_neon::models::data::events::Iitem_challenge_completed" }, { "type": "struct", - "name": "jokers_of_neon::models::data::game_deck::GameDeck", + "name": "jokers_of_neon::models::data::events::ItemChallengeCompleted", "members": [ { "name": "game_id", "type": "core::integer::u32" }, { - "name": "len", - "type": "core::integer::u32" - }, - { - "name": "round_len", + "name": "challenge_id", "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::game_deck::Igame_deck", + "name": "jokers_of_neon::models::data::events::Iitem_challenge_completed", "items": [ { "type": "function", @@ -11570,7 +12951,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::game_deck::GameDeck" + "type": "jokers_of_neon::models::data::events::ItemChallengeCompleted" } ], "outputs": [], @@ -11580,14 +12961,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::game_deck::game_deck::Event", + "name": "jokers_of_neon::models::data::events::item_challenge_completed::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-GameDeck", - "qualified_path": "jokers_of_neon::models::data::game_deck::game_deck", - "manifest_name": "jokers_of_neon-GameDeck-481bbebe" + "tag": "jokers_of_neon-ItemChallengeCompleted", + "qualified_path": "jokers_of_neon::models::data::events::item_challenge_completed", + "manifest_name": "jokers_of_neon-ItemChallengeCompleted-2cb0f253" }, { "kind": "DojoModel", @@ -11598,23 +12979,18 @@ "key": true }, { - "name": "cost_discard", - "type": "u8", - "key": false - }, - { - "name": "cost_play", - "type": "u8", + "name": "current_probability", + "type": "u16", "key": false }, { - "name": "energy_max_player", + "name": "level", "type": "u8", "key": false } ], - "class_hash": "0x4c5166033b50fa2dcbe8dca20d4c219aaf3b4944657affccd16cb08405bf8b5", - "original_class_hash": "0x4c5166033b50fa2dcbe8dca20d4c219aaf3b4944657affccd16cb08405bf8b5", + "class_hash": "0x2cdd0f8efcd582eb49fd33a9bc2c466d96bda4d2b7739b48258842fdb18984d", + "original_class_hash": "0x2cdd0f8efcd582eb49fd33a9bc2c466d96bda4d2b7739b48258842fdb18984d", "abi": [ { "type": "impl", @@ -11980,34 +13356,30 @@ }, { "type": "impl", - "name": "game_mode_beastImpl", - "interface_name": "jokers_of_neon::models::data::beast::Igame_mode_beast" + "name": "last_beast_levelImpl", + "interface_name": "jokers_of_neon::models::data::last_beast_level::Ilast_beast_level" }, { "type": "struct", - "name": "jokers_of_neon::models::data::beast::GameModeBeast", + "name": "jokers_of_neon::models::data::last_beast_level::LastBeastLevel", "members": [ { "name": "game_id", "type": "core::integer::u32" }, { - "name": "cost_discard", - "type": "core::integer::u8" - }, - { - "name": "cost_play", - "type": "core::integer::u8" + "name": "current_probability", + "type": "core::integer::u16" }, { - "name": "energy_max_player", + "name": "level", "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::beast::Igame_mode_beast", + "name": "jokers_of_neon::models::data::last_beast_level::Ilast_beast_level", "items": [ { "type": "function", @@ -12015,7 +13387,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::beast::GameModeBeast" + "type": "jokers_of_neon::models::data::last_beast_level::LastBeastLevel" } ], "outputs": [], @@ -12025,31 +13397,46 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::beast::game_mode_beast::Event", + "name": "jokers_of_neon::models::data::last_beast_level::last_beast_level::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-GameModeBeast", - "qualified_path": "jokers_of_neon::models::data::beast::game_mode_beast", - "manifest_name": "jokers_of_neon-GameModeBeast-2eece866" + "tag": "jokers_of_neon-LastBeastLevel", + "qualified_path": "jokers_of_neon::models::data::last_beast_level::last_beast_level", + "manifest_name": "jokers_of_neon-LastBeastLevel-ce77bf82" }, { "kind": "DojoModel", "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, { "name": "game_id", "type": "u32", - "key": true + "key": false }, { - "name": "challenge_id", + "name": "modifier_card_idx", + "type": "u32", + "key": false + }, + { + "name": "current_hand_card_idx", "type": "u32", "key": false + }, + { + "name": "suit", + "type": "Suit", + "key": false } ], - "class_hash": "0x40f2a16a814460d5105e655f240e0ef22171fdbb3f04fdf727511d5703316e2", - "original_class_hash": "0x40f2a16a814460d5105e655f240e0ef22171fdbb3f04fdf727511d5703316e2", + "class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", + "original_class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", "abi": [ { "type": "impl", @@ -12415,26 +13802,68 @@ }, { "type": "impl", - "name": "item_challenge_completedImpl", - "interface_name": "jokers_of_neon::models::data::events::Iitem_challenge_completed" + "name": "modifier_card_suit_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Imodifier_card_suit_event" + }, + { + "type": "enum", + "name": "jokers_of_neon::models::data::card::Suit", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "Clubs", + "type": "()" + }, + { + "name": "Diamonds", + "type": "()" + }, + { + "name": "Hearts", + "type": "()" + }, + { + "name": "Spades", + "type": "()" + }, + { + "name": "Joker", + "type": "()" + } + ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::ItemChallengeCompleted", + "name": "jokers_of_neon::models::data::events::ModifierCardSuitEvent", "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, { "name": "game_id", "type": "core::integer::u32" }, { - "name": "challenge_id", + "name": "modifier_card_idx", + "type": "core::integer::u32" + }, + { + "name": "current_hand_card_idx", "type": "core::integer::u32" + }, + { + "name": "suit", + "type": "jokers_of_neon::models::data::card::Suit" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Iitem_challenge_completed", + "name": "jokers_of_neon::models::data::events::Imodifier_card_suit_event", "items": [ { "type": "function", @@ -12442,7 +13871,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::ItemChallengeCompleted" + "type": "jokers_of_neon::models::data::events::ModifierCardSuitEvent" } ], "outputs": [], @@ -12452,36 +13881,46 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::item_challenge_completed::Event", + "name": "jokers_of_neon::models::data::events::modifier_card_suit_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-ItemChallengeCompleted", - "qualified_path": "jokers_of_neon::models::data::events::item_challenge_completed", - "manifest_name": "jokers_of_neon-ItemChallengeCompleted-2cb0f253" + "tag": "jokers_of_neon-ModifierCardSuitEvent", + "qualified_path": "jokers_of_neon::models::data::events::modifier_card_suit_event", + "manifest_name": "jokers_of_neon-ModifierCardSuitEvent-3733fa1c" }, { "kind": "DojoModel", "members": [ + { + "name": "player", + "type": "ContractAddress", + "key": true + }, { "name": "game_id", "type": "u32", - "key": true + "key": false }, { - "name": "current_probability", - "type": "u16", + "name": "neon_cards_idx", + "type": "Array", "key": false }, { - "name": "level", - "type": "u8", + "name": "multi", + "type": "u32", + "key": false + }, + { + "name": "points", + "type": "u32", "key": false } ], - "class_hash": "0x2cdd0f8efcd582eb49fd33a9bc2c466d96bda4d2b7739b48258842fdb18984d", - "original_class_hash": "0x2cdd0f8efcd582eb49fd33a9bc2c466d96bda4d2b7739b48258842fdb18984d", + "class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", + "original_class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", "abi": [ { "type": "impl", @@ -12847,30 +14286,38 @@ }, { "type": "impl", - "name": "last_beast_levelImpl", - "interface_name": "jokers_of_neon::models::data::last_beast_level::Ilast_beast_level" + "name": "neon_poker_hand_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event" }, { "type": "struct", - "name": "jokers_of_neon::models::data::last_beast_level::LastBeastLevel", + "name": "jokers_of_neon::models::data::events::NeonPokerHandEvent", "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, { "name": "game_id", "type": "core::integer::u32" }, { - "name": "current_probability", - "type": "core::integer::u16" + "name": "neon_cards_idx", + "type": "core::array::Array::" }, { - "name": "level", - "type": "core::integer::u8" + "name": "multi", + "type": "core::integer::u32" + }, + { + "name": "points", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::last_beast_level::Ilast_beast_level", + "name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event", "items": [ { "type": "function", @@ -12878,7 +14325,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::last_beast_level::LastBeastLevel" + "type": "jokers_of_neon::models::data::events::NeonPokerHandEvent" } ], "outputs": [], @@ -12888,14 +14335,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::last_beast_level::last_beast_level::Event", + "name": "jokers_of_neon::models::data::events::neon_poker_hand_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-LastBeastLevel", - "qualified_path": "jokers_of_neon::models::data::last_beast_level::last_beast_level", - "manifest_name": "jokers_of_neon-LastBeastLevel-ce77bf82" + "tag": "jokers_of_neon-NeonPokerHandEvent", + "qualified_path": "jokers_of_neon::models::data::events::neon_poker_hand_event", + "manifest_name": "jokers_of_neon-NeonPokerHandEvent-319c54d1" }, { "kind": "DojoModel", @@ -12909,25 +14356,10 @@ "name": "game_id", "type": "u32", "key": false - }, - { - "name": "modifier_card_idx", - "type": "u32", - "key": false - }, - { - "name": "current_hand_card_idx", - "type": "u32", - "key": false - }, - { - "name": "suit", - "type": "Suit", - "key": false } ], - "class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", - "original_class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", + "class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", + "original_class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", "abi": [ { "type": "impl", @@ -13293,42 +14725,12 @@ }, { "type": "impl", - "name": "modifier_card_suit_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Imodifier_card_suit_event" - }, - { - "type": "enum", - "name": "jokers_of_neon::models::data::card::Suit", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "Clubs", - "type": "()" - }, - { - "name": "Diamonds", - "type": "()" - }, - { - "name": "Hearts", - "type": "()" - }, - { - "name": "Spades", - "type": "()" - }, - { - "name": "Joker", - "type": "()" - } - ] + "name": "play_game_over_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Iplay_game_over_event" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::ModifierCardSuitEvent", + "name": "jokers_of_neon::models::data::events::PlayGameOverEvent", "members": [ { "name": "player", @@ -13337,24 +14739,12 @@ { "name": "game_id", "type": "core::integer::u32" - }, - { - "name": "modifier_card_idx", - "type": "core::integer::u32" - }, - { - "name": "current_hand_card_idx", - "type": "core::integer::u32" - }, - { - "name": "suit", - "type": "jokers_of_neon::models::data::card::Suit" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Imodifier_card_suit_event", + "name": "jokers_of_neon::models::data::events::Iplay_game_over_event", "items": [ { "type": "function", @@ -13362,7 +14752,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::ModifierCardSuitEvent" + "type": "jokers_of_neon::models::data::events::PlayGameOverEvent" } ], "outputs": [], @@ -13372,46 +14762,41 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::modifier_card_suit_event::Event", + "name": "jokers_of_neon::models::data::events::play_game_over_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-ModifierCardSuitEvent", - "qualified_path": "jokers_of_neon::models::data::events::modifier_card_suit_event", - "manifest_name": "jokers_of_neon-ModifierCardSuitEvent-3733fa1c" + "tag": "jokers_of_neon-PlayGameOverEvent", + "qualified_path": "jokers_of_neon::models::data::events::play_game_over_event", + "manifest_name": "jokers_of_neon-PlayGameOverEvent-12f13b9f" }, { "kind": "DojoModel", "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, { "name": "game_id", "type": "u32", - "key": false - }, - { - "name": "neon_cards_idx", - "type": "Array", - "key": false + "key": true }, { - "name": "multi", + "name": "level", "type": "u32", - "key": false + "key": true }, { - "name": "points", - "type": "u32", + "name": "count_hand", + "type": "u8", + "key": true + }, + { + "name": "poker_hand", + "type": "PokerHand", "key": false } ], - "class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", - "original_class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", + "class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", + "original_class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", "abi": [ { "type": "impl", @@ -13777,38 +15162,88 @@ }, { "type": "impl", - "name": "neon_poker_hand_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event" + "name": "play_poker_hand_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Iplay_poker_hand_event" }, { - "type": "struct", - "name": "jokers_of_neon::models::data::events::NeonPokerHandEvent", - "members": [ + "type": "enum", + "name": "jokers_of_neon::models::data::poker_hand::PokerHand", + "variants": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "None", + "type": "()" }, { - "name": "game_id", - "type": "core::integer::u32" + "name": "RoyalFlush", + "type": "()" }, { - "name": "neon_cards_idx", - "type": "core::array::Array::" + "name": "StraightFlush", + "type": "()" }, { - "name": "multi", + "name": "FiveOfAKind", + "type": "()" + }, + { + "name": "FourOfAKind", + "type": "()" + }, + { + "name": "FullHouse", + "type": "()" + }, + { + "name": "Straight", + "type": "()" + }, + { + "name": "Flush", + "type": "()" + }, + { + "name": "ThreeOfAKind", + "type": "()" + }, + { + "name": "TwoPair", + "type": "()" + }, + { + "name": "OnePair", + "type": "()" + }, + { + "name": "HighCard", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "jokers_of_neon::models::data::events::PlayPokerHandEvent", + "members": [ + { + "name": "game_id", "type": "core::integer::u32" }, { - "name": "points", + "name": "level", "type": "core::integer::u32" + }, + { + "name": "count_hand", + "type": "core::integer::u8" + }, + { + "name": "poker_hand", + "type": "jokers_of_neon::models::data::poker_hand::PokerHand" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event", + "name": "jokers_of_neon::models::data::events::Iplay_poker_hand_event", "items": [ { "type": "function", @@ -13816,7 +15251,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::NeonPokerHandEvent" + "type": "jokers_of_neon::models::data::events::PlayPokerHandEvent" } ], "outputs": [], @@ -13826,14 +15261,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::neon_poker_hand_event::Event", + "name": "jokers_of_neon::models::data::events::play_poker_hand_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-NeonPokerHandEvent", - "qualified_path": "jokers_of_neon::models::data::events::neon_poker_hand_event", - "manifest_name": "jokers_of_neon-NeonPokerHandEvent-319c54d1" + "tag": "jokers_of_neon-PlayPokerHandEvent", + "qualified_path": "jokers_of_neon::models::data::events::play_poker_hand_event", + "manifest_name": "jokers_of_neon-PlayPokerHandEvent-6abe67fd" }, { "kind": "DojoModel", @@ -13847,10 +15282,20 @@ "name": "game_id", "type": "u32", "key": false + }, + { + "name": "level", + "type": "u32", + "key": false + }, + { + "name": "player_score", + "type": "u32", + "key": false } ], - "class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", - "original_class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", + "class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", + "original_class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", "abi": [ { "type": "impl", @@ -14216,12 +15661,12 @@ }, { "type": "impl", - "name": "play_game_over_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Iplay_game_over_event" + "name": "play_win_game_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Iplay_win_game_event" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::PlayGameOverEvent", + "name": "jokers_of_neon::models::data::events::PlayWinGameEvent", "members": [ { "name": "player", @@ -14230,12 +15675,20 @@ { "name": "game_id", "type": "core::integer::u32" + }, + { + "name": "level", + "type": "core::integer::u32" + }, + { + "name": "player_score", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Iplay_game_over_event", + "name": "jokers_of_neon::models::data::events::Iplay_win_game_event", "items": [ { "type": "function", @@ -14243,7 +15696,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PlayGameOverEvent" + "type": "jokers_of_neon::models::data::events::PlayWinGameEvent" } ], "outputs": [], @@ -14253,41 +15706,31 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::play_game_over_event::Event", + "name": "jokers_of_neon::models::data::events::play_win_game_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-PlayGameOverEvent", - "qualified_path": "jokers_of_neon::models::data::events::play_game_over_event", - "manifest_name": "jokers_of_neon-PlayGameOverEvent-12f13b9f" + "tag": "jokers_of_neon-PlayWinGameEvent", + "qualified_path": "jokers_of_neon::models::data::events::play_win_game_event", + "manifest_name": "jokers_of_neon-PlayWinGameEvent-c57c8fde" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "level", + "name": "attack", "type": "u32", - "key": true - }, - { - "name": "count_hand", - "type": "u8", - "key": true - }, - { - "name": "poker_hand", - "type": "PokerHand", "key": false } ], - "class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", - "original_class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", + "class_hash": "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0", + "original_class_hash": "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0", "abi": [ { "type": "impl", @@ -14653,88 +16096,26 @@ }, { "type": "impl", - "name": "play_poker_hand_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Iplay_poker_hand_event" - }, - { - "type": "enum", - "name": "jokers_of_neon::models::data::poker_hand::PokerHand", - "variants": [ - { - "name": "None", - "type": "()" - }, - { - "name": "RoyalFlush", - "type": "()" - }, - { - "name": "StraightFlush", - "type": "()" - }, - { - "name": "FiveOfAKind", - "type": "()" - }, - { - "name": "FourOfAKind", - "type": "()" - }, - { - "name": "FullHouse", - "type": "()" - }, - { - "name": "Straight", - "type": "()" - }, - { - "name": "Flush", - "type": "()" - }, - { - "name": "ThreeOfAKind", - "type": "()" - }, - { - "name": "TwoPair", - "type": "()" - }, - { - "name": "OnePair", - "type": "()" - }, - { - "name": "HighCard", - "type": "()" - } - ] + "name": "player_attackImpl", + "interface_name": "jokers_of_neon::models::data::events::Iplayer_attack" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::PlayPokerHandEvent", + "name": "jokers_of_neon::models::data::events::PlayerAttack", "members": [ { - "name": "game_id", - "type": "core::integer::u32" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "level", + "name": "attack", "type": "core::integer::u32" - }, - { - "name": "count_hand", - "type": "core::integer::u8" - }, - { - "name": "poker_hand", - "type": "jokers_of_neon::models::data::poker_hand::PokerHand" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Iplay_poker_hand_event", + "name": "jokers_of_neon::models::data::events::Iplayer_attack", "items": [ { "type": "function", @@ -14742,7 +16123,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PlayPokerHandEvent" + "type": "jokers_of_neon::models::data::events::PlayerAttack" } ], "outputs": [], @@ -14752,41 +16133,31 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::play_poker_hand_event::Event", + "name": "jokers_of_neon::models::data::events::player_attack::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-PlayPokerHandEvent", - "qualified_path": "jokers_of_neon::models::data::events::play_poker_hand_event", - "manifest_name": "jokers_of_neon-PlayPokerHandEvent-6abe67fd" + "tag": "jokers_of_neon-PlayerAttack", + "qualified_path": "jokers_of_neon::models::data::events::player_attack", + "manifest_name": "jokers_of_neon-PlayerAttack-3b7323b8" }, { "kind": "DojoModel", "members": [ - { - "name": "player", - "type": "ContractAddress", - "key": true - }, { "name": "game_id", "type": "u32", - "key": false - }, - { - "name": "level", - "type": "u32", - "key": false + "key": true }, { - "name": "player_score", - "type": "u32", + "name": "energy", + "type": "u8", "key": false } ], - "class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", - "original_class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", + "class_hash": "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49", + "original_class_hash": "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49", "abi": [ { "type": "impl", @@ -15152,34 +16523,26 @@ }, { "type": "impl", - "name": "play_win_game_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Iplay_win_game_event" + "name": "player_beastImpl", + "interface_name": "jokers_of_neon::models::data::beast::Iplayer_beast" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::PlayWinGameEvent", + "name": "jokers_of_neon::models::data::beast::PlayerBeast", "members": [ - { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" - }, { "name": "game_id", "type": "core::integer::u32" }, { - "name": "level", - "type": "core::integer::u32" - }, - { - "name": "player_score", - "type": "core::integer::u32" + "name": "energy", + "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Iplay_win_game_event", + "name": "jokers_of_neon::models::data::beast::Iplayer_beast", "items": [ { "type": "function", @@ -15187,7 +16550,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PlayWinGameEvent" + "type": "jokers_of_neon::models::data::beast::PlayerBeast" } ], "outputs": [], @@ -15197,31 +16560,36 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::play_win_game_event::Event", + "name": "jokers_of_neon::models::data::beast::player_beast::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-PlayWinGameEvent", - "qualified_path": "jokers_of_neon::models::data::events::play_win_game_event", - "manifest_name": "jokers_of_neon-PlayWinGameEvent-c57c8fde" + "tag": "jokers_of_neon-PlayerBeast", + "qualified_path": "jokers_of_neon::models::data::beast::player_beast", + "manifest_name": "jokers_of_neon-PlayerBeast-22d6f7af" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "game_id", + "type": "u32", "key": true }, { - "name": "attack", + "name": "potion_heal", + "type": "u32", + "key": false + }, + { + "name": "current_hp", "type": "u32", "key": false } ], - "class_hash": "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0", - "original_class_hash": "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0", + "class_hash": "0xc08b898bbf24211a37fbdccc3bc3bf615954fe0c821a9de3e6e8151eaa3871", + "original_class_hash": "0xc08b898bbf24211a37fbdccc3bc3bf615954fe0c821a9de3e6e8151eaa3871", "abi": [ { "type": "impl", @@ -15587,26 +16955,30 @@ }, { "type": "impl", - "name": "player_attackImpl", - "interface_name": "jokers_of_neon::models::data::events::Iplayer_attack" + "name": "player_healedImpl", + "interface_name": "jokers_of_neon::models::data::events::Iplayer_healed" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::PlayerAttack", + "name": "jokers_of_neon::models::data::events::PlayerHealed", "members": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "game_id", + "type": "core::integer::u32" }, { - "name": "attack", + "name": "potion_heal", + "type": "core::integer::u32" + }, + { + "name": "current_hp", "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Iplayer_attack", + "name": "jokers_of_neon::models::data::events::Iplayer_healed", "items": [ { "type": "function", @@ -15614,7 +16986,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PlayerAttack" + "type": "jokers_of_neon::models::data::events::PlayerHealed" } ], "outputs": [], @@ -15624,31 +16996,41 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::player_attack::Event", + "name": "jokers_of_neon::models::data::events::player_healed::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-PlayerAttack", - "qualified_path": "jokers_of_neon::models::data::events::player_attack", - "manifest_name": "jokers_of_neon-PlayerAttack-3b7323b8" + "tag": "jokers_of_neon-PlayerHealed", + "qualified_path": "jokers_of_neon::models::data::events::player_healed", + "manifest_name": "jokers_of_neon-PlayerHealed-3cdab4ab" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "energy", + "name": "poker_hand", "type": "u8", "key": false + }, + { + "name": "multi", + "type": "u32", + "key": false + }, + { + "name": "points", + "type": "u32", + "key": false } ], - "class_hash": "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49", - "original_class_hash": "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49", + "class_hash": "0x34c07816aa25e5daadc2370bd4793af7dbd786de2c1e99d74e7347680ffa281", + "original_class_hash": "0x34c07816aa25e5daadc2370bd4793af7dbd786de2c1e99d74e7347680ffa281", "abi": [ { "type": "impl", @@ -16014,26 +17396,34 @@ }, { "type": "impl", - "name": "player_beastImpl", - "interface_name": "jokers_of_neon::models::data::beast::Iplayer_beast" + "name": "poker_hand_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Ipoker_hand_event" }, { "type": "struct", - "name": "jokers_of_neon::models::data::beast::PlayerBeast", + "name": "jokers_of_neon::models::data::events::PokerHandEvent", "members": [ { - "name": "game_id", - "type": "core::integer::u32" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "energy", + "name": "poker_hand", "type": "core::integer::u8" + }, + { + "name": "multi", + "type": "core::integer::u32" + }, + { + "name": "points", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::beast::Iplayer_beast", + "name": "jokers_of_neon::models::data::events::Ipoker_hand_event", "items": [ { "type": "function", @@ -16041,7 +17431,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::beast::PlayerBeast" + "type": "jokers_of_neon::models::data::events::PokerHandEvent" } ], "outputs": [], @@ -16051,41 +17441,46 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::beast::player_beast::Event", + "name": "jokers_of_neon::models::data::events::poker_hand_event::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-PlayerBeast", - "qualified_path": "jokers_of_neon::models::data::beast::player_beast", - "manifest_name": "jokers_of_neon-PlayerBeast-22d6f7af" + "tag": "jokers_of_neon-PokerHandEvent", + "qualified_path": "jokers_of_neon::models::data::events::poker_hand_event", + "manifest_name": "jokers_of_neon-PokerHandEvent-2ca11749" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "ContractAddress", + "name": "game_id", + "type": "u32", "key": true }, { - "name": "poker_hand", - "type": "u8", + "name": "is_active", + "type": "bool", "key": false }, { - "name": "multi", - "type": "u32", + "name": "current_probability", + "type": "u16", "key": false }, { - "name": "points", - "type": "u32", + "name": "active_rage_ids", + "type": "Span", + "key": false + }, + { + "name": "last_active_level", + "type": "u8", "key": false } ], - "class_hash": "0x34c07816aa25e5daadc2370bd4793af7dbd786de2c1e99d74e7347680ffa281", - "original_class_hash": "0x34c07816aa25e5daadc2370bd4793af7dbd786de2c1e99d74e7347680ffa281", + "class_hash": "0x7732ec110c4cfe77b29c39aa5115b1e4f5a547a42ef2e36c8b96ff5382a63fa", + "original_class_hash": "0x7732ec110c4cfe77b29c39aa5115b1e4f5a547a42ef2e36c8b96ff5382a63fa", "abi": [ { "type": "impl", @@ -16451,34 +17846,62 @@ }, { "type": "impl", - "name": "poker_hand_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Ipoker_hand_event" + "name": "rage_roundImpl", + "interface_name": "jokers_of_neon::models::status::game::rage::Irage_round" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::PokerHandEvent", + "name": "core::array::Span::", "members": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "jokers_of_neon::models::status::game::rage::RageRound", + "members": [ + { + "name": "game_id", + "type": "core::integer::u32" }, { - "name": "poker_hand", - "type": "core::integer::u8" + "name": "is_active", + "type": "core::bool" }, { - "name": "multi", - "type": "core::integer::u32" + "name": "current_probability", + "type": "core::integer::u16" }, { - "name": "points", - "type": "core::integer::u32" + "name": "active_rage_ids", + "type": "core::array::Span::" + }, + { + "name": "last_active_level", + "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ipoker_hand_event", + "name": "jokers_of_neon::models::status::game::rage::Irage_round", "items": [ { "type": "function", @@ -16486,7 +17909,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PokerHandEvent" + "type": "jokers_of_neon::models::status::game::rage::RageRound" } ], "outputs": [], @@ -16496,14 +17919,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::poker_hand_event::Event", + "name": "jokers_of_neon::models::status::game::rage::rage_round::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-PokerHandEvent", - "qualified_path": "jokers_of_neon::models::data::events::poker_hand_event", - "manifest_name": "jokers_of_neon-PokerHandEvent-2ca11749" + "tag": "jokers_of_neon-RageRound", + "qualified_path": "jokers_of_neon::models::status::game::rage::rage_round", + "manifest_name": "jokers_of_neon-RageRound-625525ca" }, { "kind": "DojoModel", @@ -16514,28 +17937,13 @@ "key": true }, { - "name": "is_active", - "type": "bool", - "key": false - }, - { - "name": "current_probability", - "type": "u16", - "key": false - }, - { - "name": "active_rage_ids", + "name": "rewards_ids", "type": "Span", "key": false - }, - { - "name": "last_active_level", - "type": "u8", - "key": false } ], - "class_hash": "0x7732ec110c4cfe77b29c39aa5115b1e4f5a547a42ef2e36c8b96ff5382a63fa", - "original_class_hash": "0x7732ec110c4cfe77b29c39aa5115b1e4f5a547a42ef2e36c8b96ff5382a63fa", + "class_hash": "0x315761eb593391eaf1293fa2f5b43903a93c31ded0a925f9d31077fbd8ccc5a", + "original_class_hash": "0x315761eb593391eaf1293fa2f5b43903a93c31ded0a925f9d31077fbd8ccc5a", "abi": [ { "type": "impl", @@ -16901,22 +18309,8 @@ }, { "type": "impl", - "name": "rage_roundImpl", - "interface_name": "jokers_of_neon::models::status::game::rage::Irage_round" - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] + "name": "rewardImpl", + "interface_name": "jokers_of_neon::models::data::reward::Ireward" }, { "type": "struct", @@ -16930,33 +18324,21 @@ }, { "type": "struct", - "name": "jokers_of_neon::models::status::game::rage::RageRound", + "name": "jokers_of_neon::models::data::reward::Reward", "members": [ { "name": "game_id", "type": "core::integer::u32" }, { - "name": "is_active", - "type": "core::bool" - }, - { - "name": "current_probability", - "type": "core::integer::u16" - }, - { - "name": "active_rage_ids", + "name": "rewards_ids", "type": "core::array::Span::" - }, - { - "name": "last_active_level", - "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::game::rage::Irage_round", + "name": "jokers_of_neon::models::data::reward::Ireward", "items": [ { "type": "function", @@ -16964,7 +18346,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::game::rage::RageRound" + "type": "jokers_of_neon::models::data::reward::Reward" } ], "outputs": [], @@ -16974,14 +18356,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::status::game::rage::rage_round::Event", + "name": "jokers_of_neon::models::data::reward::reward::Event", "kind": "enum", "variants": [] } ], - "tag": "jokers_of_neon-RageRound", - "qualified_path": "jokers_of_neon::models::status::game::rage::rage_round", - "manifest_name": "jokers_of_neon-RageRound-625525ca" + "tag": "jokers_of_neon-Reward", + "qualified_path": "jokers_of_neon::models::data::reward::reward", + "manifest_name": "jokers_of_neon-Reward-1ffe01c2" }, { "kind": "DojoModel", diff --git a/manifests/dev/deployment/manifest.toml b/manifests/dev/deployment/manifest.toml index cfee4f5..a31fbfe 100644 --- a/manifests/dev/deployment/manifest.toml +++ b/manifests/dev/deployment/manifest.toml @@ -24,8 +24,8 @@ manifest_name = "dojo-base" [[contracts]] kind = "DojoContract" address = "0x6a41badee85305fa1aac33488860360c66b60d7f3b204d6e2cd84071dc3c394" -class_hash = "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5" -original_class_hash = "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5" +class_hash = "0x6064cd42481d56780719611f314fd168f59da3e319e4fdaf3606c3483563db0" +original_class_hash = "0x6064cd42481d56780719611f314fd168f59da3e319e4fdaf3606c3483563db0" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/jokers_of_neon-game_system-7a205bbc.json" reads = [] @@ -37,7 +37,10 @@ systems = [ "play", "discard", "end_turn", + "create_reward", + "select_reward", "select_deck", + "use_adventurer", "select_special_cards", "select_modifier_cards", "discard_effect_card", @@ -62,8 +65,8 @@ manifest_name = "jokers_of_neon-poker_hand_system-25bae3ed" [[contracts]] kind = "DojoContract" address = "0x75602558fd679c49be1a6ccb73e3d6d842f0558e1f41c4013ce109d05a5790f" -class_hash = "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d" -original_class_hash = "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d" +class_hash = "0x4da1956c768854cdfddd16b65b34b7ce24c2c44a2acf60b1f2592475b503fa2" +original_class_hash = "0x4da1956c768854cdfddd16b65b34b7ce24c2c44a2acf60b1f2592475b503fa2" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/jokers_of_neon-rage_system-601fc835.json" reads = [] @@ -73,6 +76,30 @@ tag = "jokers_of_neon-rage_system" systems = ["calculate"] manifest_name = "jokers_of_neon-rage_system-601fc835" +[[models]] +kind = "DojoModel" +class_hash = "0x79045f9b971b4009a1822c5471f5b54365f86045fbf1ca4745a441195ec8c40" +original_class_hash = "0x79045f9b971b4009a1822c5471f5b54365f86045fbf1ca4745a441195ec8c40" +abi = "manifests/dev/deployment/abis/models/jokers_of_neon-AdventurerConsumed-5d6c7696.json" +tag = "jokers_of_neon-AdventurerConsumed" +qualified_path = "jokers_of_neon::models::data::adventurer::adventurer_consumed" +manifest_name = "jokers_of_neon-AdventurerConsumed-5d6c7696" + +[[models.members]] +name = "adventurer_id" +type = "u32" +key = true + +[[models.members]] +name = "owner" +type = "ContractAddress" +key = false + +[[models.members]] +name = "consumed" +type = "bool" +key = false + [[models]] kind = "DojoModel" class_hash = "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf" @@ -637,8 +664,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2" -original_class_hash = "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2" +class_hash = "0x25c9eb7813071767dcf7069b422a5b8a3895c51346932209f389a63ba62ecae" +original_class_hash = "0x25c9eb7813071767dcf7069b422a5b8a3895c51346932209f389a63ba62ecae" abi = "manifests/dev/deployment/abis/models/jokers_of_neon-Game-162de85b.json" tag = "jokers_of_neon-Game" qualified_path = "jokers_of_neon::models::status::game::game::game" @@ -1008,6 +1035,30 @@ name = "energy" type = "u8" key = false +[[models]] +kind = "DojoModel" +class_hash = "0xc08b898bbf24211a37fbdccc3bc3bf615954fe0c821a9de3e6e8151eaa3871" +original_class_hash = "0xc08b898bbf24211a37fbdccc3bc3bf615954fe0c821a9de3e6e8151eaa3871" +abi = "manifests/dev/deployment/abis/models/jokers_of_neon-PlayerHealed-3cdab4ab.json" +tag = "jokers_of_neon-PlayerHealed" +qualified_path = "jokers_of_neon::models::data::events::player_healed" +manifest_name = "jokers_of_neon-PlayerHealed-3cdab4ab" + +[[models.members]] +name = "game_id" +type = "u32" +key = true + +[[models.members]] +name = "potion_heal" +type = "u32" +key = false + +[[models.members]] +name = "current_hp" +type = "u32" +key = false + [[models]] kind = "DojoModel" class_hash = "0x34c07816aa25e5daadc2370bd4793af7dbd786de2c1e99d74e7347680ffa281" @@ -1071,6 +1122,25 @@ name = "last_active_level" type = "u8" key = false +[[models]] +kind = "DojoModel" +class_hash = "0x315761eb593391eaf1293fa2f5b43903a93c31ded0a925f9d31077fbd8ccc5a" +original_class_hash = "0x315761eb593391eaf1293fa2f5b43903a93c31ded0a925f9d31077fbd8ccc5a" +abi = "manifests/dev/deployment/abis/models/jokers_of_neon-Reward-1ffe01c2.json" +tag = "jokers_of_neon-Reward" +qualified_path = "jokers_of_neon::models::data::reward::reward" +manifest_name = "jokers_of_neon-Reward-1ffe01c2" + +[[models.members]] +name = "game_id" +type = "u32" +key = true + +[[models.members]] +name = "rewards_ids" +type = "Span" +key = false + [[models]] kind = "DojoModel" class_hash = "0x58fe22073d9dc0c2cf86d7a19fa3d32e90e1eac8b3b057c20a9477c88565134" diff --git a/scripts/enviroment.sh b/scripts/enviroment.sh index b3dd27a..6a66f0f 100755 --- a/scripts/enviroment.sh +++ b/scripts/enviroment.sh @@ -3,6 +3,11 @@ sozo execute game_system create_game -c 1 --wait --world 0x37578f01e123327fb366f sleep 3 echo -e "\n[INFO] Game created successfully. Waiting 3 seconds before selecting deck..." +echo -e "\n[INFO] Selecting aventurer for the game..." +sozo execute game_system use_adventurer -c 1,1 --wait --world 0x37578f01e123327fb366fc6e2224f4be4e44234d682855e1326363b57444b88 +sleep 3 +echo -e "\n[INFO] Aventurer selected successfully. Waiting 3 seconds before selecting deck..." + echo -e "\n[INFO] Selecting deck for the game..." sozo execute game_system select_deck -c 1,0 --wait --world 0x37578f01e123327fb366fc6e2224f4be4e44234d682855e1326363b57444b88 sleep 3 diff --git a/src/interfaces/erc721.cairo b/src/interfaces/erc721.cairo new file mode 100644 index 0000000..ae931fa --- /dev/null +++ b/src/interfaces/erc721.cairo @@ -0,0 +1,7 @@ +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; +use starknet::ContractAddress; + +#[dojo::interface] +trait IERC721System { + fn owner_of(world: @IWorldDispatcher, token_id: u256) -> ContractAddress; +} diff --git a/src/interfaces/loot_survivor.cairo b/src/interfaces/loot_survivor.cairo new file mode 100644 index 0000000..5d50990 --- /dev/null +++ b/src/interfaces/loot_survivor.cairo @@ -0,0 +1,48 @@ +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; +#[derive(Drop, Copy, PartialEq, Serde)] +struct Item { // 21 storage bits + id: u8, // 7 bits + xp: u16, // 9 bits +} + +#[derive(Drop, Copy, Serde, PartialEq)] +struct Equipment { // 128 bits + weapon: Item, + chest: Item, + head: Item, + waist: Item, // 16 bits per item + foot: Item, + hand: Item, + neck: Item, + ring: Item, +} + +#[derive(Drop, Copy, Serde, PartialEq)] +struct Stats { // 30 bits total + strength: u8, + dexterity: u8, + vitality: u8, // 5 bits per stat + intelligence: u8, + wisdom: u8, + charisma: u8, + luck: u8 // dynamically generated, not stored. +} + +#[derive(Drop, Copy, Serde)] +struct Adventurer { + health: u16, // 10 bits + xp: u16, // 15 bits + gold: u16, // 9 bits + beast_health: u16, // 10 bits + stat_upgrades_available: u8, // 4 bits + stats: Stats, // 30 bits + equipment: Equipment, // 128 bits + battle_action_count: u8, // 8 bits + mutated: bool, // not packed + awaiting_item_specials: bool, // not packed +} + +#[dojo::interface] +trait ILootSurvivorSystem { + fn get_adventurer(world: @IWorldDispatcher, adventurer_id: felt252) -> Adventurer; +} diff --git a/src/lib.cairo b/src/lib.cairo index c35862c..9414848 100644 --- a/src/lib.cairo +++ b/src/lib.cairo @@ -17,6 +17,7 @@ mod constants { mod models { mod data { + mod adventurer; mod beast; mod blister_pack; mod card; @@ -34,6 +35,7 @@ mod models { mod rage; } mod round { + mod adventurer; mod beast; mod challenge; mod current_hand_card; @@ -66,6 +68,7 @@ mod tests { } mod utils { + mod adventurer; mod calculate_hand; mod constants; mod game; @@ -82,3 +85,8 @@ mod configs { mod rage; mod slot_special_cards; } + +mod interfaces { + mod erc721; + mod loot_survivor; +} diff --git a/src/models/data/adventurer.cairo b/src/models/data/adventurer.cairo new file mode 100644 index 0000000..57b9177 --- /dev/null +++ b/src/models/data/adventurer.cairo @@ -0,0 +1,10 @@ +use starknet::ContractAddress; + +#[derive(Copy, Drop, IntrospectPacked, Serde)] +#[dojo::model] +struct AdventurerConsumed { + #[key] + adventurer_id: u32, + owner: ContractAddress, + consumed: bool +} diff --git a/src/models/status/game/game.cairo b/src/models/status/game/game.cairo index c979312..09dd90d 100644 --- a/src/models/status/game/game.cairo +++ b/src/models/status/game/game.cairo @@ -10,7 +10,9 @@ enum GameSubState { REWARD_CARDS_PACK, DRAFT_MODIFIERS, DRAFT_SPECIALS, - DRAFT_DECK + DRAFT_DECK, + DRAFT_ADVENTURER, + DRAFT_ADVENTURER_CARDS } #[derive(Serde, Copy, Drop, IntrospectPacked, PartialEq)] diff --git a/src/models/status/round/adventurer.cairo b/src/models/status/round/adventurer.cairo new file mode 100644 index 0000000..0cd7624 --- /dev/null +++ b/src/models/status/round/adventurer.cairo @@ -0,0 +1,57 @@ +use core::num::traits::{Sqrt}; +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; + +use jokers_of_neon::models::status::game::game::Game; +use jokers_of_neon::interfaces::erc721::{IERC721SystemDispatcher, IERC721SystemDispatcherTrait}; +use jokers_of_neon::interfaces::loot_survivor::{ + ILootSurvivorSystemDispatcher, ILootSurvivorSystemDispatcherTrait, Adventurer +}; +use jokers_of_neon::models::data::adventurer::{AdventurerConsumed, AdventurerConsumedStore}; +use jokers_of_neon::utils::adventurer::{is_mainnet, ADVENTURER_ADDRESS_MAINNET}; +use starknet::{ContractAddress, get_caller_address, get_tx_info}; + +mod errors { + const NOT_TOKEN_OWNER: felt252 = 'Not token owner'; + const ADVENTURER_CONSUMED: felt252 = 'Adventurer consumed'; +} + +#[generate_trait] +impl AdventurerImpl of AdventurerTrait { + fn use_adventurer(world: IWorldDispatcher, adventurer_id: u32, ref game: Game) { + if is_mainnet(get_tx_info().unbox().chain_id) { + let erc721_dispatcher = IERC721SystemDispatcher { contract_address: ADVENTURER_ADDRESS_MAINNET() }; + let owner = erc721_dispatcher.owner_of(adventurer_id.into()); + assert(owner == get_caller_address(), errors::NOT_TOKEN_OWNER); + + let mut adventurer_consumed = AdventurerConsumedStore::get(world, adventurer_id); + assert(!adventurer_consumed.consumed, errors::ADVENTURER_CONSUMED); + + let loot_survivor_dispatcher = ILootSurvivorSystemDispatcher { contract_address: ADVENTURER_ADDRESS_MAINNET() }; + let adventurer = loot_survivor_dispatcher.get_adventurer(adventurer_id.into()); + let level = get_level_from_xp(adventurer.xp); + + game.player_hp += (level + level / 2).into(); + + adventurer_consumed.consumed = true; + AdventurerConsumedStore::set(@adventurer_consumed, world); + } else { + let mut adventurer_consumed = AdventurerConsumedStore::get(world, adventurer_id); + assert(!adventurer_consumed.consumed, errors::ADVENTURER_CONSUMED); + + let level = 13; + + game.player_hp += level + level / 2; + + adventurer_consumed.consumed = true; + AdventurerConsumedStore::set(@adventurer_consumed, world); + } + } +} + +fn get_level_from_xp(xp: u16) -> u8 { + if (xp == 0) { + 1 + } else { + xp.sqrt() + } +} diff --git a/src/models/status/round/beast.cairo b/src/models/status/round/beast.cairo index 70fc10e..06ff0e5 100644 --- a/src/models/status/round/beast.cairo +++ b/src/models/status/round/beast.cairo @@ -93,7 +93,6 @@ impl BeastImpl of BeastTrait { player_beast.energy -= game_mode_beast.cost_play; PlayerBeastStore::set(@player_beast, world); - if beast.current_health.is_zero() { let play_win_game_event = PlayWinGameEvent { player: get_caller_address(), game_id, level: game.level, player_score: 0 @@ -112,7 +111,7 @@ impl BeastImpl of BeastTrait { _ => Option::None }.unwrap(); IRageSystemDispatcher { contract_address: rage_system_address.try_into().unwrap() }.calculate(game.id); - // create_level(world, ref store, game); TODO: + // create_level(world, ref store, game); TODO: } else if player_beast.energy.is_zero() { _attack_beast(world, ref store, ref game, ref player_beast, ref beast, ref game_mode_beast); } else { diff --git a/src/systems/game_system.cairo b/src/systems/game_system.cairo index 2dc7db7..3844bd9 100644 --- a/src/systems/game_system.cairo +++ b/src/systems/game_system.cairo @@ -16,6 +16,9 @@ trait IGameSystem { fn end_turn(ref world: IWorldDispatcher, game_id: u32); fn discard_effect_card(ref world: IWorldDispatcher, game_id: u32, card_index: u32); fn discard_special_card(ref world: IWorldDispatcher, game_id: u32, special_card_index: u32); + fn use_adventurer(ref world: IWorldDispatcher, game_id: u32, adventurer_id: u32); + fn skip_adventurer(ref world: IWorldDispatcher, game_id: u32); + fn select_aventurer_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array); } mod errors { @@ -38,6 +41,8 @@ mod errors { const WRONG_SUBSTATE_DRAFT_MODIFIERS: felt252 = 'Wrong substate DRAFT_MODIFIERS'; const WRONG_SUBSTATE_DRAFT_SPECIALS: felt252 = 'Wrong substate DRAFT_SPECIALS'; const WRONG_SUBSTATE_SELECT_REWARD: felt252 = 'Wrong substate SELECT_REWARD'; + const WRONG_SUBSTATE_DRAFT_ADVENTURER: felt252 = 'Wrong substate SELECT_ADVENTURE'; + const WRONG_SUBSTATE_ADVENTURER_CARDS: felt252 = 'Wrong substate SELECT_ADV_CARDS'; } #[dojo::contract] @@ -69,6 +74,7 @@ mod game_system { use jokers_of_neon::models::data::reward::{Reward, RewardType, RewardStore}; use jokers_of_neon::models::status::game::game::{Game, GameStore, GameState, GameSubState}; use jokers_of_neon::models::status::game::rage::{RageRound, RageRoundStore}; + use jokers_of_neon::models::status::round::adventurer::AdventurerTrait; use jokers_of_neon::models::status::round::beast::BeastTrait; use jokers_of_neon::models::status::round::challenge::ChallengeTrait; use jokers_of_neon::models::status::round::current_hand_card::{CurrentHandCard, CurrentHandCardTrait}; @@ -284,6 +290,69 @@ mod game_system { store.set_blister_pack_result(blister_pack_result); } + fn use_adventurer(ref world: IWorldDispatcher, game_id: u32, adventurer_id: u32) { + let mut store: Store = StoreTrait::new(world); + + let mut game = store.get_game(game_id); + // Check that the game exists (if the game has no owner means it does not exists) + assert(game.owner.is_non_zero(), errors::GAME_NOT_FOUND); + + // Check that the owner of the game is the caller + assert(game.owner == get_caller_address(), errors::CALLER_NOT_OWNER); + + // Check that the status of the game + assert(game.substate == GameSubState::DRAFT_ADVENTURER, errors::WRONG_SUBSTATE_DRAFT_ADVENTURER); + + AdventurerTrait::use_adventurer(world, adventurer_id, ref game); + + game.substate = GameSubState::DRAFT_ADVENTURER_CARDS; + store.set_game(game); + + let cards = open_blister_pack(world, ref store, game, SPECIAL_CARDS_PACK_ID); + let blister_pack_result = BlisterPackResult { game_id, cards_picked: false, cards }; + emit!(world, (blister_pack_result)); + store.set_blister_pack_result(blister_pack_result); + } + + fn skip_adventurer(ref world: IWorldDispatcher, game_id: u32) { + let mut store: Store = StoreTrait::new(world); + + let mut game = store.get_game(game_id); + // Check that the game exists (if the game has no owner means it does not exists) + assert(game.owner.is_non_zero(), errors::GAME_NOT_FOUND); + + // Check that the owner of the game is the caller + assert(game.owner == get_caller_address(), errors::CALLER_NOT_OWNER); + + // Check that the status of the game + assert(game.substate == GameSubState::DRAFT_ADVENTURER, errors::WRONG_SUBSTATE_DRAFT_ADVENTURER); + + game.substate = GameSubState::CREATE_LEVEL; + store.set_game(game); + } + + fn select_aventurer_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array) { + let mut store: Store = StoreTrait::new(world); + + let mut game = store.get_game(game_id); + // Check that the game exists (if the game has no owner means it does not exists) + assert(game.owner.is_non_zero(), errors::GAME_NOT_FOUND); + + // Check that the owner of the game is the caller + assert(game.owner == get_caller_address(), errors::CALLER_NOT_OWNER); + + // Check that the status of the game + assert(game.substate == GameSubState::DRAFT_ADVENTURER_CARDS, errors::WRONG_SUBSTATE_ADVENTURER_CARDS); + + let mut blister_pack_result = store.get_blister_pack_result(game.id); + assert(cards_index.len() <= 2, errors::INVALID_CARD_INDEX_LEN); + + select_cards_from_blister(world, ref game, blister_pack_result.cards, cards_index); + + game.substate = GameSubState::CREATE_LEVEL; + store.set_game(game); + } + fn select_special_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array) { let mut store: Store = StoreTrait::new(world); @@ -332,7 +401,7 @@ mod game_system { blister_pack_result.cards_picked = true; store.set_blister_pack_result(blister_pack_result); - game.substate = GameSubState::CREATE_LEVEL; + game.substate = GameSubState::DRAFT_ADVENTURER; store.set_game(game); // self.create_level(game_id) } diff --git a/src/tests/test_game_play_beast.cairo b/src/tests/test_game_play_beast.cairo index 3dba408..0fc991b 100644 --- a/src/tests/test_game_play_beast.cairo +++ b/src/tests/test_game_play_beast.cairo @@ -278,7 +278,7 @@ mod test_play_beast_special_cards { player_beast_after.energy == player_beast_before.energy - game_mode_beast.cost_play, 'wrong player energy' ); } -// #[test] + // #[test] // #[available_gas(30000000000000000)] // fn test_play_special_initial_advantage() { // let (world, systems) = setup::spawn_game(); @@ -286,15 +286,15 @@ mod test_play_beast_special_cards { // let mut game = mock_game(ref store, PLAYER()); // mock_round(ref store, @game, 300); -// // Mock special card + // // Mock special card // let special_cards_ids = array![SPECIAL_INITIAL_ADVANTAGE_ID]; // mock_special_cards(ref store, ref game, special_cards_ids); -// // Mock hand + // // Mock hand // let hand_cards_ids = array![ACE_CLUBS_ID, ACE_HEARTS_ID, ACE_DIAMONDS_ID, ACE_SPADES_ID]; // mock_current_hand_cards_ids(ref store, game.id, hand_cards_ids); -// set_contract_address(PLAYER()); + // set_contract_address(PLAYER()); // systems.game_system.play(game.id, array![0, 1, 2, 3], array![100, 100, 100, 100]); // // Four of a Kind - points: 60, multi: 7 // // points: 11 + 11 + 11 + 11 + 100 diff --git a/src/utils/adventurer.cairo b/src/utils/adventurer.cairo new file mode 100644 index 0000000..38d5af2 --- /dev/null +++ b/src/utils/adventurer.cairo @@ -0,0 +1,14 @@ +use dojo::world::Resource::Contract; +use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; + +use starknet::{ContractAddress, contract_address_const}; + +const MAINNET_CHAIN_ID: felt252 = 0x534e5f4d41494e; + +fn is_mainnet(chain_id: felt252) -> bool{ + chain_id == MAINNET_CHAIN_ID +} + +fn ADVENTURER_ADDRESS_MAINNET() -> ContractAddress { + contract_address_const::<0x018108b32cea514a78ef1b0e4a0753e855cdf620bc0565202c02456f618c4dc4>() +}