#ifndef T2DLL_T2WORLDDEF_H #define T2DLL_T2WORLDDEF_H #include "../common.h" #include "T2PaletteAnimeDef.h" #include "T2TemplatePlugin.h" // unknown name struct GradeDef { unsigned int m0; // mask of VIPs available int m4; // minimum population int m8; // grade up animation ID int mC; int m10; int m14; // grade up animation start frame }; class AFX_CLASS_EXPORT T2WorldDef : public T2TemplatePlugin { public: T2WorldDef(DWORD inType, T2PluginSpecifier& inSpecifier, CResFile* inResFile, T2WorldPlugin* inPlugin); public: virtual ~T2WorldDef(); virtual void GetName(CString& outStr); virtual int GetSortKey() { return mWorldType; } CPalette* GetPalette() { return GetPaletteAnimeDef()->GetTowerPalette(); } BOOL IsUseMatterObject() const { return false; } int GetOutViewKind() const { return mOutViewKind; } T2PaletteAnimeDef* GetPaletteAnimeDef() const { return mPaletteAnimeDef; } T2SeasonParamDef* GetSeasonParamDef() const { return mSeasonParamDef; } virtual int GetInitialFunds() const { return mInitialFunds; } int GetHeight() const { return mHeight; } int GetWidth() const { return mWidth; } void GetBuildArea(RECT& rect) const { rect = mBuildArea; } virtual BOOL IsHoliday(T2DateTime* inDateTime) const { return false; } virtual BOOL IsRainyDay(T2DateTime* inDateTime) const { return false; } BOOL IsStoppableFloor(int y) { return !((y >= (mGroundLine - mLobbyHeight) && y < (mGroundLine - 1))); } int GetLobbyHeight() { return mLobbyHeight; } virtual int ExchangeMoney(int v) const; virtual void DrawWorld(T2TowerDoc* inDoc); virtual void DoAnimate(T2TowerDoc* inDoc); virtual void DrawBkgnd(const RECT& inRect, T2TowerDoc* inDoc); virtual void DrawBkgnd(unsigned int inImageIndex, const RECT& inDestRect, T2TowerDoc* inDoc); virtual void DrawRoofAndFloor(const RECT& inRect, T2TowerDoc* inDoc, ROOFANDFLOOR inRoofAndFloor); virtual void DrawBuild(T2Equip* inEquip, T2TowerDoc* inDoc); virtual void DrawSideObj(T2Equip* inEquip, T2TowerDoc* inDoc, SIDEOBJPATTERN inSideObjPattern); virtual void DrawOptionObj(T2TowerDoc* inDoc, const RECT& inRect); virtual void DrawRubble(T2TowerDoc* inDoc, T2Tenant* inTenant); virtual void DrawMark(T2BitImage* inDestImage, const RECT& inRect, int inZoomLevel, unsigned int inPattern); virtual void DrawCrane(T2TowerDoc* inDoc, const RECT& inRect); virtual const char* GetMoneyUnit() { return mMoneyUnit; } virtual T2EventItem* MakeXEvent(T2TowerEvent* inTowerEvent, CResFile*, unsigned long, int); T2Maru_Reggae* GetReggae() { return NULL; } virtual T2Transport* GetCruise(T2TowerEvent* inTowerEvent) { return NULL; } virtual void InitializeBkgndInfo(BkgndInfo* inBkgndInfoPtr); virtual void InitializeFloorInfo(T2FloorInfo* inFloorInfo); virtual void InitializeDocument(T2TowerDoc* inDoc); virtual BOOL TenantAreaCheck(T2TowerDoc* inDoc, RECT& inRect, BOOL inShowMessage); virtual void CalcOptionObj(T2TowerDoc* inDoc, T2Equip* inEquip); virtual void CalcCranePos(T2TowerDoc* inDoc); virtual void ClearCranePos(T2TowerDoc* inDoc); virtual void DrawCtrl(T2TowerDoc* inDoc, T2MWControl* inControl); virtual void ButtonDownOnCtrl(T2TowerDoc* inDoc, T2MWControl* inControl, CPoint inPt, CWnd* inWnd); virtual void ButtonUpOnCtrl(T2TowerDoc* inDoc, T2MWControl* inControl, CPoint inPt, CWnd* inWnd); virtual void MouseMoveOnCtrl(T2TowerDoc* inDoc, T2MWControl* inControl, CPoint inPt, CWnd* inWnd); virtual void GetToolTipText(T2TowerDoc* inDoc, T2MWControl* inControl, LPNMTTDISPINFO outInfo); virtual int IdleProc(T2TowerDoc* inDoc); virtual int CheckGameLevelProc(T2TowerDoc* inDoc); virtual void GetGradeUpMessage(int inGradeNum, CString& outStr); virtual void DayChanged(T2TowerDoc* inDoc) {} virtual void ViewModeChanged(T2TowerDoc* inDoc, VIEWMODE); virtual void ReplaceSkyOffscreen(int inResID); virtual BOOL3 ChangeFastSEProc(T2PaletteAnime* inPaletteAnime) { return BOOL3_NEG1; } virtual BOOL3 ChangeSEProc(T2PaletteAnime* inPaletteAnime) { return BOOL3_NEG1; } virtual BOOL3 ChangeFastSEProc(T2PaletteAnime* inPaletteAnime, T2DateTime* inDateTime) { return BOOL3_NEG1; } virtual BOOL3 ChangeSkyColorProc(T2PaletteAnime* inPaletteAnime) { return BOOL3_NEG1; } virtual BOOL3 AdjustSkyStateProc(T2PaletteAnime* inPaletteAnime, T2DateTime* inDateTime) { return BOOL3_NEG1; } virtual BOOL UseOwnSkyPaletteFunction() { return false; } virtual void SetupGradeUpAnimation(T2DlgItemAnimation* inAnimation, int inGradeNum); virtual void WriteStatisticsProc(T2TowerDoc* inDoc, T2Archive& inArchive); virtual void ReadStatisticsProc(T2TowerDoc* inDoc, T2Archive& inArchive); virtual BOOL CheckTreasure(T2TowerDoc* inDoc, T2TreasureStatus* inTreasureStatus); int GetCashAmount(int i) const { return (i >= 0 && i < 8) ? mCashAmount[i] : 0; } virtual unsigned long OptionProc(unsigned long, void*) { return 0; } unsigned int GetToiletDenomi(unsigned int inGameLevel) const; unsigned int GetColdDenomi(unsigned int inGameLevel, unsigned int inMonth) const; BOOL IsDustOn(unsigned int inGameLevel) const; T2TowerVision* GetTowerVision(); void SetLatestBuild(T2Equip* inEquip, BOOL inFlag); void SetLatestBuild(T2ToolDef* inToolDef, BOOL inFlag); void InitTowerEvent(T2TowerDoc* inDoc); void WriteTowerEvent(T2Archive& inArchive); void ReadTowerEvent(T2Archive& inArchive); void StopEvent(); T2TowerEvent* GetTowerEvent(); T2FireBurning* GetFireBurning(); T2MetroRailway* GetMetroRailway(); T2BlackOut* GetBlackOut(); BOOL IsBlackOut(); int mWorldType; int mGroundLine; int mLobbyHeight; int _5C; POINT mInitPos; int mTopFloorLine; int mBottomFloorLine; int m70; // starting level int m74; // starting month int _78; int _7C; int _80; int mNumOfGradeDef; GradeDef mGradeDef[8]; int m148[5]; char m15C[20]; unsigned int mMinimumLevelForDust; unsigned int mMinimumLevelForToilet; unsigned int mToiletDenomi; int m17C; int mBGVUnit; int mBGHUnit; int mSkyVSize; int mSkyHSize; POINT m190; // crane size T2WordDefArray *mWordDefArray; T2BitImage *mSkyOffscreen; T2BitImage *m1A0; T2BitImage *m1A4[2]; T2BitImage *m1AC; T2BitImage *m1B0; T2BitImage *m1B4; T2BitImage *m1B8; T2BitImage *m1BC; T2BitImage *m1C0; T2BitImage *m1C4; T2BitImage *m1C8; T2BitImage *m1CC; T2ImageObj *m1D0; T2PoolDef *mPoolDef; int _1D8; int _1DC; int _1E0; int _1E4; int _1E8; int _1EC; int _1F0; T2BitImage *mImage; int mHeight; int mWidth; RECT mBuildArea; int _210; BOOL _214; int mOutViewKind; T2PaletteAnimeDef *mPaletteAnimeDef; T2SeasonParamDef *mSeasonParamDef; T2ColdTableDef *mColdTableDef; int m228; int mCashAmount[8]; int mInitialFunds; int mMoneyNumerator; int mMoneyDenominator; CString mMoneyUnit; T2TowerEvent *mTowerEvent; protected: virtual void DrawClock(T2MWControl* inControl, T2DateTime& inDateTime); virtual void DrawCalendar(T2MWControl* inControl, T2DateTime& inDateTime, T2TowerDoc* inDoc); virtual void DrawFunds(T2MWControl* inControl, int inFunds); virtual void DrawPopulation(T2MWControl* inControl, int inPop); virtual void DrawMessage(T2MWControl* inControl); virtual void DrawPauseButton(T2MWControl* inControl); virtual void DrawInViewButton(T2MWControl* inControl); virtual void DrawOutViewButton(T2MWControl* inControl); virtual void DrawMaintButton(T2MWControl* inControl); virtual void DrawEvalButton(T2MWControl* inControl); virtual void DrawPriceButton(T2MWControl* inControl); virtual void DrawTransButton(T2MWControl* inControl); virtual void DrawSlider(T2MWControl* inControl); virtual void ClickClock(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickCalendar(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickFunds(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickPopulation(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickPauseButton(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickInViewButton(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickOutViewButton(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickMaintButton(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickEvalButton(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickPriceButton(T2MWControl* inControl, T2TowerDoc* inDoc); virtual void ClickTransButton(T2MWControl* inControl, T2TowerDoc* inDoc); virtual int SliderPointToValue(T2MWControl* inControl, CPoint inPt); virtual void GetClockTip(T2TowerDoc* inDoc, T2MWControl* inControl, char* outStr); virtual void GetCalendarTip(T2TowerDoc* inDoc, T2MWControl* inControl, char* outStr); virtual void GetFundsTip(T2TowerDoc* inDoc, T2MWControl* inControl, char* outStr); virtual void GetPopulationTip(T2TowerDoc* inDoc, T2MWControl* inControl, char* outStr); virtual void GetPauseButtonTip(T2TowerDoc* inDoc, T2MWControl* inControl, char* outStr); virtual void DrawSimpleMWControl(T2MWControl* inControl, const char* inStr); void SetupOffscreen(HINSTANCE inModule); void DisposeOffscreen(); void SetupPalette(HINSTANCE inModule); void DisposePalette(); T2PaletteAnimeDef* MakePaletteAnimeDef(); T2PoolDef* MakePoolDef(); T2SeasonParamDef* MakeSeasonParamDef(); T2ColdTableDef* MakeColdTableDef(); }; inline /*virtual*/ int T2WorldDef::ExchangeMoney(int v) const { return (mMoneyNumerator == 1 && mMoneyDenominator == 1) ? v : ((v / mMoneyDenominator) * mMoneyNumerator); } #endif