git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3463 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
86a45f1a55
commit
c8635934a6
7 changed files with 377 additions and 253 deletions
|
@ -614,29 +614,7 @@ void() PutClientInServer =
|
|||
|
||||
|
||||
DecodeLevelParms ();
|
||||
/*
|
||||
if (self.skill_combat == 0 && self.skill_sneak == 0 && self.skill_doctor == 0 && self.skill_science == 0)
|
||||
{
|
||||
self.deadflag = DEAD_NO;
|
||||
self.health = 200;
|
||||
self.max_health = 200;
|
||||
setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
self.view_ofs = '0 0 22';
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.solid = SOLID_NOT;
|
||||
spot = SelectSpawnPoint ();
|
||||
self.origin = spot.origin + '0 0 1';
|
||||
self.angles = spot.angles;
|
||||
self.fixangle = TRUE; // turn this way immediately
|
||||
self.movetype = MOVETYPE_WALK;
|
||||
self.flags = FL_CLIENT;
|
||||
self.classname = "player";
|
||||
self.currentmenu = "none";
|
||||
self.air_finished = time + 999;
|
||||
self.active = 1;
|
||||
player_stand1 ();
|
||||
return;
|
||||
}*/
|
||||
|
||||
|
||||
if (self.current_slot == 0)
|
||||
{
|
||||
|
@ -1536,6 +1514,7 @@ void() PlayerPreThink =
|
|||
|
||||
|
||||
|
||||
|
||||
if (self.score < 200)
|
||||
{
|
||||
if ((self.skill_combat + self.skill_doctor + self.skill_sneak + self.skill_science) <= 10)
|
||||
|
@ -1555,6 +1534,7 @@ void() PlayerPreThink =
|
|||
if (self.perk2timer > 0)
|
||||
self.perk2timer = self.perk2timer - 1;
|
||||
|
||||
|
||||
self.shadowtime = time_left;
|
||||
|
||||
if (self.cycle1 < time)
|
||||
|
@ -1686,23 +1666,17 @@ void() PlayerPreThink =
|
|||
|
||||
if (self.flash < time || ToIID(self.islot4) == IID_EQUIP_GOGGLES)
|
||||
{
|
||||
local string x;
|
||||
|
||||
if (ToIID(self.islot4) == IID_EQUIP_GOGGLES)
|
||||
stuffcmd(self, "v_cshift 25 0 25 25\n");
|
||||
|
||||
x = ftos(self.recoil);
|
||||
|
||||
if (self.steadyaim == 0)
|
||||
stuffcmd(self, "v_idlescale 0\n");
|
||||
else if (self.recoil >= 4)
|
||||
stuffcmd(self, "v_idlescale 4\n");
|
||||
else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80 && self.position > 0)
|
||||
stuffcmd(self, "v_idlescale 0\n");
|
||||
else if (self.velocity == '0 0 0' && self.position > 0)
|
||||
stuffcmd(self, "v_idlescale 1\n");
|
||||
else if (self.velocity == '0 0 0' && self.health >= self.max_health*0.80)
|
||||
stuffcmd(self, "v_idlescale 2\n");
|
||||
else if (self.velocity != '0 0 0' || self.health < self.max_health*0.80)
|
||||
stuffcmd(self, "v_idlescale 4\n");
|
||||
else if (self.health < self.max_health*0.50)
|
||||
stuffcmd(self, "v_idlescale 6\n");
|
||||
else
|
||||
stuffcmd(self, strcat("v_idlescale ", x, "\n"));
|
||||
|
||||
}
|
||||
self.cycle2 = time + 1;
|
||||
|
|
|
@ -34,7 +34,7 @@ float k_mwheeldown;
|
|||
float mouseisdown;
|
||||
|
||||
#define IMGSIZEF 64
|
||||
#define IMGSIZEV ('1 1 0'*IMGSIZEF)
|
||||
#define IMGSIZEV ('1 1 0'*(scrwidth/10))
|
||||
#define IMGSIZEK 32
|
||||
#define IMGSIZEH ('1 1 0'*IMGSIZEK)
|
||||
#define IMGSIZEX 48
|
||||
|
@ -46,8 +46,6 @@ float mouseisdown;
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
void(vector pos, float slotno) TraderImage =
|
||||
{
|
||||
local float it, mod_s, mod_e;
|
||||
|
@ -123,6 +121,8 @@ void(vector pos, float slotno) SlotImage =
|
|||
drawstring(pos + IMGSIZEV - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1);
|
||||
};
|
||||
|
||||
|
||||
|
||||
void(vector pos, float slotno) SlotImageSmall =
|
||||
{
|
||||
local float it, mod_s, mod_e;
|
||||
|
|
|
@ -6,38 +6,13 @@ float viewmodelindex;
|
|||
float scrwidth;
|
||||
float scrheight;
|
||||
|
||||
void() Quick_Draw =
|
||||
{
|
||||
|
||||
drawstring('32 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q1 ", '8 8 8', '1 1 1', 1);
|
||||
QuickImage('32 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 5);
|
||||
|
||||
drawstring('64 -80 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " q2 ", '8 8 8', '1 1 1', 1);
|
||||
QuickImage('64 -72 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 6);
|
||||
};
|
||||
|
||||
void() DrawScreen =
|
||||
{
|
||||
ScreenImage();
|
||||
};
|
||||
|
||||
void() Weapon_Draw =
|
||||
{
|
||||
local float hand;
|
||||
|
||||
hand = getstati(61);
|
||||
|
||||
if (hand == 1)
|
||||
{
|
||||
drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 1 ", '8 8 8', '1 1 1', 1);
|
||||
SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 1);
|
||||
}
|
||||
if (hand == 2)
|
||||
{
|
||||
drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " HAND 2 ", '8 8 8', '1 1 1', 1);
|
||||
SlotImage('0 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 2);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void() Crosshair_Draw =
|
||||
{
|
||||
|
@ -83,21 +58,17 @@ void() Position_Draw =
|
|||
s = getstati(58);
|
||||
sn = ftos(s);
|
||||
|
||||
if (pos == 0)
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.93)) +('0 1 0'*(scrheight*0.87)), "gui/hud/stand.png", '0 0 0'+'32 60 0'*(scrwidth/640), '1 1 1');
|
||||
else if (pos == 1)
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.93)) +('0 1 0'*(scrheight*0.87)), "gui/hud/duck.png", '0 0 0'+'32 60 0'*(scrwidth/640), '1 1 1');
|
||||
else if (pos == 2)
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.93)) +('0 1 0'*(scrheight*0.87)), "gui/hud/prone.png", '0 0 0'+'32 60 0'*(scrwidth/640), '1 1 1');
|
||||
|
||||
if (s > 0)
|
||||
{
|
||||
drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "sneak", '8 8 8', '1 1 1', 1);
|
||||
PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1);
|
||||
drawstring('0 8 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), strcat("%", sn), '8 8 8', '1 1 1', 1);
|
||||
}
|
||||
else if (pos == 1)
|
||||
{
|
||||
drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "duck", '8 8 8', '1 1 1', 1);
|
||||
PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 1);
|
||||
}
|
||||
else if (pos == 2)
|
||||
{
|
||||
drawstring('0 -32 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), "prone", '8 8 8', '1 1 1', 1);
|
||||
PosImage('0 -24 0'+('1 0 0'*(scrwidth*0.40)) +('0 1 0'*(scrheight*0.90)), 2);
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.79)), "gui/hud/sneak.png", '0 0 0'+'72 25 0'*(scrwidth/640), '1 1 1');
|
||||
//drawstring('0 0 0'+('1 0 0'*(scrwidth*0.20)) +('0 1 0'*(scrheight*0.80)), strcat("%", sn), '8 8 8', '1 1 1', 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -140,63 +111,9 @@ void() Time_Draw =
|
|||
drawstring('0 32 0'+('1 0 0'*(scrwidth*0.10))+('0 1 0'*(scrheight*0.90)), strcat("[", qtime, ":", rtime, "]\n"), '8 8 8', '1 1 1', 1);
|
||||
};
|
||||
|
||||
void() Ammo_Draw =
|
||||
{
|
||||
local float hand, weap, ammo, amount;
|
||||
local string reveal;
|
||||
|
||||
hand = getstati(61);
|
||||
|
||||
if (hand == 1)
|
||||
{
|
||||
weap = ToIID(getstati(32));
|
||||
ammo = WeaponAmmoType(weap);
|
||||
amount = ShadowSlotOfItem(self, ammo);
|
||||
//drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1);
|
||||
//SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount);
|
||||
drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1);
|
||||
if (amount > 0)
|
||||
SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount);
|
||||
else
|
||||
BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0);
|
||||
}
|
||||
else if (hand == 2)
|
||||
{
|
||||
weap = ToIID(getstati(33));
|
||||
ammo = WeaponAmmoType(weap);
|
||||
amount = ShadowSlotOfItem(self, ammo);
|
||||
reveal = ftos(amount);
|
||||
//drawstring('300 350 0'+('1 0 0'*IMGSIZEF), " AMMO ", '8 8 8', '1 1 1', 1);
|
||||
//SlotImage('300 358 0'+('1 0 0'*IMGSIZEF), amount);
|
||||
drawstring('-64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " AMMO ", '8 8 8', '1 1 1', 1);
|
||||
if (amount > 0)
|
||||
SlotImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), amount);
|
||||
else
|
||||
BlankImage('-64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 0);
|
||||
}
|
||||
};
|
||||
|
||||
void() Money_Draw =
|
||||
{
|
||||
string cash;
|
||||
|
||||
cash = ftos(getstati(50));
|
||||
|
||||
drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1);
|
||||
MoneyImage('64 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "money.jpg");
|
||||
|
||||
};
|
||||
|
||||
void() Energy_Draw =
|
||||
{
|
||||
string cash;
|
||||
|
||||
cash = ftos(getstati(51));
|
||||
|
||||
drawstring('34 -32 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), cash, '8 8 8', '1 1 1', 1);
|
||||
MoneyImage('32 -24 0'+('1 0 0'*(scrwidth*0.50)) +('0 1 0'*(scrheight*0.90)), "energy.jpg");
|
||||
|
||||
};
|
||||
|
||||
void() Weight_Draw =
|
||||
{
|
||||
|
@ -229,114 +146,57 @@ void() Weight_Draw =
|
|||
|
||||
};
|
||||
|
||||
void() Armor_Draw =
|
||||
{
|
||||
//drawstring('300 350 0'+('3 0 0'*IMGSIZEF), " ARMOR ", '8 8 8', '1 1 1', 1);
|
||||
//SlotImage('300 358 0'+('3 0 0'*IMGSIZEF), 3);
|
||||
drawstring('64 -32 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), " ARMOR ", '8 8 8', '1 1 1', 1);
|
||||
SlotImage('64 -24 0'+('1 0 0'*(scrwidth*0.80)) +('0 1 0'*(scrheight*0.90)), 3);
|
||||
|
||||
};
|
||||
|
||||
void() Health_Draw =
|
||||
{
|
||||
float hp, maxhp, status, perc, hpos, tpos, opos, ostatus, ones;
|
||||
string string_hpos, string_tpos, string_opos;
|
||||
local float bar, hp, maxhp, top;
|
||||
|
||||
hp = getstati(48);
|
||||
maxhp = getstati(49);
|
||||
|
||||
status = (floor(hp) * 100) / maxhp;
|
||||
perc = status;
|
||||
bar = 0;
|
||||
top = ceil(150 * (hp/maxhp));
|
||||
|
||||
if (hp >= maxhp)
|
||||
string_hpos = "one.jpg";
|
||||
else
|
||||
string_hpos = "zero.jpg";
|
||||
if (top > 150)
|
||||
top = 150;
|
||||
|
||||
ostatus = status;
|
||||
status = status * 0.10;
|
||||
status = floor(status);
|
||||
|
||||
if (status == 0)
|
||||
string_tpos = "zero.jpg";
|
||||
if (status == 1)
|
||||
string_tpos = "one.jpg";
|
||||
if (status == 2)
|
||||
string_tpos = "two.jpg";
|
||||
if (status == 3)
|
||||
string_tpos = "three.jpg";
|
||||
if (status == 4)
|
||||
string_tpos = "four.jpg";
|
||||
if (status == 5)
|
||||
string_tpos = "five.jpg";
|
||||
if (status == 6)
|
||||
string_tpos = "six.jpg";
|
||||
if (status == 7)
|
||||
string_tpos = "seven.jpg";
|
||||
if (status == 8)
|
||||
string_tpos = "eight.jpg";
|
||||
if (status == 9)
|
||||
string_tpos = "nine.jpg";
|
||||
if (status == 10)
|
||||
string_tpos = "zero.jpg";
|
||||
|
||||
ones = (ostatus - (status*10));
|
||||
ones = floor(ones);
|
||||
|
||||
if (ones == 0)
|
||||
string_opos = "zero.jpg";
|
||||
if (ones == 1)
|
||||
string_opos = "one.jpg";
|
||||
if (ones == 2)
|
||||
string_opos = "two.jpg";
|
||||
if (ones == 3)
|
||||
string_opos = "three.jpg";
|
||||
if (ones == 4)
|
||||
string_opos = "four.jpg";
|
||||
if (ones == 5)
|
||||
string_opos = "five.jpg";
|
||||
if (ones == 6)
|
||||
string_opos = "six.jpg";
|
||||
if (ones == 7)
|
||||
string_opos = "seven.jpg";
|
||||
if (ones == 8)
|
||||
string_opos = "eight.jpg";
|
||||
if (ones == 9)
|
||||
string_opos = "nine.jpg";
|
||||
if (status == 10)
|
||||
string_opos = "zero.jpg";
|
||||
|
||||
if (hp <= 0)
|
||||
while (bar <= top)
|
||||
{
|
||||
string_hpos = "zero.jpg";
|
||||
string_tpos = "zero.jpg";
|
||||
string_opos = "zero.jpg";
|
||||
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.07)) +('0 1 0'*(scrheight*0.75)) - ('0 1 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'12 1 0'*(scrwidth/640), '1 1 1', 1);
|
||||
|
||||
|
||||
bar = bar + 1;
|
||||
}
|
||||
|
||||
if (perc > 50)
|
||||
{
|
||||
HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 0, "percent.jpg");
|
||||
HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_hpos);
|
||||
HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_tpos);
|
||||
HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 0, string_opos);
|
||||
}
|
||||
else if (perc > 25)
|
||||
{
|
||||
HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 1, "percent.jpg");
|
||||
HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_hpos);
|
||||
HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_tpos);
|
||||
HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 1, string_opos);
|
||||
}
|
||||
else
|
||||
{
|
||||
HealthImage('0 -24 0'+('0 1 0'*(scrheight*0.90)), 2, "percent.jpg");
|
||||
HealthImage('32 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_hpos);
|
||||
HealthImage('64 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_tpos);
|
||||
HealthImage('96 -24 0'+('0 1 0'*(scrheight*0.90)), 2, string_opos);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void() Radiation_Draw =
|
||||
{
|
||||
local float bar, rad, top;
|
||||
|
||||
rad = getstati(106);
|
||||
|
||||
bar = 0;
|
||||
top = ceil(150 * (rad/100));
|
||||
|
||||
if (top > 150)
|
||||
top = 150;
|
||||
|
||||
while (bar <= top)
|
||||
{
|
||||
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.02)) +('0 1 0'*(scrheight*0.75)) - ('0 1 0'*bar*(scrheight/640)), "gui/graph/yellow.jpg", '0 0 0'+'12 1 0'*(scrwidth/640), '1 1 1', 1);
|
||||
|
||||
|
||||
bar = bar + 1;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
void() DoThatViewModelThing =
|
||||
{
|
||||
float newframe, newmodel;
|
||||
|
@ -375,6 +235,105 @@ void() CSQC_Init =
|
|||
};
|
||||
|
||||
|
||||
void(vector pos, float x) HUD_Image =
|
||||
{
|
||||
local float it, mod_s, mod_e;
|
||||
local string itname;
|
||||
|
||||
|
||||
if (x <= 16)
|
||||
it = getstati(31+x);
|
||||
|
||||
|
||||
itname = GetItemImage(ToIID(it));
|
||||
drawpic(pos, strcat("gui/", itname), '48 48 0', '1 1 1', 1);
|
||||
|
||||
it = ToStatus(it);
|
||||
if (it <= 1)
|
||||
return;
|
||||
itname = ftos(it);
|
||||
it = strlen(itname);
|
||||
drawstring(pos + '48 48 0' - '0 8 0' - '8 0 0'*it, itname, '8 8 8', '1 1 1', 1);
|
||||
};
|
||||
|
||||
|
||||
void(vector pos, float slotno) HUD_Weapon_Image =
|
||||
{
|
||||
local float it, mod_s, mod_e;
|
||||
local string itname;
|
||||
|
||||
|
||||
if (slotno == downslotnum && slotnum)
|
||||
slotno = slotnum;
|
||||
else if (slotno == slotnum && downslotnum)
|
||||
slotno = downslotnum;
|
||||
|
||||
if (slotno <= 16)
|
||||
it = getstati(31+slotno);
|
||||
|
||||
|
||||
itname = GetItemImage(ToIID(it));
|
||||
drawpic(pos, strcat("gui/weapons/", itname), '180 59 0', '1 1 1', 1);
|
||||
|
||||
};
|
||||
|
||||
void() Ammo_Draw =
|
||||
{
|
||||
local float hand, weap, ammo, amount, max, bar, top;
|
||||
local string reveal;
|
||||
|
||||
hand = getstati(61);
|
||||
|
||||
if (hand == 1)
|
||||
{
|
||||
weap = ToIID(getstati(32));
|
||||
ammo = ToStatus(getstati(32));
|
||||
max = WeaponMagQuant(weap);
|
||||
|
||||
|
||||
bar = 0;
|
||||
top = ceil(35 * (ammo/max));
|
||||
|
||||
if (top > 35)
|
||||
top = 35;
|
||||
|
||||
while (bar <= top)
|
||||
{
|
||||
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1);
|
||||
|
||||
|
||||
bar = bar + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (hand == 2)
|
||||
{
|
||||
weap = ToIID(getstati(33));
|
||||
ammo = ToStatus(getstati(33));
|
||||
max = WeaponMagQuant(weap);
|
||||
|
||||
|
||||
bar = 0;
|
||||
top = ceil(35 * (ammo/max));
|
||||
|
||||
if (top > 35)
|
||||
top = 35;
|
||||
|
||||
while (bar <= top)
|
||||
{
|
||||
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.99)) - ('0 2 0'*bar*(scrheight/640)), "gui/graph/green.jpg", '0 0 0'+'8 1 0'*(scrwidth/640), '1 1 1', 1);
|
||||
|
||||
|
||||
bar = bar + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
void(float vwidth, float vheight, float do2d) CSQC_UpdateView =
|
||||
{
|
||||
|
@ -406,8 +365,6 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView =
|
|||
|
||||
renderscene();
|
||||
|
||||
// if (usehud)
|
||||
// Hud_Draw();
|
||||
|
||||
if (getstati(57) == 1)
|
||||
BriefImage();
|
||||
|
@ -435,17 +392,22 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView =
|
|||
GainPerk_Draw();
|
||||
else
|
||||
{
|
||||
Time_Draw();
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.06)) +('0 1 0'*(scrheight*0.45)), "gui/hud/health.png", '0 0 0'+'25 155 0'*(scrwidth/640), '1 1 1');
|
||||
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.01)) +('0 1 0'*(scrheight*0.45)), "gui/hud/radiation.png", '0 0 0'+'25 155 0'*(scrwidth/640), '1 1 1');
|
||||
drawpic('0 0 0' + ('0 1 0'*(scrheight*0.84)), "gui/hud/hud.png", '0 0 0'+'80 10 0'*(scrwidth/80), '1 1 1');
|
||||
|
||||
Health_Draw();
|
||||
Weight_Draw();
|
||||
Money_Draw();
|
||||
Radiation_Draw();
|
||||
|
||||
HUD_Weapon_Image('0 0 0'+('1 0 0'*(scrwidth*0.38)) +('0 1 0'*(scrheight*0.87)), getstati(61));
|
||||
Ammo_Draw();
|
||||
Energy_Draw();
|
||||
Weapon_Draw();
|
||||
Armor_Draw();
|
||||
|
||||
SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.72)) +('0 1 0'*(scrheight*0.87)), getstati(5));
|
||||
SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.79)) +('0 1 0'*(scrheight*0.87)), getstati(6));
|
||||
|
||||
Position_Draw();
|
||||
Quick_Draw();
|
||||
Chem_Draw();
|
||||
Time_Draw();
|
||||
Crosshair_Draw();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -362,11 +362,49 @@ void() TreasureChest =
|
|||
setsize (self, '-12 -12 0', '12 12 12');
|
||||
self.takedamage = DAMAGE_NO;
|
||||
self.classname = "treasure_chest";
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
void() rad_think =
|
||||
{
|
||||
local entity te;
|
||||
|
||||
self.think = rad_think;
|
||||
self.nextthink = time + 1;
|
||||
|
||||
te = findradius (self.origin, 700);
|
||||
while (te)
|
||||
{
|
||||
if (te.classname == "player")
|
||||
te.radiation = te.radiation + 1;
|
||||
|
||||
te = te.chain;
|
||||
}
|
||||
};
|
||||
|
||||
void(vector spot) spawn_radiation =
|
||||
{
|
||||
local entity rad;
|
||||
|
||||
rad = spawn();
|
||||
|
||||
setorigin(rad, spot + '0 0 64');
|
||||
rad.movetype = MOVETYPE_BOUNCE;
|
||||
rad.velocity_x = crandom()*200;
|
||||
rad.velocity_y = crandom()*200;
|
||||
rad.velocity_z = -200;
|
||||
|
||||
rad.avelocity_y = crandom()*200;
|
||||
|
||||
setmodel (rad, "");
|
||||
rad.solid = SOLID_NOT;
|
||||
setsize (rad, '-12 -12 0', '12 12 12');
|
||||
rad.takedamage = DAMAGE_NO;
|
||||
rad.classname = "rad";
|
||||
|
||||
rad.think = rad_think;
|
||||
rad.nextthink = time + 1;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
@ -841,6 +879,9 @@ void() item_health =
|
|||
setsize (self, '0 0 0', '32 32 56');
|
||||
StartItem ();
|
||||
}
|
||||
|
||||
if (random()*100 <= 2)
|
||||
spawn_radiation(self.origin);
|
||||
};
|
||||
|
||||
|
||||
|
@ -1059,6 +1100,9 @@ void() item_armor1_finish =
|
|||
};
|
||||
void() item_armor1 =
|
||||
{
|
||||
if (random()*100 <= 2)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
if (random()<0.50)
|
||||
{
|
||||
precache_model ("progs/enforcer.mdl");
|
||||
|
@ -1072,6 +1116,9 @@ void() item_armor1 =
|
|||
|
||||
void() item_armor2 =
|
||||
{
|
||||
if (random()*100 <= 2)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
if (random()<0.50)
|
||||
{
|
||||
precache_model ("progs/enforcer.mdl");
|
||||
|
@ -1092,6 +1139,9 @@ void() item_armor2 =
|
|||
|
||||
void() item_armorInv =
|
||||
{
|
||||
if (random()*100 <= 2)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
if (random()<0.50)
|
||||
{
|
||||
precache_model ("progs/enforcer.mdl");
|
||||
|
@ -1332,6 +1382,8 @@ void() weapon_supershotgun =
|
|||
TreasureChest();
|
||||
|
||||
|
||||
if (random()*100 <= 5)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
|
@ -1353,6 +1405,11 @@ void() weapon_nailgun =
|
|||
else
|
||||
TreasureChest();
|
||||
|
||||
|
||||
if (random()*100 <= 10)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
|
@ -1373,6 +1430,10 @@ void() weapon_supernailgun =
|
|||
else if (random()*100 <= 40)
|
||||
TreasureChest();
|
||||
|
||||
|
||||
if (random()*100 <= 10)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
|
@ -1394,6 +1455,10 @@ void() weapon_grenadelauncher =
|
|||
else if (random()*100 <= 40)
|
||||
TreasureChest();
|
||||
|
||||
|
||||
if (random()*100 <= 5)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
|
@ -1415,6 +1480,11 @@ void() weapon_rocketlauncher =
|
|||
else if (random()*100 <= 40)
|
||||
TreasureChest();
|
||||
|
||||
|
||||
if (random()*100 <= 10)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
|
@ -1437,6 +1507,11 @@ void() weapon_lightning =
|
|||
else if (random()*100 <= 40)
|
||||
TreasureChest();
|
||||
|
||||
|
||||
if (random()*100 <= 10)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
SpawnJunk(self.origin);
|
||||
|
@ -1778,6 +1853,9 @@ void() item_rockets =
|
|||
setsize (self, '0 0 0', '32 32 56');
|
||||
StartItem ();
|
||||
|
||||
if (random()*100 <= 2)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -1817,6 +1895,9 @@ void() item_cells =
|
|||
setsize (self, '0 0 0', '32 32 56');
|
||||
StartItem ();
|
||||
|
||||
if (random()*100 <= 2)
|
||||
spawn_radiation(self.origin);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -100,6 +100,63 @@ float() crandom =
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void() healing_bob =
|
||||
{
|
||||
local float rnd1, rnd2, rnd3;
|
||||
|
||||
self.cnt = self.cnt + 1;
|
||||
|
||||
if (self.cnt == 20)
|
||||
remove(self);
|
||||
|
||||
rnd1 = self.velocity_x + (-30 + (random() * 20));
|
||||
rnd2 = self.velocity_y + (-30 + (random() * 20));
|
||||
rnd3 = self.velocity_z + 30 + random() * 10;
|
||||
|
||||
if (random()*100 > 50)
|
||||
rnd1 = 24;
|
||||
else
|
||||
rnd1 = -24;
|
||||
|
||||
if (random()*100 > 50)
|
||||
rnd2 = 24;
|
||||
else
|
||||
rnd2 = -24;
|
||||
|
||||
if (random()*100 > 50)
|
||||
rnd3 = -5;
|
||||
else
|
||||
rnd3 = 10;
|
||||
|
||||
self.velocity_x = rnd1;
|
||||
self.velocity_y = rnd2;
|
||||
self.velocity_z = rnd3;
|
||||
|
||||
|
||||
self.think = healing_bob;
|
||||
self.nextthink = time + 0.2;
|
||||
};
|
||||
|
||||
void (entity spot) spawn_healing =
|
||||
{
|
||||
local entity hologram;
|
||||
|
||||
hologram = spawn ();
|
||||
hologram.movetype = MOVETYPE_FLY;
|
||||
hologram.solid = SOLID_NOT;
|
||||
hologram.owner = spot;
|
||||
setmodel (hologram, "progs/healing.spr");
|
||||
setorigin (hologram, spot.origin + '0 0 48');
|
||||
setsize (hologram, VEC_ORIGIN, VEC_ORIGIN);
|
||||
hologram.angles = spot.angles;
|
||||
hologram.think = healing_bob;
|
||||
hologram.nextthink = time + 0.1;
|
||||
};
|
||||
|
||||
|
||||
void(float slotno) UsePerk =
|
||||
{
|
||||
local float x, mcount;
|
||||
|
@ -4169,6 +4226,9 @@ void () UseStimpack =
|
|||
DecreaseDestroySlot(x);//take away a stimpack
|
||||
sound (trace_ent, CHAN_BODY, "items/r_item2.wav", 1, ATTN_NORM);
|
||||
RevivePlayer(self, te);
|
||||
spawn_healing(te);
|
||||
spawn_healing(te);
|
||||
spawn_healing(te);
|
||||
found = 1;
|
||||
}
|
||||
|
||||
|
@ -4216,6 +4276,9 @@ void () UseStimpack =
|
|||
|
||||
self.health = self.health + 30 + (self.skill_doctor);
|
||||
self.regen = self.regen + (5 + (self.skill_doctor/2));
|
||||
spawn_healing(self);
|
||||
spawn_healing(self);
|
||||
spawn_healing(self);
|
||||
}
|
||||
}
|
||||
else if (trace_ent.classname == "player")//healing another team-mate
|
||||
|
@ -4288,6 +4351,9 @@ void () UseStimpack =
|
|||
|
||||
trace_ent.health = trace_ent.health + 30 + (self.skill_doctor);
|
||||
trace_ent.regen = trace_ent.regen + (3 + (self.skill_doctor/2));
|
||||
spawn_healing(trace_ent);
|
||||
spawn_healing(trace_ent);
|
||||
spawn_healing(trace_ent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6190,6 +6256,8 @@ void (entity jeb, float length) spawn_stop =
|
|||
hologram.nextthink = (time + 0.01);
|
||||
};
|
||||
|
||||
|
||||
|
||||
void (string color) ZoomInLarge =
|
||||
{
|
||||
if (self.attack_finished > time)
|
||||
|
|
|
@ -103,6 +103,7 @@ void() SetupStats =
|
|||
clientstat(103, 2, skill_science);
|
||||
clientstat(104, 2, shadowtime);
|
||||
clientstat(105, 2, announcercache);
|
||||
clientstat(106, 2, radiation);
|
||||
clientstat(108, 2, safezone);
|
||||
clientstat(109, 2, connected);
|
||||
clientstat(110, 2, steadyaim);
|
||||
|
@ -634,18 +635,22 @@ if (coop == 1) // Players vs Monsters
|
|||
musicplay = 1;
|
||||
musictrack = 1;
|
||||
|
||||
bprint(2, "the battle begins!\n");
|
||||
if (world.map_obj == OBJ_DEADTOWN)
|
||||
musictrack = 2;
|
||||
|
||||
ze = find (world, classname, "player");
|
||||
while (ze != world)
|
||||
{
|
||||
if (musictrack == 1)
|
||||
stuffcmd(ze, "play music/battle\n");
|
||||
if (musictrack == 2)
|
||||
stuffcmd(ze, "play misc/zombies\n");
|
||||
|
||||
ze = find (ze, classname, "player");
|
||||
}
|
||||
|
||||
}
|
||||
else if (musicplay < 100)
|
||||
else if (musicplay < 50)
|
||||
musicplay = musicplay + 1;
|
||||
else if (musicplay >= 100)
|
||||
musicplay = 0;
|
||||
|
@ -1587,6 +1592,7 @@ void() worldspawn =
|
|||
precache_model ("progs/ammobox.mdl");
|
||||
precache_model ("progs/ammobox2.mdl");
|
||||
precache_model ("progs/stop.spr");
|
||||
precache_model ("progs/healing.spr");
|
||||
|
||||
precache_model ("progs/v_axe.mdl");
|
||||
precache_model ("progs/v_span.mdl");
|
||||
|
|
|
@ -56,7 +56,17 @@ float SPAWN_CRUCIFIED = 1;
|
|||
|
||||
.float inpain;
|
||||
|
||||
void() zombie_stand1 =[ $stand1, zombie_stand2 ] {ai_stand();};
|
||||
void() zombie_stand1 =[ $stand1, zombie_stand2 ] {ai_stand();
|
||||
|
||||
if ((pointcontents(self.origin) <= -2) && (self.owner.netname == "lair"))
|
||||
{
|
||||
remove(self.owner);
|
||||
remove(self);
|
||||
}
|
||||
else if ((pointcontents(self.origin) <= -2))
|
||||
remove(self);
|
||||
|
||||
};
|
||||
void() zombie_stand2 =[ $stand2, zombie_stand3 ] {ai_stand();};
|
||||
void() zombie_stand3 =[ $stand3, zombie_stand4 ] {ai_stand();};
|
||||
void() zombie_stand4 =[ $stand4, zombie_stand5 ] {ai_stand();};
|
||||
|
@ -119,6 +129,7 @@ if (self.takedamage == DAMAGE_NO)
|
|||
remove(self);
|
||||
return;
|
||||
}
|
||||
|
||||
};
|
||||
void() zombie_run3 =[ $run3, zombie_run4 ] {ai_run(4);};
|
||||
void() zombie_run4 =[ $run4, zombie_run5 ] {ai_run(4);};
|
||||
|
@ -728,19 +739,16 @@ void () spawn_ghoul_copy =
|
|||
|
||||
|
||||
self.think = spawn_ghoul_copy;
|
||||
self.nextthink = time + 5 + random()*5;
|
||||
self.nextthink = time + 8 + random()*4;
|
||||
stuff = self.origin;
|
||||
|
||||
waterlev = ftos(pointcontents(self.origin));
|
||||
|
||||
bprint(2, "pointcontents: ");
|
||||
bprint(2, waterlev);
|
||||
bprint(2, "\n");
|
||||
|
||||
|
||||
loadzombie = 0;
|
||||
|
||||
te = findradius (self.origin, 800);
|
||||
|
||||
te = findradius (self.origin, 1200);
|
||||
while (te)
|
||||
{
|
||||
if (te.classname == "player")
|
||||
|
@ -749,6 +757,17 @@ void () spawn_ghoul_copy =
|
|||
te = te.chain;
|
||||
}
|
||||
|
||||
|
||||
te = findradius (self.origin, 400);
|
||||
while (te)
|
||||
{
|
||||
if (te.classname == "player")
|
||||
loadzombie = 0;
|
||||
|
||||
te = te.chain;
|
||||
}
|
||||
|
||||
|
||||
if (loadzombie == 0)
|
||||
return;
|
||||
|
||||
|
@ -782,12 +801,13 @@ void () spawn_ghoul_copy =
|
|||
return;
|
||||
|
||||
zombie = spawn ();
|
||||
zombie.owner = self;
|
||||
self = zombie;
|
||||
self.solid = SOLID_SLIDEBOX;
|
||||
self.movetype = MOVETYPE_STEP;
|
||||
setmodel (self, "progs/ghoul.mdl");
|
||||
setsize (self, '-8 -8 -24', '8 8 24');
|
||||
self.health = 60;
|
||||
self.health = 90;
|
||||
self.netname = "ghoul";
|
||||
self.max_health = self.health;
|
||||
self.th_stand = zombie_stand1;
|
||||
|
@ -799,7 +819,16 @@ void () spawn_ghoul_copy =
|
|||
|
||||
self.angles_y = random()*360;
|
||||
|
||||
self.origin = stuff + '0 16 0';
|
||||
if (random()*100 <= 3)
|
||||
{
|
||||
setsize (self, '-16 -16 -24', '16 16 32');
|
||||
self.health = 400;
|
||||
self.netname = "ghoul lord";
|
||||
self.max_health = self.health;
|
||||
self.scale = 2;
|
||||
}
|
||||
|
||||
self.origin = stuff + '0 64 0';
|
||||
self.origin_z = self.origin_z + 1;
|
||||
droptofloor();
|
||||
|
||||
|
@ -850,7 +879,7 @@ void() monster_zombie =
|
|||
local entity zombie, lair;
|
||||
local entity te, ze;
|
||||
local float stop;
|
||||
local vector jojo;
|
||||
local vector spot;
|
||||
local float zomc, pcount;
|
||||
|
||||
if (self.zone == 0)
|
||||
|
@ -894,12 +923,16 @@ void() monster_zombie =
|
|||
|
||||
if (stop == 0)
|
||||
{
|
||||
jojo = self.origin;
|
||||
spot = self.origin;
|
||||
lair = spawn ();
|
||||
setorigin(lair, jojo);
|
||||
setorigin(lair, spot);
|
||||
lair.origin = spot;
|
||||
lair.solid = SOLID_NOT;
|
||||
lair.health = 1000;
|
||||
lair.max_health = 1000;
|
||||
setmodel (lair, "");
|
||||
lair.movetype = MOVETYPE_STEP;
|
||||
setsize (lair, '0 0 0', '0 0 0');
|
||||
setsize (lair, '-8 -8 -24', '8 8 24');
|
||||
lair.netname = "lair";
|
||||
lair.classname = "lair";
|
||||
lair.nextthink = time + 30;
|
||||
|
@ -914,7 +947,7 @@ void() monster_zombie =
|
|||
setmodel (self, "progs/ghoul.mdl");
|
||||
|
||||
setsize (self, '-8 -8 -24', '8 8 24');
|
||||
self.health = 60;
|
||||
self.health = 90;
|
||||
self.classname = "monster";
|
||||
self.netname = "ghoul";
|
||||
self.th_stand = zombie_stand1;
|
||||
|
@ -932,6 +965,6 @@ void() monster_zombie =
|
|||
if (random()<0.25 && world.map_obj == 1)
|
||||
spawn_civilian(self.origin);
|
||||
|
||||
if (random()<0.5 && world.map_obj == 4)
|
||||
if (random()<0.25 && world.map_obj == 4)
|
||||
spawn_civilian(self.origin);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue