1 /*-- Power crystal --*/
2 
3 #include Library_Flag
4 
5 local DefaultFlagRadius = 250;
6 
Initialize()7 protected func Initialize()
8 {
9 	SetCategory(C4D_StaticBack);
10 	SetR(Random(360));
11 	SetObjectBlitMode(GFX_BLIT_Additive);
12 	SetClrModulation(RGB(127+Random(3)*64,127+Random(3)*64,127+Random(3)*64));
13 	return _inherited(...);
14 }
15 
16 local Name = "$Name$";
17 local Description = "$Description$";
18 
CheckConstructionSite(structure_id,x,y)19 global func CheckConstructionSite(structure_id, x,y)
20 {
21 	// Construction check: May not construct in power crystal range
22 	if (!inherited(structure_id, x,y, ...)) return false;
23 	if (FindObject(Find_ID(PowerCrystals), Find_Distance(PowerCrystals.DefaultFlagRadius, x,y))) return false;
24 	return true;
25 }
26