r72 - trunk/basezym/progsqc
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Aug 8 20:23:45 EDT 2007
Author: Vermeulen
Date: 2007-08-08 20:23:45 -0400 (Wed, 08 Aug 2007)
New Revision: 72
Modified:
trunk/basezym/progsqc/inventory.qc
trunk/basezym/progsqc/player.qc
Log:
Changed movement and jetpack
Modified: trunk/basezym/progsqc/inventory.qc
===================================================================
--- trunk/basezym/progsqc/inventory.qc 2007-08-08 19:14:00 UTC (rev 71)
+++ trunk/basezym/progsqc/inventory.qc 2007-08-09 00:23:45 UTC (rev 72)
@@ -554,7 +554,7 @@
newmis.noise = iteminfo_pickupsound;
setorigin(newmis, org);
setmodel(newmis, iteminfo_pickupmodel);
- setsize(newmis, '-4 -4 -4', '4 4 4');
+ setsize(newmis, '-8 -8 -8', '8 8 8');
Inventory_ModifyItem(newmis, itemtype, quantity, ammo1, ammo2);
// NOTE: should match viewweapon_animframefunc WS_TURNON code
};
Modified: trunk/basezym/progsqc/player.qc
===================================================================
--- trunk/basezym/progsqc/player.qc 2007-08-08 19:14:00 UTC (rev 71)
+++ trunk/basezym/progsqc/player.qc 2007-08-09 00:23:45 UTC (rev 72)
@@ -473,7 +473,7 @@
sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/landing.wav"), 1, ATTN_NORM);
}
self.jumpflag = FALSE;
- if (self.button2)
+ if (self.button2 || self.button5)
if (self.flags & FL_JUMPRELEASED)
{
sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jump.wav"), 1, ATTN_NORM);
@@ -500,7 +500,7 @@
{
if (self.jetpackactive)
{
- self.jetpackacc = 1.5;
+ self.jetpackacc = 1;
sound(self, CHAN_BODY, strcat(self.playerclass.sounddir, "/jetpackstop.wav"), 1, ATTN_NORM);
self.jetpackactive = FALSE;
}
@@ -585,13 +585,13 @@
float sv_airaccel_sideways_friction = 0.3;
-float sv_airaccel_qw = 0.93;
-
+float sv_airaccel_qw = 0.93;
+
void() SV_PlayerPhysics =
{
local vector wishvel, wishdir, v;
local float wishspeed, f;
- local float velo_z;
+ float vel_z;
if (self.movetype == MOVETYPE_NONE)
return;
@@ -658,7 +658,7 @@
self.angles_z = 0;
}
- if (self.movetype == MOVETYPE_NOCLIP || self.movetype == MOVETYPE_FLY)
+ if (self.movetype == MOVETYPE_NOCLIP)
{
// noclipping or flying
self.velocity = self.velocity * (1 - frametime * sv_friction);
@@ -677,54 +677,6 @@
self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed);
}
}
- else if (self.button5 && self.jetpackfuel > 5)
- {
- makevectors(self.v_angle_y * '0 1 0');
- wishvel = v_forward * self.movement_x + v_right * self.movement_y;
- // acceleration
- wishdir = normalize(wishvel);
- wishspeed = vlen(wishvel);
- if (wishspeed > sv_maxairspeed)
- wishspeed = sv_maxairspeed;
-
- if (wishvel_x > 0 || wishvel_y > 0)
- {
- velo_z = sv_gravity * (self.jetpackacc + 3 * (1 - wishspeed / sv_maxairspeed));
- }
- else
- {
- self.jetpackacc = self.jetpackacc + 0.1;
- velo_z = sv_gravity * (self.jetpackacc + 3 * (1 - wishspeed / sv_maxairspeed));
- }
-
- if (time >= self.teleport_time)
- self.velocity = self.velocity * (1 - frametime * sv_friction) + (frametime * sv_friction) * wishspeed * 2 * wishdir + (velo_z * '0 0 1') * frametime;
- }
- else if (self.button6 && self.jetpackfuel > 5)
- {
- makevectors(self.v_angle_y * '0 1 0');
- wishvel = v_forward * self.movement_x + v_right * self.movement_y;
- // acceleration
- wishdir = normalize(wishvel);
- wishspeed = vlen(wishvel);
- if (wishspeed > sv_maxairspeed)
- wishspeed = sv_maxairspeed;
-
- if (wishvel_x > 0 || wishvel_y > 0)
- {
- velo_z = sv_gravity * ((self.jetpackacc*1.5) + 3 * (1 - wishspeed / sv_maxairspeed));
- }
- else
- {
- self.jetpackacc = self.jetpackacc + 0.2;
- velo_z = sv_gravity * ((self.jetpackacc*1.5) + 3 * (1 - wishspeed / sv_maxairspeed));
- }
-
- velo_z = velo_z * -1;
-
- if (time >= self.teleport_time)
- self.velocity = self.velocity * (1 - frametime * sv_friction) + (frametime * sv_friction) * wishspeed * 2 * wishdir + (velo_z * '0 0 1') * frametime;
- }
else if (self.waterlevel >= 2)
{
// swimming
@@ -831,12 +783,28 @@
// acceleration
wishdir = normalize(wishvel);
wishspeed = wishspeed + vlen(wishvel);
- if (wishspeed > sv_maxairspeed)
- wishspeed = sv_maxairspeed;
+
+ if (self.button5 && self.jetpackfuel > 5)
+ {
+ self.movetype = MOVETYPE_FLY;
+
+ if (self.velocity_z < cvar("g_player_jetpack_maxupspeed"))
+ {
+ self.jetpackacc = self.jetpackacc + cvar("g_player_jetpack_acc");
+ self.velocity_z = self.velocity_z + self.jetpackacc;
+ }
+ if (wishspeed > cvar("g_player_jetpack_maxmovespeed"))
+ wishspeed = cvar("g_player_jetpack_maxmovespeed");
+ }
+ else
+ {
+ self.movetype = MOVETYPE_WALK;
+ if (wishspeed > sv_maxairspeed)
+ wishspeed = sv_maxairspeed;
+ }
if (time >= self.teleport_time)
{
float vel_straight;
- float vel_z;
vector vel_perpend;
vel_straight = self.velocity * wishdir;
vel_z = self.velocity_z;
More information about the zymotic-commits
mailing list