Add separate player classes for separate sounds and whatnot.

Fully implement UT movement for all modes (walk, swim, fly).
This commit is contained in:
Marisa the Magician 2018-12-28 19:10:35 +01:00
commit 35ee056d7a
20 changed files with 321 additions and 84 deletions

View file

@ -3,7 +3,7 @@
What began as a test for importing UT vertex meshes has turned into an actual What began as a test for importing UT vertex meshes has turned into an actual
full UT weapon and item mod. full UT weapon and item mod.
This mod requires a recent GZDoom devbuild (g3.6pre-31-gd965c9aa7 or later). This mod requires GZDoom 3.7.0 or later.
## Currently implemented ## Currently implemented
@ -48,6 +48,7 @@ This mod requires a recent GZDoom devbuild (g3.6pre-31-gd965c9aa7 or later).
- Visual recoil affecting aim (improved A_Swing from Soundless Mound, can be - Visual recoil affecting aim (improved A_Swing from Soundless Mound, can be
toggled) toggled)
- UT-like weapon dropping style - UT-like weapon dropping style
- UT player classes (sound only, no models yet)
## In progress ## In progress

View file

@ -19,6 +19,7 @@ user float flak_hudsize = 1.0; // 0.2 <-> 1.0 in steps of 0.2 (default 1.0)
user float flak_weaponsize = 0.8; // 0.2 <-> 1.0 in steps of 0.2 (default 0.8) user float flak_weaponsize = 0.8; // 0.2 <-> 1.0 in steps of 0.2 (default 0.8)
user float flak_statussize = 1.0; // 0.5 <-> 1.5 in steps of 0.1 (default 1.0) user float flak_statussize = 1.0; // 0.5 <-> 1.5 in steps of 0.1 (default 1.0)
user bool flak_footsteps = true; // players make footstep sounds user bool flak_footsteps = true; // players make footstep sounds
user bool flak_bossfootsteps = false; // boss players play mechanic footsteps (unlike in vanilla UT)
server bool flak_translocator = false; // translocator is enabled (hello, sequence breaking) server bool flak_translocator = false; // translocator is enabled (hello, sequence breaking)
server bool flak_transloc2k4 = false; // translocator has recharging ammo like in UT2k4 and up server bool flak_transloc2k4 = false; // translocator has recharging ammo like in UT2k4 and up
user bool flak_noswitchdeemer = true; // don't switch to redeemer when out of ammo user bool flak_noswitchdeemer = true; // don't switch to redeemer when out of ammo

BIN
graphics/Blake.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
graphics/Brock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
graphics/Ivana.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

BIN
graphics/Lauren.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
graphics/Xan.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
graphics/hud/Boss.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

BIN
graphics/hud/BossArm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
graphics/hud/BossBlt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
graphics/hud/BossBot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
graphics/hud/BossPad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

View file

@ -60,6 +60,7 @@ OptionMenu "UTOptionMenu"
StaticText " " StaticText " "
StaticText "Misc Options", "Gold" StaticText "Misc Options", "Gold"
Option "UT Footsteps", "flak_footsteps", "YesNo" Option "UT Footsteps", "flak_footsteps", "YesNo"
Option "Use Boss Class Footsteps", "flak_bossfootsteps", "YesNo"
Option "UT Blood", "flak_blood", "YesNo" Option "UT Blood", "flak_blood", "YesNo"
Option "[WIP] UT Gibbing", "flak_gibs", "YesNo" Option "[WIP] UT Gibbing", "flak_gibs", "YesNo"
Option "[WIP] Corpses Take Damage", "flak_corpsedamage", "YesNo" Option "[WIP] Corpses Take Damage", "flak_corpsedamage", "YesNo"

View file

