summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2FireBurning.h
blob: 1f0bec85d753ebdbfae0fd6747d79ffa2d838117 (plain)
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
#pragma once
#include "common.h"
#include "LAttachment.h"
#include "T2EventItem.h"

enum {
	kFireBurningStatus0 = 0,
	kFireBurningStatus1 = 1,
	kFireBurningStatus2 = 2,
};

enum {
	kFireFightNull = 0,
	kFireFightHelicopter = 1,
	kFireFightFireman = 2,
	kFireFightDoNothing = 3,
};

class AFX_CLASS_EXPORT T2FireBurning : public T2EventItem {
public:
	T2FireBurning(T2TowerEvent* inTowerEvent, CResFile* inResFile, int inSubID);
	virtual ~T2FireBurning();
	virtual DWORD GetID() { return 'FBEv'; }
	virtual BOOL Start(T2TowerDoc* inDoc);
	virtual int Exec(T2TowerDoc* inDoc);
	virtual void StopEvent(T2TowerDoc* inDoc);
	virtual unsigned int DialogHook(T2EventDialog* inDialog, unsigned int inResult, T2TowerDoc* inDoc);
	virtual void StartEvent(T2TowerDoc* inTowerDoc, POINT inPt, const T2Tenant* inTenant);
	virtual void IdleEvent(T2TowerDoc* inDoc);
	BOOL MakeFire(POINT inPt, T2TowerDoc* inDoc);
	void Extinguish(T2Fire* inFire);
	BOOL DoExtinguish(CPoint& inPt);
	BOOL IsEmergency() { return mStatus != kFireBurningStatus0; }

protected:
	virtual void SetupDialog(T2Dialog* inDialog);
	BOOL AdjustFirePos(T2FloorInfo* inFloorInfo, POINT& inPt, RECT& outRect) const;
	void CallFireman(T2TowerDoc* inDoc, const T2Tenant* inTenant);
	BOOL IsBreakoutFire(const T2TowerDoc* inDoc, POINT& outPt, T2Tenant*& outTenant) const;

	int mFightAction;
	unsigned int mTimePassed;
	int mHelicopterPrice;
	LArray *mFireArray;
	int m40;
	T2BitImage *mImage;
	T2ImageObj *mImageObj;
	int mFireWidth;
	int _50;
	T2FireAttach *mAttach;
	int _58;
	T2Helicopter *mHelicopter;
	T2PeoplePtrList *mPeopleList;
};

class AFX_CLASS_EXPORT T2Fire {
public:
	T2Fire(POINT& inPt, T2TowerDoc* inDoc, int inVar, T2ImageObj* inImageObj);
	~T2Fire();
	BOOL Move();
	BOOL HitTest(CPoint& inPt, CRect& outRect);
	BOOL ExtinguishByFireman(T2TowerDoc* inDoc, T2PeoplePtrList* inPeopleList);

	void SetArsonTenant(T2Tenant* inTenant) { mArsonTenant = inTenant; }
	T2Tenant* GetArsonTenant() { return mArsonTenant; }
	T2People* GetFireman() const { return mFireman; }

protected:
	void SetFireman(T2People* inPeople);

	unsigned int x0;
	unsigned int x4;
	T2TowerDoc *mDocument;
	int xC;
	T2Sprite *mSprite;
	int mFireSpriteID;
	unsigned int x18;
	unsigned int x1C;
	T2Tenant *mArsonTenant;
	T2People *mFireman;
};

class AFX_CLASS_EXPORT T2Helicopter {
public:
	T2Helicopter(T2TowerDoc* inDoc, const T2Tenant* inTenant);
	~T2Helicopter();
	void Move(T2TowerDoc* inDoc);

	T2TowerDoc *mDocument;
	T2Sprite *mSprite;
	T2BitImage *mImage;
	T2ImageObj *mImageObj;
	int mHeliSpriteID;
	int mTimePassed;
	int mSpeed;
	int mWaterSpriteID;
	BOOL mWaterVisible;
};

class AFX_CLASS_EXPORT T2FireAttach : public LAttachment {
public:
	T2FireAttach(T2EventItem* inOwner, unsigned int inMessage, BOOL inExecuteHost);
	virtual ~T2FireAttach();
protected:
	virtual void ExecuteSelf(unsigned int inMessage, void* ioData);
	T2EventItem *mOwner;
};