From 73ad3b2dd8baa7f65c9c473165dd790bd4c53670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Pi=C3=B1ones?= Date: Sun, 3 Nov 2024 17:38:00 -0300 Subject: [PATCH] wip beast jn --- src/constants/beast.cairo | 99 ++++++++++++++++++++++++++++- src/models/status/round/beast.cairo | 9 ++- 2 files changed, 105 insertions(+), 3 deletions(-) diff --git a/src/constants/beast.cairo b/src/constants/beast.cairo index 3b12daf..f4a7df5 100644 --- a/src/constants/beast.cairo +++ b/src/constants/beast.cairo @@ -74,7 +74,16 @@ const WRAITH_BEAST_ID: u32 = 73; const WYVERN_BEAST_ID: u32 = 74; const YETI_BEAST_ID: u32 = 75; -fn all_beast() -> Array { +const JACK_BEAST_ID: u32 = 101; +const QUEEN_BEAST_ID: u32 = 102; +const KING_BEAST_ID: u32 = 103; +const JOKER_BEAST_ID: u32 = 104; +const NEON_JACK_BEAST_ID: u32 = 105; +const NEON_QUEEN_BEAST_ID: u32 = 106; +const NEON_KING_BEAST_ID: u32 = 107; +const NEON_JOKER_BEAST_ID: u32 = 108; + +fn beast_loot_survivor() -> Array { array![ AMMIT_BEAST_ID, ANANSI_BEAST_ID, @@ -154,6 +163,94 @@ fn all_beast() -> Array { ] } +fn all_beast() -> Array { + array![ + AMMIT_BEAST_ID, + ANANSI_BEAST_ID, + BALROG_BEAST_ID, + BANSHEE_BEAST_ID, + BASILISK_BEAST_ID, + BEAR_BEAST_ID, + BEHEMOTH_BEAST_ID, + BERSERKER_BEAST_ID, + BIGFOOT_BEAST_ID, + CHIMERA_BEAST_ID, + CHUPACABRA_BEAST_ID, + COLOSSUS_BEAST_ID, + CYCLOPS_BEAST_ID, + DIREWOLF_BEAST_ID, + DRAGON_BEAST_ID, + DRAUGR_BEAST_ID, + ENT_BEAST_ID, + ETTIN_BEAST_ID, + FAIRY_BEAST_ID, + FENRIR_BEAST_ID, + GHOUL_BEAST_ID, + GIANT_BEAST_ID, + GNOME_BEAST_ID, + GOBLIN_BEAST_ID, + GOLEM_BEAST_ID, + GORGON_BEAST_ID, + GRIFFIN_BEAST_ID, + HARPY_BEAST_ID, + HIPPOGRIFF_BEAST_ID, + HYDRA_BEAST_ID, + JAGUAR_BEAST_ID, + JIANGSHI_BEAST_ID, + JOTUNN_BEAST_ID, + JUGGERNAUT_BEAST_ID, + KAPPA_BEAST_ID, + KELPIE_BEAST_ID, + KITSUNE_BEAST_ID, + KRAKEN_BEAST_ID, + LEPRECHAUN_BEAST_ID, + LEVIATHAN_BEAST_ID, + LICH_BEAST_ID, + MANTICORE_BEAST_ID, + MANTIS_BEAST_ID, + MINOTAUR_BEAST_ID, + NEMEANLION_BEAST_ID, + NEPHILIM_BEAST_ID, + NUE_BEAST_ID, + OGRE_BEAST_ID, + ONI_BEAST_ID, + ORC_BEAST_ID, + PEGASUS_BEAST_ID, + PHOENIX_BEAST_ID, + PIXIE_BEAST_ID, + QILIN_BEAST_ID, + RAKSHASA_BEAST_ID, + RAT_BEAST_ID, + ROC_BEAST_ID, + SATORI_BEAST_ID, + SKELETON_BEAST_ID, + SKINWALKER_BEAST_ID, + SPIDER_BEAST_ID, + SPRITE_BEAST_ID, + TARRASQUE_BEAST_ID, + TITAN_BEAST_ID, + TROLL_BEAST_ID, + TYPHON_BEAST_ID, + VAMPIRE_BEAST_ID, + WARLOCK_BEAST_ID, + WENDIGO_BEAST_ID, + WERETIGER_BEAST_ID, + WEREWOLF_BEAST_ID, + WOLF_BEAST_ID, + WRAITH_BEAST_ID, + WYVERN_BEAST_ID, + YETI_BEAST_ID, + JACK_BEAST_ID, + QUEEN_BEAST_ID, + KING_BEAST_ID, + JOKER_BEAST_ID, + NEON_JACK_BEAST_ID, + NEON_QUEEN_BEAST_ID, + NEON_KING_BEAST_ID, + NEON_JOKER_BEAST_ID + ] +} + fn is_loot_survivor_beast(beast_id: u32) -> bool { beast_id <= YETI_BEAST_ID } diff --git a/src/models/status/round/beast.cairo b/src/models/status/round/beast.cairo index 938b002..4597c4e 100644 --- a/src/models/status/round/beast.cairo +++ b/src/models/status/round/beast.cairo @@ -1,7 +1,7 @@ use core::nullable::NullableTrait; use dojo::world::Resource::Contract; use dojo::world::{IWorldDispatcher, IWorldDispatcherTrait}; -use jokers_of_neon::constants::beast::{all_beast, is_loot_survivor_beast}; +use jokers_of_neon::constants::beast::{all_beast, beast_loot_survivor, is_loot_survivor_beast}; use jokers_of_neon::constants::card::INVALID_CARD; use jokers_of_neon::models::data::beast::{ GameModeBeast, GameModeBeastStore, Beast, BeastStore, PlayerBeast, PlayerBeastStore, TypeBeast @@ -273,7 +273,12 @@ fn _attack_beast( fn _create_beast(world: IWorldDispatcher, game_id: u32, level: u8) { let mut randomizer = RandomImpl::new(world); - let beast_id = randomizer.between::(0, all_beast().len() - 1); + + let beast_id = if level < 10 { + *beast_loot_survivor()[randomizer.between::(0, beast_loot_survivor().len() - 1)] + } else { + *all_beast()[randomizer.between::(0, all_beast().len() - 1)] + }; let (tier, health, attack) = _generate_stats(level); let type_beast = if is_loot_survivor_beast(beast_id) { TypeBeast::LOOT_SURVIVOR