2001-06-08 00:14:11 +00:00
|
|
|
float foo = 1;
|
|
|
|
float bar = 1;
|
2001-06-27 05:46:53 +00:00
|
|
|
float snafu = 2;
|
2001-07-07 02:38:40 +00:00
|
|
|
float negative = -------2;
|
2001-06-08 00:14:11 +00:00
|
|
|
|
2001-06-27 22:56:52 +00:00
|
|
|
void () eek;
|
|
|
|
|
2001-06-01 21:57:59 +00:00
|
|
|
float () main =
|
|
|
|
{
|
2001-06-06 20:05:08 +00:00
|
|
|
local float handle;
|
|
|
|
local string buffer;
|
2001-06-04 04:52:14 +00:00
|
|
|
|
2001-06-08 00:14:11 +00:00
|
|
|
handle = open ("main.qc", 0);
|
2001-06-06 20:05:08 +00:00
|
|
|
if (handle == -1) {
|
|
|
|
print (strerror (errno ()) + "\n");
|
|
|
|
return 1;
|
2001-06-05 23:53:55 +00:00
|
|
|
}
|
2001-06-06 20:05:08 +00:00
|
|
|
do {
|
|
|
|
buffer = read (handle, 1024);
|
|
|
|
if (read_result == -1) {
|
|
|
|
print (strerror (errno ()) + "\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
print (buffer);
|
|
|
|
} while (read_result == 1024);
|
|
|
|
close (handle);
|
2001-06-27 22:56:52 +00:00
|
|
|
eek ();
|
2001-06-06 20:05:08 +00:00
|
|
|
return 0;
|
2001-06-05 23:53:55 +00:00
|
|
|
};
|
2001-06-08 00:14:11 +00:00
|
|
|
|
|
|
|
float () baz =
|
|
|
|
{
|
|
|
|
return foo + bar;
|
|
|
|
};
|
2001-06-08 22:54:34 +00:00
|
|
|
|
|
|
|
void (float x) test =
|
|
|
|
{
|
|
|
|
local string str;
|
|
|
|
local float urk = 0;
|
|
|
|
|
2001-06-27 05:46:53 +00:00
|
|
|
if (urk) {
|
|
|
|
urk = foo || snafu;
|
|
|
|
} else {
|
|
|
|
print ("owie");
|
|
|
|
}
|
2001-06-08 22:54:34 +00:00
|
|
|
};
|
2001-06-27 21:15:15 +00:00
|
|
|
|
|
|
|
void () blarg =
|
|
|
|
{
|
|
|
|
local float foo = -1;
|
|
|
|
local float bar;
|
|
|
|
do {
|
|
|
|
foo = 1;
|
|
|
|
} while (foo);
|
|
|
|
if (bar = foo);
|
|
|
|
foo = 2;
|
2001-07-15 01:49:24 +00:00
|
|
|
while (foo) {
|
|
|
|
bar = foo;
|
|
|
|
}
|
2001-06-27 21:15:15 +00:00
|
|
|
};
|
2001-06-27 22:56:52 +00:00
|
|
|
|
|
|
|
void () eek =
|
|
|
|
{
|
|
|
|
traceon();
|
|
|
|
self.origin = '0 0 0';
|
|
|
|
self.origin = self.origin + '1 2 3';
|
|
|
|
traceoff();
|
|
|
|
};
|
2001-07-10 18:25:54 +00:00
|
|
|
|
|
|
|
.string classname;
|
|
|
|
.string netname;
|
|
|
|
float (entity tester) IsBuilding =
|
|
|
|
{
|
|
|
|
if (
|
|
|
|
tester.classname == "building_sentrygun" ||
|
|
|
|
tester.classname == "building_sentrygun_base" ||
|
|
|
|
tester.classname == "building_tesla" ||
|
|
|
|
tester.classname == "building_dispenser" ||
|
|
|
|
tester.classname == "building_camera" ||
|
|
|
|
tester.classname == "building_arawana" ||
|
|
|
|
tester.classname == "building_teleporter"||
|
|
|
|
tester.classname == "building_fieldgen"||
|
|
|
|
tester.classname == "building_sensor"
|
|
|
|
)
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
float(entity thing) IsMonster =
|
|
|
|
{
|
|
|
|
if (thing.classname=="monster_shambler")
|
|
|
|
return 1;
|
|
|
|
if (thing.classname=="monster_demon1")
|
|
|
|
return 1;
|
|
|
|
if (thing.classname=="monster_wizard")
|
|
|
|
return 1;
|
|
|
|
if (thing.classname=="monster_army")
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
if (thing.classname=="monster_knight")
|
|
|
|
return 1;
|
|
|
|
if (thing.classname=="monster_hknight")
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
string(entity thething) GetEnemyName =
|
|
|
|
{
|
|
|
|
if (thething.classname == "player")
|
|
|
|
return thething.netname;
|
|
|
|
|
|
|
|
if (IsMonster(thething))
|
|
|
|
return "";
|
|
|
|
|
|
|
|
if (IsBuilding(thething))
|
|
|
|
return "";
|
|
|
|
|
|
|
|
if (thething.classname == "grenade" && thething.netname == "land_mine")
|
|
|
|
return "land mine";
|
|
|
|
|
|
|
|
if (thething.classname != "")
|
|
|
|
return thething.classname;
|
|
|
|
|
|
|
|
return "unknown stuff";
|
|
|
|
};
|
2001-07-12 23:11:40 +00:00
|
|
|
void () assign =
|
|
|
|
{
|
|
|
|
local float foo;
|
|
|
|
local float bar;
|
|
|
|
|
|
|
|
foo = bar;
|
|
|
|
foo = bar = 1;
|
|
|
|
foo = bar = bar + 1;
|
|
|
|
};
|