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- global real gOutRadius;
- global int gNetwork = 0;
- global string gMessage = "dummy";
- global int gLineOfSight = 0;
- global int gOneTime = 0;
- global int gTurnOff = 0;
- global int gStartSound = 45;
- global int gProgressSound = 36;
- global int gEndSound = 45;
- global int gActive;
-
- gInRadius = 50.0;
- gOutRadius = 90.0;
- Reset("dummy");
- }
-
- int Reset(string dummy)
- {
- SetCollidableProperties(thisObject,1,0);
- SetStyle(thisObject,2);
- gTurnOff = 0;
- gActive = 1;
- IgnoreCollision(thisObject);
- }
-
- int startsound(string soundname)
- {
- gStartSound = GetSoundIndex(soundname);
-
- }
-
- int endsound(string soundname)
- {
- gEndSound = GetSoundIndex(soundname);
-
- }
-
- int progresssound(string soundname)
- {
- gProgressSound = GetSoundIndex(soundname);
-
- }
-
- int Pickup(string dummy)
- {
- gActive = 0;
- ReturnValue(thisObject,0);
- }
-
- int Holster(string dummy)
- {
- ReturnValue(thisObject,0);
- }
-
- int GetActive()
- {
- ReturnValue(thisObject,gActive);
- }
-
- int Drop(string dummy)
- {
- gActive = 1;
- SetCollidableProperties(thisObject,1,0);
- SetStyle(thisObject,2);
- PlaySound(thisObject,38);
-
- ReturnValue(thisObject,0);
- }
-
- int network(string str)
- {
- gNetwork = Str2Int(str);
- }
-
- int outradius(string str)
- {
- gOutRadius = Str2Real(str);
- }
-
- int lineofsight(string dummy)
- {
- int value;
- value = str2int(dummy);
- gLineOfSight = value;
- }
-
-
-
-
- int Collidants(string dummy) {
- int result;
- map::iterator ix;
- map::iterator iy;
- map objInList;
- result = 0;
-
- if (gTurnOff == 0)
- {
- if (IsAuthoritative(thisObject) != 1)
- return result;
-
- objInList = Collisions(thisObject,1,1,0);
-
- ix = begin(objInList);
- iy = end(objInList);
-
- if (ix != iy)
- {
- if (gOneTime == 1)
- {
- gTurnOff = 1;
- }
- PlaySound(thisObject,gStartSound);
- SendMessage(thisObject,gOutRadius,gNetwork);
- }
-
- }
- IgnoreCollision(thisObject);
- }
-
- int Colliders(string dummy)
- {
-
- map::iterator ix;
- map objInList;
- int value;
-
- objInList = Collisions(thisObject,0,1,0);
-
- for (ix = begin(objInList) ;ix != end(objInList); ++ix)
- {
- value = AddObjectTo(first(dereference(ix)),thisObject);
- if (value != 0)
- {
- PlaySound(thisObject,35);
- SetScale(thisObject,1.0);
- break;
- }
- }
-
- return 0;
- }
-