diff --git a/docs/doxygen_custom.css b/docs/doxygen_custom.css index 877606101a..943a4fe917 100644 --- a/docs/doxygen_custom.css +++ b/docs/doxygen_custom.css @@ -2,7 +2,7 @@ body, table, div, p, dl { font: inherit } -body, table, div, p, dl, p.reference, p.definition, .memberdecls .header { +body, table, div, p, dl, p.reference, p.definition, .memberdecls .header, .mdescRight { color: #121212; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji; } @@ -48,7 +48,7 @@ body { flex-direction: row; width: 100%; - max-width: 1000px; + max-width: 1100px; min-height: 100%; margin: 0 auto; } @@ -92,9 +92,7 @@ table { #details + .groupheader, .definition, -.memtitle, -.contents > p:first-child > a:first-child /* "Go to the source code of this file." */ -{ display: none } +.memtitle { display: none } table.memname * { display: inline; @@ -125,19 +123,22 @@ code { display: block !important; border-left: 1px solid #eee; padding-left: 1em; - margin: 1em 0; + margin: 1.5em 0; width: 100%; box-sizing: border-box; } .memproto { padding: 8px; - margin-bottom: .5em; box-shadow: none; text-shadow: none; display: inline-block; } +.memdoc p:first-child { + margin-top: 0; +} + .memname { margin-left: 0; } diff --git a/include/map.h b/include/map.h index eda5ad5bf1..833a57a350 100644 --- a/include/map.h +++ b/include/map.h @@ -61,12 +61,25 @@ typedef struct ItemDrop { /* 0x04 */ s16 unk_08; } ItemDrop; // size = 0x06 +/// @brief Describes heart/flower drop chances after defeating an Npc in the overworld. +/// +/// The algorithm for calculating the number of hearts/flowers from a StatDrop is: +/// - If current HP/FP > cutoff, drop 0. +/// - Roll generalChance. If it fails, drop 0. +/// - Roll chancePerAttempt attempts times. For each success, drop a heart/flower. +/// +/// StaticNpc holds a table of StatDrops for each stat (hearts, flowers). All are checked together +/// and the number of hearts/flowers to drop is the total number of successful attempts for each stat. +/// +/// Each heart/flower is worth 1 HP and 1 FP respectively, if picked up. +/// +/// cutoff, generalChance, and chancePerAttempt are short fixed-point percentage values. +/// That is, `F16(0)` is a 0% chance and `F16(100)` is a 100% chance. typedef struct StatDrop { - // NOTE: these %s are F16 - /* 0x00 */ s16 hpCutoff; // % of max HP/FP - /* 0x02 */ s16 generalChance; // % - /* 0x04 */ s16 attempts; - /* 0x06 */ s16 chancePerAttempt; // % + /* 0x00 */ s16 cutoff; ///< % of max HP/FP. If current HP/FP > cutoff, no hearts/flowers can be dropped. + /* 0x02 */ s16 generalChance; ///< % chance for any hearts/flowers to be dropped at all from this StatDrop. + /* 0x04 */ s16 attempts; ///< Maximum number of hearts/flowers that can be dropped from this StatDrop. + /* 0x06 */ s16 chancePerAttempt; ///< % chance for a single heart/flower to be dropped from each attempt. } StatDrop; // size = 0x08 #define NO_DROPS { F16(100), F16(0), 0, F16(0) }