1
0
Fork 0
forked from fte/fteqw

*** empty log message ***

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1758 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Magnus 2006-01-02 03:53:58 +00:00
parent 2f4063ce2e
commit 119ce05ca4
16 changed files with 1074 additions and 780 deletions

View file

@ -37,7 +37,7 @@ void() info_intermission =
void() SetChangeParms =
{
if (self.health <= 0)
if (self.armor <= 0)
{
SetNewParms ();
return;
@ -47,114 +47,62 @@ void() SetChangeParms =
self.items = self.items - (self.items &
(IT_KEY1 | IT_KEY2 | IT_INVISIBILITY | IT_INVULNERABILITY | IT_SUIT | IT_QUAD) );
// cap super health
if (self.health > 100)
self.health = 100;
if (self.health < 50)
self.health = 50;
parm1 = self.items;
parm2 = self.health;
parm3 = self.armorvalue;
if (self.ammo_shells < 25)
parm4 = 25;
else
parm4 = self.ammo_shells;
parm5 = self.ammo_nails;
parm6 = self.ammo_rockets;
parm7 = self.ammo_cells;
parm8 = self.weapon;
parm9 = self.armortype * 100;
parm1 = self.slot1;
parm2 = self.slot2;
parm3 = self.armor;
parm4 = self.protect;
parm5 = self.equipment;
parm6 = self.chem;
parm7 = self.chemcount;
parm8 = self.ammo_shells;
parm9 = self.trait;
parm10 = self.perk;
parm11 = self.bandages;
parm12 = self.scraps;
//parm13 = self.class;
parm14 = self.team;
parm15 = self.grenadetype;
parm16 = self.current_slot;
parm17 = self.islot1;
parm18 = self.islot2;
parm19 = self.islot3;
parm20 = self.islot4;
parm21 = self.islot5;
parm22 = self.islot6;
parm23 = self.islot7;
parm24 = self.islot8;
parm25 = self.islot9;
parm26 = self.islot10;
parm27 = self.islot11;
parm28 = self.islot12;
parm29 = self.islot13;
parm30 = self.islot14;
parm31 = self.islot15;
parm32 = self.islot16;
};
void() SetNewParms =
{ //remember, don't use self!
parm1 = IT_SHOTGUN | IT_AXE;
parm2 = 100;
parm3 = 0;
parm4 = 25;
{
parm1 = 5;
parm2 = 1;
parm3 = 1;
parm4 = 0;
parm5 = 0;
parm6 = 0;
parm7 = 0;
parm8 = 1;
parm8 = 8;
parm9 = 0;
parm16 = 1;
parm17 = SlotVal(IID_WP_AK74, 30);
parm18 = SlotVal(IID_GREN_SMOKE, 500);
parm19 = SlotVal(IID_ARM_LEATHER, 1);
parm20 = SlotVal(IID_AM_AK74, 120);
parm21 = SlotVal(IID_AM_MOONLIGHT, 120);
parm22 = 0;
parm23 = SlotVal(IID_WP_TOOLKIT, 1);
parm24 = SlotVal(IID_WP_MOONLIGHT, 30);
parm25 = 0;
parm26 = SlotVal(IID_CHEM_STIMPACK, 3);
parm27 = SlotVal(IID_BUILD_MRAMMO, 3);
parm28 = SlotVal(IID_BUILD_AUTODOC, 3);
parm29 = 0;
parm30 = 0;
parm31 = 0;
parm32 = 0;
parm10 = 0;
parm11 = 0;
parm12 = 0;
//parm13 = 0;
parm14 = 0;
parm15 = 0;
};
void() DecodeLevelParms =
{
if (serverflags)
{
if (world.model == "maps/start.bsp")
SetNewParms (); // take away all stuff on starting new episode
}
self.slot1 = parm1;
self.slot2 = parm2;
self.armor = parm3;
self.protect = parm4;
self.equipment = parm5;
self.chem = parm6;
self.chemcount = parm7;
self.ammo_shells = parm8;
self.trait = parm9;
self.perk = parm10;
self.bandages = parm11;
self.scraps = parm12;
//self.class = parm13;
self.oldteam = parm14;
self.grenadetype = parm15;
self.items = parm1;
self.health = parm2;
self.armorvalue = parm3;
self.ammo_shells = parm4;
self.ammo_nails = parm5;
self.ammo_rockets = parm6;
self.ammo_cells = parm7;
self.weapon = parm8;
self.armortype = parm9 * 0.01;
self.current_slot = parm16;
self.islot1 = parm17;
self.islot2 = parm18;
self.islot3 = parm19;
self.islot4 = parm20;
self.islot5 = parm21;
self.islot6 = parm22;
self.islot7 = parm23;
self.islot8 = parm24;
self.islot9 = parm25;
self.islot10= parm26;
self.islot11= parm27;
self.islot12 = parm28;
self.islot13 = parm29;
self.islot14 = parm30;
self.islot15 = parm31;
self.islot16 = parm32;
};
/*
@ -190,7 +138,6 @@ entity() FindIntermission =
return spot;
objerror ("FindIntermission: no spot");
return world;
};
@ -470,6 +417,63 @@ entity() SelectSpawnPoint =
void() DecodeLevelParms;
void() PlayerDie;
/*
===========
ValidateUser
============
*/
float(entity e) ValidateUser =
{
/*
local string s;
local string userclan;
local float rank, rankmin, rankmax;
//
// if the server has set "clan1" and "clan2", then it
// is a clan match that will allow only those two clans in
//
s = serverinfo("clan1");
if (s)
{
userclan = masterinfo(e,"clan");
if (s == userclan)
return true;
s = serverinfo("clan2");
if (s == userclan)
return true;
return false;
}
//
// if the server has set "rankmin" and/or "rankmax" then
// the users rank must be between those two values
//
s = masterinfo (e, "rank");
rank = stof (s);
s = serverinfo("rankmin");
if (s)
{
rankmin = stof (s);
if (rank < rankmin)
return false;
}
s = serverinfo("rankmax");
if (s)
{
rankmax = stof (s);
if (rankmax < rank)
return false;
}
return true;
*/
};
/*
===========
PutClientInServer
@ -505,10 +509,14 @@ void() PutClientInServer =
DecodeLevelParms ();
W_SetCurrentAmmo ();
self.attack_finished = time;
self.th_pain = player_pain;
self.th_die = PlayerDie;
self.current_slot = 1;
WeaponAmmo(1);
WeaponAmmo(2);
self.deadflag = DEAD_NO;
// paustime is set by teleporters to keep the player from moving a while
self.pausetime = 0;
@ -617,7 +625,7 @@ void() PutClientInServer =
self.invincible_finished = time + 3;
}
W_SetCurrentAmmo();
};
@ -1044,49 +1052,46 @@ void() ArmorCheck =
local float bit;
local float value;
local float aid;
//Armor
aid = ToIID(self.islot3);
if (aid == IID_ARM_SHIRT)
if (self.armor == 1)
type = 0.20;
if (aid == IID_ARM_LEATHER)
if (self.armor == 2)
type = 0.30;
if (aid == IID_ARM_KEVLAR)
if (self.armor == 3)
type = 0.35;
if (aid == IID_ARM_METAL)
if (self.armor == 4)
type = 0.35;
if (aid == IID_ARM_COMBAT)
if (self.armor == 5)
type = 0.40;
if (aid == IID_ARM_BROTHERHOOD)
if (self.armor == 6)
type = 0.45;
if (aid == IID_ARM_FORCE)
if (self.armor == 7)
type = 0.10;
if (aid == IID_ARM_LPOWER)
if (self.armor == 8)
type = 0.50;
if (aid <= IID_ARM_KEVLAR)
if (self.armor <= 3)
self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1);
else if (aid <= IID_ARM_BROTHERHOOD)
else if (self.armor <= 6)
self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1);
else
self.items = (self.items - (self.items & ((IT_ARMOR1 | IT_ARMOR2) | IT_ARMOR3)) + IT_ARMOR1);
if (aid == 1)
if (self.armor == 1)
self.armornoise = "misc/thud.wav";
if (aid == 2)
if (self.armor == 2)
self.armornoise = "misc/thud.wav";
if (aid == 3)
if (self.armor == 3)
self.armornoise = "misc/thud.wav";
if (aid == 4)
if (self.armor == 4)
self.armornoise = "weapons/ric1.wav";
if (aid == 5)
if (self.armor == 5)
self.armornoise = "misc/thud.wav";
if (aid == 6)
if (self.armor == 6)
self.armornoise = "misc/thud.wav";
if (aid == 7)
if (self.armor == 7)
self.armornoise = "misc/laserdef.wav";
if (aid == 8)
if (self.armor == 8)
self.armornoise = "weapons/ric1.wav";
self.armorvalue = type * 100;
@ -1095,26 +1100,10 @@ void() ArmorCheck =
void () WeightControl =
{
//for each inventory item, add up it's weight.
local float wt;
wt = wt + GetItemsWeight(self.islot1);
wt = wt + GetItemsWeight(self.islot2);
wt = wt + GetItemsWeight(self.islot3);
wt = wt + GetItemsWeight(self.islot4);
wt = wt + GetItemsWeight(self.islot5);
wt = wt + GetItemsWeight(self.islot6);
wt = wt + GetItemsWeight(self.islot7);
wt = wt + GetItemsWeight(self.islot8);
wt = wt + GetItemsWeight(self.islot9);
wt = wt + GetItemsWeight(self.islot10);
wt = wt + GetItemsWeight(self.islot11);
wt = wt + GetItemsWeight(self.islot12);
wt = wt + GetItemsWeight(self.islot13);
wt = wt + GetItemsWeight(self.islot14);
wt = wt + GetItemsWeight(self.islot15);
wt = wt + GetItemsWeight(self.islot16);
self.weight = wt;
GetArmorWeight();
GetWeaponWeight(self, 1);
GetWeaponWeight(self, 2);
if (self.class == 1)
self.max_weight = 20;
@ -1537,6 +1526,7 @@ void() PlayerPostThink =
if (self.rtime > time)
self.weaponframe = 3;
CheckPowerups ();
W_WeaponFrame ();
@ -1676,8 +1666,8 @@ void(entity targ, entity attacker) ClientObituary =
bprint (PRINT_MEDIUM, "& ");
if (attacker.velocity_z != 0)
bprint (PRINT_MEDIUM, "@ ");
// if (attacker.current_slot == 1 && attacker.mag1 == 0)
// bprint (PRINT_MEDIUM, "! ");
if (attacker.current_slot == 1 && attacker.mag1 == 0)
bprint (PRINT_MEDIUM, "! ");
bprint (PRINT_MEDIUM, "] ");
@ -1975,30 +1965,43 @@ void(entity targ, entity attacker) ClientObituary =
void() Identify =
{
local string c1, c2, c3, c5, c6, c7;
local float tmp;
makevectors (self.v_angle);
traceline (self.origin, (self.origin + (v_forward * 2000)), FALSE, self);
if (trace_ent.classname == "player" && self.currentmenu == "none" && self.team == trace_ent.team)
{
if (trace_ent.class == 2)
c1 = "\nmedic\n";
c1 = "medic\n";
if (trace_ent.class == 3)
c1 = "\nassassin\n";
c1 = "assassin\n";
if (trace_ent.class == 4)
c1 = "\nsoldier\n";
c1 = "soldier\n";
if (trace_ent.class == 6)
c1 = "\nscientist\n";
c1 = "scientist\n";
c2 = ftos (trace_ent.health);
c3 = GetItemName (ToIID(ItemInSlot(trace_ent, trace_ent.current_slot)));
c3 = GetWeaponName (trace_ent, trace_ent.current_slot);
if (trace_ent.islot3 == 0)
c5 = "no armor";
else
c5 = GetItemName(ToIID(trace_ent.islot3));
if (trace_ent.armor == 0)
c5 = "\nno armor";
if (trace_ent.armor == 1)
c5 = "\nlightly armored";
if (trace_ent.armor == 2)
c5 = "\nleather armor";
if (trace_ent.armor == 3)
c5 = "\nkevlar armor";
if (trace_ent.armor == 4)
c5 = "\nmetal armor";
if (trace_ent.armor == 5)
c5 = "\ncombat armor";
if (trace_ent.armor == 6)
c5 = "\nbrotherhood armor";
if (trace_ent.armor == 7)
c5 = "\nforce armor";
if (trace_ent.armor == 8)
c5 = "\nmetal armor mkii";
centerprint (self, trace_ent.netname, c1, c2, "\n", c3, "\n", c5);
centerprint7 (self, trace_ent.netname, "\n", c1, c2, "\n", c3, c5);
}
if (trace_ent.classname == "robowolf" && self.currentmenu == "none")
{
@ -2010,12 +2013,12 @@ void() Identify =
else
c5 = "\nhostile\n";
centerprint (self, trace_ent.netname, c1, c2, c3, c5, "", "");
centerprint7 (self, trace_ent.netname, c1, c2, c3, c5, "", "");
}
if (trace_ent.classname == "station" && self.currentmenu == "none")
{
c1 = trace_ent.netname;
if (self.armortype == 0)
if (self.armor == 0)
c2 = "uncompleted";
else if (trace_ent.health >= trace_ent.max_health)
c2 = "online";
@ -2028,19 +2031,28 @@ void() Identify =
c3 = trace_ent.track.netname;
centerprint (self, c1, "\nstationary bot", "\n", c2, "\n", "owned by ", c3);
centerprint7 (self, c1, "\nstationary bot", "\n", c2, "\n", "owned by ", c3);
}
if (trace_ent.classname == "monster" && self.currentmenu == "none")
{
c1 = "hostile";
tmp = ToIID(trace_ent.islot3);
if (tmp == 0)
c2 = "natural armor";
else if (tmp == IID_ARM_SHIRT)
c2 = "natural armor";
if (trace_ent.armor == 1)
c2 = "lightly armored";
else
c2 = GetItemName(ToIID(trace_ent.islot3));
if (trace_ent.armor == 2)
c2 = "leather armor";
if (trace_ent.armor == 3)
c2 = "kevlar armor";
if (trace_ent.armor == 4)
c2 = "metal armor";
if (trace_ent.armor == 5)
c2 = "combat armor";
if (trace_ent.armor == 6)
c2 = "brotherhood armor";
if (trace_ent.armor == 7)
c2 = "force armor";
if (trace_ent.armor == 8)
c2 = "metal armor mkii";
if (trace_ent.weapon == 1)
c3 = "rifle";
@ -2053,6 +2065,6 @@ void() Identify =
if (trace_ent.weapon >= 5)
c3 = "assault rifle";
centerprint (self, trace_ent.netname, "\n", c1, "\n", c2, "\n", c3);
centerprint7 (self, trace_ent.netname, "\n", c1, "\n", c2, "\n", c3);
}
};

View file

@ -192,12 +192,10 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
if (save >= targ.armorvalue)
{
save = targ.armorvalue;
/* targ.armortype = 0; // lost all armor
targ.armortype = 0; // lost all armor
targ.items = targ.items - (targ.items & (IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3));
*/
}
take = ceil(damage-save);
// add to the damage total for clients, which will be sent as a single
@ -264,38 +262,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
(targ != attacker)&& inflictor.classname !="door")
return;
// do the damage
//different sorts of armour simply subtract different ammounts
switch(ToIID(targ.islot3))
{
case IID_ARM_SHIRT:
take -= 1;
break;
case IID_ARM_LEATHER:
take -= 2;
break;
case IID_ARM_KEVLAR:
take -= 3;
break;
case IID_ARM_METAL:
take -= 4;
break;
case IID_ARM_COMBAT:
take -= 5;
break;
case IID_ARM_BROTHERHOOD:
take -= 6;
break;
case IID_ARM_FORCE:
take -= 7;
break;
case IID_ARM_LPOWER:
take -= 8;
break;
default:
break;
}
take = take - targ.armor;
targ.health = targ.health - take;
if (targ.health <= 0)

