MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / GiveReward

Method GiveReward

src/SB/Game/zNPCTypeCommon.cpp:1867–1932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1865}
1866
1867void zNPCCommon::GiveReward()
1868{
1869 S32 i;
1870 U32 s;
1871 NPCConfig* cfg = this->cfg_npc;
1872 U32 shinies[5];
1873 S32 esteem;
1874
1875 if (this->SelfType() != NPC_TYPE_ARFDOG)
1876 {
1877 if ((this->SelfType() & 0xFFFFFF00) == 'NTT\0')
1878 {
1879 zCombo_Add(1);
1880 }
1881 else
1882 {
1883 zCombo_Add(3);
1884 }
1885 }
1886
1887 for (i = 0, s = 0; i < 5; i++)
1888 {
1889 esteem = cfg->cnt_esteem[i];
1890 if (esteem >= 1)
1891 {
1892 if (esteem == globals.player.g.ShinyValuePurple)
1893 {
1894 shinies[s] = 0;
1895 s++;
1896 }
1897 else if (esteem == globals.player.g.ShinyValueBlue)
1898 {
1899 shinies[s] = 1;
1900 s++;
1901 }
1902 else if (esteem == globals.player.g.ShinyValueGreen)
1903 {
1904 shinies[s] = 2;
1905 s++;
1906 }
1907 else if (esteem == globals.player.g.ShinyValueYellow)
1908 {
1909 shinies[s] = 3;
1910 s++;
1911 }
1912 else if (esteem == globals.player.g.ShinyValueRed)
1913 {
1914 shinies[s] = 4;
1915 s++;
1916 }
1917 else
1918 {
1919 shinies[i] = 4;
1920 s++;
1921 break;
1922 }
1923 }
1924 }

Callers 2

SDS_StartExplodeMethod · 0.80
EnterMethod · 0.80

Calls 5

PosMethod · 0.95
PlayerKiltMeMethod · 0.95
zCombo_AddFunction · 0.85
SelfTypeMethod · 0.80
zEntPickup_SpawnNRewardsFunction · 0.70

Tested by

no test coverage detected