1
0
Fork 0
forked from fte/fteqw

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3480 fc73d0e0-1445-4013-8a0c-d673dee63da5

This commit is contained in:
Magnus 2009-11-26 20:38:53 +00:00
parent f3350239fc
commit 6401a36d2e
6 changed files with 185 additions and 24 deletions

View file

@ -346,7 +346,8 @@ void() execute_changelevel =
localcmd("map r_bunker\n");
localcmd(strcat("map ", self.map, "\n"));
};
@ -385,6 +386,8 @@ void() changelevel_touch =
sprint (other, 2,"there are still bombs to disarm.\n");
return;
}
else
localcmd(strcat("map ", self.map, "\n"));
if (world.map_obj == OBJ_HOSTAGE && hostages > 0)
return;
@ -412,7 +415,7 @@ void() changelevel_touch =
other = find (other, classname, "player");
}
localcmd("serverinfo objective return\n");
//localcmd("serverinfo objective return\n");
SUB_UseTargets ();
@ -1651,6 +1654,10 @@ void() PlayerPreThink =
SneakLevel();
self.accept = 0;
if (self.safezone > 0)
self.safezone = self.safezone - 1;
self.endinfo1 = rescue;
self.endinfo2 = dead_hostage;
self.endinfo3 = hostages;
@ -1742,6 +1749,8 @@ void() PlayerPreThink =
if (self.cycle2 < time)
{
if (self.blurtime > 0 && self.blurtime <= 1)
stuffcmd(self, "gl_motionblur 0\n");
else if (self.blurtime > 0)
@ -1780,7 +1789,11 @@ void() PlayerPreThink =
if (self.musictimer == 0)
{
if (world.model == "maps/r_bunker.bsp")
if (self.soundmode == 1)
stuffcmd(self, "play music/exploring\n");
else if (self.soundmode == 2)
stuffcmd(self, "play music/vault\n");
else if (world.model == "maps/r_bunker.bsp")
stuffcmd(self, "play music/vault\n");
else if (world.map_obj == OBJ_DEADTOWN)
stuffcmd(self, "play music/afterglow\n");
@ -2693,5 +2706,12 @@ void(entity targ, entity attacker) ClientObituary =
void() Identify =
{
return;
local vector source;
makevectors (self.v_angle);
source = self.origin + '0 0 0';
traceline (source, source + v_forward*128, FALSE, self);
if (trace_ent.netname)
centerprint (self, trace_ent.netname);
};

View file

@ -43,7 +43,7 @@ float mouseisdown;
#define IMGSIZEZ ('1 1 0'*IMGSIZEX)
#define IMGSIZEQ ('1 1 0'*2)
#define CURSORSIZE 8
#define CURSORSIZE 32
@ -1020,7 +1020,7 @@ void() Invent_Draw =
op = floor((mousepos_y - contextpos_y)/8);
drawstring(contextpos + (0 * ('0 8 0'*(scrwidth/640))), "use", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=0)*'0 0 1'*(scrwidth/640), 1);
drawstring(contextpos + (2 * ('0 8 0'*(scrwidth/640))), "drop", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=2)*'0 0 1'*(scrwidth/640), 1);
if (getstati(108) == 1)
if (getstati(108) > 0)
drawstring(contextpos + (4 * ('0 8 0'*(scrwidth/640))), "sell", '8 8 0'*(scrwidth/640), '1 1 0'*(scrwidth/640) + (op!=4)*'0 0 1'*(scrwidth/640), 1);
}
@ -1186,7 +1186,7 @@ float(float eventtype, float param1, float param2) CSQC_InputEvent =
show_items = false;
show_gainperk = false;
}
if (param1 == 'b' && (getstati(108) == 1))
if (param1 == 'b' && (getstati(108) > 0))
{
show_trader = !show_trader;
show_pipboy = false;

View file

@ -123,16 +123,6 @@ void() Time_Draw =
local float xtime, ytime, ztime, obj;
local string qtime, rtime, shadowtime, text, text2;
xtime = getstati(63);
ytime = floor(xtime/60);
ztime = xtime - (ytime*60);
qtime = ftos(ytime);
rtime = ftos(ztime);
shadowtime = ftos(getstati(63));
drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.86)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8'*(scrwidth/640), '1 1 1', 1);
obj = getstati(66);
if (obj == 1)
@ -143,12 +133,27 @@ void() Time_Draw =
text = "assassinate commanders\n";
if (obj == 4)
text = "rescue citizens\n";
else
text = "no active mission.\n";
drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.86)), text, '8 8 8'*(scrwidth/640), '1 1 1', 1);
xtime = getstati(63);
ytime = floor(xtime/60);
ztime = xtime - (ytime*60);
qtime = ftos(ytime);
rtime = ftos(ztime);
shadowtime = ftos(getstati(63));
if (obj >= 1)
drawstring('0 0 0'+('1 0 0'*(scrwidth*0.25))+('0 1 0'*(scrheight*0.88)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8'*(scrwidth/640), '1 1 1', 1);
drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.88)), text, '8 8 8'*(scrwidth/640), '1 1 1', 1);
if (obj >= 1)
{
text = "citizens rescued: ";
text2 = ftos(getstati(113));
drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.90)), strcat(text, text2), '8 8 8'*(scrwidth/640), '1 1 1', 1);
@ -160,6 +165,7 @@ void() Time_Draw =
text = "citizens left: ";
text2 = ftos(getstati(115));
drawstring('0 0 0'+('1 0 0'*(scrwidth*0.03))+('0 1 0'*(scrheight*0.94)), strcat(text, text2), '8 8 8'*(scrwidth/640), '1 1 1', 1);
}
};

View file

