mirror of
https://github.com/pmret/papermario.git
synced 2024-11-09 12:32:38 +01:00
document StatDrop (#88)
This commit is contained in:
parent
6b1ca37bc6
commit
191be39a03
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
body, table, div, p, dl { font: inherit }
|
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;
|
color: #121212;
|
||||||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
|
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;
|
flex-direction: row;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 1000px;
|
max-width: 1100px;
|
||||||
min-height: 100%;
|
min-height: 100%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
@ -92,9 +92,7 @@ table {
|
|||||||
|
|
||||||
#details + .groupheader,
|
#details + .groupheader,
|
||||||
.definition,
|
.definition,
|
||||||
.memtitle,
|
.memtitle { display: none }
|
||||||
.contents > p:first-child > a:first-child /* "Go to the source code of this file." */
|
|
||||||
{ display: none }
|
|
||||||
|
|
||||||
table.memname * {
|
table.memname * {
|
||||||
display: inline;
|
display: inline;
|
||||||
@ -125,19 +123,22 @@ code {
|
|||||||
display: block !important;
|
display: block !important;
|
||||||
border-left: 1px solid #eee;
|
border-left: 1px solid #eee;
|
||||||
padding-left: 1em;
|
padding-left: 1em;
|
||||||
margin: 1em 0;
|
margin: 1.5em 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.memproto {
|
.memproto {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
margin-bottom: .5em;
|
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.memdoc p:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.memname {
|
.memname {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
@ -61,12 +61,25 @@ typedef struct ItemDrop {
|
|||||||
/* 0x04 */ s16 unk_08;
|
/* 0x04 */ s16 unk_08;
|
||||||
} ItemDrop; // size = 0x06
|
} 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 {
|
typedef struct StatDrop {
|
||||||
// NOTE: these %s are F16
|
/* 0x00 */ s16 cutoff; ///< % of max HP/FP. If current HP/FP > cutoff, no hearts/flowers can be dropped.
|
||||||
/* 0x00 */ s16 hpCutoff; // % of max HP/FP
|
/* 0x02 */ s16 generalChance; ///< % chance for any hearts/flowers to be dropped at all from this StatDrop.
|
||||||
/* 0x02 */ s16 generalChance; // %
|
/* 0x04 */ s16 attempts; ///< Maximum number of hearts/flowers that can be dropped from this StatDrop.
|
||||||
/* 0x04 */ s16 attempts;
|
/* 0x06 */ s16 chancePerAttempt; ///< % chance for a single heart/flower to be dropped from each attempt.
|
||||||
/* 0x06 */ s16 chancePerAttempt; // %
|
|
||||||
} StatDrop; // size = 0x08
|
} StatDrop; // size = 0x08
|
||||||
|
|
||||||
#define NO_DROPS { F16(100), F16(0), 0, F16(0) }
|
#define NO_DROPS { F16(100), F16(0), 0, F16(0) }
|
||||||
|
Loading…
Reference in New Issue
Block a user