The Binding of Isaac: Rebirth

The Binding of Isaac: Rebirth

82 arvostelua
!!~ Better CurseAPI
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Tiedostokoko
Julkaistu
Päivitetty
87.462 KB
13.1.2024 klo 20.01
4.3. klo 13.22
4 muutosilmoitusta ( näytä )
Tarvitset lisäosan käyttääksesi tätä esinettä.

Tilaa ladataksesi
!!~ Better CurseAPI

Kuvaus
Requires MiniMAPI

Found a bug? Want to contribute? Check out Better CurseAPI's GitHub repository![github.com]

I was unsatisfied with CurseAPI, so I made my own better version.

Here's a list of the improvements over CurseAPI
- Uses the stage seed instead of math.random
- Compatible with MiniMAPI
- Doesn't override the game's actual curse chance
- Allows custom functions to determine if a curse is allowed to spawn on a given floor
- Allows differently weighted curses
- Allows generating multiple curses on a floor (That's off by default, don't worry)
- Uses Game():GetLevel():CanStageHaveCurseOfLabyrinth() instead of trying to compute it manually
- Puts itself at the top of the mod list so you don't have to add ~ before your mod name to get the right load order

How to use Better CurseAPI
(If you need an example for any of these steps, download the Example Curse mod[github.com] from GitHub and look at the code)
1. Add your curse to content/curses.xml

2. Call BetterCurseAPI:registerCurse(curse_name, curse_weight, is_allowed_function, curse_icon) and store the return value in a local variable. That's your curse id. You'll need it later.
curse_name is the same name you used in curses.xml
curse_weight is the relative chance for a curse to appear, it is either a number or a function that returns a number. If unsure, make this value 1.0
is_allowed_function is either a boolean value, or a function that returns true if your curse is allowed on this floor and false if it isn't. If unsure, make it true.
curse_icon is either nil, or a table in the order of { sprite, animation name, animation frame }. If nil, your curse will not have an icon (This is not recommended).

3. Your curse is now registered. Use BetterCurseAPI:isCurseActive(curse_id) with the curse id from step 2 to check if your curse is currently active.

4. (Technically optional, but recommended) Add your curse to the Better CurseAPI mod config menu page. Be sure to check if mod config menu is installed first. You are responsible for saving and loading the user configuration for any custom curses you add. Better CurseAPI will not store it for you.

The easiest way is to use BetterCurseAPI:addCurseConfig(curse_id, paramsTable).
curse_id is the curse id from step 2.

paramsTable is a table with the following keys.
enabled_current_setting is a function that returns true if the curse is currently enabled, and false if it is disabled.
on_change_enabled is a function that takes 1 parameter, which is true if the curse is being enabled, and false if it is being disabled.
default_enabled is either true or false, indicating whether the curse is enabled by default.
on_weight_change is a function that takes 1 parameter, which is a number equal to the new weight value being set.
default_weight is a number equal to the default weight value.
text is an optional parameter to display text below a curse's name. I recommend something like "Added by 'MOD_NAME' (Version 1.0)".
26 kommenttia
Kitty McTophat  [tekijä] 18.8. klo 11.23 
Ah, thank you for asking!
Feel free to include it in your mod, I don't mind at all
Black_L4mb 18.8. klo 11.16 
Hey there, I'm the developer of the Absolution series of mods.
I will be using your API in the full overhaul that will be releasing soon, and I was wondering if I could include this mod directly in my files rather than have it as a separate dependency. The intent is to make it so end users don't have to subscribe to multiple mods, and I will ensure you are properly credited.

If you'd prefer to keep it separate, I will direct users to subscribe to this in conjunction with my mods, just let me know!
aylooisastupid 7.8. klo 16.51 
does this work with rep+?
Kattack 4.3. klo 15.56 
That would be hype, even if rgon doesn't implement such a thing it would still be very helpful if you could find some other way to have it work without minimapi (perhaps optionally)
Kitty McTophat  [tekijä] 4.3. klo 12.58 
Ah, I wasn't aware of Repentogon having its own minimap system. I'll look into that and try to make an update
fraZ0R 2.3. klo 14.13 
MiniMapAPI is extremely laggy due to completely reimplementing the minimap system and redrawing it every tick, doesn't Repentogon offer its own way of doing minimap stuff without it? Would there be a way to make this API not depend on mmapi?
Kattack 11.12.2024 klo 8.21 
Yo you got the debug text enabled on the release version !!! can you turn it off it is spammy pls thx
lil gaggle 17.11.2024 klo 15.55 
im I reading enchantment table what does this mean
PhotoFinn 30.7.2024 klo 14.47 
Hello there! Me again, I don't know if you guys are still working on this mod, but if you are, I've just released an update to Accursed that includes several new callbacks that you guys can use to make your mod compatible with ours
Busybody64 4.5.2024 klo 11.01 
Repentogon?