Merge github.com:eukara/freetfc
This commit is contained in:
commit
fb27e32a1f
6 changed files with 113 additions and 10 deletions
0
install_patches.sh
Normal file → Executable file
0
install_patches.sh
Normal file → Executable file
|
@ -28,6 +28,7 @@ void
|
||||||
VGUI_TeamJoin(float i)
|
VGUI_TeamJoin(float i)
|
||||||
{
|
{
|
||||||
sendevent("TeamJoin", "f", i);
|
sendevent("TeamJoin", "f", i);
|
||||||
|
winCTTeam.Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -14,20 +14,32 @@
|
||||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
SNIPER_IDLE,
|
||||||
|
SNIPER_AIM,
|
||||||
|
SNIPER_FIRE,
|
||||||
|
SNIPER_DRAW,
|
||||||
|
SNIPER_HOLSTER,
|
||||||
|
SNIPER_AUTOIDLE,
|
||||||
|
SNIPER_AUTOFIRE,
|
||||||
|
SNIPER_AUTODRAW,
|
||||||
|
SNIPER_AUTOHOLSTER,
|
||||||
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
w_autorifle_precache(void)
|
w_autorifle_precache(void)
|
||||||
{
|
{
|
||||||
precache_model("models/v_tfc_sniper.mdl");
|
precache_model("models/v_tfc_sniper.mdl");
|
||||||
precache_model("models/w_autorifle.mdl");
|
precache_model("models/w_autorifle.mdl");
|
||||||
precache_model("models/p_autorifle.mdl");
|
precache_model("models/p_autorifle.mdl");
|
||||||
|
Sound_Precache("weapon_sniper.fire");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
w_autorifle_updateammo(player pl)
|
w_autorifle_updateammo(player pl)
|
||||||
{
|
{
|
||||||
#ifdef SERVER
|
Weapons_UpdateAmmo(pl, __NULL__, pl.m_iAmmoShells, __NULL__);
|
||||||
Weapons_UpdateAmmo(pl, __NULL__, __NULL__, __NULL__);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string
|
string
|
||||||
|
@ -47,11 +59,17 @@ w_autorifle_deathmsg(void)
|
||||||
return "%s was assaulted by %s's Assault Cannon.";
|
return "%s was assaulted by %s's Assault Cannon.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
w_autorifle_release(player pl)
|
||||||
|
{
|
||||||
|
Weapons_ViewAnimation(pl, SNIPER_AUTOIDLE);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
w_autorifle_draw(player pl)
|
w_autorifle_draw(player pl)
|
||||||
{
|
{
|
||||||
Weapons_SetModel("models/v_tfc_sniper.mdl");
|
Weapons_SetModel("models/v_tfc_sniper.mdl");
|
||||||
Weapons_ViewAnimation(pl, 0);
|
Weapons_ViewAnimation(pl, SNIPER_AUTOIDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
float
|
float
|
||||||
|
@ -60,6 +78,69 @@ w_autorifle_aimanim(player pl)
|
||||||
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
return self.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
w_autorifle_primary(player pl)
|
||||||
|
{
|
||||||
|
int s = w_baseauto_fire(pl, player::m_iAmmoShells, 8, [0,0]);
|
||||||
|
|
||||||
|
switch (s) {
|
||||||
|
case AUTO_FIRE_FAILED:
|
||||||
|
return;
|
||||||
|
break;
|
||||||
|
case AUTO_FIRED:
|
||||||
|
case AUTO_LAST:
|
||||||
|
Weapons_ViewAnimation(pl, SNIPER_AUTOFIRE);
|
||||||
|
#ifdef CLIENT
|
||||||
|
View_SetMuzzleflash(MUZZLE_WEIRD);
|
||||||
|
#else
|
||||||
|
Sound_Play(pl, CHAN_WEAPON, "weapon_sniper.fire");
|
||||||
|
#endif
|
||||||
|
pl.w_attack_next = 0.1f;
|
||||||
|
break;
|
||||||
|
case AUTO_EMPTY:
|
||||||
|
pl.w_attack_next = 0.2f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
pl.w_idle_next = 1.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
w_autorifle_hud(player pl)
|
||||||
|
{
|
||||||
|
#ifdef CLIENT
|
||||||
|
vector cross_pos;
|
||||||
|
vector aicon_pos;
|
||||||
|
|
||||||
|
/* crosshair/laser */
|
||||||
|
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||||
|
drawsubpic(
|
||||||
|
cross_pos,
|
||||||
|
[24,24],
|
||||||
|
g_cross_spr,
|
||||||
|
[0.1875,0],
|
||||||
|
[0.1875, 0.1875],
|
||||||
|
[1,1,1],
|
||||||
|
1.0f,
|
||||||
|
DRAWFLAG_NORMAL
|
||||||
|
);
|
||||||
|
|
||||||
|
HUD_DrawAmmo2();
|
||||||
|
|
||||||
|
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||||
|
drawsubpic(
|
||||||
|
aicon_pos,
|
||||||
|
[24,24],
|
||||||
|
g_hud7_spr,
|
||||||
|
[0,72/128],
|
||||||
|
[24/256, 24/128],
|
||||||
|
g_hud_color,
|
||||||
|
pSeatLocal->m_flAmmo2Alpha,
|
||||||
|
DRAWFLAG_ADDITIVE
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
w_autorifle_hudpic(player pl, int selected, vector pos, float a)
|
w_autorifle_hudpic(player pl, int selected, vector pos, float a)
|
||||||
{
|
{
|
||||||
|
@ -98,11 +179,11 @@ weapon_t w_autorifle =
|
||||||
.slot_pos = 0,
|
.slot_pos = 0,
|
||||||
.draw = w_autorifle_draw,
|
.draw = w_autorifle_draw,
|
||||||
.holster = __NULL__,
|
.holster = __NULL__,
|
||||||
.primary = __NULL__,
|
.primary = w_autorifle_primary,
|
||||||
.secondary = __NULL__,
|
.secondary = __NULL__,
|
||||||
.reload = __NULL__,
|
.reload = __NULL__,
|
||||||
.release = __NULL__,
|
.release = w_autorifle_release,
|
||||||
.postdraw = __NULL__,
|
.postdraw = w_autorifle_hud,
|
||||||
.precache = w_autorifle_precache,
|
.precache = w_autorifle_precache,
|
||||||
.pickup = __NULL__,
|
.pickup = __NULL__,
|
||||||
.updateammo = w_autorifle_updateammo,
|
.updateammo = w_autorifle_updateammo,
|
||||||
|
|
|
@ -33,6 +33,7 @@ w_nailgun_precache(void)
|
||||||
precache_model("models/w_nailgun.mdl");
|
precache_model("models/w_nailgun.mdl");
|
||||||
precache_model("models/p_nailgun.mdl");
|
precache_model("models/p_nailgun.mdl");
|
||||||
precache_model("models/nail.mdl");
|
precache_model("models/nail.mdl");
|
||||||
|
Sound_Precache("weapon_nailgun.fire");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -75,18 +76,25 @@ void
|
||||||
w_nailgun_shootnail(player pl)
|
w_nailgun_shootnail(player pl)
|
||||||
{
|
{
|
||||||
static void w_rpg_shootrocket_touch(void) {
|
static void w_rpg_shootrocket_touch(void) {
|
||||||
|
#ifndef CLIENT
|
||||||
|
/* impact per bullet */
|
||||||
|
if (trace_ent.iBleeds == 0) {
|
||||||
|
DecalGroups_Place("Impact.BigShot", trace_endpos + (v_forward * -2));
|
||||||
|
SurfData_Impact(trace_ent, trace_surfaceflagsi, trace_endpos, trace_plane_normal);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
remove(self);
|
remove(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
Weapons_MakeVectors(pl);
|
Weapons_MakeVectors(pl);
|
||||||
entity p = spawn();
|
entity p = spawn();
|
||||||
setmodel(p, "models/nail.mdl");
|
setmodel(p, "models/nail.mdl");
|
||||||
setorigin(p, Weapons_GetCameraPos(pl) + (v_forward * 8));
|
setorigin(p, Weapons_GetCameraPos(pl) + (v_forward * 14) + (v_up * -4) + (v_right * 2));
|
||||||
p.owner = self;
|
p.owner = self;
|
||||||
p.movetype = MOVETYPE_FLYMISSILE;
|
p.movetype = MOVETYPE_FLYMISSILE;
|
||||||
p.solid = SOLID_BBOX;
|
p.solid = SOLID_BBOX;
|
||||||
p.gravity = 0.5f;
|
p.gravity = 0.5f;
|
||||||
p.velocity = (v_forward * 1000);
|
p.velocity = (v_forward * 1000) + (v_up * 4) + (v_right * -2);
|
||||||
p.angles = vectoangles(p.velocity);
|
p.angles = vectoangles(p.velocity);
|
||||||
p.touch = w_rpg_shootrocket_touch;
|
p.touch = w_rpg_shootrocket_touch;
|
||||||
p.think = Util_Destroy;
|
p.think = Util_Destroy;
|
||||||
|
@ -114,6 +122,9 @@ w_nailgun_primary(player pl)
|
||||||
}
|
}
|
||||||
Weapons_ViewAnimation(pl, NAILGUN_SHOOT2);
|
Weapons_ViewAnimation(pl, NAILGUN_SHOOT2);
|
||||||
Weapons_ViewPunchAngle(pl, [-1,0,0]);
|
Weapons_ViewPunchAngle(pl, [-1,0,0]);
|
||||||
|
#ifndef CLIENT
|
||||||
|
Sound_Play(pl, CHAN_WEAPON, "weapon_nailgun.fire");
|
||||||
|
#endif
|
||||||
pl.w_attack_next = 0.1f;
|
pl.w_attack_next = 0.1f;
|
||||||
break;
|
break;
|
||||||
case AUTO_EMPTY:
|
case AUTO_EMPTY:
|
||||||
|
|
|
@ -36,7 +36,7 @@ bind "f1" "vote yes"
|
||||||
bind "f2" "vote no"
|
bind "f2" "vote no"
|
||||||
|
|
||||||
// Game Variables
|
// Game Variables
|
||||||
seta "hostname" "FreeTF Server"
|
seta "hostname" "FreeTFC Server"
|
||||||
seta "maxplayers" "8"
|
seta "maxplayers" "8"
|
||||||
|
|
||||||
// disable some nuclide niceties
|
// disable some nuclide niceties
|
||||||
|
|
|
@ -18,6 +18,16 @@ weapon_sbs.reload
|
||||||
sample weapons/reload3.wav
|
sample weapons/reload3.wav
|
||||||
}
|
}
|
||||||
|
|
||||||
|
weapon_nailgun.fire
|
||||||
|
{
|
||||||
|
sample weapons/airgun_1.wav
|
||||||
|
}
|
||||||
|
|
||||||
|
weapon_sniper.fire
|
||||||
|
{
|
||||||
|
sample weapons/sniper.wav
|
||||||
|
}
|
||||||
|
|
||||||
engineer.build
|
engineer.build
|
||||||
{
|
{
|
||||||
sample weapons/building.wav
|
sample weapons/building.wav
|
||||||
|
|
Loading…
Reference in a new issue