Zed fixes #16

Merged
dkanus merged 24 commits from :fpfix into master 2022-03-03 15:43:35 +03:00
2 changed files with 74 additions and 61 deletions
Showing only changes of commit 0ca633cad4 - Show all commits

View File

@ -63,14 +63,14 @@ function PostRender(Canvas C)
local NicePlayerController nicePlayer; local NicePlayerController nicePlayer;
local ScrnHUD scrnHUDInstance; local ScrnHUD scrnHUDInstance;
// TODO maybe use scrnhud? // TODO maybe use scrnhud?
local HUDKillingFloor kfHud; // local HUDKillingFloor kfHud;
local Texture barTexture; local Texture barTexture;
local int x, y, center, barWidth, offset; local int x, y, center, barWidth, offset;
local int missesWidth, missesHeight, missesSpace; local int missesWidth, missesHeight, missesSpace;
local int missesX, missesY; local int missesX, missesY;
local Vector CamPos, ViewDir; // local Vector CamPos, ViewDir;
local Rotator CamRot; // local Rotator CamRot;
local float OffsetX, BarLength, BarHeight, XL, YL, posY; // local float OffsetX, BarLength, BarHeight, XL, YL, posY;
if(C == none) return; if(C == none) return;
if(C.ViewPort == none) return; if(C.ViewPort == none) return;

View File

@ -450,44 +450,55 @@ function PlayFiring(){
if(!currentContext.bIsBursting) if(!currentContext.bIsBursting)
FireCount ++; FireCount ++;
} }
// Handle setting new recoil // Handle setting new recoil
simulated function HandleRecoil(float Rec){ simulated function HandleRecoil(float Rec)
{
local int stationarySeconds; local int stationarySeconds;
local rotator NewRecoilRotation; local rotator NewRecoilRotation;
local NicePlayerController nicePlayer; local NicePlayerController nicePlayer;
local NiceHumanPawn nicePawn; local NiceHumanPawn nicePawn;
local vector AdjustedVelocity; local vector AdjustedVelocity;
local float AdjustedSpeed; local float AdjustedSpeed;
local KFWeapon kfWeap; local KFWeapon KFW;
if(Instigator != none){
if(Instigator != none)
{
nicePlayer = NicePlayerController(Instigator.Controller); nicePlayer = NicePlayerController(Instigator.Controller);
nicePawn = NiceHumanPawn(Instigator); nicePawn = NiceHumanPawn(Instigator);
} }
if(nicePlayer == none || nicePawn == none) if(nicePlayer == none || nicePawn == none)
return; return;
if(bResetRecoil || nicePlayer.IsZedTimeActive() && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillEnforcerZEDBarrage')){ if(bResetRecoil || nicePlayer.IsZedTimeActive() && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillEnforcerZEDBarrage'))
{
Rec = 0.0; Rec = 0.0;
bResetRecoil = false; bResetRecoil = false;
} }
kfWeap= KFWeapon(Weapon); KFW= KFWeapon(Weapon);
if (kfWeap.bAimingRifle) { if (KFW.bAimingRifle)
{
Rec *= 0.5; Rec *= 0.5;
} }
if(nicePawn.stationaryTime > 0.0 && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillHeavyStablePosition')){ if (nicePawn.stationaryTime > 0.0 && class'NiceVeterancyTypes'.static.hasSkill(nicePlayer, class'NiceSkillHeavyStablePosition'))
{
stationarySeconds = Ceil(2 * nicePawn.stationaryTime) - 1; stationarySeconds = Ceil(2 * nicePawn.stationaryTime) - 1;
Rec *= FMax(0.0, 1.0 - (stationarySeconds * class'NiceSkillHeavyStablePosition'.default.recoilDampeningBonus)); Rec *= FMax(0.0, 1.0 - (stationarySeconds * class'NiceSkillHeavyStablePosition'.default.recoilDampeningBonus));
} }
if(!nicePlayer.bFreeCamera){ if (!nicePlayer.bFreeCamera)
if(Weapon.GetFireMode(ThisModeNum).bIsFiring || currentContext.bIsBursting){ {
if (Weapon.GetFireMode(ThisModeNum).bIsFiring || currentContext.bIsBursting)
{
NewRecoilRotation.Pitch = RandRange(maxVerticalRecoilAngle * 0.5, maxVerticalRecoilAngle); NewRecoilRotation.Pitch = RandRange(maxVerticalRecoilAngle * 0.5, maxVerticalRecoilAngle);
NewRecoilRotation.Yaw = RandRange(maxHorizontalRecoilAngle * 0.5, maxHorizontalRecoilAngle); NewRecoilRotation.Yaw = RandRange(maxHorizontalRecoilAngle * 0.5, maxHorizontalRecoilAngle);
if (!bRecoilRightOnly && Rand(2) == 1) if (!bRecoilRightOnly && Rand(2) == 1)
NewRecoilRotation.Yaw *= -1; NewRecoilRotation.Yaw *= -1;
if(RecoilVelocityScale > 0){ if (RecoilVelocityScale > 0)
{
if (Weapon.Owner != none && Weapon.Owner.Physics == PHYS_Falling && if (Weapon.Owner != none && Weapon.Owner.Physics == PHYS_Falling &&
Weapon.Owner.PhysicsVolume.Gravity.Z > class'PhysicsVolume'.default.Gravity.Z){ Weapon.Owner.PhysicsVolume.Gravity.Z > class'PhysicsVolume'.default.Gravity.Z)
{
AdjustedVelocity = Weapon.Owner.Velocity; AdjustedVelocity = Weapon.Owner.Velocity;
// Ignore Z velocity in low grav so we don't get massive recoil // Ignore Z velocity in low grav so we don't get massive recoil
AdjustedVelocity.Z = 0; AdjustedVelocity.Z = 0;
@ -497,7 +508,8 @@ simulated function HandleRecoil(float Rec){
NewRecoilRotation.Pitch += (AdjustedSpeed * RecoilVelocityScale * 0.5); NewRecoilRotation.Pitch += (AdjustedSpeed * RecoilVelocityScale * 0.5);
NewRecoilRotation.Yaw += (AdjustedSpeed * RecoilVelocityScale * 0.5); NewRecoilRotation.Yaw += (AdjustedSpeed * RecoilVelocityScale * 0.5);
} }
else{ else
{
NewRecoilRotation.Pitch += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale); NewRecoilRotation.Pitch += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale);
NewRecoilRotation.Yaw += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale); NewRecoilRotation.Yaw += (VSize(Weapon.Owner.Velocity) * RecoilVelocityScale);
} }
@ -514,6 +526,7 @@ simulated function HandleRecoil(float Rec){
} }
} }
} }
function DoFireEffect(){ function DoFireEffect(){
local bool bIsShotgunBullet, bForceComplexTraj; local bool bIsShotgunBullet, bForceComplexTraj;
local bool bPinpoint; local bool bPinpoint;