From b321b087449b42c5a70439eb42ec885e13686b66 Mon Sep 17 00:00:00 2001 From: dub_zn Date: Fri, 1 Nov 2024 21:43:03 -0300 Subject: [PATCH 1/4] add rewards logic --- manifests/dev/deployment/manifest.json | 3385 ++++++++++++++++------- manifests/dev/deployment/manifest.toml | 113 +- src/constants/packs.cairo | 13 + src/constants/reward.cairo | 3 + src/lib.cairo | 2 + src/models/data/events.cairo | 11 + src/models/data/reward.cairo | 31 + src/models/status/game/game.cairo | 3 +- src/models/status/round/beast.cairo | 4 +- src/models/status/round/challenge.cairo | 2 +- src/models/status/round/level.cairo | 4 - src/systems/game_system.cairo | 61 +- src/tests/test_game_play_beast.cairo | 9 +- 13 files changed, 2584 insertions(+), 1057 deletions(-) create mode 100644 src/constants/reward.cairo create mode 100644 src/models/data/reward.cairo diff --git a/manifests/dev/deployment/manifest.json b/manifests/dev/deployment/manifest.json index d6d2271..7e1c240 100644 --- a/manifests/dev/deployment/manifest.json +++ b/manifests/dev/deployment/manifest.json @@ -1256,8 +1256,8 @@ { "kind": "DojoContract", "address": "0x6a41badee85305fa1aac33488860360c66b60d7f3b204d6e2cd84071dc3c394", - "class_hash": "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49", - "original_class_hash": "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49", + "class_hash": "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5", + "original_class_hash": "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -1982,8 +1982,8 @@ { "kind": "DojoContract", "address": "0x75602558fd679c49be1a6ccb73e3d6d842f0558e1f41c4013ce109d05a5790f", - "class_hash": "0x4d335ac492b01d48fc5431dc87810c59111033fb62eaefd438ab41b6cdb3c06", - "original_class_hash": "0x4d335ac492b01d48fc5431dc87810c59111033fb62eaefd438ab41b6cdb3c06", + "class_hash": "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d", + "original_class_hash": "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -2235,6 +2235,11 @@ "type": "u32", "key": true }, + { + "name": "beast_id", + "type": "u32", + "key": false + }, { "name": "tier", "type": "u8", @@ -2250,14 +2255,24 @@ "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": "0x5a1c6141a6afc7ffaff55d76c948b77992e8cd89ca6c50b21ac617a9889dcd0", - "original_class_hash": "0x5a1c6141a6afc7ffaff55d76c948b77992e8cd89ca6c50b21ac617a9889dcd0", + "class_hash": "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf", + "original_class_hash": "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf", "abi": [ { "type": "impl", @@ -2626,6 +2641,20 @@ "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::beast::Beast", @@ -2634,6 +2663,10 @@ "name": "game_id", "type": "core::integer::u32" }, + { + "name": "beast_id", + "type": "core::integer::u32" + }, { "name": "tier", "type": "core::integer::u8" @@ -2646,9 +2679,17 @@ "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" } ] }, @@ -2685,33 +2726,18 @@ "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", @@ -3077,52 +3103,26 @@ }, { "type": "impl", - "name": "blister_pack_itemImpl", - "interface_name": "jokers_of_neon::models::status::shop::shop::Iblister_pack_item" - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] + "name": "beast_attackImpl", + "interface_name": "jokers_of_neon::models::data::events::Ibeast_attack" }, { "type": "struct", - "name": "jokers_of_neon::models::status::shop::shop::BlisterPackItem", + "name": "jokers_of_neon::models::data::events::BeastAttack", "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", @@ -3130,7 +3130,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::shop::shop::BlisterPackItem" + "type": "jokers_of_neon::models::data::events::BeastAttack" } ], "outputs": [], @@ -3140,14 +3140,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", @@ -3158,18 +3158,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", @@ -3535,8 +3545,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", @@ -3554,35 +3564,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", @@ -3590,7 +3598,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::shop::shop::BlisterPackResult" + "type": "jokers_of_neon::models::status::shop::shop::BlisterPackItem" } ], "outputs": [], @@ -3600,14 +3608,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", @@ -3618,23 +3626,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", @@ -4000,34 +4003,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", @@ -4035,7 +4058,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyBlisterPackEvent" + "type": "jokers_of_neon::models::status::shop::shop::BlisterPackResult" } ], "outputs": [], @@ -4045,14 +4068,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", @@ -4073,23 +4096,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", @@ -4455,48 +4468,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", @@ -4511,22 +4488,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", @@ -4534,7 +4503,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyCardEvent" + "type": "jokers_of_neon::models::data::events::BuyBlisterPackEvent" } ], "outputs": [], @@ -4544,14 +4513,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", @@ -4572,18 +4541,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", @@ -4949,66 +4923,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", @@ -5023,18 +4979,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", @@ -5042,7 +5002,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyPokerHandEvent" + "type": "jokers_of_neon::models::data::events::BuyCardEvent" } ], "outputs": [], @@ -5052,14 +5012,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", @@ -5075,18 +5035,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", @@ -5452,26 +5417,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", @@ -5482,18 +5487,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", @@ -5501,7 +5510,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::BuyRerollEvent" + "type": "jokers_of_neon::models::data::events::BuyPokerHandEvent" } ], "outputs": [], @@ -5511,14 +5520,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", @@ -5529,38 +5538,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", @@ -5926,30 +5920,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", @@ -5967,41 +5939,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", @@ -6009,7 +5969,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::shop::shop::CardItem" + "type": "jokers_of_neon::models::data::events::BuyRerollEvent" } ], "outputs": [], @@ -6019,41 +5979,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", @@ -6419,34 +6394,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", @@ -6454,7 +6477,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::CardScoreEvent" + "type": "jokers_of_neon::models::status::shop::shop::CardItem" } ], "outputs": [], @@ -6464,31 +6487,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", + "name": "index", + "type": "u32", + "key": false + }, + { + "name": "multi", + "type": "u32", + "key": false + }, + { + "name": "points", + "type": "u32", "key": false } ], - "class_hash": "0x366273a4ee649b33c07c7584bba0132ac37cc86f52ba525e4ced46a49b960f4", - "original_class_hash": "0x366273a4ee649b33c07c7584bba0132ac37cc86f52ba525e4ced46a49b960f4", + "class_hash": "0x25edae79ec31b503664c1ad9da2104d3b0dc4b4611bc3cd7bd613a438ce80b3", + "original_class_hash": "0x25edae79ec31b503664c1ad9da2104d3b0dc4b4611bc3cd7bd613a438ce80b3", "abi": [ { "type": "impl", @@ -6854,36 +6887,34 @@ }, { "type": "impl", - "name": "challengeImpl", - "interface_name": "jokers_of_neon::models::data::challenge::Ichallenge" + "name": "card_score_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Icard_score_event" }, { "type": "struct", - "name": "core::array::Span::", + "name": "jokers_of_neon::models::data::events::CardScoreEvent", "members": [ { - "name": "snapshot", - "type": "@core::array::Array::" - } - ] - }, - { - "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::" + "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", @@ -6891,7 +6922,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::challenge::Challenge" + "type": "jokers_of_neon::models::data::events::CardScoreEvent" } ], "outputs": [], @@ -6901,36 +6932,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", @@ -7296,30 +7322,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", @@ -7327,7 +7373,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::ChallengeCompleted" + "type": "jokers_of_neon::models::data::challenge::Challenge" } ], "outputs": [], @@ -7337,36 +7383,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", @@ -7732,30 +7778,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", @@ -7763,7 +7809,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::challenge::ChallengePlayer" + "type": "jokers_of_neon::models::data::events::ChallengeCompleted" } ], "outputs": [], @@ -7773,31 +7819,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", @@ -8163,26 +8214,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", @@ -8190,7 +8245,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::CreateGameEvent" + "type": "jokers_of_neon::models::data::challenge::ChallengePlayer" } ], "outputs": [], @@ -8200,36 +8255,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", @@ -8595,30 +8645,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", @@ -8626,7 +8672,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::round::current_hand_card::CurrentHandCard" + "type": "jokers_of_neon::models::data::events::CreateGameEvent" } ], "outputs": [], @@ -8636,14 +8682,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", @@ -8659,23 +8705,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", @@ -9041,26 +9077,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", @@ -9071,22 +9093,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", @@ -9094,7 +9108,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": [], @@ -9104,14 +9118,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", @@ -9122,18 +9136,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", @@ -9499,30 +9523,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": "struct", - "name": "jokers_of_neon::models::data::game_deck::DeckCard", + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "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", @@ -9530,7 +9576,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::game_deck::DeckCard" + "type": "jokers_of_neon::models::status::game::game::CurrentSpecialCards" } ], "outputs": [], @@ -9540,76 +9586,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", @@ -9975,62 +9981,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", @@ -10038,7 +10012,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::DetailEarnedEvent" + "type": "jokers_of_neon::models::data::game_deck::DeckCard" } ], "outputs": [], @@ -10048,96 +10022,76 @@ }, { "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", - "key": true - }, - { - "name": "owner", + "name": "player", "type": "ContractAddress", - "key": false - }, - { - "name": "player_name", - "type": "felt252", - "key": false - }, - { - "name": "max_hands", - "type": "u8", - "key": false - }, - { - "name": "max_discard", - "type": "u8", - "key": false + "key": true }, { - "name": "max_jokers", - "type": "u8", + "name": "game_id", + "type": "u32", "key": false }, { - "name": "player_score", + "name": "round_defeat", "type": "u32", "key": false }, { - "name": "level", + "name": "level_bonus", "type": "u32", "key": false }, { - "name": "len_hand", + "name": "hands_left", "type": "u32", "key": false }, { - "name": "len_max_current_special_cards", + "name": "hands_left_cash", "type": "u32", "key": false }, { - "name": "len_current_special_cards", + "name": "discard_left", "type": "u32", "key": false }, { - "name": "current_jokers", - "type": "u8", + "name": "discard_left_cash", + "type": "u32", "key": false }, { - "name": "state", - "type": "GameState", + "name": "rage_card_defeated", + "type": "u32", "key": false }, { - "name": "substate", - "type": "GameSubState", + "name": "rage_card_defeated_cash", + "type": "u32", "key": false }, { - "name": "cash", + "name": "total", "type": "u32", "key": false } ], - "class_hash": "0x2a0bf5c76a2a51057fa8cd30b669b8b2e9ac982f6a7c0d2aac0caf2e8b385a1", - "original_class_hash": "0x2a0bf5c76a2a51057fa8cd30b669b8b2e9ac982f6a7c0d2aac0caf2e8b385a1", + "class_hash": "0x5a8e5e18e43d39e182e079e0bcc67056e5a2a4bae237350d15e51fee36a5355", + "original_class_hash": "0x5a8e5e18e43d39e182e079e0bcc67056e5a2a4bae237350d15e51fee36a5355", "abi": [ { "type": "impl", @@ -10503,130 +10457,1557 @@ }, { "type": "impl", - "name": "gameImpl", - "interface_name": "jokers_of_neon::models::status::game::game::Igame" + "name": "detail_earned_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Idetail_earned_event" }, { - "type": "enum", - "name": "jokers_of_neon::models::status::game::game::GameState", - "variants": [ + "type": "struct", + "name": "jokers_of_neon::models::data::events::DetailEarnedEvent", + "members": [ { - "name": "SELECT_DECK", - "type": "()" + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "SELECT_SPECIAL_CARDS", - "type": "()" + "name": "game_id", + "type": "core::integer::u32" }, { - "name": "SELECT_MODIFIER_CARDS", - "type": "()" + "name": "round_defeat", + "type": "core::integer::u32" }, { - "name": "AT_SHOP", - "type": "()" + "name": "level_bonus", + "type": "core::integer::u32" }, { - "name": "IN_GAME", - "type": "()" + "name": "hands_left", + "type": "core::integer::u32" }, { - "name": "FINISHED", - "type": "()" + "name": "hands_left_cash", + "type": "core::integer::u32" }, { - "name": "OPEN_BLISTER_PACK", - "type": "()" - } - ] - }, - { - "type": "enum", - "name": "jokers_of_neon::models::status::game::game::GameSubState", - "variants": [ + "name": "discard_left", + "type": "core::integer::u32" + }, { - "name": "BEAST", - "type": "()" + "name": "discard_left_cash", + "type": "core::integer::u32" }, { - "name": "CREATE_LEVEL", - "type": "()" + "name": "rage_card_defeated", + "type": "core::integer::u32" }, { - "name": "OBSTACLE", - "type": "()" + "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": "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2", + "original_class_hash": "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2", + "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": "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": "()" + } + ] + }, + { + "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" + } + ] + }, + { + "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" + } + ] + }, + { + "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": "game_id", + "type": "u32", + "key": true + }, + { + "name": "cost_discard", + "type": "u8", + "key": false + }, + { + "name": "cost_play", + "type": "u8", + "key": false + }, + { + "name": "energy_max_player", + "type": "u8", + "key": false + } + ], + "class_hash": "0x4c5166033b50fa2dcbe8dca20d4c219aaf3b4944657affccd16cb08405bf8b5", + "original_class_hash": "0x4c5166033b50fa2dcbe8dca20d4c219aaf3b4944657affccd16cb08405bf8b5", + "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": "jokers_of_neon::models::status::game::game::Game", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", "members": [ { - "name": "id", - "type": "core::integer::u32" + "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": "owner", - "type": "core::starknet::contract_address::ContractAddress" + "name": "attrs", + "type": "core::array::Span::" }, { - "name": "player_name", + "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": "max_hands", - "type": "core::integer::u8" + "name": "Struct", + "type": "dojo::model::introspect::Struct" }, { - "name": "max_discard", - "type": "core::integer::u8" + "name": "Enum", + "type": "dojo::model::introspect::Enum" }, { - "name": "max_jokers", - "type": "core::integer::u8" + "name": "Tuple", + "type": "core::array::Span::" }, { - "name": "player_score", - "type": "core::integer::u32" + "name": "Array", + "type": "core::array::Span::" }, { - "name": "level", - "type": "core::integer::u32" + "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" }, { - "name": "len_hand", - "type": "core::integer::u32" + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" }, { - "name": "len_max_current_special_cards", - "type": "core::integer::u32" + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" }, { - "name": "len_current_special_cards", - "type": "core::integer::u32" + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" }, { - "name": "current_jokers", - "type": "core::integer::u8" + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" }, { - "name": "state", - "type": "jokers_of_neon::models::status::game::game::GameState" + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" }, { - "name": "substate", - "type": "jokers_of_neon::models::status::game::game::GameSubState" + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" }, { - "name": "cash", + "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_mode_beastImpl", + "interface_name": "jokers_of_neon::models::data::beast::Igame_mode_beast" + }, + { + "type": "struct", + "name": "jokers_of_neon::models::data::beast::GameModeBeast", + "members": [ + { + "name": "game_id", "type": "core::integer::u32" + }, + { + "name": "cost_discard", + "type": "core::integer::u8" + }, + { + "name": "cost_play", + "type": "core::integer::u8" + }, + { + "name": "energy_max_player", + "type": "core::integer::u8" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::status::game::game::Igame", + "name": "jokers_of_neon::models::data::beast::Igame_mode_beast", "items": [ { "type": "function", @@ -10634,7 +12015,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::status::game::game::Game" + "type": "jokers_of_neon::models::data::beast::GameModeBeast" } ], "outputs": [], @@ -10644,14 +12025,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", @@ -10662,18 +12043,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", @@ -11039,30 +12415,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", @@ -11070,7 +12442,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::game_deck::GameDeck" + "type": "jokers_of_neon::models::data::events::ItemChallengeCompleted" } ], "outputs": [], @@ -11080,14 +12452,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", @@ -11098,23 +12470,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", @@ -11480,34 +12847,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", @@ -11515,7 +12878,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::beast::GameModeBeast" + "type": "jokers_of_neon::models::data::last_beast_level::LastBeastLevel" } ], "outputs": [], @@ -11525,36 +12888,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": "current_probability", - "type": "u16", + "name": "modifier_card_idx", + "type": "u32", "key": false }, { - "name": "level", - "type": "u8", + "name": "current_hand_card_idx", + "type": "u32", + "key": false + }, + { + "name": "suit", + "type": "Suit", "key": false } ], - "class_hash": "0x2cdd0f8efcd582eb49fd33a9bc2c466d96bda4d2b7739b48258842fdb18984d", - "original_class_hash": "0x2cdd0f8efcd582eb49fd33a9bc2c466d96bda4d2b7739b48258842fdb18984d", + "class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", + "original_class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", "abi": [ { "type": "impl", @@ -11920,30 +13293,68 @@ }, { "type": "impl", - "name": "last_beast_levelImpl", - "interface_name": "jokers_of_neon::models::data::last_beast_level::Ilast_beast_level" + "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::last_beast_level::LastBeastLevel", + "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": "current_probability", - "type": "core::integer::u16" + "name": "modifier_card_idx", + "type": "core::integer::u32" }, { - "name": "level", - "type": "core::integer::u8" + "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::last_beast_level::Ilast_beast_level", + "name": "jokers_of_neon::models::data::events::Imodifier_card_suit_event", "items": [ { "type": "function", @@ -11951,7 +13362,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::last_beast_level::LastBeastLevel" + "type": "jokers_of_neon::models::data::events::ModifierCardSuitEvent" } ], "outputs": [], @@ -11961,14 +13372,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::last_beast_level::last_beast_level::Event", + "name": "jokers_of_neon::models::data::events::modifier_card_suit_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-ModifierCardSuitEvent", + "qualified_path": "jokers_of_neon::models::data::events::modifier_card_suit_event", + "manifest_name": "jokers_of_neon-ModifierCardSuitEvent-3733fa1c" }, { "kind": "DojoModel", @@ -11984,23 +13395,23 @@ "key": false }, { - "name": "modifier_card_idx", - "type": "u32", + "name": "neon_cards_idx", + "type": "Array", "key": false }, { - "name": "current_hand_card_idx", + "name": "multi", "type": "u32", "key": false }, { - "name": "suit", - "type": "Suit", + "name": "points", + "type": "u32", "key": false } ], - "class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", - "original_class_hash": "0x42cf1e65c45e0ef0b7c53dce92420243d76e261a51da744de4b1edb51937625", + "class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", + "original_class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", "abi": [ { "type": "impl", @@ -12366,42 +13777,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": "neon_poker_hand_eventImpl", + "interface_name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::ModifierCardSuitEvent", + "name": "jokers_of_neon::models::data::events::NeonPokerHandEvent", "members": [ { "name": "player", @@ -12412,22 +13793,22 @@ "type": "core::integer::u32" }, { - "name": "modifier_card_idx", - "type": "core::integer::u32" + "name": "neon_cards_idx", + "type": "core::array::Array::" }, { - "name": "current_hand_card_idx", + "name": "multi", "type": "core::integer::u32" }, { - "name": "suit", - "type": "jokers_of_neon::models::data::card::Suit" + "name": "points", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Imodifier_card_suit_event", + "name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event", "items": [ { "type": "function", @@ -12435,7 +13816,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::ModifierCardSuitEvent" + "type": "jokers_of_neon::models::data::events::NeonPokerHandEvent" } ], "outputs": [], @@ -12445,14 +13826,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::modifier_card_suit_event::Event", + "name": "jokers_of_neon::models::data::events::neon_poker_hand_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-NeonPokerHandEvent", + "qualified_path": "jokers_of_neon::models::data::events::neon_poker_hand_event", + "manifest_name": "jokers_of_neon-NeonPokerHandEvent-319c54d1" }, { "kind": "DojoModel", @@ -12466,25 +13847,10 @@ "name": "game_id", "type": "u32", "key": false - }, - { - "name": "neon_cards_idx", - "type": "Array", - "key": false - }, - { - "name": "multi", - "type": "u32", - "key": false - }, - { - "name": "points", - "type": "u32", - "key": false } ], - "class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", - "original_class_hash": "0xbe315d2950f462aaeedaa3e80ef97234c5f7c5bd89fdab048ccbc8dfb8f5b0", + "class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", + "original_class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", "abi": [ { "type": "impl", @@ -12850,12 +14216,12 @@ }, { "type": "impl", - "name": "neon_poker_hand_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event" + "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::NeonPokerHandEvent", + "name": "jokers_of_neon::models::data::events::PlayGameOverEvent", "members": [ { "name": "player", @@ -12864,24 +14230,12 @@ { "name": "game_id", "type": "core::integer::u32" - }, - { - "name": "neon_cards_idx", - "type": "core::array::Array::" - }, - { - "name": "multi", - "type": "core::integer::u32" - }, - { - "name": "points", - "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Ineon_poker_hand_event", + "name": "jokers_of_neon::models::data::events::Iplay_game_over_event", "items": [ { "type": "function", @@ -12889,7 +14243,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::NeonPokerHandEvent" + "type": "jokers_of_neon::models::data::events::PlayGameOverEvent" } ], "outputs": [], @@ -12899,31 +14253,41 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::neon_poker_hand_event::Event", + "name": "jokers_of_neon::models::data::events::play_game_over_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-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", + "name": "game_id", + "type": "u32", "key": true }, { - "name": "game_id", + "name": "level", "type": "u32", + "key": true + }, + { + "name": "count_hand", + "type": "u8", + "key": true + }, + { + "name": "poker_hand", + "type": "PokerHand", "key": false } ], - "class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", - "original_class_hash": "0x5e27fb6ecdbdf2838b159f5ead821c0f4e5205a16cc9914cd9faf4e8c049b1d", + "class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", + "original_class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", "abi": [ { "type": "impl", @@ -13289,26 +14653,88 @@ }, { "type": "impl", - "name": "play_game_over_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Iplay_game_over_event" + "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": "()" + } + ] }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::PlayGameOverEvent", + "name": "jokers_of_neon::models::data::events::PlayPokerHandEvent", "members": [ { - "name": "player", - "type": "core::starknet::contract_address::ContractAddress" + "name": "game_id", + "type": "core::integer::u32" }, { - "name": "game_id", + "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::Iplay_game_over_event", + "name": "jokers_of_neon::models::data::events::Iplay_poker_hand_event", "items": [ { "type": "function", @@ -13316,7 +14742,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PlayGameOverEvent" + "type": "jokers_of_neon::models::data::events::PlayPokerHandEvent" } ], "outputs": [], @@ -13326,41 +14752,41 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::play_game_over_event::Event", + "name": "jokers_of_neon::models::data::events::play_poker_hand_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-PlayPokerHandEvent", + "qualified_path": "jokers_of_neon::models::data::events::play_poker_hand_event", + "manifest_name": "jokers_of_neon-PlayPokerHandEvent-6abe67fd" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u32", + "name": "player", + "type": "ContractAddress", "key": true }, { - "name": "level", + "name": "game_id", "type": "u32", - "key": true + "key": false }, { - "name": "count_hand", - "type": "u8", - "key": true + "name": "level", + "type": "u32", + "key": false }, { - "name": "poker_hand", - "type": "PokerHand", + "name": "player_score", + "type": "u32", "key": false } ], - "class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", - "original_class_hash": "0x7ec2ab66ac5a8131c5c548884c92ec43a63fd5f87578b60de734ad47df0c2d8", + "class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", + "original_class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", "abi": [ { "type": "impl", @@ -13726,67 +15152,17 @@ }, { "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": "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::PlayPokerHandEvent", + "name": "jokers_of_neon::models::data::events::PlayWinGameEvent", "members": [ + { + "name": "player", + "type": "core::starknet::contract_address::ContractAddress" + }, { "name": "game_id", "type": "core::integer::u32" @@ -13796,18 +15172,14 @@ "type": "core::integer::u32" }, { - "name": "count_hand", - "type": "core::integer::u8" - }, - { - "name": "poker_hand", - "type": "jokers_of_neon::models::data::poker_hand::PokerHand" + "name": "player_score", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Iplay_poker_hand_event", + "name": "jokers_of_neon::models::data::events::Iplay_win_game_event", "items": [ { "type": "function", @@ -13815,7 +15187,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PlayPokerHandEvent" + "type": "jokers_of_neon::models::data::events::PlayWinGameEvent" } ], "outputs": [], @@ -13825,14 +15197,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::play_poker_hand_event::Event", + "name": "jokers_of_neon::models::data::events::play_win_game_event::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-PlayWinGameEvent", + "qualified_path": "jokers_of_neon::models::data::events::play_win_game_event", + "manifest_name": "jokers_of_neon-PlayWinGameEvent-c57c8fde" }, { "kind": "DojoModel", @@ -13843,23 +15215,13 @@ "key": true }, { - "name": "game_id", - "type": "u32", - "key": false - }, - { - "name": "level", - "type": "u32", - "key": false - }, - { - "name": "player_score", + "name": "attack", "type": "u32", "key": false } ], - "class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", - "original_class_hash": "0x4b527a3a0fb4eded9951158550a045ed3d53144d3221d4ed66521b534daeb61", + "class_hash": "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0", + "original_class_hash": "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0", "abi": [ { "type": "impl", @@ -14225,34 +15587,26 @@ }, { "type": "impl", - "name": "play_win_game_eventImpl", - "interface_name": "jokers_of_neon::models::data::events::Iplay_win_game_event" + "name": "player_attackImpl", + "interface_name": "jokers_of_neon::models::data::events::Iplayer_attack" }, { "type": "struct", - "name": "jokers_of_neon::models::data::events::PlayWinGameEvent", + "name": "jokers_of_neon::models::data::events::PlayerAttack", "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", + "name": "attack", "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "jokers_of_neon::models::data::events::Iplay_win_game_event", + "name": "jokers_of_neon::models::data::events::Iplayer_attack", "items": [ { "type": "function", @@ -14260,7 +15614,7 @@ "inputs": [ { "name": "model", - "type": "jokers_of_neon::models::data::events::PlayWinGameEvent" + "type": "jokers_of_neon::models::data::events::PlayerAttack" } ], "outputs": [], @@ -14270,14 +15624,14 @@ }, { "type": "event", - "name": "jokers_of_neon::models::data::events::play_win_game_event::Event", + "name": "jokers_of_neon::models::data::events::player_attack::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-PlayerAttack", + "qualified_path": "jokers_of_neon::models::data::events::player_attack", + "manifest_name": "jokers_of_neon-PlayerAttack-3b7323b8" }, { "kind": "DojoModel", @@ -14287,19 +15641,14 @@ "type": "u32", "key": true }, - { - "name": "health", - "type": "u32", - "key": false - }, { "name": "energy", "type": "u8", "key": false } ], - "class_hash": "0x72bab25593e59ba01387711eaa353d06fd59c06a93e1b5dcff3c30245d6c640", - "original_class_hash": "0x72bab25593e59ba01387711eaa353d06fd59c06a93e1b5dcff3c30245d6c640", + "class_hash": "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49", + "original_class_hash": "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49", "abi": [ { "type": "impl", @@ -14676,10 +16025,6 @@ "name": "game_id", "type": "core::integer::u32" }, - { - "name": "health", - "type": "core::integer::u32" - }, { "name": "energy", "type": "core::integer::u8" diff --git a/manifests/dev/deployment/manifest.toml b/manifests/dev/deployment/manifest.toml index 8fa9b6c..cfee4f5 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 = "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49" -original_class_hash = "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49" +class_hash = "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5" +original_class_hash = "0x352fd9eeb1842a703803b0b06071e21caf0e093be86e0bdeb3b7bad13f11be5" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/jokers_of_neon-game_system-7a205bbc.json" reads = [] @@ -62,8 +62,8 @@ manifest_name = "jokers_of_neon-poker_hand_system-25bae3ed" [[contracts]] kind = "DojoContract" address = "0x75602558fd679c49be1a6ccb73e3d6d842f0558e1f41c4013ce109d05a5790f" -class_hash = "0x4d335ac492b01d48fc5431dc87810c59111033fb62eaefd438ab41b6cdb3c06" -original_class_hash = "0x4d335ac492b01d48fc5431dc87810c59111033fb62eaefd438ab41b6cdb3c06" +class_hash = "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d" +original_class_hash = "0x5f1bddfab781d4c4b67d7814361d1a38549f876f4e2574a576903291c3f536d" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/jokers_of_neon-rage_system-601fc835.json" reads = [] @@ -75,8 +75,8 @@ manifest_name = "jokers_of_neon-rage_system-601fc835" [[models]] kind = "DojoModel" -class_hash = "0x5a1c6141a6afc7ffaff55d76c948b77992e8cd89ca6c50b21ac617a9889dcd0" -original_class_hash = "0x5a1c6141a6afc7ffaff55d76c948b77992e8cd89ca6c50b21ac617a9889dcd0" +class_hash = "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf" +original_class_hash = "0x138b1cf753d19f46b39fc7eebc67b9cdea0ce30ef41c961bf150392837796bf" abi = "manifests/dev/deployment/abis/models/jokers_of_neon-Beast-35a29cda.json" tag = "jokers_of_neon-Beast" qualified_path = "jokers_of_neon::models::data::beast::beast" @@ -87,6 +87,11 @@ name = "game_id" type = "u32" key = true +[[models.members]] +name = "beast_id" +type = "u32" +key = false + [[models.members]] name = "tier" type = "u8" @@ -102,6 +107,35 @@ name = "health" type = "u32" key = false +[[models.members]] +name = "current_health" +type = "u32" +key = false + +[[models.members]] +name = "attack" +type = "u32" +key = false + +[[models.members]] +name = "type_beast" +type = "TypeBeast" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x5af087ffc9c3c2437a78b8884eb1bd53eaeb3207a4a68c35fc0c8c4744d12ef" +original_class_hash = "0x5af087ffc9c3c2437a78b8884eb1bd53eaeb3207a4a68c35fc0c8c4744d12ef" +abi = "manifests/dev/deployment/abis/models/jokers_of_neon-BeastAttack-46464e29.json" +tag = "jokers_of_neon-BeastAttack" +qualified_path = "jokers_of_neon::models::data::events::beast_attack" +manifest_name = "jokers_of_neon-BeastAttack-46464e29" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + [[models.members]] name = "attack" type = "u32" @@ -371,8 +405,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x366273a4ee649b33c07c7584bba0132ac37cc86f52ba525e4ced46a49b960f4" -original_class_hash = "0x366273a4ee649b33c07c7584bba0132ac37cc86f52ba525e4ced46a49b960f4" +class_hash = "0x100656d30bb4f9835d1f7c5f04cbffa556d5b6cec46818209426c90fd1ad41d" +original_class_hash = "0x100656d30bb4f9835d1f7c5f04cbffa556d5b6cec46818209426c90fd1ad41d" abi = "manifests/dev/deployment/abis/models/jokers_of_neon-Challenge-61873cc7.json" tag = "jokers_of_neon-Challenge" qualified_path = "jokers_of_neon::models::data::challenge::challenge" @@ -385,7 +419,7 @@ key = true [[models.members]] name = "active_ids" -type = "Span" +type = "Span<(u32, bool)>" key = false [[models]] @@ -603,8 +637,8 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x2a0bf5c76a2a51057fa8cd30b669b8b2e9ac982f6a7c0d2aac0caf2e8b385a1" -original_class_hash = "0x2a0bf5c76a2a51057fa8cd30b669b8b2e9ac982f6a7c0d2aac0caf2e8b385a1" +class_hash = "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2" +original_class_hash = "0x3ffc052edb32b194e03a69e0b624c9ee4d508d4ce3de3de43a0f5503832b6c2" 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" @@ -625,6 +659,16 @@ name = "player_name" type = "felt252" key = false +[[models.members]] +name = "player_hp" +type = "u32" +key = false + +[[models.members]] +name = "current_player_hp" +type = "u32" +key = false + [[models.members]] name = "max_hands" type = "u8" @@ -738,6 +782,25 @@ name = "energy_max_player" type = "u8" key = false +[[models]] +kind = "DojoModel" +class_hash = "0x40f2a16a814460d5105e655f240e0ef22171fdbb3f04fdf727511d5703316e2" +original_class_hash = "0x40f2a16a814460d5105e655f240e0ef22171fdbb3f04fdf727511d5703316e2" +abi = "manifests/dev/deployment/abis/models/jokers_of_neon-ItemChallengeCompleted-2cb0f253.json" +tag = "jokers_of_neon-ItemChallengeCompleted" +qualified_path = "jokers_of_neon::models::data::events::item_challenge_completed" +manifest_name = "jokers_of_neon-ItemChallengeCompleted-2cb0f253" + +[[models.members]] +name = "game_id" +type = "u32" +key = true + +[[models.members]] +name = "challenge_id" +type = "u32" +key = false + [[models]] kind = "DojoModel" class_hash = "0x2cdd0f8efcd582eb49fd33a9bc2c466d96bda4d2b7739b48258842fdb18984d" @@ -909,8 +972,27 @@ key = false [[models]] kind = "DojoModel" -class_hash = "0x72bab25593e59ba01387711eaa353d06fd59c06a93e1b5dcff3c30245d6c640" -original_class_hash = "0x72bab25593e59ba01387711eaa353d06fd59c06a93e1b5dcff3c30245d6c640" +class_hash = "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0" +original_class_hash = "0x148cef5976cbfa98709e064fce8879c0f48cc22bab54cd29df7bdd6a9cb3e0" +abi = "manifests/dev/deployment/abis/models/jokers_of_neon-PlayerAttack-3b7323b8.json" +tag = "jokers_of_neon-PlayerAttack" +qualified_path = "jokers_of_neon::models::data::events::player_attack" +manifest_name = "jokers_of_neon-PlayerAttack-3b7323b8" + +[[models.members]] +name = "player" +type = "ContractAddress" +key = true + +[[models.members]] +name = "attack" +type = "u32" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49" +original_class_hash = "0x789bb9f5c507a42d96c6d34cf48fa3ecff060db297695716c62b3f8129bcf49" abi = "manifests/dev/deployment/abis/models/jokers_of_neon-PlayerBeast-22d6f7af.json" tag = "jokers_of_neon-PlayerBeast" qualified_path = "jokers_of_neon::models::data::beast::player_beast" @@ -921,11 +1003,6 @@ name = "game_id" type = "u32" key = true -[[models.members]] -name = "health" -type = "u32" -key = false - [[models.members]] name = "energy" type = "u8" diff --git a/src/constants/packs.cairo b/src/constants/packs.cairo index e9b7626..3a29a57 100644 --- a/src/constants/packs.cairo +++ b/src/constants/packs.cairo @@ -22,6 +22,7 @@ const EMPTY_PACK_ID: u32 = 999; const SPECIAL_CARDS_PACK_ID: u32 = 20; const MODIFIER_CARDS_PACK_ID: u32 = 21; +const REWARD_CARDS_PACK_ID: u32 = 22; fn blister_packs_ids_all() -> Array { array![ @@ -245,3 +246,15 @@ fn MODIFIER_CARDS_PACK() -> BlisterPack { probs: array![100, 100].span(), } } + +fn REWARD_PACK() -> BlisterPack { + BlisterPack { + id: REWARD_CARDS_PACK_ID, + cost: 0, + name: 'reward_cards_pack', + probability: 100, + size: 5, + cards: array![array![].span(), array![JOKER_CARD].span(), modifiers_ids_all().span()].span(), + probs: array![100, 20, 80].span(), + } +} diff --git a/src/constants/reward.cairo b/src/constants/reward.cairo new file mode 100644 index 0000000..b211ed6 --- /dev/null +++ b/src/constants/reward.cairo @@ -0,0 +1,3 @@ +const REWARD_HP_POTION: u32 = 1; +const REWARD_BLISTER_PACK: u32 = 2; +const REWARD_SPECIAL_CARDS: u32 = 3; diff --git a/src/lib.cairo b/src/lib.cairo index c35c7ed..c35862c 100644 --- a/src/lib.cairo +++ b/src/lib.cairo @@ -10,6 +10,7 @@ mod constants { mod modifiers; mod packs; mod playhand; + mod reward; mod specials; mod two_pow; } @@ -25,6 +26,7 @@ mod models { mod game_deck; mod last_beast_level; mod poker_hand; + mod reward; } mod status { mod game { diff --git a/src/models/data/events.cairo b/src/models/data/events.cairo index 4d084d2..4b61748 100644 --- a/src/models/data/events.cairo +++ b/src/models/data/events.cairo @@ -281,3 +281,14 @@ struct PlayerAttack { player: ContractAddress, attack: u32 } + +#[derive(Copy, Drop, Serde)] +#[dojo::event] +#[dojo::model] +struct PlayerHealed { + #[key] + game_id: u32, + potion_heal: u32, + current_hp: u32, +} + diff --git a/src/models/data/reward.cairo b/src/models/data/reward.cairo new file mode 100644 index 0000000..550db51 --- /dev/null +++ b/src/models/data/reward.cairo @@ -0,0 +1,31 @@ +use jokers_of_neon::constants::reward::{REWARD_HP_POTION, REWARD_BLISTER_PACK, REWARD_SPECIAL_CARDS}; + +#[derive(Copy, Drop, Serde)] +#[dojo::model] +struct Reward { + #[key] + game_id: u32, + rewards_ids: Span +} + +#[derive(Serde, Copy, Drop, IntrospectPacked, PartialEq)] +enum RewardType { + HP_POTION, + BLISTER_PACK, + SPECIAL_CARDS, + NONE +} + +impl u32IntoRewardType of Into { + fn into(self: u32) -> RewardType { + if self == REWARD_HP_POTION { + RewardType::HP_POTION + } else if self == REWARD_BLISTER_PACK { + RewardType::BLISTER_PACK + } else if self == REWARD_SPECIAL_CARDS { + RewardType::SPECIAL_CARDS + } else { + RewardType::NONE + } + } +} diff --git a/src/models/status/game/game.cairo b/src/models/status/game/game.cairo index 0e578ed..35636b1 100644 --- a/src/models/status/game/game.cairo +++ b/src/models/status/game/game.cairo @@ -4,7 +4,8 @@ use starknet::ContractAddress; enum GameSubState { BEAST, CREATE_LEVEL, - OBSTACLE + OBSTACLE, + REWARD } #[derive(Serde, Copy, Drop, IntrospectPacked, PartialEq)] diff --git a/src/models/status/round/beast.cairo b/src/models/status/round/beast.cairo index b029738..b959b27 100644 --- a/src/models/status/round/beast.cairo +++ b/src/models/status/round/beast.cairo @@ -99,7 +99,7 @@ impl BeastImpl of BeastTrait { }; emit!(world, (play_win_game_event)); game.state = GameState::IN_GAME; - game.substate = GameSubState::CREATE_LEVEL; + game.substate = GameSubState::REWARD; game.player_score += 1; if is_rage_card_active(@rage_round, RAGE_CARD_DIMINISHED_HOLD) { @@ -111,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/models/status/round/challenge.cairo b/src/models/status/round/challenge.cairo index 3831f7a..0e0e931 100644 --- a/src/models/status/round/challenge.cairo +++ b/src/models/status/round/challenge.cairo @@ -85,7 +85,7 @@ impl ChallengeImpl of ChallengeTrait { if Self::is_completed(world, game_id) { emit!(world, ChallengeCompleted { player: game.owner, player_name: game.player_name, game_id }); - game.substate = GameSubState::CREATE_LEVEL; + game.substate = GameSubState::REWARD; GameStore::set(@game, world); } else { challenge_player.plays -= 1; diff --git a/src/models/status/round/level.cairo b/src/models/status/round/level.cairo index 2eec1a4..7563d28 100644 --- a/src/models/status/round/level.cairo +++ b/src/models/status/round/level.cairo @@ -16,27 +16,23 @@ impl LevelImpl of LevelTrait { let mut last_active_level = LastBeastLevelStore::get(world, game_id); if game.level <= level_config.min_round_level_before_activate.into() { - println!("dale 1"); return GameSubState::OBSTACLE; } if last_active_level.level != 0 && game.level - last_active_level.level.into() <= level_config.level_cooldown.try_into().unwrap() { - println!("dale 2"); return GameSubState::OBSTACLE; } let mut randomizer = RandomImpl::new(world); let random = randomizer.between::(0, 100); if random <= last_active_level.current_probability { - println!("dale 3"); last_active_level.level = game.level.try_into().unwrap(); last_active_level.current_probability = level_config.initial_probability; LastBeastLevelStore::set(@last_active_level, world); GameSubState::BEAST } else { - println!("dale 4"); if last_active_level.current_probability + level_config.increment_by_round <= 100 { last_active_level.current_probability = last_active_level.current_probability + level_config.increment_by_round; diff --git a/src/systems/game_system.cairo b/src/systems/game_system.cairo index 745a6f8..c4a82cb 100644 --- a/src/systems/game_system.cairo +++ b/src/systems/game_system.cairo @@ -6,6 +6,7 @@ use jokers_of_neon::models::data::poker_hand::PokerHand; trait IGameSystem { fn create_game(ref world: IWorldDispatcher, player_name: felt252) -> u32; fn create_level(ref world: IWorldDispatcher, game_id: u32); + fn select_reward(ref world: IWorldDispatcher, game_id: u32, reward_index: u8); fn select_deck(ref world: IWorldDispatcher, game_id: u32, deck_id: u8); fn select_special_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array); fn select_modifier_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array); @@ -30,6 +31,7 @@ mod errors { const INVALID_DECK_ID: felt252 = 'Game: use an invalid deck'; const WRONG_SUBSTATE_BEAST: felt252 = 'Game: wrong substate BEAST'; const WRONG_SUBSTATE_CREATE_LEVEL: felt252 = 'Wrong substate CREATE_LEVEL'; + const WRONG_SUBSTATE_REWARD: felt252 = 'Wrong substate REWARD'; } #[dojo::contract] @@ -37,7 +39,7 @@ mod game_system { use core::nullable::NullableTrait; use dojo::world::Resource::Contract; use jokers_of_neon::constants::card::{JOKER_CARD, NEON_JOKER_CARD, INVALID_CARD}; - use jokers_of_neon::constants::packs::{SPECIAL_CARDS_PACK_ID, MODIFIER_CARDS_PACK_ID}; + use jokers_of_neon::constants::packs::{SPECIAL_CARDS_PACK_ID, MODIFIER_CARDS_PACK_ID, REWARD_CARDS_PACK_ID}; use jokers_of_neon::constants::specials::{ SPECIAL_MULTI_FOR_HEART_ID, SPECIAL_MULTI_FOR_CLUB_ID, SPECIAL_MULTI_FOR_DIAMOND_ID, SPECIAL_MULTI_FOR_SPADE_ID, SPECIAL_INCREASE_LEVEL_PAIR_ID, SPECIAL_INCREASE_LEVEL_DOUBLE_PAIR_ID, SPECIAL_INCREASE_LEVEL_STRAIGHT_ID, @@ -52,12 +54,13 @@ mod game_system { PokerHandEvent, CreateGameEvent, CardScoreEvent, PlayWinGameEvent, PlayGameOverEvent, DetailEarnedEvent, SpecialModifierPointsEvent, SpecialModifierMultiEvent, SpecialModifierSuitEvent, SpecialPokerHandEvent, SpecialGlobalEvent, ModifierCardSuitEvent, RoundScoreEvent, NeonPokerHandEvent, PlayPokerHandEvent, - SpecialCashEvent + SpecialCashEvent, PlayerHealed }; use jokers_of_neon::models::data::game_deck::{GameDeckStore, GameDeckImpl}; use jokers_of_neon::models::data::last_beast_level::{LastBeastLevel, LastBeastLevelStore}; use jokers_of_neon::models::data::poker_hand::{LevelPokerHand, PokerHand}; - use jokers_of_neon::models::status::game::game::{Game, GameState, GameSubState}; + 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::beast::BeastTrait; use jokers_of_neon::models::status::round::challenge::ChallengeTrait; @@ -74,6 +77,7 @@ mod game_system { use jokers_of_neon::utils::level::create_level; use jokers_of_neon::utils::packs::{open_blister_pack, select_cards_from_blister}; use jokers_of_neon::utils::rage::is_rage_card_active; + use jokers_of_neon::utils::random::RandomImpl; use starknet::{ContractAddress, get_caller_address, ClassHash}; use super::IGameSystem; use super::errors; @@ -131,7 +135,7 @@ mod game_system { match game.substate { GameSubState::BEAST => { BeastTrait::create(world, ref store, game_id); }, GameSubState::OBSTACLE => { ChallengeTrait::create(world, ref store, game_id); }, - GameSubState::CREATE_LEVEL => {}, + _ => {}, } game.level += 1; store.set_game(game); @@ -147,7 +151,7 @@ mod game_system { match game.substate { GameSubState::BEAST => { BeastTrait::play(world, game_id, cards_index, modifiers_index); }, GameSubState::OBSTACLE => { ChallengeTrait::play(world, game_id, cards_index, modifiers_index); }, - GameSubState::CREATE_LEVEL => {}, + _ => {}, } } @@ -161,7 +165,7 @@ mod game_system { match game.substate { GameSubState::BEAST => { BeastTrait::discard(world, game_id, cards_index, modifiers_index); }, GameSubState::OBSTACLE => { ChallengeTrait::discard(world, game_id, cards_index, modifiers_index); }, - GameSubState::CREATE_LEVEL => {}, + _ => {}, } } @@ -175,6 +179,51 @@ mod game_system { BeastTrait::end_turn(world, game_id); } + fn select_reward(ref world: IWorldDispatcher, game_id: u32, reward_index: u8) { + let mut game = GameStore::get(world, game_id); + assert(game.owner.is_non_zero(), errors::GAME_NOT_FOUND); + assert(game.substate == GameSubState::REWARD, errors::WRONG_SUBSTATE_REWARD); + + let reward: RewardType = (*RewardStore::get(world, game_id).rewards_ids.at(reward_index.into())).into(); + match reward { + RewardType::HP_POTION => { + game.state = GameState::IN_GAME; + + let mut randomizer = RandomImpl::new(world); + let hp_heal = randomizer.between::(25, 50); + game + .player_hp = + if game.current_player_hp + hp_heal >= game.player_hp { + game.player_hp + } else { + game.current_player_hp + hp_heal + }; + emit!(world, PlayerHealed { game_id, potion_heal: hp_heal, current_hp: game.player_hp }); + }, + RewardType::BLISTER_PACK => { + game.state = GameState::SELECT_MODIFIER_CARDS; + + let mut store = StoreTrait::new(world); + let cards = open_blister_pack(world, ref store, game, REWARD_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); + }, + RewardType::SPECIAL_CARDS => { + game.state = GameState::SELECT_SPECIAL_CARDS; + + let mut store = StoreTrait::new(world); + 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); + }, + _ => {} + } + game.substate = GameSubState::CREATE_LEVEL; + GameStore::set(@game, world) + } + fn select_deck(ref world: IWorldDispatcher, game_id: u32, deck_id: u8) { let mut store: Store = StoreTrait::new(world); let mut game = store.get_game(game_id); diff --git a/src/tests/test_game_play_beast.cairo b/src/tests/test_game_play_beast.cairo index 4cdf133..3dba408 100644 --- a/src/tests/test_game_play_beast.cairo +++ b/src/tests/test_game_play_beast.cairo @@ -106,7 +106,6 @@ mod test_play_beast_special_cards { // player_score = 1560 let beast_after = BeastStore::get(world, game.id); - println!("beast_after.current_health: {}", beast_after.current_health); assert(beast_after.current_health.is_zero(), 'wrong beast health'); let player_beast_after = PlayerBeastStore::get(world, game.id); @@ -279,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(); @@ -287,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 From a35a5412c85e5b57dce4a6988e84959beee7ef30 Mon Sep 17 00:00:00 2001 From: dub_zn Date: Fri, 1 Nov 2024 22:41:16 -0300 Subject: [PATCH 2/4] upgrade events flow --- src/models/status/game/game.cairo | 16 +++---- src/models/status/round/beast.cairo | 2 +- src/models/status/round/challenge.cairo | 2 +- src/systems/game_system.cairo | 59 ++++++++++++++++++------- 4 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/models/status/game/game.cairo b/src/models/status/game/game.cairo index 35636b1..c979312 100644 --- a/src/models/status/game/game.cairo +++ b/src/models/status/game/game.cairo @@ -3,20 +3,20 @@ use starknet::ContractAddress; #[derive(Serde, Copy, Drop, IntrospectPacked, PartialEq)] enum GameSubState { BEAST, - CREATE_LEVEL, OBSTACLE, - REWARD + CREATE_LEVEL, + CREATE_REWARD, + REWARD_SPECIALS, + REWARD_CARDS_PACK, + DRAFT_MODIFIERS, + DRAFT_SPECIALS, + DRAFT_DECK } #[derive(Serde, Copy, Drop, IntrospectPacked, PartialEq)] enum GameState { - SELECT_DECK, - SELECT_SPECIAL_CARDS, - SELECT_MODIFIER_CARDS, - AT_SHOP, IN_GAME, - FINISHED, - OPEN_BLISTER_PACK + FINISHED } #[derive(Copy, Drop, IntrospectPacked, Serde)] diff --git a/src/models/status/round/beast.cairo b/src/models/status/round/beast.cairo index b959b27..54e4466 100644 --- a/src/models/status/round/beast.cairo +++ b/src/models/status/round/beast.cairo @@ -99,7 +99,7 @@ impl BeastImpl of BeastTrait { }; emit!(world, (play_win_game_event)); game.state = GameState::IN_GAME; - game.substate = GameSubState::REWARD; + game.substate = GameSubState::CREATE_REWARD; game.player_score += 1; if is_rage_card_active(@rage_round, RAGE_CARD_DIMINISHED_HOLD) { diff --git a/src/models/status/round/challenge.cairo b/src/models/status/round/challenge.cairo index 0e0e931..4a0b9ab 100644 --- a/src/models/status/round/challenge.cairo +++ b/src/models/status/round/challenge.cairo @@ -85,7 +85,7 @@ impl ChallengeImpl of ChallengeTrait { if Self::is_completed(world, game_id) { emit!(world, ChallengeCompleted { player: game.owner, player_name: game.player_name, game_id }); - game.substate = GameSubState::REWARD; + game.substate = GameSubState::CREATE_REWARD; GameStore::set(@game, world); } else { challenge_player.plays -= 1; diff --git a/src/systems/game_system.cairo b/src/systems/game_system.cairo index c4a82cb..e9d4a4d 100644 --- a/src/systems/game_system.cairo +++ b/src/systems/game_system.cairo @@ -6,7 +6,8 @@ use jokers_of_neon::models::data::poker_hand::PokerHand; trait IGameSystem { fn create_game(ref world: IWorldDispatcher, player_name: felt252) -> u32; fn create_level(ref world: IWorldDispatcher, game_id: u32); - fn select_reward(ref world: IWorldDispatcher, game_id: u32, reward_index: u8); + fn create_reward(ref world: IWorldDispatcher, game_id: u32, reward_index: u8); + fn select_reward(ref world: IWorldDispatcher, game_id: u32, cards_index: Array); fn select_deck(ref world: IWorldDispatcher, game_id: u32, deck_id: u8); fn select_special_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array); fn select_modifier_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array); @@ -26,12 +27,17 @@ mod errors { const GAME_NOT_IN_GAME: felt252 = 'Game: is not IN_GAME'; const GAME_NOT_SELECT_SPECIAL_CARDS: felt252 = 'Game:is not SELECT_SPECIAL_CARD'; const GAME_NOT_SELECT_MODIFIER_CARDS: felt252 = 'Game:is not SELCT_MODIFIER_CARD'; - const GAME_NOT_SELECT_DECK: felt252 = 'Game:is not SELECT_DECK'; const USE_INVALID_CARD: felt252 = 'Game: use an invalid card'; const INVALID_DECK_ID: felt252 = 'Game: use an invalid deck'; - const WRONG_SUBSTATE_BEAST: felt252 = 'Game: wrong substate BEAST'; + + const WRONG_SUBSTATE_BEAST: felt252 = 'Wrong substate BEAST'; const WRONG_SUBSTATE_CREATE_LEVEL: felt252 = 'Wrong substate CREATE_LEVEL'; + const WRONG_SUBSTATE_CREATE_REWARD: felt252 = 'Wrong substate CREATE_REWARD'; const WRONG_SUBSTATE_REWARD: felt252 = 'Wrong substate REWARD'; + const WRONG_SUBSTATE_DRAFT_DECK: felt252 = 'Wrong substate DRAFT_DECK'; + 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'; } #[dojo::contract] @@ -105,8 +111,8 @@ mod game_system { len_max_current_special_cards: 5, len_current_special_cards: 0, current_jokers: 0, - state: GameState::SELECT_DECK, - substate: GameSubState::CREATE_LEVEL, + state: GameState::IN_GAME, + substate: GameSubState::DRAFT_DECK, cash: 0 }; store.set_game(game); @@ -179,15 +185,15 @@ mod game_system { BeastTrait::end_turn(world, game_id); } - fn select_reward(ref world: IWorldDispatcher, game_id: u32, reward_index: u8) { + fn create_reward(ref world: IWorldDispatcher, game_id: u32, reward_index: u8) { let mut game = GameStore::get(world, game_id); assert(game.owner.is_non_zero(), errors::GAME_NOT_FOUND); - assert(game.substate == GameSubState::REWARD, errors::WRONG_SUBSTATE_REWARD); + assert(game.substate == GameSubState::CREATE_REWARD, errors::WRONG_SUBSTATE_REWARD); let reward: RewardType = (*RewardStore::get(world, game_id).rewards_ids.at(reward_index.into())).into(); match reward { RewardType::HP_POTION => { - game.state = GameState::IN_GAME; + game.substate = GameSubState::CREATE_LEVEL; let mut randomizer = RandomImpl::new(world); let hp_heal = randomizer.between::(25, 50); @@ -201,7 +207,7 @@ mod game_system { emit!(world, PlayerHealed { game_id, potion_heal: hp_heal, current_hp: game.player_hp }); }, RewardType::BLISTER_PACK => { - game.state = GameState::SELECT_MODIFIER_CARDS; + game.substate = GameSubState::REWARD_CARDS_PACK; let mut store = StoreTrait::new(world); let cards = open_blister_pack(world, ref store, game, REWARD_CARDS_PACK_ID); @@ -210,7 +216,7 @@ mod game_system { store.set_blister_pack_result(blister_pack_result); }, RewardType::SPECIAL_CARDS => { - game.state = GameState::SELECT_SPECIAL_CARDS; + game.substate = GameSubState::REWARD_SPECIALS; let mut store = StoreTrait::new(world); let cards = open_blister_pack(world, ref store, game, SPECIAL_CARDS_PACK_ID); @@ -220,6 +226,28 @@ mod game_system { }, _ => {} } + GameStore::set(@game, world) + } + + fn select_reward(ref world: IWorldDispatcher, game_id: u32, cards_index: Array) { + let mut game = GameStore::get(world, game_id); + assert(game.owner.is_non_zero(), errors::GAME_NOT_FOUND); + assert( + game.substate == GameSubState::REWARD_SPECIALS || game.substate == GameSubState::REWARD_CARDS_PACK, + errors::WRONG_SUBSTATE_SELECT_REWARD + ); + + let mut store = StoreTrait::new(world); + match game.substate { + GameSubState::REWARD_SPECIALS => { assert(cards_index.len() <= 1, errors::INVALID_CARD_INDEX_LEN); }, + GameSubState::REWARD_CARDS_PACK => { assert(cards_index.len() <= 3, errors::INVALID_CARD_INDEX_LEN); }, + _ => {} + } + let mut blister_pack_result = store.get_blister_pack_result(game.id); + select_cards_from_blister(world, ref game, blister_pack_result.cards, cards_index); + blister_pack_result.cards_picked = true; + store.set_blister_pack_result(blister_pack_result); + game.substate = GameSubState::CREATE_LEVEL; GameStore::set(@game, world) } @@ -234,12 +262,11 @@ mod game_system { assert(game.owner == get_caller_address(), errors::CALLER_NOT_OWNER); // Check that the status of the game - assert(game.state == GameState::SELECT_DECK, errors::GAME_NOT_SELECT_DECK); - + assert(game.substate == GameSubState::DRAFT_DECK, errors::WRONG_SUBSTATE_DRAFT_DECK); assert(deck_id < 3, errors::INVALID_DECK_ID); GameDeckImpl::init(ref store, game_id, deck_id); - game.state = GameState::SELECT_SPECIAL_CARDS; + game.substate = GameSubState::DRAFT_SPECIALS; store.set_game(game); let cards = open_blister_pack(world, ref store, game, SPECIAL_CARDS_PACK_ID); @@ -259,14 +286,14 @@ mod game_system { assert(game.owner == get_caller_address(), errors::CALLER_NOT_OWNER); // Check that the status of the game - assert(game.state == GameState::SELECT_SPECIAL_CARDS, errors::GAME_NOT_SELECT_SPECIAL_CARDS); + assert(game.substate == GameSubState::DRAFT_SPECIALS, errors::WRONG_SUBSTATE_DRAFT_SPECIALS); 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.state = GameState::SELECT_MODIFIER_CARDS; + game.substate = GameSubState::DRAFT_MODIFIERS; store.set_game(game); let cards = open_blister_pack(world, ref store, game, MODIFIER_CARDS_PACK_ID); @@ -286,7 +313,7 @@ mod game_system { assert(game.owner == get_caller_address(), errors::CALLER_NOT_OWNER); // Check that the status of the game - assert(game.state == GameState::SELECT_MODIFIER_CARDS, errors::GAME_NOT_SELECT_MODIFIER_CARDS); + assert(game.substate == GameSubState::DRAFT_MODIFIERS, errors::WRONG_SUBSTATE_DRAFT_MODIFIERS); let mut blister_pack_result = store.get_blister_pack_result(game.id); assert(cards_index.len() <= 5, errors::INVALID_CARD_INDEX_LEN); From fbb3a6d8c0674dcd0b8af38258b7de81e823f66c Mon Sep 17 00:00:00 2001 From: dub_zn Date: Sat, 2 Nov 2024 01:51:32 -0300 Subject: [PATCH 3/4] initialize reward --- src/systems/game_system.cairo | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/systems/game_system.cairo b/src/systems/game_system.cairo index e9d4a4d..25ac80a 100644 --- a/src/systems/game_system.cairo +++ b/src/systems/game_system.cairo @@ -46,6 +46,7 @@ mod game_system { use dojo::world::Resource::Contract; use jokers_of_neon::constants::card::{JOKER_CARD, NEON_JOKER_CARD, INVALID_CARD}; use jokers_of_neon::constants::packs::{SPECIAL_CARDS_PACK_ID, MODIFIER_CARDS_PACK_ID, REWARD_CARDS_PACK_ID}; + use jokers_of_neon::constants::reward::{REWARD_HP_POTION, REWARD_BLISTER_PACK, REWARD_SPECIAL_CARDS}; use jokers_of_neon::constants::specials::{ SPECIAL_MULTI_FOR_HEART_ID, SPECIAL_MULTI_FOR_CLUB_ID, SPECIAL_MULTI_FOR_DIAMOND_ID, SPECIAL_MULTI_FOR_SPADE_ID, SPECIAL_INCREASE_LEVEL_PAIR_ID, SPECIAL_INCREASE_LEVEL_DOUBLE_PAIR_ID, SPECIAL_INCREASE_LEVEL_STRAIGHT_ID, @@ -124,6 +125,13 @@ mod game_system { world ); + RewardStore::set( + @Reward { + game_id, rewards_ids: array![REWARD_HP_POTION, REWARD_BLISTER_PACK, REWARD_SPECIAL_CARDS].span() + }, + world + ); + let create_game_event = CreateGameEvent { player: get_caller_address(), game_id }; emit!(world, (create_game_event)); game_id From 172c8e4cedd0c066283a4d30986f71c338d06b8f Mon Sep 17 00:00:00 2001 From: dub_zn Date: Sat, 2 Nov 2024 11:57:26 -0300 Subject: [PATCH 4/4] update substate directly from `select_reward` --- src/systems/game_system.cairo | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/systems/game_system.cairo b/src/systems/game_system.cairo index 25ac80a..efd4060 100644 --- a/src/systems/game_system.cairo +++ b/src/systems/game_system.cairo @@ -256,8 +256,7 @@ mod game_system { blister_pack_result.cards_picked = true; store.set_blister_pack_result(blister_pack_result); - game.substate = GameSubState::CREATE_LEVEL; - GameStore::set(@game, world) + self.create_level(game_id) } fn select_deck(ref world: IWorldDispatcher, game_id: u32, deck_id: u8) {