@ -16,8 +16,11 @@ ut/malepain3 injurm04
ut/malepain4 injurh5 ut/malepain4 injurh5
ut/land land1 ut/land land1
ut/malegrunt land10 ut/malegrunt land10
ut/malegrunt1 mland3
ut/malejump jump1 ut/malejump jump1
ut/malejump1 tmjump3
ut/malehump land01 ut/malehump land01
ut/malehump1 mland3
ut/malesurf gasp02 ut/malesurf gasp02
ut/malegasp hgasp1 ut/malegasp hgasp1
ut/maledrowned1 uwinjr41 ut/maledrowned1 uwinjr41
@ -25,27 +28,54 @@ ut/drowned uwinjr42
$random ut/maledrowned { ut/maledrowned1 ut/drowned } $random ut/maledrowned { ut/maledrowned1 ut/drowned }
ut/maledrowning drownm02 ut/maledrowning drownm02
$playeralias player male *death ut/maledie // hotfix for a doom glitch
$playeralias player male *xdeath ut/malexdie
$playeralias player male *gibbed ut/gibp
$playeralias player male *pain100 ut/malepain1
$playeralias player male *pain75 ut/malepain2
$playeralias player male *pain50 ut/malepain3
$playeralias player male *pain25 ut/malepain4
$playeralias player male *grunt ut/malegrunt
$playeralias player male *land DSEMPTY $playeralias player male *land DSEMPTY
$playeralias player male *uland ut/land $playeralias player female *land DSEMPTY
$playeralias player male *jump ut/malejump $playeralias player other *land DSEMPTY
$playeralias player male *usefail ut/malehump
$playeralias player male *surface ut/malesurface
$playeralias player male *gasp ut/malegasp
$playeralias player male *death-drowning ut/maledrowned $playeralias tmale1 neutral *death ut/maledie
$playeralias player male *xdeath-drowning ut/maledrowned $playeralias tmale1 neutral *xdeath ut/malexdie
$playeralias player male *pain100-drowning ut/maledrowning $playeralias tmale1 neutral *gibbed ut/gibp
$playeralias player male *pain75-drowning ut/maledrowning $playeralias tmale1 neutral *pain100 ut/malepain1
$playeralias player male *pain50-drowning ut/maledrowning $playeralias tmale1 neutral *pain75 ut/malepain2
$playeralias player male *pain25-drowning ut/maledrowning $playeralias tmale1 neutral *pain50 ut/malepain3
$playeralias tmale1 neutral *pain25 ut/malepain4
$playeralias tmale1 neutral *grunt ut/malegrunt
$playeralias tmale1 neutral *land DSEMPTY
$playeralias tmale1 neutral *uland ut/land1
$playeralias tmale1 neutral *jump ut/malejump1
$playeralias tmale1 neutral *usefail ut/malehump1
$playeralias tmale1 neutral *surface ut/malesurface
$playeralias tmale1 neutral *gasp ut/malegasp
$playeralias tmale1 neutral *death-drowning ut/maledrowned
$playeralias tmale1 neutral *xdeath-drowning ut/maledrowned
$playeralias tmale1 neutral *pain100-drowning ut/maledrowning
$playeralias tmale1 neutral *pain75-drowning ut/maledrowning
$playeralias tmale1 neutral *pain50-drowning ut/maledrowning
$playeralias tmale1 neutral *pain25-drowning ut/maledrowning
$playeralias tmale2 neutral *death ut/maledie
$playeralias tmale2 neutral *xdeath ut/malexdie
$playeralias tmale2 neutral *gibbed ut/gibp
$playeralias tmale2 neutral *pain100 ut/malepain1
$playeralias tmale2 neutral *pain75 ut/malepain2
$playeralias tmale2 neutral *pain50 ut/malepain3
$playeralias tmale2 neutral *pain25 ut/malepain4
$playeralias tmale2 neutral *grunt ut/malegrunt
$playeralias tmale2 neutral *land DSEMPTY
$playeralias tmale2 neutral *uland ut/land
$playeralias tmale2 neutral *jump ut/malejump
$playeralias tmale2 neutral *usefail ut/malehump
$playeralias tmale2 neutral *surface ut/malesurface
$playeralias tmale2 neutral *gasp ut/malegasp
$playeralias tmale2 neutral *death-drowning ut/maledrowned
$playeralias tmale2 neutral *xdeath-drowning ut/maledrowned
$playeralias tmale2 neutral *pain100-drowning ut/maledrowning
$playeralias tmale2 neutral *pain75-drowning ut/maledrowning
$playeralias tmale2 neutral *pain50-drowning ut/maledrowning
$playeralias tmale2 neutral *pain25-drowning ut/maledrowning
ut/femaledie1 decap01 ut/femaledie1 decap01
ut/femaledie2 death1d ut/femaledie2 death1d
@ -67,33 +97,73 @@ ut/femaledrowned1 uwhit01
$random ut/femaledrowned { ut/femaledroenwd1 ut/drowned } $random ut/femaledrowned { ut/femaledroenwd1 ut/drowned }
ut/femaledrowning mdrown2f ut/femaledrowning mdrown2f
$playeralias player female *death ut/femaledie $playeralias tfemale neutral *death ut/femaledie
$playeralias player female *xdeath ut/femalexdie $playeralias tfemale neutral *xdeath ut/femalexdie
$playeralias player female *gibbed ut/gibp $playeralias tfemale neutral *gibbed ut/gibp
$playeralias player female *pain100 ut/femalepain1 $playeralias tfemale neutral *pain100 ut/femalepain1
$playeralias player female *pain75 ut/femalepain2 $playeralias tfemale neutral *pain75 ut/femalepain2
$playeralias player female *pain50 ut/femalepain3 $playeralias tfemale neutral *pain50 ut/femalepain3
$playeralias player female *pain25 ut/femalepain4 $playeralias tfemale neutral *pain25 ut/femalepain4
$playeralias player female *grunt ut/femalegrunt $playeralias tfemale neutral *grunt ut/femalegrunt
$playeralias player female *land DSEMPTY $playeralias tfemale neutral *land DSEMPTY
$playeralias player female *uland ut/land $playeralias tfemale neutral *uland ut/land
$playeralias player female *jump ut/femalejump $playeralias tfemale neutral *jump ut/femalejump
$playeralias player female *usefail ut/femalegrunt $playeralias tfemale neutral *usefail ut/femalegrunt
$playeralias player female *surface ut/femalesurf $playeralias tfemale neutral *surface ut/femalesurf
$playeralias player female *gasp ut/femalegasp $playeralias tfemale neutral *gasp ut/femalegasp
$playeralias player female *death-drowning ut/femaledrowned $playeralias tfemale neutral *death-drowning ut/femaledrowned
$playeralias player female *xdeath-drowning ut/femaledrowned $playeralias tfemale neutral *xdeath-drowning ut/femaledrowned
$playeralias player female *pain100-drowning ut/femaledrowning $playeralias tfemale neutral *pain100-drowning ut/femaledrowning
$playeralias player female *pain75-drowning ut/femaledrowning $playeralias tfemale neutral *pain75-drowning ut/femaledrowning
$playeralias player female *pain50-drowning ut/femaledrowning $playeralias tfemale neutral *pain50-drowning ut/femaledrowning
$playeralias player female *pain25-drowning ut/femaledrowning $playeralias tfemale neutral *pain25-drowning ut/femaledrowning
ut/bossdie1 bdeath1
ut/bossdie2 bdeath2
ut/bossdie3 bdeath3
$random ut/bossdie { ut/bossdie1 ut/bossdie2 ut/bossdie3 }
ut/bossxdie1 bdeath4
ut/bossxdie2 bdeath3
$random ut/bossxdie { ut/bossxdie1 ut/bossxdie2 }
ut/gibpboss bnewgib
ut/bosspain1 binjur1
ut/bosspain2 binjur2
ut/bosspain3 binjur3
ut/bosspain4 binjur4
ut/bossgrunt bland01
ut/bossjump bjump1
ut/bosshump bjump1
$playeralias tboss neutral *death ut/bossdie
$playeralias tboss neutral *xdeath ut/bossxdie
$playeralias tboss neutral *gibbed ut/gibpboss
$playeralias tboss neutral *pain100 ut/bosspain1
$playeralias tboss neutral *pain75 ut/bosspain2
$playeralias tboss neutral *pain50 ut/bosspain3
$playeralias tboss neutral *pain25 ut/bosspain4
$playeralias tboss neutral *grunt ut/bossgrunt
$playeralias tboss neutral *land DSEMPTY
$playeralias tboss neutral *uland ut/land
$playeralias tboss neutral *jump ut/bossjump
$playeralias tboss neutral *usefail ut/bosshump
$playeralias tboss neutral *surface ut/malesurf
$playeralias tboss neutral *gasp ut/malegasp
$playeralias tboss neutral *death-drowning ut/maledrowned
$playeralias tboss neutral *xdeath-drowning ut/maledrowned
$playeralias tboss neutral *pain100-drowning ut/maledrowning
$playeralias tboss neutral *pain75-drowning ut/maledrowning
$playeralias tboss neutral *pain50-drowning ut/maledrowning
$playeralias tboss neutral *pain25-drowning ut/maledrowning
ut/playerfootstep1 stone02 ut/playerfootstep1 stone02
ut/playerfootstep2 stone04 ut/playerfootstep2 stone04
ut/playerfootstep3 stone05 ut/playerfootstep3 stone05
$random ut/playerfootstep { ut/playerfootstep1 ut/playerfootstep2 ut/playerfootstep3 } $random ut/playerfootstep { ut/playerfootstep1 ut/playerfootstep2 ut/playerfootstep3 }
ut/bossfootstep bfootstep
ut/playerfootstepwet lsplash ut/playerfootstepwet lsplash
ut/wetsplash dsplash ut/wetsplash dsplash

