From 09cce3bc75ba853a9cec385b25dd4f79f4e045fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Pi=C3=B1ones?= Date: Thu, 31 Oct 2024 22:29:00 -0300 Subject: [PATCH] add event select special & modifier --- manifests/dev/deployment/manifest.json | 4 ++-- manifests/dev/deployment/manifest.toml | 4 ++-- src/models/status/shop/shop.cairo | 1 + src/systems/game_system.cairo | 8 ++++++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/manifests/dev/deployment/manifest.json b/manifests/dev/deployment/manifest.json index 904bed7..d6d2271 100644 --- a/manifests/dev/deployment/manifest.json +++ b/manifests/dev/deployment/manifest.json @@ -1256,8 +1256,8 @@ { "kind": "DojoContract", "address": "0x6a41badee85305fa1aac33488860360c66b60d7f3b204d6e2cd84071dc3c394", - "class_hash": "0x3a4aafb2e4f059bf801527b62432f2671368d33ae29c33b737f3c145e832229", - "original_class_hash": "0x3a4aafb2e4f059bf801527b62432f2671368d33ae29c33b737f3c145e832229", + "class_hash": "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49", + "original_class_hash": "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { diff --git a/manifests/dev/deployment/manifest.toml b/manifests/dev/deployment/manifest.toml index f9042ed..8fa9b6c 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 = "0x3a4aafb2e4f059bf801527b62432f2671368d33ae29c33b737f3c145e832229" -original_class_hash = "0x3a4aafb2e4f059bf801527b62432f2671368d33ae29c33b737f3c145e832229" +class_hash = "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49" +original_class_hash = "0x2251dab55d7d4473ca9badd43dee9aa8cc3664a1afbab3a29284b251805fa49" base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" abi = "manifests/dev/deployment/abis/contracts/jokers_of_neon-game_system-7a205bbc.json" reads = [] diff --git a/src/models/status/shop/shop.cairo b/src/models/status/shop/shop.cairo index caddadd..e1eb31f 100644 --- a/src/models/status/shop/shop.cairo +++ b/src/models/status/shop/shop.cairo @@ -58,6 +58,7 @@ struct BlisterPackItem { } #[derive(Copy, Drop, Serde)] +#[dojo::event] #[dojo::model] struct BlisterPackResult { #[key] diff --git a/src/systems/game_system.cairo b/src/systems/game_system.cairo index 2cc3416..fca1179 100644 --- a/src/systems/game_system.cairo +++ b/src/systems/game_system.cairo @@ -185,7 +185,9 @@ mod game_system { store.set_game(game); let cards = open_blister_pack(world, ref store, game, SPECIAL_CARDS_PACK_ID); - store.set_blister_pack_result(BlisterPackResult { game_id, cards_picked: false, cards }); + let blister_pack_result = BlisterPackResult { game_id, cards_picked: false, cards }; + emit!(world, (blister_pack_result)); + store.set_blister_pack_result(blister_pack_result); } fn select_special_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array) { @@ -213,7 +215,9 @@ mod game_system { store.set_game(game); let cards = open_blister_pack(world, ref store, game, MODIFIER_CARDS_PACK_ID); - store.set_blister_pack_result(BlisterPackResult { game_id, cards_picked: false, cards }); + let blister_pack_result = BlisterPackResult { game_id, cards_picked: false, cards }; + emit!(world, (blister_pack_result)); + store.set_blister_pack_result(blister_pack_result); } fn select_modifier_cards(ref world: IWorldDispatcher, game_id: u32, cards_index: Array) {