@ -684,6 +684,7 @@ float intermission_running;
.float shadowskill_speech;
.float musictimer;
.float soundmode;
.float rescued;
.float scale;

View file

@ -909,10 +909,139 @@ void() misc_noisemaker =
};
void() explore_think =
{
local entity te;
self.think = explore_think;
self.nextthink = time + 0.5;
te = findradius(self.origin, 128);
while (te.classname == "player")
{
if (te.soundmode != 1)
{
te.musictimer = 0;
te.soundmode = 1;
}
te = te.chain;
}
};
void() sound_explore =
{
self.think = explore_think;
self.nextthink = time + 0.5;
};
void() vault_think =
{
local entity te;
self.think = vault_think;
self.nextthink = time + 0.5;
te = findradius(self.origin, 128);
while (te.classname == "player")
{
if (te.soundmode != 2)
{
te.musictimer = 0;
te.soundmode = 2;
}
te = te.chain;
}
};
void() sound_vault =
{
self.think = vault_think;
self.nextthink = time + 0.5;
};
void() env_grass1 =
{
local entity grass;
setmodel (self, "progs/grass1.spr");
self.touch = SUB_Null;
self.solid = SOLID_NOT;
setsize (self, '-16 -16 -16', '16 16 0');
self.takedamage = DAMAGE_NO;
self.classname = "env_grass";
self.movetype = MOVETYPE_BOUNCE;
grass = spawn();
grass.origin = self.origin;
setmodel (grass, "progs/grass1.spr");
grass.touch = SUB_Null;
grass.solid = SOLID_NOT;
setsize (grass, '-16 -16 -16', '16 16 0');
grass.takedamage = DAMAGE_NO;
grass.classname = "env_grass";
grass.angles_y = grass.angles_y + 90;
grass.movetype = MOVETYPE_BOUNCE;
};
void() env_grass2 =
{
local entity grass;
setmodel (self, "progs/grass2.spr");
self.touch = SUB_Null;
self.solid = SOLID_NOT;
setsize (self, '-16 -16 -16', '16 16 0');
self.takedamage = DAMAGE_NO;
self.classname = "env_grass";
self.movetype = MOVETYPE_BOUNCE;
grass = spawn();
grass.origin = self.origin;
setmodel (grass, "progs/grass2.spr");
grass.touch = SUB_Null;
grass.solid = SOLID_NOT;
setsize (grass, '-16 -16 -16', '16 16 0');
grass.takedamage = DAMAGE_NO;
grass.classname = "env_grass";
grass.angles_y = grass.angles_y + 90;
grass.movetype = MOVETYPE_BOUNCE;
};
void() env_car =
{
setmodel (self, "progs/car.mdl");
self.touch = SUB_Null;
self.solid = SOLID_BBOX;
setsize (self, '-16 -16 -16', '16 16 16');
self.takedamage = DAMAGE_NO;
self.classname = "env_grass";
self.movetype = MOVETYPE_BOUNCE;
};
void() brotherhood_merchant =
{
local entity sign;
/*
sign = spawn();
sign.movetype = MOVETYPE_BOUNCE;
sign.velocity_x = crandom()*50;
@ -933,7 +1062,7 @@ void() brotherhood_merchant =
sign.origin = self.origin + '0 32 32';
setmodel(sign, "progs/money.mdl");
sign.solid = SOLID_BBOX;
sign.scale = 10;
sign.scale = 10;*/
@ -946,7 +1075,7 @@ void() brotherhood_merchant =
self.classname = "merchant";
self.think = shop_face;
self.nextthink = time + 0.5;
self.netname = "merchant";
self.xslot1 = SlotVal(IID_WP_GLOCK, 1);
@ -1001,11 +1130,13 @@ void() brotherhood_sergeant =
self.movetype = MOVETYPE_BOUNCE;
self.velocity_z = -200;
setmodel (self, "progs/enforcer.mdl");
setmodel (self, "progs/hknight.mdl");
self.touch = SUB_Null;
self.solid = SOLID_SLIDEBOX;
setsize (self, '-16 -16 -24', '16 16 32');
self.takedamage = DAMAGE_NO;
self.classname = "sergeant";
self.netname = "rupert starfall, the commander";
};
void() brotherhood_soldier =
@ -1041,6 +1172,7 @@ void() brotherhood_soldier =
self.xslot19 = SlotVal(IID_WP_MOONLIGHT, 1);
self.xslot20 = SlotVal(IID_WP_MOSSBERG, 1);
self.netname = "soldier";
self.think = shop_face;
self.nextthink = time + 0.5;
@ -1063,6 +1195,7 @@ void() brotherhood_guard =
self.solid = SOLID_SLIDEBOX;
setsize (self, '-16 -16 -24', '16 16 32');
self.takedamage = DAMAGE_NO;
self.netname = "guard";
};
void() brotherhood_doctor =
@ -1088,6 +1221,8 @@ void() brotherhood_doctor =
self.xslot18 = SlotVal(IID_CHEM_SUPERSTIM, 1);
self.xslot19 = SlotVal(IID_CHEM_ADRENALINE, 1);
self.xslot20 = SlotVal(IID_CHEM_RADX, 1);
self.netname = "doctor";
};

View file

@ -1962,7 +1962,6 @@ void() W_Attack =
weap = ToIID(self.(SlotField(self.current_slot)));
self.safezone = 0;
if (weap == IID_NONE)
{
@ -5970,7 +5969,7 @@ void () shop_face =
if (te.classname == "player")
{
self.enemy = te;
te.safezone = 1;
te.safezone = 2;
te.xslot1 = self.xslot1;
te.xslot2 = self.xslot2;
te.xslot3 = self.xslot3;