BIN
sounds/BFootstep.ogg Normal file

Binary file not shown.

BIN
sounds/MLand3.ogg Normal file

Binary file not shown.

BIN
sounds/TMJump3.ogg Normal file

Binary file not shown.

View file

@ -1,7 +1,7 @@
GameInfo GameInfo
{ {
AddEventHandlers = "RedeemerHUDHandler", "UTMainHandler" AddEventHandlers = "RedeemerHUDHandler", "UTMainHandler"
PlayerClasses = "UTPlayer" PlayerClasses = "UTPlayerTMale1", "UTPlayerTMale2", "UTPlayerTFemale1", "UTPlayerTFemale2", "UTPlayerTBoss"
StatusBarClass = "UTHud" StatusBarClass = "UTHud"
BackpackType = "UTBackpack" BackpackType = "UTBackpack"
BorderFlat = "TEMPBG" BorderFlat = "TEMPBG"

View file

@ -11,14 +11,29 @@ Class UTPlayer : DoomPlayer
int last_tap_fm, last_tap_sm; int last_tap_fm, last_tap_sm;
int last_jump_held; int last_jump_held;
int dolltype;
Property DollType : dolltype;
enum EDollType
{
DOLL_Male,
DOLL_Female,
DOLL_Boss
};
const groundspeed = 400.; const groundspeed = 400.;
const swimspeed = 200.;
const baseaccelrate = 2048.; const baseaccelrate = 2048.;
const walkfactor = 0.3; const walkfactor = 0.3;
const utaircontrol = 0.35; const utaircontrol = 0.35;
const swimspeed_doomish = 400.;
const groundspeed_doomish = 600.; const groundspeed_doomish = 600.;
const terminalvelocity = 2500.;
const dodgez = 210.; const dodgez = 210.;
const utjumpz = 325.; const utjumpz = 325.;
const groundfriction = 8.;
const fluidfriction = 1.2;
const terminalvelocity = 2500.;
Default Default
{ {
@ -28,6 +43,12 @@ Class UTPlayer : DoomPlayer
Player.DamageScreenColor "FF 00 00"; Player.DamageScreenColor "FF 00 00";
Player.ViewHeight 46; Player.ViewHeight 46;
Player.GruntSpeed 20; Player.GruntSpeed 20;
MaxDropoffHeight 18;
MaxStepHeight 18;
+NOFRICTION;
+NOFRICTIONBOUNCE;
+NOMENU;
UTPlayer.DollType DOLL_Male;
} }
// Have to modify the give cheat to handle UT armor // Have to modify the give cheat to handle UT armor
@ -188,7 +209,7 @@ Class UTPlayer : DoomPlayer
if ( !footsteps.GetBool() ) return; if ( !footsteps.GetBool() ) return;
double ang = level.time/(20*TICRATE/35.)*360.; double ang = level.time/(20*TICRATE/35.)*360.;
bool forcefootstep = false; bool forcefootstep = false;
if ( player.onground && !bNoGravity && !lastground && (waterlevel < 3) ) if ( player.onground && !bNoGravity && !lastground && (waterlevel < 2) )
{ {
player.jumptics = 0; player.jumptics = 0;
if ( lastvelz < -8 ) if ( lastvelz < -8 )
@ -199,16 +220,17 @@ Class UTPlayer : DoomPlayer
} }
else forcefootstep = true; else forcefootstep = true;
} }
if ( forcefootstep || ((abs(sin(ang)) >= 1.0) && player.onground && lastground && (player.jumptics == 0) && (player.cmd.forwardmove || player.cmd.sidemove) && (waterlevel < 3)) ) if ( forcefootstep || ((abs(sin(ang)) >= 1.0) && player.onground && lastground && (player.jumptics == 0) && (player.cmd.forwardmove || player.cmd.sidemove) && (waterlevel < 2)) )
{ {
double vol = abs(vel.xy.length())*0.03; double vol = abs(vel.xy.length())*0.03;
if ( forcefootstep ) vol = clamp(-lastvelz*0.05,0.01,1.0); if ( forcefootstep ) vol = clamp(-lastvelz*0.05,0.01,1.0);
if ( (waterlevel > 0) || GetFloorTerrain().IsLiquid && !bOnMobj ) A_PlaySound("ut/playerfootstepwet",CHAN_5,vol); if ( (waterlevel > 0) || GetFloorTerrain().IsLiquid && !bOnMobj ) A_PlaySound("ut/playerfootstepwet",CHAN_5,vol);
else A_PlaySound("ut/playerfootstep",CHAN_5,vol); else PlayFootstep(vol);
} }
lastground = player.onground; lastground = player.onground;
lastvelz = prevvelz; lastvelz = prevvelz;
prevvelz = vel.z; prevvelz = vel.z;
// TODO exit/entry sounds for water
} }
double FrictionToUnreal() double FrictionToUnreal()
@ -235,7 +257,7 @@ Class UTPlayer : DoomPlayer
else Angle += cmd.yaw*(360./65536.); else Angle += cmd.yaw*(360./65536.);
player.onground = (pos.z <= floorz) || bOnMobj || bMBFBouncer || (player.cheats & CF_NOCLIP2); player.onground = (pos.z <= floorz) || bOnMobj || bMBFBouncer || (player.cheats & CF_NOCLIP2);
if ( player.onground ) lastgroundtic = gametic; if ( player.onground ) lastgroundtic = gametic;
if ( !player.onground && !bNoGravity && (waterlevel < 3) && (abs(pos.z-floorz) <= maxdropoffheight) && (player.jumptics == 0) ) if ( !player.onground && !bNoGravity && (waterlevel < 2) && (abs(pos.z-floorz) <= maxdropoffheight) && (player.jumptics == 0) && (vel.z < 0) )
{ {
SetOrigin(Vec2OffsetZ(0,0,floorz),true); SetOrigin(Vec2OffsetZ(0,0,floorz),true);
player.onground = true; player.onground = true;
@ -277,7 +299,7 @@ Class UTPlayer : DoomPlayer
} }
} }
last_sm = sm; last_sm = sm;
if ( !bNoGravity && player.onground && (waterlevel < 3) ) if ( !bNoGravity && player.onground && (waterlevel < 2) )
{ {
if ( dodge.length() > 0 ) if ( dodge.length() > 0 )
{ {
@ -329,7 +351,7 @@ Class UTPlayer : DoomPlayer
player.vel = vel.xy; player.vel = vel.xy;
} }
} }
else if ( !bNoGravity && (waterlevel < 3) ) else if ( !bNoGravity && (waterlevel < 2) )
{ {
// air acceleration when falling // air acceleration when falling
float maxaccel = accelrate/TICRATE; float maxaccel = accelrate/TICRATE;
@ -348,6 +370,7 @@ Class UTPlayer : DoomPlayer
double maxvel; double maxvel;
if ( flak_doomspeed ) maxvel = (groundspeed_doomish*fs)/TICRATE; if ( flak_doomspeed ) maxvel = (groundspeed_doomish*fs)/TICRATE;
else maxvel = (groundspeed*fs)/TICRATE; else maxvel = (groundspeed*fs)/TICRATE;
// TODO attempt to replicate walk on ice velocity increase glitch
// if new velocity is higher than ground speed, steer but don't increase it // if new velocity is higher than ground speed, steer but don't increase it
if ( (vel.xy+acceleration/TICRATE).length() > maxvel ) if ( (vel.xy+acceleration/TICRATE).length() > maxvel )
{ {
@ -359,41 +382,70 @@ Class UTPlayer : DoomPlayer
player.vel *= 0; player.vel *= 0;
player.jumptics = -2; player.jumptics = -2;
} }
else if ( bFly || (player.cheats&CF_NOCLIP2) )
{
// fly cheat has infinite friction (player stops moving when movement keys are released)
Vector3 dir = (0,0,0);
if ( vel.length() > double.epsilon ) dir = vel.unit();
Vector3 x, y;
[x, y] = dt_Matrix4.GetAxes(pitch,angle,0);
acceleration3 = x*player.cmd.forwardmove+y*player.cmd.sidemove;
if ( player.cmd.buttons&BT_JUMP ) acceleration3.z = 0x500;
else if ( player.cmd.buttons&BT_CROUCH ) acceleration3.z = -0x500;
if ( acceleration3.length() <= double.epsilon ) vel *= 0;
else else
{ {
// swimming uses standard physics, otherwise things break Vector3 acceldir = acceleration3.unit();
double forwardmove, sidemove; acceleration3 = acceldir*Min(acceleration3.length(),accelrate/TICRATE);
double bobfactor; vel = vel-(dir-acceldir)*vel.length();
double friction, movefactor;
double fm, sm;
[friction, movefactor] = GetFriction();
bobfactor = (friction<ORIG_FRICTION)?movefactor:ORIG_FRICTION_FACTOR;
fm = cmd.forwardmove;
sm = cmd.sidemove;
[fm, sm] = TweakSpeeds(fm,sm);
fm *= Speed/256;
sm *= Speed/256;
if ( CanCrouch() && (player.crouchfactor != 1) )
{
fm *= player.crouchfactor;
sm *= player.crouchfactor;
bobfactor *= player.crouchfactor;
} }
forwardmove = fm*movefactor*(35/TICRATE); vel = vel+acceleration3/TICRATE;
sidemove = sm*movefactor*(35/TICRATE); double maxvel;
if ( forwardmove ) if ( flak_doomspeed ) maxvel = groundspeed_doomish/TICRATE;
{ else maxvel = groundspeed/TICRATE;
Bob(Angle, cmd.forwardmove*bobfactor/256.,true); maxvel *= fs;
ForwardThrust(forwardmove,Angle); if ( vel.length() > maxvel ) vel = vel.unit()*maxvel;
player.vel *= 0;
player.jumptics = -2;
if ( !(player.cheats & CF_PREDICTING) ) PlayIdle();
} }
if ( sidemove ) else
{ {
let a = Angle-90; // swimming is pretty much like ground movement, but with much reduced friction and lower speed
Bob(a,cmd.sidemove*bobfactor/256.,false); friction *= fluidfriction/groundfriction;
Thrust(sidemove,a); Vector3 dir = (0,0,0);
if ( vel.length() > double.epsilon ) dir = vel.unit();
double doomfriction = clamp(GetFriction()/ORIG_FRICTION,0.0,1.0);
Vector3 x, y;
[x, y] = dt_Matrix4.GetAxes(pitch,angle,0);
acceleration3 = x*player.cmd.forwardmove+y*player.cmd.sidemove;
if ( player.cmd.buttons&BT_JUMP ) acceleration3.z = 0x500;
else if ( player.cmd.buttons&BT_CROUCH ) acceleration3.z = -0x500;
if ( acceleration3.length() <= double.epsilon )
{
Vector3 oldvel = vel;
vel = vel-(2*dir)*vel.length()*friction/TICRATE;
if ( oldvel dot vel < 0.0 ) vel *= 0;
}
else
{
Vector3 acceldir = acceleration3.unit();
acceleration3 = acceldir*Min(acceleration3.length(),accelrate/TICRATE);
vel = vel-(dir-acceldir)*vel.length()*friction/TICRATE;
}
vel = vel+acceleration3/TICRATE;
double maxvel;
if ( flak_doomspeed ) maxvel = swimspeed_doomish/TICRATE;
else maxvel = swimspeed/TICRATE;
maxvel *= fs*doomfriction;
if ( vel.length() > maxvel ) vel = vel.unit()*maxvel;
player.vel = vel.xy;
player.jumptics = -2;
if ( !(player.cheats & CF_PREDICTING) )
{
if ( acceleration3.length() <= double.epsilon ) PlayIdle();
else PlayRunning();
} }
if ( !(player.cheats&CF_PREDICTING) && ((forwardmove != 0) || (sidemove != 0)) )
PlayRunning();
} }
if ( player.cheats & CF_REVERTPLEASE ) if ( player.cheats & CF_REVERTPLEASE )
{ {
@ -401,6 +453,30 @@ Class UTPlayer : DoomPlayer
player.camera = player.mo; player.camera = player.mo;
} }
} }
override void CheckCrouch( bool totallyfrozen )
{
if ( !flak_utmovement || !player || (player.mo != self) )
{
Super.CheckCrouch(totallyfrozen);
return;
}
if ( player.cmd.buttons&BT_JUMP ) player.cmd.buttons &= ~BT_CROUCH;
if ( CanCrouch() && (player.health > 0) && level.IsCrouchingAllowed() && player.onground ) // in UT you can't crouch unless you're on the ground
{
if ( !totallyfrozen )
{
int crouchdir = player.crouching;
if ( !crouchdir ) crouchdir = (player.cmd.buttons&BT_CROUCH)?-1:1;
else if ( player.cmd.buttons&BT_CROUCH ) player.crouching = 0;
if ( (crouchdir == 1) && (player.crouchfactor < 1) && (pos.Z+height < ceilingz) )
CrouchMove(1);
else if ( (crouchdir == -1) && (player.crouchfactor > 0.5 ))
CrouchMove(-1);
}
}
else player.Uncrouch();
player.crouchoffset = -(ViewHeight)*(1-player.crouchfactor);
}
override void CheckJump() override void CheckJump()
{ {
if ( !flak_utmovement || !player || (player.mo != self) ) if ( !flak_utmovement || !player || (player.mo != self) )
@ -411,9 +487,7 @@ Class UTPlayer : DoomPlayer
if ( player.cmd.buttons&BT_JUMP ) if ( player.cmd.buttons&BT_JUMP )
{ {
if ( player.crouchoffset ) player.crouching = 1; if ( player.crouchoffset ) player.crouching = 1;
else if ( waterlevel >= 2 ) Vel.z = 4*Speed; else if ( level.IsJumpingAllowed() && player.onground && (player.jumpTics == 0) && (last_jump_held < gametic-1) && !bNoGravity && (waterlevel < 2) && !(player.cheats&(CF_FLY|CF_NOCLIP2)) )
else if ( bNoGravity ) Vel.z = 3.;
else if ( level.IsJumpingAllowed() && player.onground && (player.jumpTics == 0) && (last_jump_held < gametic-1) )
{ {
double jumpvelz; double jumpvelz;
if ( flak_doomspeed ) jumpvelz = jumpz; if ( flak_doomspeed ) jumpvelz = jumpz;
@ -438,6 +512,76 @@ Class UTPlayer : DoomPlayer
if ( !player.onground || player.jumptics ) if ( !player.onground || player.jumptics )
last_jump_held = gametic; last_jump_held = gametic;
} }
virtual void PlayFootstep( double vol )
{
A_PlaySound("ut/playerfootstep",CHAN_5,vol);
}
}
// these only exist for sound
// female classes have identical sounds, so they use the same soundclass here
Class UTPlayerTMale1 : UTPlayer
{
Default
{
Player.SoundClass "tmale1";
Player.DisplayName "M Commando";
Player.Portrait "Blake";
-NOMENU;
}
}
Class UTPlayerTMale2 : UTPlayer
{
Default
{
Player.SoundClass "tmale2";
Player.DisplayName "M Soldier";
Player.Portrait "Brock";
-NOMENU;
}
}
Class UTPlayerTFemale1 : UTPlayer
{
Default
{
Player.SoundClass "tfemale";
Player.DisplayName "F Commando";
Player.Portrait "Ivana";
UTPlayer.DollType DOLL_Female;
-NOMENU;
}
}
Class UTPlayerTFemale2 : UTPlayer
{
Default
{
Player.SoundClass "tfemale";
Player.DisplayName "F Soldier";
Player.Portrait "Lauren";
UTPlayer.DollType DOLL_Female;
-NOMENU;
}
}
Class UTPlayerTBoss : UTPlayer
{
transient CVar bossfootsteps;
Default
{
Player.SoundClass "tboss";
Player.DisplayName "Boss";
Player.Portrait "Xan";
UTPlayer.DollType DOLL_Boss;
// should have NOBLOOD, but Xan did bleed in vanilla UT so...
// (this is what gave birth to the theory that Xan was actually Jerl Liandri himself)
-NOMENU;
}
override void PlayFootstep( double vol )
{
if ( !bossfootsteps ) bossfootsteps = CVar.GetCVar('flak_bossfootsteps',players[consoleplayer]);
if ( bossfootsteps.GetBool() ) A_PlaySound("ut/bossfootstep",CHAN_5,vol);
else Super.PlayFootstep(vol);
}
} }
Class UTWeapon : Weapon Class UTWeapon : Weapon

View file

@ -23,7 +23,7 @@ Class ViewTracer : LineTracer
Class UTHud : BaseStatusBar Class UTHud : BaseStatusBar
{ {
TextureID AmmoBar, Boxes[4], Keys[5], BigNum[12], Flash, Slots[10], Icons[14], Uses[14], Man[5], Woman[5], WeaponBox, IconTloc2, UseTloc2; TextureID AmmoBar, Boxes[4], Keys[5], BigNum[12], Flash, Slots[10], Icons[14], Uses[14], Man[5], Woman[5], Boss[5], WeaponBox, IconTloc2, UseTloc2;
Class<Weapon> IconClasses[14]; Class<Weapon> IconClasses[14];
double HScale; double HScale;
Color tintcolor, bgcolor; Color tintcolor, bgcolor;
@ -142,6 +142,11 @@ Class UTHud : BaseStatusBar
Woman[2] = TexMan.CheckForTexture("WomanPad",TexMan.Type_Any); Woman[2] = TexMan.CheckForTexture("WomanPad",TexMan.Type_Any);
Woman[3] = TexMan.CheckForTexture("WomanBot",TexMan.Type_Any); Woman[3] = TexMan.CheckForTexture("WomanBot",TexMan.Type_Any);
Woman[4] = TexMan.CheckForTexture("WomanBlt",TexMan.Type_Any); Woman[4] = TexMan.CheckForTexture("WomanBlt",TexMan.Type_Any);
Boss[0] = TexMan.CheckForTexture("Boss",TexMan.Type_Any);
Boss[1] = TexMan.CheckForTexture("BossArm",TexMan.Type_Any);
Boss[2] = TexMan.CheckForTexture("BossPad",TexMan.Type_Any);
Boss[3] = TexMan.CheckForTexture("BossBot",TexMan.Type_Any);
Boss[4] = TexMan.CheckForTexture("BossBlt",TexMan.Type_Any);
WeaponBox = TexMan.CheckForTexture("WpSel",TexMan.Type_Any); WeaponBox = TexMan.CheckForTexture("WpSel",TexMan.Type_Any);
} }
@ -330,7 +335,22 @@ Class UTHud : BaseStatusBar
d = DamageAmplifier(CPlayer.mo.FindInventory("DamageAmplifier")); d = DamageAmplifier(CPlayer.mo.FindInventory("DamageAmplifier"));
j = UTJumpBoots(CPlayer.mo.FindInventory("UTJumpBoots")); j = UTJumpBoots(CPlayer.mo.FindInventory("UTJumpBoots"));
if ( d && !d.isBlinking() ) dollcolor = d.BlendColor; if ( d && !d.isBlinking() ) dollcolor = d.BlendColor;
if ( CPlayer.GetGender() == 1 ) int dolltype = 0;
if ( CPlayer.mo is 'UTPlayer' ) dolltype = UTPlayer(CPlayer.mo).DollType;
else
{
// female doll for female, male doll for male/neutral, boss doll for object
dolltype = (CPlayer.GetGender()==3)?UTPlayer.DOLL_Boss:(CPlayer.GetGender()==1)?UTPlayer.DOLL_Female:UTPlayer.DOLL_Male;
}
if ( dolltype == UTPlayer.DOLL_Boss )
{
UTDrawTintedTex(Boss[0],hudsize*statussize,min(opacity,15),dollcolor);
if ( a ) UTDrawTintedTex(Boss[1],hudsize*statussize,int(min(opacity,15)*(a.Amount/double(a.MaxAmount))),dollcolor);
if ( t ) UTDrawTintedTex(Boss[2],hudsize*statussize,int(min(opacity,15)*(t.Amount/double(t.MaxAmount))),dollcolor);
if ( j ) UTDrawTintedTex(Boss[3],hudsize*statussize,int(min(opacity,15)*(j.Amount/double(j.MaxAmount))),dollcolor);
if ( s ) UTDrawTintedTex(Boss[4],hudsize*statussize,int(min(opacity,15)*(s.Amount/double(s.MaxAmount))),GoldColor);
}
else if ( dolltype == UTPlayer.DOLL_Female )
{ {
UTDrawTintedTex(Woman[0],hudsize*statussize,min(opacity,15),dollcolor); UTDrawTintedTex(Woman[0],hudsize*statussize,min(opacity,15),dollcolor);
if ( a ) UTDrawTintedTex(Woman[1],hudsize*statussize,int(min(opacity,15)*(a.Amount/double(a.MaxAmount))),dollcolor); if ( a ) UTDrawTintedTex(Woman[1],hudsize*statussize,int(min(opacity,15)*(a.Amount/double(a.MaxAmount))),dollcolor);