1
0
Fork 0
forked from fte/fteqw

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

This commit is contained in:
Magnus 2009-11-23 05:04:45 +00:00
parent 8a0bd1abd9
commit 9a5379f76e
9 changed files with 227 additions and 208 deletions

View file

@ -1080,6 +1080,9 @@ void() PlayerJump =
if (!(self.flags & FL_ONGROUND)) if (!(self.flags & FL_ONGROUND))
return; return;
if (self.position > 0)
return;
if ( !(self.flags & FL_JUMPRELEASED) ) if ( !(self.flags & FL_JUMPRELEASED) )
return; // don't pogo stick return; // don't pogo stick
@ -1610,7 +1613,7 @@ void() PlayerPreThink =
{ {
self.score = 200; self.score = 200;
sound (self, CHAN_BODY, "misc/levelup.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "player/levelup.wav", 1, ATTN_NORM);
sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n");
} }
} }
@ -1620,7 +1623,7 @@ void() PlayerPreThink =
{ {
self.score = 200; self.score = 200;
sound (self, CHAN_BODY, "misc/levelup.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "player/levelup.wav", 1, ATTN_NORM);
sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n"); sprint(self, 2, "you have gained a level!\npress 'p' to assign a skill point.\n");
} }
} }
@ -1706,6 +1709,18 @@ void() PlayerPreThink =
self.cycle1 = time + 0.5; self.cycle1 = time + 0.5;
} }
if (walkmove(0, 0) && self.solid != SOLID_SLIDEBOX)
{
self.materialize = 0;
self.solid = SOLID_SLIDEBOX;
}
else
{
self.materialize = 5;
self.solid = SOLID_NOT;
}
if (self.materialize > 0) if (self.materialize > 0)
{ {
self.materialize = self.materialize - 1; self.materialize = self.materialize - 1;
@ -1715,12 +1730,13 @@ void() PlayerPreThink =
if (walkmove(0, 0)) if (walkmove(0, 0))
{ {
self.solid = SOLID_SLIDEBOX; self.solid = SOLID_SLIDEBOX;
//bprint(2, "turning solid\n"); bprint(2, "turning solid\n");
} }
else else
{ {
self.materialize = 50; self.materialize = 50;
//bprint(2, "stuck in object, returning non-solid\n"); bprint(2, "stuck in object, returning non-solid\n");
self.solid = SOLID_NOT;
} }
} }
} }
@ -1794,12 +1810,19 @@ void() PlayerPreThink =
if (ToIID(self.islot4) == IID_EQUIP_GOGGLES) if (ToIID(self.islot4) == IID_EQUIP_GOGGLES)
stuffcmd(self, "v_cshift 25 0 25 25\n"); stuffcmd(self, "v_cshift 25 0 25 25\n");
if (self.position == 0)
x = ftos(self.recoil); x = ftos(self.recoil);
else if (self.position == 1)
x = ftos(self.recoil/2);
else if (self.position == 2)
x = ftos(self.recoil/4);
if (self.steadyaim == 0) if (self.steadyaim == 0)
stuffcmd(self, "v_idlescale 0\n"); stuffcmd(self, "v_idlescale 0\n");
else else if (self.recoil > 0)
stuffcmd(self, strcat("v_idlescale ", x, "\n")); stuffcmd(self, strcat("v_idlescale ", x, "\n"));
else if (self.velocity != '0 0 0')
stuffcmd(self, "v_idlescale 1\n");
} }
self.cycle2 = time + 1; self.cycle2 = time + 1;
@ -1818,7 +1841,7 @@ void() PlayerPreThink =
{ {
PlayerJump (); PlayerJump ();
} }
else else if (self.position > 0)
self.flags = self.flags | FL_JUMPRELEASED; self.flags = self.flags | FL_JUMPRELEASED;
// teleporters can force a non-moving pause time // teleporters can force a non-moving pause time

View file

@ -321,7 +321,7 @@ void(string arg1) Cmd_InvBuy =
if (x == 0) if (x == 0)
{ {
sprint(self, 2, "no more room in inventory!\n"); sprint(self, 2, "no more room in inventory!\n");
sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM); sound (self, CHAN_BODY, "misc/beep2.wav", 1, ATTN_NORM);
return; return;
} }
@ -370,8 +370,14 @@ void(string arg1) Cmd_InvBuy =
iid = ToIID(item); iid = ToIID(item);
amount = ToStatus(item); amount = ToStatus(item);
money = GetBaseValue(iid); money = GetBaseValue(iid);
if (self.supertime <= 0)
money = ceil(money * (1 - (self.skill_speech/30))); money = ceil(money * (1 - (self.skill_speech/30)));
else
{
sprint(self, 2, "We don't serve your kind here!\n");
sound (self, CHAN_BODY, "misc/beep1.wav", 1, ATTN_NORM);
return;
}
if (self.ammo_shells < money) if (self.ammo_shells < money)
{ {
sprint(self, 2, "not enough money.\n"); sprint(self, 2, "not enough money.\n");

View file

@ -147,22 +147,14 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
damage = floor(damage); damage = floor(damage);
targ.health = floor(targ.health); targ.health = floor(targ.health);
/*
if (attacker.classname == "player" && total_players == 4)
damage = floor(damage * 0.75);
if (attacker.classname == "player" && total_players == 3)
damage = floor(damage * 0.80);
else if (attacker.classname == "player" && total_players == 2)
damage = floor(damage * 0.90);
if (targ.classname == "player")
damage = floor(damage * 0.60);*/
if (challenge_rating <= 6 && attacker.classname == "monster") if (challenge_rating >= 20 && attacker.classname == "monster")
damage = damage * 0.70; damage = damage * 1.30;
if (challenge_rating <= 9 && attacker.classname == "monster") else if (challenge_rating <= 12 && attacker.classname == "monster")
damage = damage * 0.80; damage = damage * 1.20;
else if (challenge_rating <= 9 && attacker.classname == "monster")
damage = damage * 1.10;
if (targ.radiation > 0) if (targ.radiation > 0)
{ {
@ -191,7 +183,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
if (attacker.classname == "player" && targ.classname == "monster" && attacker.recoil <= 5) if (attacker.classname == "player" && targ.classname == "monster" && attacker.recoil <= 5)
attacker.score = attacker.score + 1; attacker.score = attacker.score + 1;
//attacker a monster from behind awards points //attacking a monster from behind awards points
local vector vec; local vector vec;
local float dot; local float dot;
@ -202,21 +194,27 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
vec = normalize (attacker.origin - targ.origin); vec = normalize (attacker.origin - targ.origin);
dot = (vec * v_forward); dot = (vec * v_forward);
if (dot > 0.3) if (dot < 0.3)
attacker.score = attacker.score + 1; attacker.score = attacker.score + 1;
if (attacker.perk1 == 15 || attacker.perk2 == 15)
{
bprint(2, "SNEAK ATTACK\n");
damage = damage * (1 + (attacker.skill_sneak/15));
}
} }
//attacking a team-mate is a HUGE penalty //attacking a team-mate is a HUGE penalty
if (attacker.classname == "player" && targ.classname == "player") if (attacker.classname == "player" && targ.classname == "player")
{ {
attacker.score = attacker.score - 3; attacker.score = attacker.score - 5;
sprint(attacker, 2, "you just shot a teammate! be careful!\n"); sprint(attacker, 2, "you just shot a teammate! be careful!\n");
} }
//attacking a hostage is a HUGE penalty //attacking a hostage is a HUGE penalty
if (attacker.classname == "player" && targ.classname == "hostage") if (attacker.classname == "player" && targ.classname == "hostage")
{ {
attacker.score = attacker.score - 3; attacker.score = attacker.score - 5;
sprint(attacker, 2, "you just shot a hostage! be careful!\n"); sprint(attacker, 2, "you just shot a hostage! be careful!\n");
} }
@ -231,36 +229,23 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return; return;
} }
else if (targ.position == 1 && random()<0.05) else if (targ.position == 1 && random()<0.10)
{ {
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return; return;
} }
else if (targ.position == 2 && random()<0.10) else if (targ.position == 2 && random()<0.20)
{ {
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return; return;
} }
damage = damage * 1.25;
//nintendo gamer: going into the zone gives a 50% miss chance
if (targ.rage == 255)
{
if (random()<0.50)
{
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return;
}
}
//stay low: if taking cover, 20% miss chance (others get 10% bonus)
//paranoia: if taking cover, 25% miss chance (others get 10% bonus)
if (targ.rage == 777) if (targ.rage == 777)
{ {
if (targ.perk1 == 2 || targ.perk2 == 2) if (targ.perk1 == 4 || targ.perk2 == 4)
{ {
if (random()<0.20) if (random()<0.20)
{ {
@ -270,7 +255,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
} }
else else
{ {
if (random()<0.05) if (random()<0.10)
{ {
sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM); sound (targ, CHAN_BODY, "effects/miss.wav", 1, ATTN_NORM);
return; return;
@ -279,51 +264,35 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
} }
//master blaster: the more you burst, the higher the damage bonus //master blaster: the more you burst, the higher the damage bonus
if (attacker.perk1 == 18 || attacker.perk2 == 18) if (attacker.perk1 == 14 || attacker.perk2 == 14)
{ {
if (attacker.recoil > 10) if (attacker.recoil > 5)
{ {
sprint(attacker, 2, "!MASTER BLASTER\n"); damage = damage * (1 + (attacker.recoil * 0.03));
damage = damage * (1 + (attacker.recoil * 0.01));
} }
} }
//hit the deck //stay low
if (targ.perk1 == 4 || targ.perk2 == 4) if (targ.perk1 == 4 || targ.perk2 == 4)
{ {
if (targ.position == 2) if (targ.position == 2)
damage = damage * 0.90; damage = damage * 0.75;
} }
//sneak attack: if you attack a creature who isn't fighting you, bonus damage //sneak attack: if you attack a creature who isn't fighting you, bonus damage
if (attacker.skill_sneak > 0) if (attacker.skill_sneak > 0 && attacker.sneak > 0)
{ {
if (targ.enemy != attacker) if (targ.enemy != attacker)
damage = damage * (1 + (attacker.skill_sneak/100));
}
//death wish: 20% damage bonus to targ, 10% to attacker
if (targ.perk1 == 19 || targ.perk2 == 19)
damage = damage * 1.10;
//death wish: 20% damage bonus to targ, 10% to attacker
if (attacker.perk1 == 19 || attacker.perk2 == 19)
damage = damage * 1.20;
//die hard: if below 50% health, 25% damage resistance
if (targ.perk1 == 1 || targ.perk2 == 1)
{ {
if (targ.health < (targ.max_health*0.5)) bprint(2, "SNEAK ATTACK\n");
damage = damage * 0.75; damage = damage * (1 + (attacker.skill_sneak/15));
}
} }
if ((targ.perk1 == 17 || targ.perk2 == 17) && random()<0.02)
{
damage = damage * 0.10;
sprint(self, 2, "!ONE IN A MILLION\n");
}
// used by buttons and triggers to set activator for target firing // used by buttons and triggers to set activator for target firing
damage_attacker = attacker; damage_attacker = attacker;
@ -336,7 +305,7 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
attacker.critical = 0; attacker.critical = 0;
} }
if (attacker.critical == 3 && targ.classname != "car")//attacker scored a headshot/critical if (attacker.critical == 3 && targ.classname == "car")//attacker scored a headshot/critical
{ {
if (attacker.critical == 3) if (attacker.critical == 3)
{ {
@ -346,24 +315,8 @@ void(entity targ, entity inflictor, entity attacker, float damage) T_Damage =
if (targ.classname == "monster") if (targ.classname == "monster")
attacker.score = attacker.score + 1; attacker.score = attacker.score + 1;
helm = targ.armortype;
if (targ.helmet == 0)
{
sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM); sound (targ, CHAN_VOICE, "player/headshot.wav", 1, ATTN_NORM);
helm = 0;
}
if (targ.helmet == 1)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.30;
}
if (targ.helmet == 2)
{
sound (targ, CHAN_BODY, "weapons/helmet.wav", 1, ATTN_NORM);
helm = 0.45;
}
damage = (damage - (damage * helm));
makevectors (targ.v_angle); makevectors (targ.v_angle);
} }
@ -518,7 +471,7 @@ take = damage;
if (targ.classname == "player" && targ.zoom > 0) if (targ.classname == "player" && targ.zoom > 0)
{ {
targ.maxspeed = targ.maxspeed * 0.33; targ.maxspeed = targ.maxspeed * 0.33;
stuffcmd(targ, "v_idlescale 20\n"); stuffcmd(targ, "v_idlescale 10\n");
} }
else if (take > 20 && targ.classname == "player") else if (take > 20 && targ.classname == "player")
{ {
@ -532,15 +485,15 @@ take = damage;
stuffcmd(targ, "v_cshift 100 0 0 50\n"); stuffcmd(targ, "v_cshift 100 0 0 50\n");
} }
ArmorNoise(targ, attacker);
if (take <= 0) if (take <= 0)
{ {
take = 0; take = 0;
sound (targ, CHAN_BODY, targ.armornoise, 1, ATTN_NORM);
return; return;
} }
ArmorNoise(targ, attacker);
if (targ.hold <= 0) if (targ.hold <= 0)
targ.health = targ.health - take; targ.health = targ.health - take;

View file

@ -476,9 +476,6 @@ void() Trader_Draw =
float width,height,lvl,bar; float width,height,lvl,bar;
vector w; vector w;
width = cvar("vid_conwidth");
height = cvar("vid_conheight");
//w = '1 1 0'*height;
@ -508,19 +505,19 @@ void() Trader_Draw =
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 1*IMGSIZEF*(scrwidth/640) && mousepos_y <= 2*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/IMGSIZEF) + 0; slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 0;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 2*IMGSIZEF*(scrwidth/640) && mousepos_y <= 3*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/IMGSIZEF) + 5; slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 5;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 3*IMGSIZEF*(scrwidth/640) && mousepos_y <= 4*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/IMGSIZEF) + 10; slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 10;
if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640)) if (mousepos_x >= 1*IMGSIZEF*(scrwidth/640) && mousepos_x <= 6*IMGSIZEF*(scrwidth/640))
if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640)) if (mousepos_y >= 4*IMGSIZEF*(scrwidth/640) && mousepos_y <= 5*IMGSIZEF*(scrwidth/640))
slotnum = floor((mousepos_x)/IMGSIZEF) + 15; slotnum = floor((mousepos_x)/(IMGSIZEF*(scrwidth/640))) + 15;
if (showcontextmenu && show_trader) if (showcontextmenu && show_trader)

View file

@ -508,6 +508,7 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView =
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'+('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'); 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(); Health_Draw();
Radiation_Draw(); Radiation_Draw();
@ -528,6 +529,9 @@ void(float vwidth, float vheight, float do2d) CSQC_UpdateView =
if (getstati(42) > 0) if (getstati(42) > 0)
SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.77)) +('0 1 0'*(scrheight*0.90)), 11); SlotImageSmall('0 0 0'+('1 0 0'*(scrwidth*0.77)) +('0 1 0'*(scrheight*0.90)), 11);
if (getstati(110) == 0)
drawpic('0 0 0'+('1 0 0'*(scrwidth*0.64)) +('0 1 0'*(scrheight*0.97)), "gui/hud/aim.png", '16 16 0'*(scrheight/640), '1 1 1');
HUD_Perks_Draw(); HUD_Perks_Draw();
Position_Draw(); Position_Draw();

View file

@ -2586,6 +2586,12 @@ string (float slot, float int) PerkName =
return "Economic Moves"; return "Economic Moves";
if (int == 11) if (int == 11)
return "Nuclear Man"; return "Nuclear Man";
if (int == 12)
return "Commander";
if (int == 14)
return "Blaster Master";
if (int == 15)
return "Fighting Dirty";
}; };
string (float slot, float int) PerkNameCentered = string (float slot, float int) PerkNameCentered =
@ -2612,6 +2618,12 @@ string (float slot, float int) PerkNameCentered =
return " Economic Moves "; return " Economic Moves ";
if (int == 11) if (int == 11)
return " Nuclear Man "; return " Nuclear Man ";
if (int == 12)
return " Commander ";
if (int == 14)
return " Blaster Master ";
if (int == 15)
return " Fighting Dirty ";
}; };
@ -2641,6 +2653,10 @@ string(float int) GetPerkImage =
return "gui/perks/Nuclear Man.jpg"; return "gui/perks/Nuclear Man.jpg";
else if (int == 12) else if (int == 12)
return "gui/perks/Commander.jpg"; return "gui/perks/Commander.jpg";
else if (int == 14)
return "gui/perks/Blaster Master.jpg";
else if (int == 15)
return "gui/perks/Fighting Dirty.jpg";
else else
return "gui/perks/none.jpg"; return "gui/perks/none.jpg";
@ -2673,6 +2689,10 @@ string(float int) GetPerkDesc =
return "Your body has adapted to radiation to the point that you"; return "Your body has adapted to radiation to the point that you";
else if (int == 12) else if (int == 12)
return "Your supreme leadership affects all of those around you,"; return "Your supreme leadership affects all of those around you,";
else if (int == 14)
return "Your mastery of burst weapons is complete. You receive a";
else if (int == 15)
return "You are an expert in stealth and can now sneak attack an";
else else
return ""; return "";
@ -2704,6 +2724,10 @@ string(float int) GetPerkDesc2 =
return "can absorb small amounts, healing you as well!"; return "can absorb small amounts, healing you as well!";
else if (int == 12) else if (int == 12)
return " inspiring allies and causing foes to tremble."; return " inspiring allies and causing foes to tremble.";
else if (int == 14)
return " damage bonus the longer you hold the trigger.";
else if (int == 15)
return " enemy who is not facing you.";
else else
return ""; return "";
@ -2724,7 +2748,7 @@ string(float int) GetPerkRequirements =
else if (int == 6) else if (int == 6)
return "None"; return "None";
else if (int == 7) else if (int == 7)
return "Sneak: 7"; return "None";
else if (int == 8) else if (int == 8)
return "None"; return "None";
else if (int == 9) else if (int == 9)

