home *** CD-ROM | disk | FTP | other *** search
-
-
- int Initialize(string type) {
- global real gInRadius;
- global real gOutRadius;
- global int gNetwork = 0;
- global string gMessage = "dummy";
- global real gDelay = 1.0;
- global int gLineOfSight = 0;
- Reset("dummy");
- }
-
- int Reset(string dummy)
- {
- wakeupTime = 0.01;
-
- gInRadius = 50.0;
- gOutRadius = 90.0;
- SetCollidableProperties(thisObject,1,0);
- SetStyle(thisObject,5);
- return 0;
- }
-
- int start(string dummy)
- {
- TimedEvent(1);
- }
-
- int lineofsight(string dummy)
- {
- int value;
- value = str2int(dummy);
- gLineOfSight = value;
- }
-
- int TimedEvent(int input)
- {
- real time;
- time = GetTime(thisObject);
-
- wakeupTime = time + gDelay;
-
- map objInList;
- objInList = QuerySphere(thisObject,gInRadius,1,gLineOfSight);
-
- map::iterator ix;
- map::iterator iy;
-
- ix = begin(objInList);
- iy = end(objInList);
-
- if (ix == iy)
- {
- SendMessage(thisObject,gOutRadius,gNetwork);
- }
- }
-
- int inradius(string str)
- {
- gInRadius = Str2Real(str);
- }
-
- int network(string str)
- {
- gNetwork = Str2Int(str);
- }
-
- int outradius(string str)
- {
- gOutRadius = Str2Real(str);
- }
-