Bumped ZScript ver.

Added OnDrop to weapons replicating the UT drop style.
Some fixes for UT player movement.
Hide keys from HUD in DM.
Added "classic jump boots" option.
Fixed missing ambientglow on some weapon skins.
This commit is contained in:
Marisa the Magician 2018-11-15 19:03:20 +01:00
commit fe08f11997
7 changed files with 50 additions and 8 deletions

View file

@ -36,7 +36,9 @@ Class DamageAmpLight : DynamicLight
Destroy();
return;
}
SetOrigin(target.pos,true);
if ( target.player )
SetOrigin(target.Vec2OffsetZ(0,0,target.player.viewz),true);
else SetOrigin(target.Vec3Offset(0,0,target.height/2),true);
args[LIGHT_INTENSITY] = Random[ASMD](10,12)*8;
bDORMANT = Powerup(master).isBlinking();
}
@ -317,7 +319,8 @@ Class UTJumpBoots : Inventory
if ( pickup )
{
Owner.GiveInventory("PowerJumpBoots_HighJump",1);
Owner.GiveInventory("PowerJumpBoots_IronFeet",1);
if ( flak_radboots )
Owner.GiveInventory("PowerJumpBoots_IronFeet",1);
}
return false;
}
@ -325,7 +328,8 @@ Class UTJumpBoots : Inventory
{
Super.Tick();
if ( !Owner || !Owner.player ) return;
amount--;
if ( flak_radboots )
amount--;
if ( (amount > 0) && (owner.player.jumptics == -1) )
{
Amount = max(0,Amount-700);
@ -379,6 +383,8 @@ Class PowerJumpBoots_IronFeet : PowerIronFeet
override void DoEffect()
{
Powerup.DoEffect();
if ( !flak_radboots )
DepleteOrDestroy();
}
}

View file

@ -235,7 +235,7 @@ Class UTPlayer : DoomPlayer
else Angle += cmd.yaw*(360./65536.);
player.onground = (pos.z <= floorz) || bOnMobj || bMBFBouncer || (player.cheats & CF_NOCLIP2);
if ( player.onground ) lastgroundtic = gametic;
if ( !player.onground && (abs(pos.z-floorz) <= maxdropoffheight) && (player.jumptics == 0) )
if ( !player.onground && !bNoGravity && (waterlevel < 3) && (abs(pos.z-floorz) <= maxdropoffheight) && (player.jumptics == 0) )
{
SetOrigin(Vec2OffsetZ(0,0,floorz),true);
player.onground = true;
@ -277,9 +277,9 @@ Class UTPlayer : DoomPlayer
}
}
last_sm = sm;
if ( !bNoGravity && player.onground )
if ( !bNoGravity && player.onground && (waterlevel < 3) )
{
if ( !waterlevel && (dodge.length() > 0) )
if ( dodge.length() > 0 )
{
if ( flak_doomspeed ) vel += dodge.unit()*(groundspeed_doomish*1.5)/TICRATE;
else vel += dodge.unit()*(groundspeed*1.5)/TICRATE;
@ -329,7 +329,7 @@ Class UTPlayer : DoomPlayer
player.vel = vel.xy;
}
}
else if ( !bNoGravity && !waterlevel )
else if ( !bNoGravity && (waterlevel < 3) )
{
// air acceleration when falling
float maxaccel = accelrate/TICRATE;
@ -491,6 +491,12 @@ Class UTWeapon : Weapon
override void Tick()
{
Super.Tick();
// don't slide on floor when dropped
if ( CurState == ResolveState("Spawn")+1 )
{
if ( pos.z <= floorz )
vel.xy *= 0;
}
if ( !Owner || !Owner.player || (Owner.player.ReadyWeapon != self) ) return;
Owner.player.WeaponState |= WF_WEAPONBOBBING; // UT weapons always bob
}
@ -580,6 +586,19 @@ Class UTWeapon : Weapon
return ammoitem;
}
override void OnDrop( Actor dropper )
{
Vector2 hofs = RotateVector((dropper.radius,0),dropper.angle);
SetOrigin(dropper.Vec3Offset(hofs.x,hofs.y,dropper.height*0.5),false);
Vector3 x, y, z;
[x, y, z] = Matrix4.GetAxes(dropper.pitch,dropper.angle,dropper.roll);
vel = x*12.0;
vel.z += 4.0;
angle = dropper.angle;
pitch = 0;
roll = 0;
}
Default
{
Weapon.BobStyle "Smooth";

View file

@ -509,6 +509,7 @@ Class UTHud : BaseStatusBar
private void DrawKeys()
{
if ( deathmatch ) return; // no need to draw in DM
if ( gameinfo.gametype&(GAME_Hexen|GAME_Strife) ) return; // no key display for these ATM (will do eventually)
bool locks[6];
for ( int i=0; i<6; i++ ) locks[i] = CPlayer.mo.CheckKeys(i+1,false,true);