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

Method IsAttackFrame

src/SB/Game/zNPCTypeCommon.cpp:1819–1865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1817}
1818
1819S32 zNPCCommon::IsAttackFrame(F32 tym_anim, S32 series)
1820{
1821 S32 result = 0;
1822 NPCConfig* cfg = this->cfg_npc;
1823
1824 if (!cfg)
1825 return 0;
1826
1827 xVec3 var_30, var_3C, var_48;
1828
1829 switch (series)
1830 {
1831 case 0:
1832 case 1:
1833 var_30 = cfg->animFrameRange[0];
1834 var_3C = cfg->animFrameRange[1];
1835 var_48 = cfg->animFrameRange[2];
1836 break;
1837 case 2:
1838 var_30 = cfg->animFrameRange[3];
1839 var_3C = cfg->animFrameRange[4];
1840 var_48 = cfg->animFrameRange[5];
1841 break;
1842 default:
1843 var_30 = cfg->animFrameRange[6];
1844 var_3C = cfg->animFrameRange[7];
1845 var_48 = cfg->animFrameRange[8];
1846 break;
1847 }
1848
1849 F32 tym = (tym_anim < 0.0f) ? this->AnimTimeCurrent() : tym_anim;
1850
1851 if (tym >= var_30.x && tym <= var_30.y)
1852 {
1853 result = 1;
1854 }
1855 else if (tym >= var_3C.x && tym <= var_3C.y)
1856 {
1857 result = 2;
1858 }
1859 else if (tym >= var_48.x && tym <= var_48.y)
1860 {
1861 result = 3;
1862 }
1863
1864 return result;
1865}
1866
1867void zNPCCommon::GiveReward()
1868{

Callers 2

ProcessMethod · 0.80
VFXSmokeStackMethod · 0.80

Calls 1

AnimTimeCurrentMethod · 0.95

Tested by

no test coverage detected