Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add special hand thief beast #29

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/models/status/round/beast.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ impl BeastImpl of BeastTrait {
}
store.set_game(game);

let game_mode_beast = GameModeBeast { game_id, cost_discard: 1, cost_play: 2, energy_max_player: 3 };
GameModeBeastStore::set(@game_mode_beast, world);
let game_mode_beast = GameModeBeastStore::get(world, game.id);

_create_beast(world, game_id, game.level.try_into().unwrap());

Expand Down
9 changes: 9 additions & 0 deletions src/systems/game_system.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ mod game_system {
use jokers_of_neon::models::status::game::game::{Game, GameStore, GameState, GameSubState};
use jokers_of_neon::models::status::game::rage::{RageRound, RageRoundStore};
use jokers_of_neon::models::status::round::adventurer::AdventurerTrait;
use jokers_of_neon::models::data::beast::{
GameModeBeast, GameModeBeastStore
};
use jokers_of_neon::models::status::round::beast::BeastTrait;
use jokers_of_neon::models::status::round::challenge::ChallengeTrait;
use jokers_of_neon::models::status::round::current_hand_card::{CurrentHandCard, CurrentHandCardTrait};
Expand Down Expand Up @@ -142,6 +145,9 @@ mod game_system {
world
);

let game_mode_beast = GameModeBeast { game_id, cost_discard: 1, cost_play: 2, energy_max_player: 3 };
GameModeBeastStore::set(@game_mode_beast, world);

let create_game_event = CreateGameEvent { player: get_caller_address(), game_id };
emit!(world, (create_game_event));
game_id
Expand Down Expand Up @@ -447,6 +453,9 @@ mod game_system {
if remove_special_card.effect_card_id == SPECIAL_HAND_THIEF_ID {
game.max_hands -= 1;
game.max_discard -= 1;
let mut game_mode_beast = GameModeBeastStore::get(world, game.id);
game_mode_beast.energy_max_player += 1;
GameModeBeastStore::set(@game_mode_beast, world);
}
if remove_special_card.effect_card_id == SPECIAL_EXTRA_HELP_ID {
game.len_hand -= 2;
Expand Down
6 changes: 6 additions & 0 deletions src/utils/packs.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use jokers_of_neon::constants::card::{JOKER_CARD, NEON_JOKER_CARD};
use jokers_of_neon::constants::specials::{SPECIAL_HAND_THIEF_ID, SPECIAL_EXTRA_HELP_ID};
use jokers_of_neon::models::data::game_deck::{GameDeckStore, GameDeckImpl};
use jokers_of_neon::models::status::game::game::{Game, CurrentSpecialCards, CurrentSpecialCardsStore, GameState};
use jokers_of_neon::models::data::beast::{
GameModeBeast, GameModeBeastStore
};
use jokers_of_neon::store::{Store, StoreTrait};
use jokers_of_neon::utils::constants::{is_special_card, is_modifier_card};
use jokers_of_neon::utils::random::{Random, RandomImpl, RandomTrait};
Expand Down Expand Up @@ -78,6 +81,9 @@ fn select_cards_from_blister(
if card_id == SPECIAL_HAND_THIEF_ID {
game.max_hands += 1;
game.max_discard += 1;
let mut game_mode_beast = GameModeBeastStore::get(world, game.id);
game_mode_beast.energy_max_player += 1;
GameModeBeastStore::set(@game_mode_beast, world);
}
if card_id == SPECIAL_EXTRA_HELP_ID {
game.len_hand += 2;
Expand Down
Loading