2001-07-23 20:52:47 +00:00
|
|
|
|
#include "defs.qh"
|
2001-07-17 05:58:10 +00:00
|
|
|
|
/*=======================================================//
|
|
|
|
|
// OfteN.QC - CustomTF 3.2.OfN - 30/1/2001 - //
|
|
|
|
|
// by Sergio Fuma<6D>a Grunwaldt - OfteN aka superCOCK2000 //
|
|
|
|
|
=========================================================//
|
|
|
|
|
Additional stuff
|
|
|
|
|
=========================================================*/
|
|
|
|
|
|
|
|
|
|
//= HOLOGRAPH SETTINGS ==========//
|
|
|
|
|
#define HOLO_POWER_COST 10 //
|
|
|
|
|
#define HOLO_CYCLE_COST 2 //
|
|
|
|
|
#define HOLO_CYCLE_TIME 1.5 //
|
|
|
|
|
//===============================//
|
|
|
|
|
|
|
|
|
|
//= FLARE GREN SETTINGS =========//
|
|
|
|
|
#define FLARE_DURATION 60 //
|
|
|
|
|
//===============================//
|
|
|
|
|
|
|
|
|
|
void() HoloThink;
|
|
|
|
|
void(entity player) RemoveHolo;
|
|
|
|
|
|
|
|
|
|
//====================================================================//
|
|
|
|
|
// Initialize stuff, localinfos etc... //
|
|
|
|
|
// This is called on worldspawn and with the IMPULSE_UPDATEINFO (194) //
|
|
|
|
|
//====================================================================//
|
|
|
|
|
|
|
|
|
|
void () UpdateInfos =
|
|
|
|
|
{
|
|
|
|
|
local string st;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "allow_debug"); //
|
|
|
|
|
if (st == "1" || st =="on")
|
|
|
|
|
allow_debug = 1;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
debug_target=world;
|
|
|
|
|
allow_debug = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*st = infokey(world, "cool_gibs"); //
|
|
|
|
|
if (st == "1" || st =="on")
|
|
|
|
|
cool_gibs = 1;
|
|
|
|
|
else
|
|
|
|
|
cool_gibs = 0;*/
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "pay_msgs"); //
|
|
|
|
|
if (st == "1" || st =="on")
|
|
|
|
|
pay_msgs = 1;
|
|
|
|
|
else
|
|
|
|
|
pay_msgs = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "team_prefix"); //
|
|
|
|
|
if (st == "1" || st =="on")
|
|
|
|
|
team_prefix = 1;
|
|
|
|
|
else
|
|
|
|
|
team_prefix = 0;
|
|
|
|
|
|
|
|
|
|
/*st = infokey(world, "allow_mauser"); //
|
|
|
|
|
if (st == "1" || st =="on")
|
|
|
|
|
allow_mauser = 1;
|
|
|
|
|
else
|
|
|
|
|
allow_mauser = 0;*/
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "headless"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
headless = 1;
|
|
|
|
|
else
|
|
|
|
|
headless = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_grapple"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_grapple = 1;
|
|
|
|
|
else
|
|
|
|
|
no_grapple = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_army"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_army = 1;
|
|
|
|
|
else
|
|
|
|
|
no_army = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "nicecolors"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
nicecolors = 1;
|
|
|
|
|
else
|
|
|
|
|
nicecolors = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "relax_cheatcheck"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
relax_cheatcheck = 1;
|
|
|
|
|
else
|
|
|
|
|
relax_cheatcheck = 0;
|
|
|
|
|
|
|
|
|
|
/*st = infokey(world, "allow_antigrav"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
allow_antigrav = 1;
|
|
|
|
|
else
|
|
|
|
|
allow_antigrav = 0;*/
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_clusters"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_clusters = 1;
|
|
|
|
|
else
|
|
|
|
|
no_clusters = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_c4"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_c4 = 1;
|
|
|
|
|
else
|
|
|
|
|
no_c4 = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_otr"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_otr = 1;
|
|
|
|
|
else
|
|
|
|
|
no_otr = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_laser"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_laser = 1;
|
|
|
|
|
else
|
|
|
|
|
no_laser = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_detpush"); //
|
|
|
|
|
if (st == "0" || st =="off" )
|
|
|
|
|
no_detpush = 0;
|
|
|
|
|
else
|
|
|
|
|
no_detpush = 1;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_monstercolors"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_monstercolors = 1;
|
|
|
|
|
else
|
|
|
|
|
no_monstercolors = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "no_chaplan"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
no_chaplan = 1;
|
|
|
|
|
else
|
|
|
|
|
no_chaplan = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "max_mines"); //
|
|
|
|
|
if (st==string_null) st="4"; //sets default, 4 max mines
|
|
|
|
|
max_mines = stof(st);
|
|
|
|
|
if (max_mines < 2 ) max_mines = 2; // the allowed minimum are 2 mines
|
|
|
|
|
else if (max_mines > 8) max_mines = 8; //the allowed maximum is 8 mines
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "custom_mode"); //
|
|
|
|
|
if (st==string_null) st="0"; //sets default
|
|
|
|
|
custom_mode = stof(st);
|
|
|
|
|
if (custom_mode < 0 ) custom_mode = 0; // the allowed minimum
|
|
|
|
|
else if (custom_mode > 2) custom_mode = 2; //the allowed maximum
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "stock_mode"); //
|
|
|
|
|
if (st==string_null) st="0"; //sets default
|
|
|
|
|
stock_mode = stof(st);
|
|
|
|
|
if (stock_mode < 0 ) stock_mode = 0; // the allowed minimum
|
|
|
|
|
else if (stock_mode > 2) stock_mode = 2; //the allowed maximum
|
|
|
|
|
|
|
|
|
|
if (stock_mode == 2 && custom_mode == 2) custom_mode = 0;
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "army_delay"); //
|
|
|
|
|
if (st==string_null) st="5"; //sets default
|
|
|
|
|
army_delay = stof(st);
|
|
|
|
|
if (army_delay < 2 ) army_delay = 2; // the allowed minimum
|
|
|
|
|
else if (army_delay > 60) army_delay = 60; //the allowed maximum
|
|
|
|
|
|
|
|
|
|
st = infokey(world, "allow_watermonsters"); //
|
|
|
|
|
if (st == "1" || st =="on" )
|
|
|
|
|
allow_watermonsters = 1;
|
|
|
|
|
else
|
|
|
|
|
allow_watermonsters = 0;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//====================================================================//
|
|
|
|
|
// Sprints to all the members on one team except one the Team> Prefix //
|
|
|
|
|
// It should be used prior any teamsprint (look at tforttm.qc) //
|
|
|
|
|
//====================================================================//
|
|
|
|
|
|
|
|
|
|
void(float tno, entity ignore) teamprefixsprint =
|
|
|
|
|
{
|
|
|
|
|
if ( team_prefix != 1 )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
local entity te;
|
|
|
|
|
|
|
|
|
|
// Don't do teamprints in DM
|
|
|
|
|
if (tno == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
te = find(world, classname, "player");
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (Teammate(te.team_no,tno) && te != ignore)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(te, PRINT_HIGH, "Team<EFBFBD> ");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = find(te, classname, "player");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==========================================================
|
|
|
|
|
// same shit but ignores 2 players
|
|
|
|
|
|
|
|
|
|
void(float tno, entity ignore, entity ignore2) teamprefixsprintbi =
|
|
|
|
|
{
|
|
|
|
|
if ( team_prefix != 1 )
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
local entity te;
|
|
|
|
|
|
|
|
|
|
// Don't do teamprints in DM
|
|
|
|
|
if (tno == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
te = find(world, classname, "player");
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (Teammate(te.team_no,tno) && te != ignore && te != ignore2)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(te, PRINT_HIGH, "Team<EFBFBD> ");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = find(te, classname, "player");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//- For better performance i added this: --//
|
|
|
|
|
void(entity ignore, string st, string st2, string st3, string st4, string st5, string st6) teamsprint6 =
|
|
|
|
|
{
|
|
|
|
|
local entity te;
|
|
|
|
|
|
|
|
|
|
te = find(world, classname, "player");
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (Teammate(te.team_no,ignore.team_no) && te != ignore)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(te, PRINT_HIGH, st);
|
|
|
|
|
sprint(te, PRINT_HIGH, st2);
|
|
|
|
|
sprint(te, PRINT_HIGH, st3);
|
|
|
|
|
sprint(te, PRINT_HIGH, st4);
|
|
|
|
|
sprint(te, PRINT_HIGH, st5);
|
|
|
|
|
sprint(te, PRINT_HIGH, st6);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = find(te, classname, "player");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==========================================================
|
|
|
|
|
// same shit but ignores 2 players
|
|
|
|
|
|
|
|
|
|
void(entity ignore, entity ignore2, string st, string st2, string st3, string st4, string st5, string st6) teamsprintbi =
|
|
|
|
|
{
|
|
|
|
|
local entity te;
|
|
|
|
|
|
|
|
|
|
te = find(world, classname, "player");
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (Teammate(te.team_no,ignore.team_no) && te != ignore && te != ignore2)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(te, PRINT_HIGH, st);
|
|
|
|
|
sprint(te, PRINT_HIGH, st2);
|
|
|
|
|
sprint(te, PRINT_HIGH, st3);
|
|
|
|
|
sprint(te, PRINT_HIGH, st4);
|
|
|
|
|
sprint(te, PRINT_HIGH, st5);
|
|
|
|
|
sprint(te, PRINT_HIGH, st6);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = find(te, classname, "player");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//================================================//
|
|
|
|
|
// Kicks any player with no TF skin on tforttm.qc //
|
|
|
|
|
//================================================//
|
|
|
|
|
|
|
|
|
|
float (string skin_str) Is_TF_Skin =
|
|
|
|
|
{
|
|
|
|
|
// if relax_cheatcheck is "on" return its a valid skin
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (relax_cheatcheck==1) return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if ( skin_str != "tf_scout"
|
|
|
|
|
&& skin_str != "tf_snipe"
|
|
|
|
|
&& skin_str != "tf_sold"
|
|
|
|
|
&& skin_str != "tf_demo"
|
|
|
|
|
&& skin_str != "tf_medic"
|
|
|
|
|
&& skin_str != "tf_hwguy"
|
|
|
|
|
&& skin_str != "tf_pyro"
|
|
|
|
|
&& skin_str != "tf_spy"
|
|
|
|
|
&& skin_str != "tf_eng")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//============================================================================//
|
|
|
|
|
// Return the new "NICE" color for the team corresponding to the no passed in //
|
|
|
|
|
//============================================================================//
|
|
|
|
|
|
2001-07-24 20:54:19 +00:00
|
|
|
|
/*string (float tno) TeamGetNiceColor =
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
if (tno == 1)
|
|
|
|
|
return "2 13";
|
|
|
|
|
if (tno == 2)
|
|
|
|
|
return "9 4";
|
|
|
|
|
if (tno == 3)
|
|
|
|
|
return "5 12";
|
|
|
|
|
if (tno == 4)
|
|
|
|
|
return "3 11";
|
|
|
|
|
|
2001-07-23 05:46:14 +00:00
|
|
|
|
return "";
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
2001-07-24 20:54:19 +00:00
|
|
|
|
*/
|
|
|
|
|
float (float tno) TeamGetNiceColor =
|
|
|
|
|
{
|
|
|
|
|
if (nicecolors == 1)
|
|
|
|
|
{
|
|
|
|
|
if (tno == 1)
|
|
|
|
|
return 2;
|
|
|
|
|
if (tno == 2)
|
|
|
|
|
return 9;
|
|
|
|
|
if (tno == 3)
|
|
|
|
|
return 5;
|
|
|
|
|
if (tno == 4)
|
|
|
|
|
return 3;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (tno == 1)
|
|
|
|
|
return 13;
|
|
|
|
|
if (tno == 2)
|
|
|
|
|
return 4;
|
|
|
|
|
if (tno == 3)
|
|
|
|
|
return 12;
|
|
|
|
|
if (tno == 4)
|
|
|
|
|
return 11;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
};
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
float (float tno, float theColor ) IsValidTopColor =
|
|
|
|
|
{
|
|
|
|
|
theColor = floor(theColor);
|
|
|
|
|
|
|
|
|
|
// if relax_cheatcheck is "on" return its a valid color value
|
|
|
|
|
if (relax_cheatcheck==1)
|
|
|
|
|
{
|
|
|
|
|
if (theColor > 13 || theColor < 0)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (tno == 1)
|
|
|
|
|
{
|
|
|
|
|
if (theColor == 4)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (number_of_teams > 2 && theColor == 12)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (number_of_teams > 3 && theColor == 11)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tno == 2)
|
|
|
|
|
{
|
|
|
|
|
if (theColor == 13)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (number_of_teams > 2 && theColor == 12)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (number_of_teams > 3 && theColor == 11)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tno == 3)
|
|
|
|
|
{
|
|
|
|
|
if (theColor==4||theColor==13)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (number_of_teams > 3 && theColor == 11)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tno == 4 && (theColor==4||theColor==13||theColor==12))
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tno == 1 && (theColor==2||theColor==13))
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (tno == 2 && (theColor==9||theColor==4))
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (tno == 3 && (theColor==12||theColor==5))
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (tno == 4 && (theColor==11||theColor==3))
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//==========================//
|
|
|
|
|
// The new holograph device //
|
|
|
|
|
//==========================//
|
|
|
|
|
void(entity player) UpdateCells =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (player.current_weapon == WEAP_SPANNER
|
|
|
|
|
|| player.current_weapon == WEAP_LIGHTNING
|
|
|
|
|
|| player.current_weapon == WEAP_FLAMETHROWER
|
|
|
|
|
|| player.current_weapon == WEAP_DAEDALUS
|
|
|
|
|
|| player.current_weapon == WEAP_LASERCANNON)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
player.currentammo = player.ammo_cells;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
player.items = player.items | IT_CELLS;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(entity player) ActivateHolo =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (!(player.cutf_items & CUTF_HOLO))
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
//sprint(player, PRINT_MEDIUM, "You do not have the holograph!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (player.has_holo == 2) return; // avoids overflow, turns to 1 after first think
|
|
|
|
|
|
|
|
|
|
if (player.ammo_cells < 10 && player.has_holo == 0)
|
|
|
|
|
{
|
|
|
|
|
local string st;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(player, PRINT_HIGH, "Your holograph needs ");
|
|
|
|
|
st=ftos(HOLO_POWER_COST);
|
|
|
|
|
sprint(player, PRINT_HIGH, st);
|
|
|
|
|
sprint(player, PRINT_HIGH," cells at least!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (player.has_holo == 1)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(player, PRINT_HIGH, "You turn off the holograph device\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
RemoveHolo(player);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
newmis = spawn();
|
2001-07-23 20:52:47 +00:00
|
|
|
|
newmis.solid = SOLID_NOT;
|
|
|
|
|
newmis.movetype = MOVETYPE_NOCLIP;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
newmis.origin = player.origin;
|
|
|
|
|
newmis.angles = player.angles;
|
|
|
|
|
newmis.colormap = player.colormap;
|
|
|
|
|
newmis.skin = player.skin;
|
|
|
|
|
setmodel (newmis, "progs/player.mdl");
|
|
|
|
|
newmis.classname = "holo";
|
|
|
|
|
newmis.owner=player;
|
|
|
|
|
newmis.frame=player.frame;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
newmis.nextthink = time + HOLO_CYCLE_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
newmis.think = HoloThink;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
newmis.effects = EF_DIMLIGHT;
|
|
|
|
|
player.ammo_cells = player.ammo_cells - HOLO_POWER_COST;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
UpdateCells(player);
|
|
|
|
|
|
|
|
|
|
stuffcmd (player, "bf\nbf\n");
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(player,PRINT_HIGH,"you turn on your holograph...\n");
|
|
|
|
|
sound (newmis, CHAN_MISC, "effects/bodyhit2.wav", 0.5, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
player.has_holo = 2; // 2 makes it wait until first think for turning off the holo
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() HoloThink =
|
|
|
|
|
{
|
|
|
|
|
//local entity oldself;
|
|
|
|
|
|
|
|
|
|
if (self.owner.ammo_cells < 1)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self.owner, PRINT_MEDIUM, "your hologram runs out of energy\n");
|
|
|
|
|
sound (self, CHAN_MISC, "effects/bodyhit1.wav", 0.6, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
spawnFOG(self.origin);
|
|
|
|
|
self.owner.has_holo = 0;
|
|
|
|
|
dremove(self);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
self.owner.ammo_cells = self.owner.ammo_cells - HOLO_CYCLE_COST;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
/*oldself = self;
|
|
|
|
|
self = self.owner;
|
|
|
|
|
W_SetCurrentAmmo();
|
|
|
|
|
self = oldself;*/
|
|
|
|
|
|
|
|
|
|
UpdateCells(self.owner);
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
self.nextthink = time + HOLO_CYCLE_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
self.owner.has_holo = 1; // ready to be turned off
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void (entity player) RemoveHolo =
|
|
|
|
|
{
|
|
|
|
|
local entity te;
|
|
|
|
|
te = find(world, classname, "holo");
|
|
|
|
|
while (te)
|
|
|
|
|
{
|
|
|
|
|
if (te.owner == player) {
|
|
|
|
|
te.owner.has_holo = 0;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sound (te, CHAN_MISC, "effects/bodyhit1.wav", 0.6, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
spawnFOG(te.origin);
|
|
|
|
|
dremove(te);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
te = find(te, classname, "holo");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//===========================//
|
|
|
|
|
// THE FLARES ARE BACK! hehe //
|
|
|
|
|
//===========================//
|
|
|
|
|
|
|
|
|
|
void() FlareBounce;
|
|
|
|
|
|
|
|
|
|
//---------------------------//
|
|
|
|
|
// Flare touch function. //
|
|
|
|
|
|
|
|
|
|
void() FlareGrenadeTouch =
|
|
|
|
|
{
|
|
|
|
|
if (other == self.owner)
|
|
|
|
|
return; // don't bounce on owner
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (pointcontents(self.origin) == CONTENT_SKY || pointcontents(self.origin) == CONTENT_SOLID) // if in wall or sky
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
dremove(self);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (self.has_holo==0)
|
|
|
|
|
{
|
|
|
|
|
self.skin=1;
|
|
|
|
|
//setmodel (self, "progs/flare.mdl");
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (other == world && self.movetype != MOVETYPE_BOUNCE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
self.velocity = '0 0 0';
|
|
|
|
|
|
|
|
|
|
if (random()<0.6)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sound (self, CHAN_MISC, "effects/bodyhit2.wav", 0.7, ATTN_NORM); // bounce sound
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sound (self, CHAN_MISC, "effects/bodyhit1.wav", 0.6, ATTN_NORM); // bounce sound
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
self.movetype = MOVETYPE_BOUNCE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
self.avelocity = '1000 200 850';
|
|
|
|
|
self.touch = FlareBounce;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (self.velocity == '0 0 0')
|
|
|
|
|
self.avelocity = '0 0 0';
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() FlareBounce =
|
|
|
|
|
{
|
|
|
|
|
if (other == self.owner)
|
|
|
|
|
return; // don't bounce on owner
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self.velocity == '0 0 0')
|
|
|
|
|
self.avelocity = '0 0 0';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//---------------------------//
|
|
|
|
|
// Flare grenade explosion. //
|
|
|
|
|
|
|
|
|
|
void() FlareGrenadeExplode =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sound (self, CHAN_MISC, "items/flare1.wav", 1, ATTN_NORM);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
//setmodel (self, "progs/flare.mdl");
|
|
|
|
|
self.skin=0;
|
|
|
|
|
self.has_holo=1;
|
|
|
|
|
|
|
|
|
|
local vector org;
|
|
|
|
|
org=self.origin;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
|
|
|
|
WriteByte (MSG_BROADCAST, TE_GUNSHOT);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#ifdef QUAKE_WORLD
|
2001-07-23 20:52:47 +00:00
|
|
|
|
WriteByte (MSG_MULTICAST, 3);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#endif
|
2001-07-23 20:52:47 +00:00
|
|
|
|
WriteCoord (MSG_BROADCAST, org_x);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, org_y);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, org_z);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#ifdef QUAKE_WORLD
|
2001-07-23 20:52:47 +00:00
|
|
|
|
multicast (org, MULTICAST_PVS);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
self.effects = self.effects | EF_DIMLIGHT;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
self.think = SUB_Remove;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
self.nextthink = time + FLARE_DURATION;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//========================================================//
|
|
|
|
|
// My stupid contributions to optimize something! //
|
|
|
|
|
//========================================================//
|
|
|
|
|
|
|
|
|
|
float(entity thing) IsMonster =
|
|
|
|
|
{
|
|
|
|
|
if (thing.classname=="monster_shambler")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (thing.classname=="monster_demon1")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (thing.classname=="monster_wizard")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (thing.classname=="monster_army")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (thing.classname=="monster_knight")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (thing.classname=="monster_hknight")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
float(entity thing) IsMonsterNonArmy =
|
|
|
|
|
{
|
|
|
|
|
if (thing.classname=="monster_shambler")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (thing.classname=="monster_demon1")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (thing.classname=="monster_wizard")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (thing.classname=="monster_knight")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (thing.classname=="monster_hknight")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
float(entity player) HasMonster =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if ((player.job & JOB_WARLOCK && player.job & JOB_DEMON_OUT)
|
|
|
|
|
||(player.job & JOB_ARMY && player.job & JOB_DEMON_OUT))
|
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string(entity themonster) GetMonsterName =
|
|
|
|
|
{
|
|
|
|
|
if (themonster.classname == "monster_wizard")
|
|
|
|
|
return "scrag";
|
|
|
|
|
if (themonster.classname == "monster_shambler")
|
|
|
|
|
return "shambler";
|
|
|
|
|
if (themonster.classname == "monster_demon1")
|
|
|
|
|
return "fiend";
|
|
|
|
|
if (themonster.classname == "monster_army")
|
|
|
|
|
return "army soldier";
|
|
|
|
|
if (themonster.classname == "monster_knight")
|
|
|
|
|
return "knight";
|
|
|
|
|
if (themonster.classname == "monster_hknight")
|
|
|
|
|
return "hell knight";
|
|
|
|
|
|
|
|
|
|
return "unknown monster";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(entity themonster) KillTheMonster =
|
|
|
|
|
{
|
|
|
|
|
local entity oself;
|
|
|
|
|
oself=self;
|
|
|
|
|
|
|
|
|
|
self=themonster;
|
|
|
|
|
|
|
|
|
|
if (themonster.classname == "monster_wizard")
|
|
|
|
|
wiz_die();
|
|
|
|
|
else if (themonster.classname == "monster_shambler")
|
|
|
|
|
custom_shambler_die();
|
|
|
|
|
else if (themonster.classname == "monster_demon1")
|
|
|
|
|
custom_demon_die();
|
|
|
|
|
else if (themonster.classname == "monster_army")
|
|
|
|
|
custom_grunt_die();
|
|
|
|
|
else if (themonster.classname == "monster_knight")
|
|
|
|
|
knight_die();
|
|
|
|
|
else if (themonster.classname == "monster_hknight")
|
|
|
|
|
hknight_die();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self=oself;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string(entity thebuilding) GetBuildingName =
|
|
|
|
|
{
|
|
|
|
|
if (thebuilding.classname == "building_dispenser")
|
|
|
|
|
return "dispenser";
|
|
|
|
|
if (thebuilding.classname == "building_sentrygun")
|
|
|
|
|
return "sentry gun";
|
|
|
|
|
if (thebuilding.classname == "building_tesla")
|
|
|
|
|
return "tesla sentry";
|
|
|
|
|
if (thebuilding.classname == "building_sensor")
|
|
|
|
|
return "motion sensor";
|
|
|
|
|
if (thebuilding.classname == "building_camera")
|
|
|
|
|
return "security camera";
|
|
|
|
|
if (thebuilding.classname == "building_teleporter")
|
|
|
|
|
return "teleporter";
|
|
|
|
|
if (thebuilding.classname == "building_fieldgen")
|
|
|
|
|
return "field generator";
|
|
|
|
|
|
|
|
|
|
return "unknown stuff";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// soldiers don't target unoffensive buildings, or cloaked teslas!
|
|
|
|
|
float(entity thebuilding) IsOffenseBuilding =
|
|
|
|
|
{
|
|
|
|
|
if (!IsBuilding(thebuilding))
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (thebuilding.classname == "building_sentrygun")
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (thebuilding.classname == "building_tesla")
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (thebuilding.tf_items & NIT_TESLA_CLOAKING)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
if (thebuilding.job == 2)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE; // tesla is uncloaked, so soldier can see it
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
string(entity thething) GetEnemyName =
|
|
|
|
|
{
|
|
|
|
|
if (thething.classname == "player")
|
|
|
|
|
return thething.netname;
|
|
|
|
|
|
|
|
|
|
if (IsMonster(thething))
|
|
|
|
|
return GetMonsterName(thething);
|
|
|
|
|
|
|
|
|
|
if (IsBuilding(thething))
|
|
|
|
|
return GetBuildingName(thething);
|
|
|
|
|
|
|
|
|
|
if (thething.classname == "grenade" && thething.netname == "land_mine")
|
|
|
|
|
return "land mine";
|
|
|
|
|
|
|
|
|
|
if (thething.classname != "")
|
|
|
|
|
return thething.classname;
|
|
|
|
|
|
|
|
|
|
return "unknown stuff";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//======================================================//
|
|
|
|
|
void() ExpBodyThink;
|
|
|
|
|
|
|
|
|
|
void(entity body) ExpBody =
|
|
|
|
|
{
|
|
|
|
|
newmis=spawn();
|
|
|
|
|
newmis.owner=body;
|
|
|
|
|
newmis.think=ExpBodyThink;
|
|
|
|
|
newmis.nextthink=time;
|
|
|
|
|
newmis.origin=body.origin;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() ExpBodyThink =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
//deathmsg = DMSG_EXPBODY;
|
|
|
|
|
TF_T_Damage(self.owner, self.owner, self.owner.martyr_enemy, self.owner.health + 60, TF_TD_IGNOREARMOUR, TF_TD_OTHER);// TF_TD_OTHER);
|
|
|
|
|
|
|
|
|
|
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
|
|
|
|
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, self.origin_x);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, self.origin_y);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, self.origin_z);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#ifdef QUAKE_WORLD
|
2001-07-23 20:52:47 +00:00
|
|
|
|
multicast (self.origin, MULTICAST_PHS);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
deathmsg = DMSG_EXPBODY;
|
|
|
|
|
T_RadiusDamage (self.owner, self.owner, EXPBODY_DMG, self.owner);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
// self.owner.is_abouttodie = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
dremove(self);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//===========================================//
|
|
|
|
|
|
|
|
|
|
void(vector where) spawnFOG =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
|
|
|
|
WriteByte (MSG_BROADCAST, TE_TELEPORT);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, where_x);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, where_y);
|
|
|
|
|
WriteCoord (MSG_BROADCAST, where_z);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#ifdef QUAKE_WORLD
|
2001-07-23 20:52:47 +00:00
|
|
|
|
multicast (where, MULTICAST_PHS);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
#endif
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//=========================================================//
|
|
|
|
|
// called on any try to dismantle something from menu.qc
|
|
|
|
|
// returns true if the thing should be dismantled
|
|
|
|
|
float() CheckEnemyDismantle =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (Teammate(self.building.real_owner.team_no,self.team_no)) return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
local string st;
|
|
|
|
|
st=GetBuildingName(self.building);
|
|
|
|
|
|
|
|
|
|
if (GetICELevel(self.building) == 1 && random() > 0.5)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "This ");
|
|
|
|
|
sprint(self, PRINT_HIGH, st);
|
|
|
|
|
sprint(self, PRINT_HIGH, " isn't easy to dismantle, it has a level 1 ICE!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH, "Somebody is trying to dismantle your ");
|
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH,st);
|
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH, "!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
else if (GetICELevel(self.building) == 2)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "You can't dismantle this ");
|
|
|
|
|
sprint(self, PRINT_HIGH, st);
|
|
|
|
|
sprint(self, PRINT_HIGH, ", it's protected with a level 2 ICE!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH, "Somebody tried to dismantle your ");
|
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH,st);
|
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH, "!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
else if (GetICELevel(self.building) == 3)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self, PRINT_HIGH, "This ");
|
|
|
|
|
sprint(self, PRINT_HIGH, st);
|
|
|
|
|
sprint(self, PRINT_HIGH, " is protected with a level 3 ICE!\n");
|
|
|
|
|
deathmsg=DMSG_ANTIDISM;
|
|
|
|
|
TF_T_Damage(self, self, self.building, self.health + 50, TF_TD_IGNOREARMOUR, TF_TD_OTHER);
|
|
|
|
|
sound (self, CHAN_MISC, "effects/crunch.wav", 1, ATTN_NONE);
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_MEDIUM, self.building.real_owner.netname);
|
|
|
|
|
bprint(PRINT_MEDIUM, "'s ");
|
|
|
|
|
bprint(PRINT_MEDIUM, st);
|
|
|
|
|
bprint(PRINT_MEDIUM, " has been dismantled by ");
|
|
|
|
|
bprint(PRINT_MEDIUM, self.netname);
|
|
|
|
|
bprint(PRINT_MEDIUM, "\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH, "The enemy has dismantled your ");
|
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH, st);
|
|
|
|
|
sprint(self.building.real_owner, PRINT_HIGH, "!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
#ifdef QUAKE_WORLD
|
|
|
|
|
logfrag(self, self.building.real_owner);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
self.real_frags = self.real_frags + 1;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (!(toggleflags & TFLAG_TEAMFRAGS))
|
2001-07-17 05:58:10 +00:00
|
|
|
|
self.frags = self.real_frags;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//- OfN - Checks spots are visible between them
|
|
|
|
|
float (vector spot1, vector spot2) vis2orig =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
traceline (spot1, spot2, TRUE, world); // see through other monsters
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (trace_inopen && trace_inwater)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return FALSE; // sight line crossed contents
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
if (trace_fraction == 1 && trace_endpos == spot2) //CH just extra check
|
2001-07-23 20:52:47 +00:00
|
|
|
|
return TRUE;
|
|
|
|
|
return FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//=========================================================================
|
|
|
|
|
// Return the number of players in game
|
|
|
|
|
float() GetNoPlayers =
|
|
|
|
|
{
|
|
|
|
|
local float num_players;
|
|
|
|
|
local entity search;
|
|
|
|
|
|
|
|
|
|
search = find (world, classname, "player");
|
|
|
|
|
while (search != world)
|
|
|
|
|
{
|
|
|
|
|
num_players = num_players + 1;
|
|
|
|
|
search = find (search, classname, "player");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return num_players;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//==================================================================
|
|
|
|
|
// prints the overall resutls, best player etc.. on intermission
|
|
|
|
|
|
|
|
|
|
entity() GetBestPlayer =
|
|
|
|
|
{
|
|
|
|
|
local float bestscore, tempscore;
|
|
|
|
|
local entity theplayer, search;
|
|
|
|
|
|
|
|
|
|
theplayer = world;
|
|
|
|
|
search = world;
|
|
|
|
|
bestscore = 0;
|
|
|
|
|
|
|
|
|
|
search = find (world, classname, "player");
|
|
|
|
|
while (search != world)
|
|
|
|
|
{
|
|
|
|
|
if (search.frags > bestscore)
|
|
|
|
|
{
|
|
|
|
|
bestscore = search.frags;
|
|
|
|
|
theplayer = search;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
search = find (search, classname, "player");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return theplayer;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
entity() GetBestKiller =
|
|
|
|
|
{
|
|
|
|
|
local float bestscore, tempscore;
|
|
|
|
|
local entity theplayer, search;
|
|
|
|
|
|
|
|
|
|
theplayer = world;
|
|
|
|
|
search = world;
|
|
|
|
|
bestscore = 0;
|
|
|
|
|
|
|
|
|
|
search = find (world, classname, "player");
|
|
|
|
|
while (search != world)
|
|
|
|
|
{
|
|
|
|
|
if (search.frags - TeamFortress_TeamGetScore(search.team_no) > bestscore && search.team_no > 0)
|
|
|
|
|
{
|
|
|
|
|
bestscore = search.frags - TeamFortress_TeamGetScore(search.team_no);
|
|
|
|
|
theplayer = search;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
search = find (search, classname, "player");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return theplayer;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() bprintline =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void() PrintResults =
|
|
|
|
|
{
|
|
|
|
|
local string winteam;
|
|
|
|
|
local entity theplayer;
|
|
|
|
|
|
|
|
|
|
bprintline();
|
|
|
|
|
|
|
|
|
|
if (time >= timelimit)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"Time limit reached!\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"Map ");
|
|
|
|
|
bprint(PRINT_HIGH,mapname);
|
|
|
|
|
bprint(PRINT_HIGH," was played for ");
|
|
|
|
|
bprint(PRINT_HIGH,ftos(floor(time/60)));
|
|
|
|
|
bprint(PRINT_HIGH," minutes.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
winteam = GetTrueTeamName(TeamFortress_TeamGetWinner());
|
|
|
|
|
|
|
|
|
|
if (winteam != "ERROR")
|
|
|
|
|
{
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,winteam);
|
|
|
|
|
bprint(PRINT_HIGH," team <20><><EFBFBD><EFBFBD> the game!!\n\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
theplayer = GetBestPlayer();
|
|
|
|
|
|
|
|
|
|
if (theplayer != world)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,theplayer.netname);
|
|
|
|
|
bprint(PRINT_HIGH," (");
|
|
|
|
|
bprint(PRINT_HIGH,GetTrueTeamName(theplayer.team_no));
|
|
|
|
|
bprint(PRINT_HIGH,") with ");
|
|
|
|
|
bprint(PRINT_HIGH,ftos(floor(theplayer.frags)));
|
|
|
|
|
bprint(PRINT_HIGH," frags.");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"None.");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"\n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
theplayer = GetBestKiller();
|
|
|
|
|
|
|
|
|
|
if (theplayer != world)
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,theplayer.netname);
|
|
|
|
|
bprint(PRINT_HIGH," (");
|
|
|
|
|
bprint(PRINT_HIGH,GetTrueTeamName(theplayer.team_no));
|
|
|
|
|
bprint(PRINT_HIGH,") with ");
|
|
|
|
|
bprint(PRINT_HIGH,ftos(floor(theplayer.frags - TeamFortress_TeamGetScore(theplayer.team_no))));
|
|
|
|
|
bprint(PRINT_HIGH," kills.");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"None.");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
bprint(PRINT_HIGH,"\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
bprintline();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//======================================================================================
|
|
|
|
|
// called on clientobituary to check if warlock knife kills should be increased
|
|
|
|
|
|
|
|
|
|
void(entity attacker) MonsterKill =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (attacker.job & JOB_WARLOCK)
|
|
|
|
|
if (deathmsg == DMSG_AXE || deathmsg == DMSG_BACKSTAB)
|
|
|
|
|
if (attacker.demon_blood < MAX_KNIFE_BLOOD)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
attacker.demon_blood = attacker.demon_blood + 1;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//===============================================================================
|
|
|
|
|
// this function returns the max amount of grens a player can carry
|
|
|
|
|
|
|
|
|
|
float(entity theplayer, float grenslot) GetMaxGrens =
|
|
|
|
|
{
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tf_items & NIT_AMMO_BANDOLIER) // player can carry more grens cause he got bandolier
|
2001-07-17 05:58:10 +00:00
|
|
|
|
{
|
|
|
|
|
if (grenslot == 2) //2nd slot
|
|
|
|
|
{
|
|
|
|
|
if (theplayer.tp_grenades_2 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_NAIL)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_FRAG)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 4;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_CALTROP)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 4;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_MIRV)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_FLARE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 8;
|
|
|
|
|
|
|
|
|
|
return 5;
|
|
|
|
|
}
|
|
|
|
|
else // first slot, or bug :)
|
|
|
|
|
{
|
|
|
|
|
if (theplayer.tp_grenades_1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_NAIL)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_FRAG)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 4;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_CALTROP)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 4;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_MIRV)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_FLARE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 8;
|
|
|
|
|
|
|
|
|
|
return 5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (grenslot == 2) //2nd slot
|
|
|
|
|
{
|
|
|
|
|
if (theplayer.tp_grenades_2 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_NAIL)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 2;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_FRAG)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_CALTROP)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_MIRV)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 2;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_FLARE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 6;
|
|
|
|
|
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
|
|
|
|
else // first slot, or bug :)
|
|
|
|
|
{
|
|
|
|
|
if (theplayer.tp_grenades_1 == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_NAIL)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 2;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_FRAG)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_2 == GR_TYPE_CALTROP)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 3;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_MIRV)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 2;// was 1
|
2001-07-23 20:52:47 +00:00
|
|
|
|
if (theplayer.tp_grenades_1 == GR_TYPE_FLARE)
|
2001-07-17 05:58:10 +00:00
|
|
|
|
return 6;
|
|
|
|
|
|
|
|
|
|
return 4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0; // shouldnt happen ever.
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//=====================================================//
|
|
|
|
|
|
|
|
|
|
/*void(entity attacker) Check_PainInflictor =
|
|
|
|
|
{
|
|
|
|
|
if (self.health <= 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
local entity real_attacker;
|
|
|
|
|
real_attacker = attacker;
|
|
|
|
|
|
|
|
|
|
if (!IsMonster(attacker) && attacker.classname!="player")
|
|
|
|
|
{
|
|
|
|
|
if (!IsMonster(atta
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self.enemy!=self && self.enemy!=world && self.enemy!=attacker && self.enemy!=attacker.owner)
|
|
|
|
|
{
|
|
|
|
|
if (!visible(self.enemy))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};*/
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
void(entity player) SwitchToCamera =
|
|
|
|
|
{
|
|
|
|
|
if (player.classname!="player")
|
|
|
|
|
{
|
|
|
|
|
RPrint("OFTEN BUG REPORT: Object '");
|
|
|
|
|
RPrint(player.classname);
|
|
|
|
|
RPrint("' in SwitchToCamera()\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
local entity camera;
|
|
|
|
|
local float done;
|
|
|
|
|
|
|
|
|
|
if (!player.has_camera)
|
|
|
|
|
return;
|
|
|
|
|
if (player.is_cameraviewing)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// FIXME: no inair, no water, no moving, no haxxxoring, no building, no detpacking, no throwing a det,
|
|
|
|
|
// no feinginG? (special)
|
|
|
|
|
|
|
|
|
|
camera = find(world, classname, "building_camera");
|
|
|
|
|
if (camera.real_owner == player)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
done = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
while (!done)
|
|
|
|
|
{
|
|
|
|
|
camera = find(camera, classname, "building_camera");
|
|
|
|
|
if (camera.real_owner == player)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
done = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
if (camera == world)
|
2001-07-23 20:52:47 +00:00
|
|
|
|
done = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (camera == world)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
msg_entity = player;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
WriteByte(MSG_ONE, SVC_SETVIEWPORT);
|
|
|
|
|
WriteEntity(MSG_ONE, camera);
|
|
|
|
|
WriteByte(MSG_ONE, SVC_SETANGLES);
|
|
|
|
|
WriteAngle(MSG_ONE, camera.angles_x);
|
|
|
|
|
WriteAngle(MSG_ONE, camera.angles_y);
|
|
|
|
|
WriteAngle(MSG_ONE, camera.angles_z);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
//- OfN create the "fake" player image
|
|
|
|
|
newmis=spawn();
|
2001-07-23 20:52:47 +00:00
|
|
|
|
newmis.solid = SOLID_BBOX; //SOLID_BSP
|
|
|
|
|
newmis.movetype = MOVETYPE_NONE;
|
|
|
|
|
newmis.takedamage = DAMAGE_AIM;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
newmis.origin = player.origin;
|
|
|
|
|
newmis.angles = player.angles;
|
|
|
|
|
newmis.colormap = player.colormap;
|
|
|
|
|
newmis.skin = player.skin;
|
|
|
|
|
setmodel (newmis, "progs/player.mdl");
|
|
|
|
|
//setsize (newmis,????); // NEEDED?
|
|
|
|
|
//setorigin (newmis, newmis.origin); // NEEDED?
|
|
|
|
|
newmis.classname = "fake_player";
|
|
|
|
|
newmis.owner=player;
|
|
|
|
|
newmis.frame=player.frame;
|
|
|
|
|
|
|
|
|
|
newmis.th_pain = FakePain;
|
|
|
|
|
newmis.th_die = FakeDie;
|
|
|
|
|
|
|
|
|
|
newmis.max_health = 9999;
|
|
|
|
|
newmis.health = 9999;
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
//newmis.nextthink = time + HOLO_CYCLE_TIME;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
//newmis.think = HoloThink;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
//newmis.effects = EF_DIMLIGHT;
|
|
|
|
|
//player.ammo_cells = player.ammo_cells - HOLO_POWER_COST;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
player.fixangle = TRUE;
|
|
|
|
|
player.is_cameraviewing = TRUE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
player.t_s_h = player.weaponmodel; // FIXME: reloading<6E>?
|
|
|
|
|
player.weaponmodel= ""; // FIXME: reloading<6E>?
|
|
|
|
|
player.view_ofs = '0 0 0';
|
|
|
|
|
|
|
|
|
|
setorigin (player, camera.origin);
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
sprint(player, PRINT_HIGH, "Camera view activated.\n");
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void(entity player) SwitchFromCamera =
|
|
|
|
|
{
|
|
|
|
|
if (player.classname!="player")
|
|
|
|
|
{
|
|
|
|
|
RPrint("OFTEN BUG REPORT: Object '");
|
|
|
|
|
RPrint(player.classname);
|
|
|
|
|
RPrint("' in SwitchFromCamera()\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!player.has_camera)
|
|
|
|
|
return;
|
|
|
|
|
if (!player.is_cameraviewing)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
|
|
msg_entity = player;
|
2001-07-23 20:52:47 +00:00
|
|
|
|
WriteByte(MSG_ONE, SVC_SETVIEWPORT);
|
|
|
|
|
WriteEntity(MSG_ONE, player);
|
|
|
|
|
WriteByte(MSG_ONE, SVC_SETANGLES);
|
|
|
|
|
WriteAngle(MSG_ONE, player.angles_x);
|
|
|
|
|
WriteAngle(MSG_ONE, player.angles_y);
|
|
|
|
|
WriteAngle(MSG_ONE, player.angles_z);
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
player.fixangle = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
|
|
|
|
|
player.weaponmodel = player.t_s_h; // FIXME: reloading<6E>?
|
|
|
|
|
player.view_ofs = '0 0 22';
|
|
|
|
|
|
2001-07-23 20:52:47 +00:00
|
|
|
|
player.is_cameraviewing = FALSE;
|
2001-07-17 05:58:10 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
2001-07-23 05:46:14 +00:00
|
|
|
|
// hola
|