diff --git a/Source/towners.cpp b/Source/towners.cpp index efd692a0a..90b95835f 100644 --- a/Source/towners.cpp +++ b/Source/towners.cpp @@ -158,6 +158,33 @@ QuestTalkData Qtalklist[] = { /** Specifies the active sound effect ID for interacting with cows. */ int CowPlaying = -1; +static void CowSFX(int pnum) +{ + if (CowPlaying == -1 || !effect_is_playing(CowPlaying)) { + sgdwCowClicks++; +#ifdef SPAWN + if (sgdwCowClicks == 4) { + sgdwCowClicks = 0; + CowPlaying = TSFX_COW2; + } else { + CowPlaying = TSFX_COW1; + } +#else + if (sgdwCowClicks >= 8) { + PlaySfxLoc(TSFX_COW1, plr[pnum]._px, plr[pnum]._py + 5); + sgdwCowClicks = 4; + CowPlaying = snSFX[sgnCowMsg][plr[pnum]._pClass]; /* snSFX is local */ + sgnCowMsg++; + if (sgnCowMsg >= 3) + sgnCowMsg = 0; + } else { + CowPlaying = sgdwCowClicks == 4 ? TSFX_COW2 : TSFX_COW1; + } +#endif + PlaySfxLoc(CowPlaying, plr[pnum]._px, plr[pnum]._py); + } +} + int GetActiveTowner(int t) { int i; @@ -1387,30 +1414,3 @@ void TalkToTowner(int p, int t) #endif } } - -void CowSFX(int pnum) -{ - if (CowPlaying == -1 || !effect_is_playing(CowPlaying)) { - sgdwCowClicks++; -#ifdef SPAWN - if (sgdwCowClicks == 4) { - sgdwCowClicks = 0; - CowPlaying = TSFX_COW2; - } else { - CowPlaying = TSFX_COW1; - } -#else - if (sgdwCowClicks >= 8) { - PlaySfxLoc(TSFX_COW1, plr[pnum]._px, plr[pnum]._py + 5); - sgdwCowClicks = 4; - CowPlaying = snSFX[sgnCowMsg][plr[pnum]._pClass]; /* snSFX is local */ - sgnCowMsg++; - if (sgnCowMsg >= 3) - sgnCowMsg = 0; - } else { - CowPlaying = sgdwCowClicks == 4 ? TSFX_COW2 : TSFX_COW1; - } -#endif - PlaySfxLoc(CowPlaying, plr[pnum]._px, plr[pnum]._py); - } -} diff --git a/Source/towners.h b/Source/towners.h index 3ffd82253..c38deb755 100644 --- a/Source/towners.h +++ b/Source/towners.h @@ -8,49 +8,11 @@ extern TownerStruct towner[NUM_TOWNERS]; -int GetActiveTowner(int t); -void SetTownerGPtrs(BYTE *pData, BYTE **pAnim); -void NewTownerAnim(int tnum, BYTE *pAnim, int numFrames, int Delay); -void InitTownerInfo(int i, int w, int sel, int t, int x, int y, int ao, int tp); -void InitQstSnds(int i); -void InitSmith(); -void InitBarOwner(); -void InitTownDead(); -void InitWitch(); -void InitBarmaid(); -void InitBoy(); -void InitHealer(); -void InitTeller(); -void InitDrunk(); -void InitCows(); -#ifdef HELLFIRE -void InitFarmer(); -void InitCowFarmer(); -void InitGirl(); -#endif void InitTowners(); void FreeTownerGFX(); -void TownCtrlMsg(int i); -void TownBlackSmith(); -void TownBarOwner(); -void TownDead(); -void TownHealer(); -void TownStory(); -void TownDrunk(); -void TownBoy(); -void TownWitch(); -void TownBarMaid(); -void TownCow(); -#ifdef HELLFIRE -void TownFarmer(); -void TownCowFarmer(); -void TownGirl(); -#endif void ProcessTowners(); ItemStruct *PlrHasItem(int pnum, int item, int &i); -void TownerTalk(int first, int t); void TalkToTowner(int p, int t); -void CowSFX(int pnum); /* data */