Commit Graph

47 Commits

Author SHA1 Message Date
MeirGavish d24b0b5619 Refactor shop code to use generic Item (#536)
* Turned SpriteObject into a member of JokerObject and CardObject and expiremented with casting

* Extracted shop code to use generic `SpriteObject`

* Extracted shop joker generation to a function

* Renamed object -> item

* Added setters and getters for `SpriteObject` members and updated all accesses to use them with casting (AI used for tedious work and reviewed - model Raptor mini)

* Added sprite_object_set_vx() because sprite_object_set_vy() exists and reordered the function order to have x,y parameters first, then targets

* Added Item object to act as a purchasable interface for the shop - AI used (model Raptor mini)

* Added -fms-extensions and switched to anonymous inheritance

* Fixed anonymous inheritance for joker and added direct access for that too

* fix build error from previous commit + clang-format

* Fixed build errors + clang-format for real this time (I hope...)

* clang-format one last time, I don't understand it anymore

* clang-format is annoying

* Added uses of CHECK_NULL_ARG macros

* Merged item_defs.h into item.h and fixed build error from previous commit

* clang-format...?

* Changed sprite_object_new() into sprite_object_init() and made it accept a parameter instead of returning one to make it less awkward

* Updated sprite_object_init() documentation

* Updated sprite_object_destroy documentation

* More clang-format

* Renamed add_to_inventory to acquire and updated documentation

* Added function documentations

* Update documentation + swap order of consumable and playing card types

* Added documentation for new files (+ small addition to button.h)

* clang-format

* Used typedef

* A bit more documentation

* Changed sho pcode to use generic Item instead of SpriteObject

* clang-format + fixed NULL-check error

* Revert weird clang-format...?

* clang-format for real

* Fixed errors from rebase on log_function_name

* Fixed build errors from rebase on main

* Added some more documentation about first member struct inheritance

* typo fix

* typo fix for real

* Removed SpriteObject field getters/setters (AI used - model Raptor mini)

* Renamed item_acquire -> item_on_acquired

* Added item_can_acquire()

* clang-format

* Fixed some sprite issues but not all...

* Fixed some more issues

* Cleanup JokerObject some more JokerObjects in the shop

* Added `item_destroy()`

* Added item_set_available_to_shop, CHECK_ITEM_TYPE macros + small documentation updates

* Another small JokerObject->Item replacement

* Removed item_set_available_to_shop and replaced with item_roll_new() and item_dispose(), also changed "available_to_shop" semantics to "rollable"

* Re-applied changes from game.c to round.c after rebase on main

* Added partial implementations of item functions for playing cards

* Line endings fix...

* Macro renames, function documentations

* Updated documentations

* Apply fixes from Copilot review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix card_object_get_buy_price type checking

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Avoid double pointer cast on dispose

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from @ricfehr3's code review

Co-authored-by: Rickey <ric@rf3.xyz>

* Remove redundant comments

* Moved error checking before joker_get_random_rarity

Co-authored-by: Rickey <ric@rf3.xyz>

* Fixed build error from rebase

* clang-format

* Added doxygen documentation for Item explaining inheritance

* Removed unnecessary comment

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rickey <ric@rf3.xyz>
2026-07-09 09:13:51 +03:00
Geralt c706a387a9 Implement a global SpriteObject update loop (#553)
* Implement `sprite_object_update_all`

* clang format

* Change update order

* tmp

* make it crash

* Fix bad address crash

* Address @MeirGavish's comments

* Tweaked card draw position further

* Tweaked card draw position further, again

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-17 19:26:53 -07:00
Geralt e26558e1a5 [Feature] Implement Joker descriptions in the Shop when holding B (#530)
* WIP

* WIP

* WIP

* WIP

* Tags are bugged but it's looking good

* Centering is bugged, almost there

* WIP

* Fixed centeriiiing, yaaaay

* good progress

* add proper '\n' support

* WIP descriptions

* All descriptions are there ^^

* missing 9-patch for pretty display

* WIP

* fix rebase issues

* Fix minor Run Setup screen issues

* Almost done, only one fix to go

* Aaaalmooost doooneeeee

* make desc frame size adaptative

* add rarity color and text

* final cleanup

* clang format

* clang format

* clang format

* clang format

* clang format

* Fix Joker update loop index

* Fix const and Bull description

* Fix unwanted button SFX

* fix tte colors

* Add misprint description

* Fix justified line length computation

* Add safeguards to tag parsing loop

* clang format

* Fix Ante bugged display at boss blind end

* Tweak suit colors

* Final fixes

* Simplified the way we print descriptions

* simplify further

* get rid of weird macro

* Fix Onwed joker price when holding A after showing its description

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-08 18:16:37 -07:00
Geralt 1df8402900 [Feature] Implement seeded runs by adding a Seed selection menu (#482)
* initial commit

* wip

* WIP

* WIP

* clang format

* Choose Seed navigation mostly done

* seed input navigation done

* seed input done

* cleanup and clang format

* Implement base 10 to 36 conversions

* Enable seeded runs

* clang format

* show default deck sprite, name and description

* Rename Deck enum to DeckType

* Implement arbitrary 9-patch expand system

* Make 9-patch example smaller in the docs

* Improve NinePatchRect docs

* fix Deck back side sprite palette

* clang format

* Add last deck description

* clang format

* Fix 'Z' in seed input keyboard

* Fix rebase issue

* fix deck sprite not updating

* Documents static funcs in run_setup.c

* more documentation

* clang format

* Move Play button to the left in its row

* Tests WIP

* removing tests for random.h

* use the new StateMachine struct

* First wave of fixes

* Fix the 9-patch again

* Changed the base 36 logic so it's in big endian

* properly set end of base 36 string to '\0'

* typos

* fix cursor position after rolling a seed + fix random seed generation

* Make keyboard more intuitive to use

* static const var

* Address more comment from @ricfehr3

* clang format

* clang format

* clang format

* clang format

* clang format

* clang format

* clang format

* fix deck palette

* create the `DEF_SEED_KEYBOARD_BUTTON_OBJECT` macro

* Replace `expand_3x3` by a call to `expand_9-patch`

* clang format

* clang format

* clang format

* fix rebase iussue in state_machine.h

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-02 00:06:37 -07:00
Geralt db27962623 Implement boss blind graphics (#352)
* Created sprite bank for all blinds

* progress city, it's a beatiful city that progress city!

* Sprite appears in blind selection screen

* Added all blind colors

* fix magic numbers + disable boss reroll

* Fix boss blind token not moving after a reroll

* fix always rolling the Needle due to choosing too early for the rng seed to be set

* No need for affine sprite for blind tokens, regular is enough

* address Copilot's review 1/2

* address Copilot's review 2/2

* correct Blind Tokens/Types

* Index palette colors into the files instead of code

* Fix blind sprites (flip bug not solved)

* Fix magic number, tile index and Mark colors

* load boss blind palette only when changing spritesheet

* Adressing clang format and ease of modification of the blinds' list

* Removed some magic numbers


---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-04-16 11:52:39 +03:00
MeirGavish 34fb0b22db Fixed Shortcut joker ID for #410 (#411) 2026-03-29 11:19:09 -07:00
Geralt 5cf9e2674d Implement arbitrary-sized joker spritesheets (#285)
* Convert static joker sprites indexes to maps for dynamic spritesheets size

* tmp commit

* reorder Joker spritesheets

* more reordering

* Joker maps, will test later

* More reorders and palette optimizations. Sprites now work

* Fix Joker gfx

* Format joker.c

* Fix rebase error

* Integrate Shoot the Moon art

* format

* format

* removing useless GBAL_UNUSED from photograph Joker effect func

* Tidy up joker.c variables formatting

* Fix magic number

* Add context for map in joker.c

Co-authored-by: Rickey <ric@rf3.xyz>

* Update source/joker.c

Co-authored-by: Rickey <ric@rf3.xyz>

* Apply suggestion from @ricfehr3

Co-authored-by: Rickey <ric@rf3.xyz>

* format

* reduce clutter in joker_effects.c file by defining a macro for forward static declarations of joker effect funcs

* refactored some maps in joker.c to make it more concise

* clang format

* adding back how to mark functions as unused when Jokers don't have a sprite yet

* format

* Remove comment about unused functions for Jokers without art

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: Rickey <ric@rf3.xyz>
2026-03-28 17:58:05 -07:00
MeirGavish 9bffe5c9a9 Refactor - remove selected from SpriteObject (#305) 2025-12-12 18:44:26 -08:00
Rickey 2fb9e6d633 Clang format joker files and def files (#257)
* Clang format joker files and def files

* Fix blind usage of GBLA_UNUSED macro

* Add final files for clang-format (main.c and selection_grid.h)

---------

Co-authored-by: MeirGavish <meir.gavish@gmail.com>
2025-12-10 09:41:24 +02:00
Geralt 0953a430c4 Implement Seltzer and Joker Expiration effect (#252)
* Add Seltzer art

* Implement Joker expiration

* Add exception to copying Jokers + Seltzer message fix

* Move all scoring logic to joker_object_score away from check_and_score_joker_for_event

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2025-11-30 08:52:42 +02:00
Geralt 435a9a0a1d Refactor JokerEffect scoring (#245)
* Remove usage of memcmp for JokerEffect null check

* Added suggestions from @ricfehr3

* Add suggestions from @MeirGavish


---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: MeirGavish <meir.gavish@gmail.com>
2025-11-28 19:03:47 +02:00
Geralt 408c264e85 Modify blueprint and brainstorm implementation to fix retrigger bug (#244)
---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2025-11-21 20:09:07 +02:00
Geralt 2fb41e533c Make Chips, Mult and Score unsigned and protect against overflow (#212)
---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2025-11-20 12:39:15 +02:00
Geralt 4183f563ab Implement cards held in hand effects (#205)
* Adapt existing Jokers to the Held Card mechanic + effect display location

* Add suggestions from @ricfehr3

* Add suggestions from @MeirGavish

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2025-11-12 13:18:53 +02:00
Rickey e0cffab768 Update list implementation to work with memory pools (#168)
* Introduce indexed list implementation

* Fix CI tests for pool

* Take bitset out of pool

* Replace joker bitset interactions with wrappers

* Add bitset tests

* Add test to gitignore

---------

Co-authored-by: rfehr-idexx <ric-fehr@idexx.com>
2025-11-11 17:56:21 +02:00
theturtlemafia 03273de829 Adds Shortcut and Four Fingers (#95)
* adds shortcut joker

* adds Four Fingers joker, and combination support for Four Fingers + Shortcut

---------

Co-authored-by: MeirGavish <meir.gavish@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-01 16:28:40 +02:00
Geralt eb815b7820 Refactor of scoring flow, Joker Callbacks and Card Retriggers (#160)
* Remove Baseball Card for now, will have to wait a future PR

* Removed cards held in hand joker scoring stage - should be in another PR

---------

Co-authored-by: MonteCrysto <mathis.martin31@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: MeirGavish <meir.gavish@gmail.com>
2025-11-01 15:50:52 +02:00
JustinL-12 b38433d191 Weight jokers by rarity in the shop (#152)
* Added weight for the rarity of jokers in the shop

* Includes manual conflict resolution

---------

Co-authored-by: JustinL-12 <jlong30@uic.edu>
Co-authored-by: MeirGavish <meir.gavish@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-27 19:18:48 +02:00
Rickey Fehr 06cd13a17f Centralize location of memory pools
This commit centralizes the location of memory pools and adds an
associated script (scripts/get_memory_map.sh) to read the memory map.
2025-10-17 16:55:09 -07:00
MeirGavish 9d1a51884f Added art for Jokers Bootstraps by @MathisMartin31 and @noctowlhoot and Pareidolia by @NoWhammies10 and @MeirGavish (jokers rearranged for palette optimization) 2025-10-09 23:42:07 +03:00
Geralt c4f22be9b9 Update joker.h
Restoring the Brainstorm Joker ID, deleted by mistake while adding the Pareidolia Joker ID
2025-10-09 14:46:57 +02:00
Geralt 6787fab0c2 Merge branch 'main' into main 2025-10-08 23:25:24 +02:00
MeirGavish 4b35b2f7d8 Added art for jokers Blueprint and Brainstorm by @NoWhammies10 and @GreenNinja2525 2025-10-08 22:40:15 +03:00
Nan bc44de0493 Update include/joker.h
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-08 17:57:20 +02:00
MonteCrysto aa5ebd13fc Add suggestions from @MeirGavish 2025-10-08 08:14:54 +02:00
MonteCrysto c781ee9666 Add a "is_card_face" function to take into account if Pareidolia is present 2025-09-30 22:47:00 +02:00
Nan 35c0d383c5 Add blueprint and brainstorm jokers
Implements blueprint and brainstorm to the game, but leaves the implementations commented out as they are still missing assets.
2025-09-13 22:18:31 +02:00
MeirGavish 64274ae465 Added joker selling (still no animation) + fixed SpriteObject constructor focused bug 2025-08-16 15:38:34 +03:00
MeirGavish 8956501591 Merge branch 'main' into jokers_palette_swapping 2025-08-04 10:21:19 +03:00
MeirGavish de672572b1 Updated joker palette swapping system to reuse palettes when jokers are removed 2025-08-04 10:18:33 +03:00
theturtlemafia 08307d62ad code review feedback 2025-08-02 12:25:31 -04:00
theturtlemafia dbff88add0 Adds XMult, Joker Stencil and Misprint (rebase) 2025-08-01 18:35:31 -04:00
MeirGavish 0c834d17c2 Added dynamic palette loading for jokers and added new joker designs by @GreenNinja2525 2025-07-30 21:00:29 +03:00
theturtlemafia ed1204db74 remove usage of extern for joker_registry. Add array size macro to util.h 2025-07-28 14:24:33 -04:00
theturtlemafia 47ee3987fd refactor jokers to use struct and function pointer 2025-07-27 07:06:35 -04:00
MeirGavish 95565862b0 Extracted JokerObject and CardObject common functionalities to SpriteObject, removing duplicate code and dangerous casts. 2025-07-27 01:13:57 +03:00
cellos51 6a1f3bcd7a I hope this works 2025-07-23 20:14:22 -04:00
MeirGavish c781807ed8 Revert "Sprite vram optimizations" 2025-07-24 02:14:04 +03:00
cellos51 6a326e27fe refactor: update blind and joker definitions; change game state to GAME_BLIND_SELECT 2025-07-23 17:31:21 -04:00
MeirGavish 5e6bc76f5f Merge branch 'main' into jokers_refactors 2025-07-23 19:33:39 +03:00
cellos51 1b4267893d Added greedy joker and refactor joker system 2025-07-22 20:00:05 -04:00
MeirGavish c24dcab726 Added TODO note and a warning comment 2025-07-23 00:02:24 +03:00
cellos51 793da72465 added co-pilot's fixes 2025-07-22 15:45:29 -04:00
cellos51 e7c5536cc2 added shop rerolling and edition pricing for jokers 2025-07-21 22:05:31 -04:00
cellos51 414bfa2a32 Semi functional jokers 2025-07-20 20:55:11 -04:00
cellos51 176910c483 Jokers appear in the shop but don't do anything yet 2025-07-18 19:29:17 -04:00
cellos51 4a5644eddb Defining a basic system for jokers 2025-07-17 21:47:50 -04:00