View file

@ -124,9 +124,19 @@ void () CrawlSound =
}; };
void() idle_frames =
{
self.weaponframe = 0;
};
void () player_lay = [ 45, player_run ] void () player_lay = [ 45, player_run ]
{ {
idle_frames();
if (self.velocity != '0 0 0') if (self.velocity != '0 0 0')
self.frame = 8 - self.crawltime; self.frame = 8 - self.crawltime;
else if (self.velocity == '0 0 0') else if (self.velocity == '0 0 0')
@ -152,15 +162,7 @@ void () player_single_shot_duck = [ 183, player_single_shot_duck2 ]{};
void () player_single_shot_duck2 = [ 184, player_run ]{}; void () player_single_shot_duck2 = [ 184, player_run ]{};
void() idle_frames =
{
local float weap;
local string x;
self.weaponframe = 0;
return;
};
@ -300,40 +302,33 @@ void () Footstep =
rand = random (); rand = random ();
if (self.sneak != 0)
return;
r = 1 - (self.skill_sneak/40);
if (self.classname == "player")
if (self.sneak <= 0)
{ {
loud_noise(20 - self.skill_sneak); loud_noise(20 - self.skill_sneak);
r = 1 - (self.skill_sneak/40);
} }
else
r = 0.25;
if (world.worldtype == 1 || world.worldtype == 2) if (self.position == 1)
{ r = r * 0.5;
if ((rand < 0.25))
if (rand < 0.25)
sound (self, CHAN_ITEM, "player/step1.wav", r, ATTN_NORM); sound (self, CHAN_ITEM, "player/step1.wav", r, ATTN_NORM);
else if ((rand < 0.5)) else if (rand < 0.5)
sound (self, CHAN_ITEM, "player/step2.wav", r, ATTN_NORM); sound (self, CHAN_ITEM, "player/step2.wav", r, ATTN_NORM);
else if ((rand < 0.75)) else if (rand < 0.75)
sound (self, CHAN_ITEM, "player/step3.wav", r, ATTN_NORM); sound (self, CHAN_ITEM, "player/step3.wav", r, ATTN_NORM);
else else
sound (self, CHAN_ITEM, "player/step4.wav", r, ATTN_NORM); sound (self, CHAN_ITEM, "player/step4.wav", r, ATTN_NORM);
}
if (world.worldtype == 0)
{
if ((rand < 0.25))
sound (self, CHAN_ITEM, "player/step1a.wav", r, ATTN_NORM);
else if ((rand < 0.5))
sound (self, CHAN_ITEM, "player/step2a.wav", r, ATTN_NORM);
else if ((rand < 0.75))
sound (self, CHAN_ITEM, "player/step3a.wav", r, ATTN_NORM);
else
sound (self, CHAN_ITEM, "player/step4a.wav", r, ATTN_NORM);
}
}; };
float (entity guy) holding_melee = float (entity guy) holding_melee =
@ -362,14 +357,11 @@ void () player_stand1 = [ 149, player_stand1 ]
player_crouch (); player_crouch ();
return; return;
} }
else else if (self.position == 2)
{
if (self.position == 2)
{ {
player_lay (); player_lay ();
return; return;
} }
}
if (self.velocity_x || self.velocity_y) if (self.velocity_x || self.velocity_y)
{ {
self.walkframe = 0; self.walkframe = 0;
@ -393,19 +385,22 @@ void () player_crouch = [ 45, player_run ]
self.frame = 45; self.frame = 45;
return; return;
} }
else else if (self.position == 2)
{
if (self.position == 2)
{ {
player_lay (); player_lay ();
return; return;
} }
}
idle_frames(); idle_frames();
self.frame = (35 + self.walkframe); self.frame = (35 + self.walkframe);
if (self.walkframe == 3 && self.ghost == 0 && self.velocity_z == 0)
Footstep ();
if (self.walkframe == 8 && self.ghost == 0 && self.velocity_z == 0)
Footstep ();
if (self.walkframe == 11) if (self.walkframe == 11)
self.walkframe = 0; self.walkframe = 0;
@ -443,24 +438,21 @@ void () player_run = [ 137, player_run ]
} }
} }
if ((!self.velocity_x && !self.velocity_y)) if (!self.velocity_x && !self.velocity_y)
{ {
player_stand1 (); player_stand1 ();
return; return;
} }
if ((self.position == 1)) else if (self.position == 1)
{ {
player_crouch (); player_crouch ();
return; return;
} }
else else if (self.position == 2)
{
if ((self.position == 2))
{ {
player_lay (); player_lay ();
return; return;
} }
}
if (self.speedmulti <= 0.60) if (self.speedmulti <= 0.60)
{ {
@ -882,6 +874,12 @@ void() player_auto_duck2 = [182, player_run ] {muzzleflash();};
void() player_auto_ducka1 = [183, player_auto_ducka2 ] {muzzleflash();}; void() player_auto_ducka1 = [183, player_auto_ducka2 ] {muzzleflash();};
void() player_auto_ducka2 = [183, player_run ] {muzzleflash();}; void() player_auto_ducka2 = [183, player_run ] {muzzleflash();};
void() player_auto_prone1 = [1, player_auto_prone2 ] {muzzleflash();};
void() player_auto_prone2 = [1, player_run ] {muzzleflash();};
void() player_auto_pronea1 = [0, player_auto_pronea2 ] {muzzleflash();};
void() player_auto_pronea2 = [0, player_run ] {muzzleflash();};
void () player_single1_left = [ 88, player_single2_left ] void () player_single1_left = [ 88, player_single2_left ]
{ {
self.weaponframe = 4; self.weaponframe = 4;

View file

@ -19,6 +19,8 @@ void (float dam, float xrecoil, string snd, float rng, float rate) FireMinigun;
void(float db) loud_noise; void(float db) loud_noise;
void() player_auto_duck1; void() player_auto_duck1;
void() player_auto_ducka1; void() player_auto_ducka1;
void() player_auto_prone1;
void() player_auto_pronea1;
void(vector org, float damage) SpawnBlood; void(vector org, float damage) SpawnBlood;
void(vector org, float damage) SpawnNonBlood; void(vector org, float damage) SpawnNonBlood;
void() SuperDamageSound; void() SuperDamageSound;
@ -779,22 +781,31 @@ void () player_single2_s = [ 183, player_run ]
void () player_fire_prone = void () player_fire_prone =
{ {
if (self.weaponframe == 1)
if (self.weaponframe == 0) {
self.weaponframe = 2;
self.frame = 1;
}
else if (self.weaponframe == 2)
{ {
self.weaponframe = 1; self.weaponframe = 1;
self.frame = 1; self.frame = 0;
} }
else else
{ {
self.weaponframe = 1; self.weaponframe = 2;
self.frame = 1; self.frame = 1;
} }
}; };
//============================================================================ //============================================================================
vector() wall_velocity = vector() wall_velocity =
@ -2635,6 +2646,28 @@ void() autofire_s =
}; };
void() autofire_p =
{
if (self.attack == 0)
self.cnt = 0;
if (self.weaponframe == 1)
self.weaponframe = 2;
else
self.weaponframe = 1;
if (self.cnt == 0)
player_auto_prone1();
else if (self.cnt == 1)
player_auto_pronea1();
self.cnt = self.cnt + 1;
if (self.cnt == 2)
self.cnt = 0;
};
void (vector org) bullet_hole = void (vector org) bullet_hole =
{ {
local float r; local float r;
@ -3386,8 +3419,10 @@ void (float dam, float ap, string snd, float rng, float rate) FireSMG =
if (self.position == 0) if (self.position == 0)
autofire (); autofire ();
if (self.position >= 1) if (self.position == 1)
autofire_s (); autofire_s ();
if (self.position == 2)
autofire_p ();
if (self.position == 0) if (self.position == 0)
adjust = '0 0 0'; adjust = '0 0 0';
@ -3526,8 +3561,10 @@ void (float rec, float speed, float dam, float type) FirePulseRifle =
if (self.position == 0) if (self.position == 0)
autofire (); autofire ();
if (self.position >= 1) if (self.position == 1)
autofire_s (); autofire_s ();
if (self.position == 2)
autofire_p ();
if (self.position == 0) if (self.position == 0)
adjust = '0 0 -4'; adjust = '0 0 -4';
@ -3733,7 +3770,8 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR
if (self.position == 1) if (self.position == 1)
player_single1_s (); player_single1_s ();
if (self.position == 2) if (self.position == 2)
player_fire_prone (); autofire_p ();
//player_fire_prone ();
} }
if (self.attack >= 1) if (self.attack >= 1)
{ {
@ -3742,16 +3780,18 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR
if (self.position == 1) if (self.position == 1)
autofire_s (); autofire_s ();
if (self.position == 2) if (self.position == 2)
player_fire_prone (); autofire_p ();
} }
tmp = accuracy * 10; tmp = accuracy * 10;
xrecoil = dam / 2; xrecoil = dam / 2;
//for the snipers
if (self.position == 2 && self.recoil == 0) if (self.position == 1)
tmp = tmp * 0.75; tmp = tmp * 0.75;
else if (self.position == 2)
tmp = tmp * 0.50;
if (self.steadyaim == 0) if (self.steadyaim == 0)
tmp = tmp * 0.25; tmp = tmp * 0.25;
@ -3770,11 +3810,10 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR
if (tmp > 500) if (tmp > 500)
tmp = 500; tmp = 500;
tmp = tmp * 0.75;
source = self.origin + '0 0 22'; source = self.origin + '0 0 22';
targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()* tmp + v_up*random()*tmp + v_up*random()*tmp; targ = self.origin + '0 0 22' + v_right*self.driftx + v_up*self.drifty + v_right*crandom()*tmp + v_up*random()*tmp + v_up*random()*tmp;
y = xrecoil * 12; y = xrecoil * 12;
@ -3789,10 +3828,7 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR
if (self.position == 2 && weap == IID_WP_AK112_M) if (self.position == 2 && weap == IID_WP_AK112_M)
{ {
if (self.recoil >= 8) y = y * 0.10;
self.recoil = 8;
y = y * 0.25;
tmp = tmp * 0.80; tmp = tmp * 0.80;
} }
if (random()*3<=2) if (random()*3<=2)
@ -3800,9 +3836,9 @@ void (float dam, float accuracy, string snd, float rng, float rate) FireAssaultR
else else
self.driftx = self.driftx - y; self.driftx = self.driftx - y;
if (random()*2<=1) if (random()*3<=2)
self.drifty = self.drifty + y; self.drifty = self.drifty + y;
else else if (self.drifty > 0)
self.drifty = self.drifty - y; self.drifty = self.drifty - y;
traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self); traceline (source+adjust, targ+adjust+v_forward*4000, FALSE, self);

View file

@ -1338,11 +1338,6 @@ void () RecoilControl =
while (te) while (te)
{ {
te.lastman = te.lastman - 0.01;
if (te.lastman < 0)
te.lastman = 0;
//superstims: heal at an incredible rate! //superstims: heal at an incredible rate!
if ((te.xregen > 0 && te.health < te.max_health) && random()<0.5) if ((te.xregen > 0 && te.health < te.max_health) && random()<0.5)
{ {
@ -1363,20 +1358,14 @@ void () RecoilControl =
te.health = te.max_health; te.health = te.max_health;
} }
te.lastman = te.lastman - 0.01;
//steady aim: for living anatomy, and aimed shots by standing still //steady aim: for living anatomy, and aimed shots by standing still
if (te.recoil != 0) if (te.recoil != 0)
te.steadyaim = 6; te.steadyaim = 6;
else if (te.recoil == 0 && te.steadyaim > 0) else if (te.recoil == 0 && te.steadyaim > 0)
{
te.steadyaim = te.steadyaim - 0.05; te.steadyaim = te.steadyaim - 0.05;
if (te.perk1 == 13 || te.perk2 == 13)
te.steadyaim = te.steadyaim - 0.05;
}
if (te.steadyaim > 0 && te.steadyaim <= 0.10) if (te.steadyaim <= 0)
te.steadyaim = 0; te.steadyaim = 0;
@ -1403,7 +1392,7 @@ void () RecoilControl =
} }
te.recoil = te.recoil - (0.15+(te.skill_combat*0.005) + (te.skill_doctor*0.003) + (te.skill_sneak*0.002)); te.recoil = te.recoil - (0.10+(te.skill_combat*0.01));
} }
else else
{ {
@ -1420,16 +1409,6 @@ void () RecoilControl =
te.drifty = te.drifty + 0.5; te.drifty = te.drifty + 0.5;
} }
if (te.recoil > 5)
te.recoil = te.recoil - 0.05;
if (te.recoil <= 5)
{
te.recoil = te.recoil + 0.10;
if (te.recoil >= 5)
te.recoil = 5;
}
} }
if (te.driftx > 250) if (te.driftx > 250)
@ -1437,10 +1416,13 @@ void () RecoilControl =
if (te.drifty > 250) if (te.drifty > 250)
te.drifty = 250; te.drifty = 250;
//support fire: going prone gives a -10 recoil bonus with this perk during heavy fire //support fire: going prone gives a -10 recoil bonus with this perk
if (getperk(1) && self.position == 2 && te.recoil > 3) if (getperk(1) && self.position == 2 && te.recoil > 3)
te.recoil = te.recoil - 0.10; {
te.recoil = te.recoil - 0.20;
te.driftx = te.driftx * 0.5;
te.drifty = te.drifty * 0.5;
}
//prone: going prone gives a -5 recoil bonus //prone: going prone gives a -5 recoil bonus
@ -1758,10 +1740,6 @@ void() worldspawn =
precache_sound ("player/step2.wav"); precache_sound ("player/step2.wav");
precache_sound ("player/step3.wav"); precache_sound ("player/step3.wav");
precache_sound ("player/step4.wav"); precache_sound ("player/step4.wav");
precache_sound ("player/step1a.wav");
precache_sound ("player/step2a.wav");
precache_sound ("player/step3a.wav");
precache_sound ("player/step4a.wav");
precache_sound ("dog/dattack1.wav"); precache_sound ("dog/dattack1.wav");
precache_sound ("dog/ddeath.wav"); precache_sound ("dog/ddeath.wav");
precache_sound ("dog/dpain1.wav"); precache_sound ("dog/dpain1.wav");