1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
|
#pragma once
#include "common.h"
#include "T2TemplatePlugin.h"
enum {
kMaxValiation = 4,
};
enum {
kToolAttrIsMover = 2,
kEquipAttrIsAbleDragMaking = 0x80,
kToolAttrNormalMenteCost = 0x100,
kMoverAttrIsStair = 0x2000,
kMoverAttrIsElevator = 0x8000,
kMoverAttrRoutingTable0 = 0x1000000,
kMoverAttrRoutingTable1 = 0x2000000,
kMoverAttrRoutingTable2 = 0x4000000,
kMoverAttrRoutingTable3 = 0x8000000,
kTenantAttrIsFireproof = 0x1000,
kTenantAttrIsFloor = 0x2000,
kTenantAttrIsValiableLength = 0x4000,
kTenantAttrIsHome = 0x8000,
// 10000
kTenantAttrIsConcat = 0x20000,
kTenantAttr40000 = 0x40000,
// 80000
kTenantAttrOnlyGroundFloor = 0x100000,
kTenantAttrOnlyAboveGround = 0x200000,
kTenantAttrOnlyUnderground = 0x400000,
kTenantAttrIsPeopleAnime = 0x800000,
kTenantAttrIsPeopleAnime2 = 0x1000000,
kTenantAttrIsNeedToilet = 0x2000000,
};
class AFX_CLASS_EXPORT T2ToolDef : public T2TemplatePlugin {
public:
T2ToolDef(DWORD type, T2PluginSpecifier& specifier, CResFile* resFile, T2WorldDef* worldDef, T2ToolPlugin* plugin);
virtual ~T2ToolDef();
virtual int GetSortKey();
virtual BOOL IsMover() { return false; }
virtual BOOL IsTenant() { return false; }
virtual BOOL IsOutObj() { return false; }
int GetToolNo() const { return mToolNo; }
int GetCategory() const { return mCategoryNo; }
int GetToolType() const { return mToolType; }
int IsSetAttribute(unsigned int a) const { return (mAttribute & a) != 0; }
DWORD GetSubPluginType() const { return mSubPluginType; }
unsigned int GetAttribute() const { return mAttribute; }
T2BitImage* GetToolIcon() const { return mToolIcon; }
void GetToolName(CString& outStr, int id) const {
outStr = *mName[id];
}
void GetCategoryName(CString outStr) const {
// BUG: outStr should be &
outStr = mCategoryName;
}
virtual int CalcPayment(T2TowerDoc*, RECT&, unsigned int id) {
return mPrice[id];
}
virtual int RequierToolIcon(T2ToolWindow*) {
return 0;
}
virtual CURSORTYPE QueryCursor(T2TowerDoc* inDoc, POINT inPt, CString& outSpriteName, RECT& outRect, POINT& outPt, int inZoomLevel, unsigned int inValiation, int);
virtual unsigned int IdleProc(T2HaveOutViewObject*, T2TowerDoc*) {
return 0;
}
virtual void DefIdleProc(T2TowerDoc*) {}
virtual void DrawProc(T2HaveOutViewObject*, const RECT&, T2TowerDoc*) const {}
virtual PROCCODE DoDestructProc(T2TowerDoc*, T2HaveOutViewObject*, POINT, RECT&);
virtual void DestructFinish(T2TowerDoc*, T2HaveOutViewObject*) {}
virtual int CalcMentenanceCostProc(const T2HaveOutViewObject*) const;
int GetConsumptionPower(unsigned int id) {
return mConsumptionPower[id];
}
int GetCurBuildCount() const { return mCurBuildCount; }
int GetMaxBuildCount() const { return mMaxBuildCount; }
int GetSettlement() const { return mSettlement; }
void DoStartUse() { mCurBuildCount++; }
void DoEndUse() { mCurBuildCount--; }
virtual void LoadExtraData(T2Archive&, T2TowerDoc*, T2HaveOutViewObject*) {}
virtual void SaveExtraData(T2Archive&, T2HaveOutViewObject*) {}
virtual void Add(CResourcePlugin* plugin);
virtual void Add(T2AdvertisePlugin* plugin);
virtual PROCCODE DrawHitMask(T2TowerDoc*, T2HaveOutViewObject*) {
return ProcCode_0;
}
CFilePluginList* GetSubPluginList() { return mSubPluginList; }
virtual unsigned long OptionProc(unsigned long, void*) {
return 0;
}
CString CalcSoundID(int) const;
void GetName(CString& outStr, int id);
int GetOutMoney(unsigned int id) const;
void SetOutMoney(unsigned int id, int money);
protected:
friend class T2Mover;
friend class T2Settlement;
friend class T2TemplatePluginList;
friend class T2ToolHelpWnd;
friend class T2TowerDoc;
int mToolType;
int mWidth;
int mHeight;
int mLevel;
unsigned int mAttribute;
int mCategoryNo;
CString mCategoryName;
CString mCategoryCommentString;
int mToolNo;
int mValiationCount;
CString *mPriceString[kMaxValiation];
CString *mOutMoneyString[kMaxValiation];
CString *mCommentString[kMaxValiation];
int mOutMoney[kMaxValiation];
CString *mToolName[kMaxValiation];
CString *mName[kMaxValiation];
int mPrice[kMaxValiation];
T2BitImage *mToolIcon;
T2BitImage *mEC;
int mConsumptionPower[kMaxValiation];
int mCurBuildCount;
int mMaxBuildCount;
DWORD mSubPluginType;
CFilePluginList *mSubPluginList;
int mSettlement;
T2DateTime *mToolQuietUntil;
T2DateTime *mCategoryQuietUntil;
};
|