From a9c58e56ff1291b73ac46dca95d5c813d3ab4939 Mon Sep 17 00:00:00 2001 From: dub_zn Date: Sat, 2 Nov 2024 15:54:01 -0300 Subject: [PATCH] add joker card to card constants pull --- src/constants/card.cairo | 5 +++++ src/models/status/round/challenge.cairo | 2 +- src/store.cairo | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/constants/card.cairo b/src/constants/card.cairo index ace2a04..751d432 100644 --- a/src/constants/card.cairo +++ b/src/constants/card.cairo @@ -63,6 +63,11 @@ const WARRIOR_DECK: u8 = 1; const WIZARD_DECK: u8 = 2; // TRADITIONALS + +fn JOKER_CARD_C() -> Card { + Card { id: JOKER_CARD, suit: Suit::Joker, value: Value::Joker, points: 100, multi_add: 1 } +} + fn TWO_CLUBS() -> Card { Card { id: TWO_CLUBS_ID, suit: Suit::Clubs, value: Value::Two, points: 2, multi_add: 0 } } diff --git a/src/models/status/round/challenge.cairo b/src/models/status/round/challenge.cairo index 71e3373..1174ea2 100644 --- a/src/models/status/round/challenge.cairo +++ b/src/models/status/round/challenge.cairo @@ -266,7 +266,7 @@ fn _resolve_challenges( Suit::Hearts => { _complete(world, ref challenge, CHALLENGE_HEARTS); }, Suit::Spades => { _complete(world, ref challenge, CHALLENGE_SPADES); }, Suit::Diamonds => { _complete(world, ref challenge, CHALLENGE_DIAMONDS); }, - Suit::Joker => {}, + Suit::Joker => { _complete(world, ref challenge, CHALLENGE_JOKER); }, Suit::None => {}, }; } diff --git a/src/store.cairo b/src/store.cairo index c35d0aa..96be92b 100644 --- a/src/store.cairo +++ b/src/store.cairo @@ -18,7 +18,7 @@ use jokers_of_neon::constants::card::{ KING_HEARTS, ACE_HEARTS_ID, ACE_HEARTS, TWO_SPADES_ID, TWO_SPADES, THREE_SPADES_ID, THREE_SPADES, FOUR_SPADES_ID, FOUR_SPADES, FIVE_SPADES_ID, FIVE_SPADES, SIX_SPADES_ID, SIX_SPADES, SEVEN_SPADES_ID, SEVEN_SPADES, EIGHT_SPADES_ID, EIGHT_SPADES, NINE_SPADES_ID, NINE_SPADES, TEN_SPADES_ID, TEN_SPADES, JACK_SPADES_ID, JACK_SPADES, QUEEN_SPADES_ID, - QUEEN_SPADES, KING_SPADES_ID, KING_SPADES, ACE_SPADES_ID, ACE_SPADES, JOKER_CARD, NEON_JOKER_CARD, INVALID_CARD, + QUEEN_SPADES, KING_SPADES_ID, KING_SPADES, ACE_SPADES_ID, ACE_SPADES, JOKER_CARD, NEON_JOKER_CARD, INVALID_CARD, JOKER_CARD_C }; use jokers_of_neon::constants::effect::{ @@ -476,6 +476,8 @@ fn get_traditional_card(id: u32) -> Card { KING_SPADES() } else if id == ACE_SPADES_ID { ACE_SPADES() + } else if id == JOKER_CARD { + JOKER_CARD_C() } else { Card { id: INVALID_CARD, suit: Suit::None, value: Value::None, points: 0, multi_add: 0 } }