View file

@ -212,14 +212,6 @@ void end_sys_globals; // flag for structure dumping
void end_sys_fields; // flag for structure dumping
//================================================
float parm17, parm18, parm18, parm19, parm20, parm21, parm22, parm23, parm24, parm25, parm26, parm27, parm28, parm29, parm30, parm31, parm32;
/*
==============================================================================
@ -234,9 +226,7 @@ float parm17, parm18, parm18, parm19, parm20, parm21, parm22, parm23,
//
float FALSE = 0;
float false = 0;
float TRUE = 1;
float true = 1;
// edict.flags
float FL_FLY = 1;
@ -477,9 +467,8 @@ float timelimit;
float fraglimit;
float deathmatch;
float coop;
var float rj = 1;
float rj = 1;
float no_connect;
//================================================
//
@ -592,6 +581,12 @@ float red_armor;
.float attack;
.float position;
.float recoil;
.float ammo1;
.float ammo2;
.float mag1;
.float mag2;
.float maxmag1;
.float maxmag2;
.float critical;
.float helmet;
.float rtime;
@ -608,15 +603,18 @@ float red_armor;
.float grenade_hold;
.float grab;
.float vehicle;
.float weight;
.float slot1_weight;
.float slot2_weight;
.float armor_weight;
.float max_weight;
.float sneak;
.float rescued;
.float scale;
.float bandages;
.float scraps;
.float armor;
.float slot1;
.float slot2;
.float cycle1;
.float cycle2;
.float c4;
@ -624,6 +622,8 @@ float red_armor;
.float protect;
.float perk;
.float equipment;
.float chem;
.float chemcount;
.float buildtype;
.float ctimer;
.float flash;
@ -747,8 +747,8 @@ string(string s) precache_sound = #19;
string(string s) precache_model = #20;
void(entity client, string s)stuffcmd = #21;
entity(vector org, float rad) findradius = #22;
void(float level, string s, ...) bprint = #23;
void(entity client, float level, string s, ...) sprint = #24;
void(float level, string s) bprint = #23;
void(entity client, float level, string s) sprint = #24;
void(string s) dprint = #25;
string(float f) ftos = #26;
string(vector v) vtos = #27;
@ -758,7 +758,7 @@ void() traceoff = #30;
void(entity e) eprint = #31; // prints an entire edict
float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
// #33 was removed
float() droptofloor= #34; // TRUE if landed on floor
float(float yaw, float dist) droptofloor= #34; // TRUE if landed on floor
void(float style, string value) lightstyle = #35;
float(float v) rint = #36; // round to nearest int
float(float v) floor = #37; // largest integer <= v
@ -802,7 +802,8 @@ void(string s) changelevel = #70;
void(string var, string val) cvar_set = #72; // sets cvar.value
void(entity client, string s, ...) centerprint = #73; // sprint, but in middle
void(entity client, string s) centerprint = #73; // sprint, but in middle
void (entity client, string x1, string x2, string x3, string x4, string x5, string x6, string x7) centerprint7 = #73;
void(vector pos, string samp, float vol, float atten) ambientsound = #74;
@ -845,6 +846,3 @@ float (entity e, float healamount, float ignore) T_Heal; // health function
float(entity targ, entity inflictor) CanDamage;

View file

@ -6,9 +6,6 @@ SOLDIER / PLAYER
==============================================================================
*/
#define mag1 currentammo
#define maxmag1 cnt
$cd id1/models/enforcer
$origin 0 -6 24
$base base
@ -54,12 +51,13 @@ void() enforcer_fire =
};
void (float tmp, float dam) enforcer_single =
void (float var, float dam) enforcer_single =
{
local vector src;
local vector dir;
local vector direction;
local entity en;
local float var;
local float r;
local vector targ;
local vector org;
@ -68,9 +66,10 @@ void (float tmp, float dam) enforcer_single =
local float ydif;
local float xdif;
local float true;
local float zdif;
if (self.enemy.sneak == 1)
tmp = tmp * 2;
var = var * 2;
if (self.mag1 == 0)
{
@ -94,7 +93,7 @@ void (float tmp, float dam) enforcer_single =
direction = dir;
traceline (src, src + direction*4000 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self);
traceline (src, src + direction*4000 + v_right*crandom()*var + v_up*crandom()*var, FALSE, self);
if (trace_fraction == PLAT_LOW_TRIGGER)
return;
@ -375,7 +374,7 @@ void() monster_enforcer =
setsize (self, '-12 -12 -24', '12 12 32');
self.health = 100;
self.islot3 = SlotVal(IID_ARM_COMBAT, 1);
self.armor = 5;
self.armortype = 0.5;
self.helmet = 1;
self.th_stand = enf_stand1;
@ -393,6 +392,3 @@ void() monster_enforcer =
walkmonster_start();
return;
};
#undef mag1
#undef maxmag1

View file

@ -288,6 +288,7 @@ float() ShamCheckAttack =
local vector spot1, spot2;
local entity targ;
local float chance;
local float enemy_yaw;
if (enemy_range == RANGE_MELEE)
{

View file

@ -274,66 +274,49 @@ void() item_health =
};
void() health_touch =
void () health_touch =
{
local float amount;
local string s;
local float amount;
local string s;
if (deathmatch == 4)
if (other.invincible_time > 0)
return;
if (other.classname != "player")
if (other.classname != "player" || other.ghost != 0)
return;
if (self.healtype == 2) // Megahealth? Ignore max_health...
if (other.classname == "player")
{
if (other.health >= 250)
if (self.healtype == H_MEGA)
return;
if (!T_Heal(other, self.healamount, 1))
if (other.ghost != 0)
return;
}
else
{
if (!T_Heal(other, self.healamount, 0))
if (other.chem == 0)
other.chem = 1;
if (other.chem > 1)
return;
}
sprint(other, PRINT_LOW, "You receive ");
s = ftos(self.healamount);
sprint(other, PRINT_LOW, s);
sprint(other, PRINT_LOW, " health\n");
if (other.equipment == 4 && other.chemcount >= 4)
return;
// health touch sound
sound(other, CHAN_ITEM, self.noise, 1, ATTN_NORM);
if (other.equipment != 4 && other.chemcount >= 2)
return;
stuffcmd (other, "bf\n");
sprint (other, PRINT_HIGH, "picked up a stimpack.\n");
other.chemcount = other.chemcount + 1;
self.model = string_null;
self.solid = SOLID_NOT;
if (random()*4 <= 2)
sound (other, CHAN_ITEM, "misc/item1.wav", 1, ATTN_NORM);
else
sound (other, CHAN_ITEM, "misc/item2.wav", 1, ATTN_NORM);
// Megahealth = rot down the player's super health
if (self.healtype == 2)
{
other.items = other.items | IT_SUPERHEALTH;
if (deathmatch != 4)
{
self.nextthink = time + 5;
self.think = item_megahealth_rot;
}
self.owner = other;
}
else
{
if (deathmatch != 2) // deathmatch 2 is the silly old rules
{
self.nextthink = time + 20;
self.think = SUB_regen;
}
self.model = string_null;
self.solid = SOLID_NOT;
return;
}
activator = other;
SUB_UseTargets(); // fire all targets / killtargets
SUB_UseTargets ();
};
void() item_megahealth_rot =

View file

@ -176,7 +176,7 @@ void() misc_fireball =
self.nextthink = time + (random() * 5);
self.think = fire_fly;
if (!self.speed)
self.speed = 1000;
self.speed == 1000;
};
void() fire_fly =
@ -335,6 +335,8 @@ void() Laser_Touch =
void(vector org, vector vec) LaunchLaser =
{
local vector vec;
if (self.classname == "monster_enforcer")
sound (self, CHAN_WEAPON, "enforcer/enfire.wav", 1, ATTN_NORM);
@ -589,7 +591,7 @@ void() func_illusionary =
self.movetype = MOVETYPE_NONE;
self.solid = SOLID_NOT;
setmodel (self, self.model);
makestatic (self);
makestatic ();
};
/*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4

View file

@ -76,7 +76,6 @@ void() BuyBandages =
void(float cost, float type) BuyChem =
{
/*
local string x;
local float y;
@ -111,7 +110,6 @@ void(float cost, float type) BuyChem =
x = GetChemName();
sprint (self, PRINT_HIGH, x);
sprint(self, PRINT_HIGH, " purchased.\n");
*/
};
void(string type) ChangeAmmo =
@ -171,7 +169,6 @@ void() BuyScraps =
void (float wt, float cost, float item) BuyWeapon =
{
/*
local float lbs;
local string qq;
local float curr;
@ -181,31 +178,29 @@ void (float wt, float cost, float item) BuyWeapon =
lbs = weightx ();
if ((self.current_slot == 1))
if (self.current_slot == 1)
{
curr = self.slot1_weight;
if (self.slot2 == 0)
self.slot2 = self.slot1;
if (self.slot2 != 0)
else if (self.slot2 != 0)
DropWeapon (self.slot2, 1, 0);
GetWeaponModel ();
}
if ((self.current_slot == 2))
if (self.current_slot == 2)
{
curr = self.slot2_weight;
if (self.slot1 == 0)
self.slot1 = self.slot2;
if (self.slot1 != 0)
{
else if (self.slot1 != 0)
DropWeapon (self.slot1, 1, 0);
self.slot2 = 0;
}
GetWeaponModel ();
}
if ((lbs + wt - curr) > self.max_weight)
{
sprint (self, PRINT_HIGH, "you can't carry that much.\n");
@ -248,7 +243,6 @@ void (float wt, float cost, float item) BuyWeapon =
GetWeaponWeight (self, 2);
GetWeaponModel ();
return;
*/
};
void (float cost, float item) BuyPerk =
@ -267,7 +261,6 @@ void (float cost, float item) BuyPerk =
void (float wt, float cost, float item) BuyArmor =
{
/*
local float curr;
local float lbs;
local string x;
@ -285,7 +278,7 @@ void (float wt, float cost, float item) BuyArmor =
self.currentmenu = "none";
return;
}
if ((((lbs + wt) - GetItemsWeight(self.islot3)) > self.max_weight))
if ((((lbs + wt) - self.armor_weight) > self.max_weight))
{
sprint (self, PRINT_HIGH, "you can't carry that much.\n");
self.currentmenu = "none";
@ -293,14 +286,13 @@ void (float wt, float cost, float item) BuyArmor =
}
sound (self, CHAN_BODY, "misc/item2.wav", 1, ATTN_NORM);
self.ammo_shells = (self.ammo_shells - cost);
// self.armor_weight = wt;
self.armor_weight = wt;
self.armor = item;
x = GetArmorName();
sprint (self, PRINT_HIGH, x);
sprint (self, PRINT_HIGH, " purchased.\n");
return;
*/
};
void (float cost, float item) BuyEquipment =
@ -328,14 +320,12 @@ void (float cost, float item) BuyProtect =
{
local string x;
/*
if ((self.armor >= TE_LIGHTNING2))
{
sprint (self, PRINT_HIGH, "too many electronics in\nyour currently worn armor!");
self.currentmenu = "none";
return;
}
*/
if ((cost > self.ammo_shells))
{
sprint (self, PRINT_HIGH, "not enough money.\n");
@ -355,20 +345,20 @@ void (float cost, float item) BuyProtect =
float (float input) overweight =
{
local float tmp;
local float var;
local float max;
tmp = input + self.weight;
var = ((((input) + self.armor_weight) + self.slot1_weight) + self.slot2_weight);
max = self.max_weight;
if (self.class == TE_LIGHTNING2)
if ((self.class == TE_LIGHTNING2))
{
max = max + SPAWNFLAG_LASER;
max = (max + SPAWNFLAG_LASER);
}
if (self.perk == TE_LAVASPLASH)
if ((self.perk == TE_LAVASPLASH))
{
return (FALSE);
}
if (tmp > max)
if ((var > max))
{
return (TRUE);
}
@ -378,6 +368,14 @@ float (float input) overweight =
}
};
float () weightx =
{
local float var;
var = self.slot1_weight + self.slot2_weight + self.armor_weight;
return var;
};
void () W_GetClass =
{
if ((self.currentmenu == "select_skill"))
@ -621,13 +619,13 @@ void() W_PlayerMenu =
BuyWeapon(5, 25, 17); //weight, cost, item
if (self.impulse == 4)
BuyWeapon(6, 28, 18); //weight, cost, item
if (self.impulse == 4)
if (self.impulse == 5)
BuyWeapon(5, 30, 19); //weight, cost, item
if (self.impulse == 4)
if (self.impulse == 6)
BuyWeapon(4, 32, 20); //weight, cost, item
if (self.impulse == 4)
if (self.impulse == 7)
BuyWeapon(7, 40, 21); //weight, cost, item
if (self.impulse == 4)
if (self.impulse == 8)
BuyWeapon(10, 45, 22); //weight, cost, item
return;

View file

@ -1,5 +1,85 @@
string (entity guy, float slot) GetWeaponName =
{
local string name;
if (slot == 0)
name = "bare hands";
if (slot == 1)
name = "knife";
else if (slot == 2)
name = "axe";
else if (slot == 3)
name = "ripper";
else if (slot == 4)
name = "power axe";
else if (slot == 5)
name = "1911";
else if (slot == 6)
name = "desert eagle";
else if (slot == 7)
name = "needler";
else if (slot == 8)
name = "alien blaster";
else if (slot == 9)
name = "pipe rifle";
else if (slot == 10)
name = "winchester";
else if (slot == 11)
name = "mossberg";
else if (slot == 12)
name = "citykiller";
else if (slot == 13)
name = "mp9";
else if (slot == 14)
name = "grease gun";
else if (slot == 15)
name = "rangemaster";
else if (slot == 16)
name = "ak-112";
else if (slot == 17)
name = "ak-74";
else if (slot == 18)
name = "dks-1";
else if (slot == 19)
name = "moonlight";
else if (slot == 20)
name = "sa-80";
else if (slot == 21)
name = "gauss rifle";
else if (slot == 22)
name = "laser carbine";
return name;
};
string () GetArmorName =
{
local string name;
local float slot;
slot = self.armor;
if (slot == 0)
name = "none";
else if (slot == 1)
name = "bulletproof shirt";
else if (slot == 2)
name = "leather armor";
else if (slot == 3)
name = "kevlar armor";
else if (slot == 4)
name = "metal armor";
else if (slot == 5)
name = "combat armor";
else if (slot == 6)
name = "brotherhood armor";
else if (slot == 7)
name = "force armor";
else if (slot == 8)
name = "light power armor";
return name;
};
string () GetEquipmentName =

View file

@ -363,7 +363,7 @@ void () ogre_smash11 = [ 57, ogre_smash12 ]
void () ogre_smash12 = [ 58, ogre_smash13 ]
{
ai_charge (0);
ai_charge ();
};
void () ogre_smash13 = [ 59, ogre_smash14 ]

View file

@ -57,16 +57,28 @@ void () Footstep =
float (entity guy) holding_melee =
{
local float iid;
iid = ToIID(ItemInSlot(guy, guy.current_slot));
if (iid == IID_NONE ||
iid == IID_WP_KNIFE ||
iid == IID_WP_AXE ||
iid == IID_WP_VIBROBLADE ||
iid == IID_WP_POWERAXE)
return true;
return false;
if ((guy.current_slot == WEAPON_SHOTGUN))
{
if ((guy.slot1 <= TE_WIZSPIKE))
{
return (TRUE);
}
if ((guy.slot1 >= WEAPON_BIG))
{
return (FALSE);
}
}
if ((guy.current_slot == WEAPON_ROCKET))
{
if ((guy.slot2 <= TE_WIZSPIKE))
{
return (TRUE);
}
if ((guy.slot2 >= WEAPON_BIG))
{
return (FALSE);
}
}
};
void () player_crouch;
@ -196,6 +208,7 @@ void () player_reload1 = [ 123, player_reload2 ]
void () player_reload2 = [ 124, player_reload3 ]
{
};
void () player_reload3 = [ 125, player_reload4 ]
@ -588,8 +601,6 @@ void () player_pull11 = [ 155, player_run ]
void () player_throw1 = [ 155, player_throw2 ]
{
self.attack_finished = time + 1;
self.weaponframe = 12;
if (((random () * WEAPON_BIG) <= WEAPON_SPIKES))
sound (self, CHAN_VOICE, "radio/grenade.wav", 0.7, ATTN_NORM);
@ -600,63 +611,57 @@ void () player_throw1 = [ 155, player_throw2 ]
void () player_throw2 = [ 156, player_throw3 ]
{
self.weaponframe = TE_LIGHTNINGBLOOD;
FireHandGrenade ();
self.attack_finished = time + 1;
//FireHandGrenade ();
};
void () player_throw3 = [ 157, player_throw4 ]
{
self.weaponframe = IDLE2A;
self.attack_finished = time + 1;
};
void () player_throw4 = [ 158, player_throw5 ]
{
self.weaponframe = IDLE3A;
self.attack_finished = time + 1;
};
void () player_throw5 = [ 157, player_throw6 ]
{
self.weaponframe = EF_FLAG1;
self.attack_finished = time + 1;
};
void () player_throw6 = [ 156, player_throw7 ]
{
self.weaponframe = IDLE5A;
self.attack_finished = time + 1;
};
void () player_throw7 = [ 155, player_throw8 ]
{
self.weaponframe = IDLE6A;
self.attack_finished = time + 1;
if (self.handgrenade <= 0)
stuffcmd (self, "impulse 1\n");
else
stuffcmd (self, "impulse 3\n");
};
void () player_throw8 = [ 159, player_throw9 ]
{
self.weaponframe = IDLE7A;
self.attack_finished = time + 1;
};
void () player_throw9 = [ 160, player_throw10 ]
{
self.weaponframe = IDLE8A;
self.attack_finished = time + 1;
};
void () player_throw10 = [ 161, player_throw11 ]
{
self.weaponframe = IDLE9A;
self.attack_finished = time + 1;
};
void () player_throw11 = [ 162, player_run ]
{
self.weaponframe = IDLE10A;
self.attack_finished = self.nextthink;
W_SetCurrentAmmo();
};
void () player_shotty1b = [ 183, player_shotty2b ]

View file

@ -1,7 +1,6 @@
../qwprogs.dat
../quake/turn/qwprogs.dat
defs.qc
inventory.qc
subs.qc
fight.qc
@ -32,4 +31,3 @@ dog.qc
ogre.qc
misc.qc
mod_buy.qc
cmds.qc

View file

@ -1,16 +1,13 @@
#define mag1 currentammo
#define maxmag1 cnt
void () army_load1;
//PISTOL
void (float tmp, float dam) army_fire =
void (float var, float dam) army_fire =
{
local vector src;
local vector dir;
local vector direction;
local entity en;
local float var;
local float r;
local vector targ;
local vector org;
@ -19,9 +16,10 @@ void (float tmp, float dam) army_fire =
local float ydif;
local float xdif;
local float true;
local float zdif;
if (self.enemy.sneak == 1)
tmp = tmp * 2;
var = var * 2;
if (self.mag1 == 0)
{
@ -48,7 +46,7 @@ void (float tmp, float dam) army_fire =
direction = dir;
traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self);
traceline (src, src + direction*2048 + v_right*crandom()*var + v_up*crandom()*var, FALSE, self);
if (trace_fraction == PLAT_LOW_TRIGGER)
return;
@ -73,12 +71,13 @@ void (float tmp, float dam) army_fire =
//RIFLE
void (float tmp, float dam) army_fire1 =
void (float var, float dam) army_fire1 =
{
local vector src;
local vector dir;
local vector direction;
local entity en;
local float var;
local float r;
local vector targ;
local vector org;
@ -87,9 +86,10 @@ void (float tmp, float dam) army_fire1 =
local float ydif;
local float xdif;
local float true;
local float zdif;
if (self.enemy.sneak == 1)
tmp = tmp * 2;
var = var * 2;
if (self.mag1 == 0)
{
@ -140,12 +140,13 @@ void (float tmp, float dam) army_fire1 =
//SHOTGUN
void (float tmp, float dam) army_fire2 =
void (float var, float dam) army_fire2 =
{
local vector src;
local vector dir;
local vector direction;
local entity en;
local float var;
local float r;
local vector targ;
local vector org;
@ -155,7 +156,7 @@ void (float tmp, float dam) army_fire2 =
local float dif;
if (self.enemy.sneak == 1)
tmp = tmp * 2;
var = var * 2;
if (self.mag1 == 0)
{
@ -239,12 +240,13 @@ void (float tmp, float dam) army_fire2 =
};
//SMG
void (float tmp, float dam) army_fire3 =
void (float var, float dam) army_fire3 =
{
local vector src;
local vector dir;
local vector direction;
local entity en;
local float var;
local float r;
local vector targ;
local vector org;
@ -253,6 +255,7 @@ void (float tmp, float dam) army_fire3 =
local float ydif;
local float xdif;
local float true;
local float zdif;
if (self.mag1 == 0)
{
@ -263,7 +266,7 @@ void (float tmp, float dam) army_fire3 =
}
if (self.enemy.sneak == 1)
tmp = tmp * 2;
var = var * 2;
self.mag1 = self.mag1 - 1;
@ -279,7 +282,7 @@ void (float tmp, float dam) army_fire3 =
direction = dir;
traceline (src, src + direction*1024 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self);
traceline (src, src + direction*1024 + v_right*crandom()*var + v_up*crandom()*var, FALSE, self);
if (trace_fraction == PLAT_LOW_TRIGGER)
return;
@ -303,12 +306,13 @@ void (float tmp, float dam) army_fire3 =
};
//Assault Rifle
void (float tmp, float dam) army_fire4 =
void (float var, float dam) army_fire4 =
{
local vector src;
local vector dir;
local vector direction;
local entity en;
local float var;
local float r;
local vector targ;
local vector org;
@ -328,7 +332,7 @@ void (float tmp, float dam) army_fire4 =
}
if (self.enemy.sneak == 1)
tmp = tmp * 2;
var = var * 2;
self.mag1 = self.mag1 - 1;
@ -344,7 +348,7 @@ void (float tmp, float dam) army_fire4 =
direction = dir;
traceline (src, src + direction*2048 + v_right*crandom()*tmp + v_up*crandom()*tmp, FALSE, self);
traceline (src, src + direction*2048 + v_right*crandom()*var + v_up*crandom()*var, FALSE, self);
if (trace_fraction == PLAT_LOW_TRIGGER)
return;
@ -1328,7 +1332,7 @@ void () monster_army =
setsize (self, '-12 -12 -24', '12 12 32');
self.health = 120;
self.islot3 = SlotVal(IID_ARM_COMBAT, 1);
self.armor = 5;
self.armortype = 35;
self.th_stand = enf_stand1;
self.th_walk = enf_walk1;
@ -1370,7 +1374,7 @@ void () monster_army =
setsize (self, '-16 -16 -24', '16 16 32');
self.health = 90;
self.team = 3;
self.islot3 = SlotVal(IID_ARM_LEATHER, 1);
self.armor = 2;
self.armortype = 0.2;
self.armornoise = "misc/thud.wav";
self.th_stand = army_stand1;
@ -1404,5 +1408,3 @@ void () monster_army =
self.maxmag1 = self.mag1;
};
#undef mag1
#undef maxmag1

View file

@ -15,7 +15,7 @@ void(float normal) SUB_AttackFinished =
QuakeEd only writes a single float for angles (bad idea), so up and down are
just constant angles.
*/
void() SetMovedir =
vector() SetMovedir =
{
if (self.angles == '0 -1 0')
self.movedir = '0 0 1';

File diff suppressed because it is too large Load diff

View file

@ -157,16 +157,16 @@ void() main =
void () GameTimer =
{
local entity te, ze;
local float switched;
local float switch;
local float c, z;
switched = 0;
switch = 0;
te = findradius(self.origin, 25000);
while (c < 300 && switched == 0)
while (c < 300 && switch == 0)
{
if (te.classname == "raider" && te.enemy != world && te.processed == 0 && te.active == 0 && switched == 0)
if (te.classname == "raider" && te.enemy != world && te.processed == 0 && te.active == 0 && switch == 0)
{
te.active = 1;
te.processed = 1;
@ -174,7 +174,7 @@ void () GameTimer =
bprint(2, te.netname);
bprint(2, "'s turn.\n");
te.maxspeed = 300;
switched = 1;
switch = 1;
ze = findradius(self.origin, 25000);
z = 0;
@ -189,7 +189,7 @@ void () GameTimer =
ze = ze.chain;
}
}
if (te.classname == "player" && te.processed == 0 && te.active == 0 && switched == 0)
if (te.classname == "player" && te.processed == 0 && te.active == 0 && switch == 0)
{
te.active = 1;
te.processed = 1;
@ -197,7 +197,7 @@ void () GameTimer =
bprint(2, te.netname);
bprint(2, "'s turn.\n");
te.maxspeed = 300;
switched = 1;
switch = 1;
ze = findradius(self.origin, 25000);
z = 0;
@ -217,7 +217,7 @@ void () GameTimer =
}
c = 0;
if (switched == 0) // no entities left, turn is over
if (switch == 0) // no entities left, turn is over
{
bprint(2, "round is now over.\n");
@ -275,8 +275,6 @@ void() worldspawn =
InitBodyQue ();
coop = 1;
SetupStats();
// custom map attributes
if (self.model == "maps/e1m8.bsp")
@ -390,7 +388,7 @@ void() worldspawn =
precache_model ("progs/v_knife.mdl");
precache_model ("progs/v_1911.mdl");
precache_model ("progs/v_ak47.mdl");
precache_model ("progs/v_mp7.mdl");
precache_model ("progs/v_smg.mdl");
precache_model ("progs/v_rangem.mdl");
precache_model ("progs/v_pipe.mdl");
precache_model ("progs/v_shotgun.mdl");