1 #ifndef INC_NODE_H
2 #define INC_NODE_H
3 
4 #include <vector>
5 
6 #include "invaders.h"
7 #include "coords.h"
8 
9 enum NodeStatus
10 {
11     NODEST_NONE,
12     NODEST_EVIL,
13     NODEST_YOU,
14     NODEST_DESTROYED
15 };
16 enum NodeColour
17 {
18     NODEC_BLUE,
19     NODEC_PURPLE,
20     NODEC_CYAN,
21     NODEC_RED,
22     NODEC_YELLOW,
23     NODEC_GREEN
24 };
25 
26 class Node : public HPInvader, public SpirallingPolygonalInvader
27 {
28     private:
29 	std::vector<RelPolarCoord> sparkVertices;
30 	int sparkPoint;
31 	void setSparks();
32 	void setPoints();
33 	CartCoord getSparkVertex(int v) const;
34 	Angle glowPhase() const;
35     protected:
36 	void doUpdate(int time);
37 	Uint32 colour() const;
38 	Uint32 innerColour() const;
39     public:
40 	int pitch;
41 	float radius;
42 
43 	float spinRate;
44 	Angle spin;
45 
46 	NodeColour nodeColour;
47 	NodeStatus status;
48 
49 	float primed;
50 	float primeRate;
51 
52 	CapturePod* capturer;
53 	InfestingInvader* targettingInfester;
54 	bool infest(InfestingInvader* inv);
55 	void uninfest();
56 	bool capture(CapturePod* pod);
57 	void uncapture();
58 
59 	int hit(int weight);
die()60 	int die() { return 0; }
dead()61 	bool dead() const { return false; }
62 
63 	float extractionProgress;
64 
65 	int extract(int time, bool hasCyan=false);
66 
67 	void draw(SDL_Surface* surface, const View& view, View*
68 		boundView=NULL, bool noAA=false) const;
69 
70 	Node(RelPolarCoord pos, float ds, NodeColour nodeColour,
71 		float spinRate=0, Angle spin=0, int pitch=1000, float
72 		radius=6);
73 };
74 
75 #endif /* INC_NODE_H */
76