Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/HPBase/Classes/BaseCam.uc b/HPBase/Classes/BaseCam.uc
- index 61b55b9..2c4755e 100644
- --- a/HPBase/Classes/BaseCam.uc
- +++ b/HPBase/Classes/BaseCam.uc
- @@ -2,6 +2,32 @@
- //________________________________________________________________________________________
- class BaseCam extends Pawn;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- +// Enumeration of camera types, some of these are not currently used
- +enum ECameraType
- +{
- + CAM_Standard,
- + CAM_Quiditch,
- + CAM_Far,
- +// CAM_Combat,
- + CAM_Boss,
- + CAM_High,
- + CAM_Reverse,
- +// CAM_Fixed,
- +// CAM_Rotate,
- +// CAM_Free,
- + CAM_FreeCam,
- + CAM_Cut,
- + CAM_TrollChase,
- + CAM_Patrol,
- + CAM_TopDown,
- + CAM_Test,
- + CAM_Test2,
- + CAM_Test3,
- + CAM_LockAroundHarry,
- +};
- +
- var vector TrackingPoint; //vector to the player
- var baseharry p; // the pawn the camera is tracking
- var rotator lastRot; // what the last rotation was
- @@ -98,30 +124,6 @@ var float fShakeDuration;
- var float fStartShakeDuration;
- var float fShakeMagnitude;
- -// Enumeration of camera types, some of these are not currently used
- -enum ECameraType
- -{
- - CAM_Standard,
- - CAM_Quiditch,
- - CAM_Far,
- -// CAM_Combat,
- - CAM_Boss,
- - CAM_High,
- - CAM_Reverse,
- -// CAM_Fixed,
- -// CAM_Rotate,
- -// CAM_Free,
- - CAM_FreeCam,
- - CAM_Cut,
- - CAM_TrollChase,
- - CAM_Patrol,
- - CAM_TopDown,
- - CAM_Test,
- - CAM_Test2,
- - CAM_Test3,
- - CAM_LockAroundHarry,
- -};
- -
- var(camera) ECameraType CameraType;
- // Used to save and restore states
- @@ -154,11 +156,152 @@ var NavigationPoint tempNavP, LastNavP;
- var float NormalCameraSpeed; //used by SetCameraSpeed to set the speed as a fraction of full speed.
- var rotator NormalCameraRotSpeed; // ""
- +
- +
- +//AdamJD vars
- +// var float rotvalX; //old -AdamJD
- +// var float rotvalY; //old -AdamJD
- +
- +var Target rectarget;
- +
- +//mouse data (comments copied from HP2 proto)
- +var float fMouseDeltaX; // saved mouse deltaX and deltaY playerHarry
- +var float fMouseDeltaY;
- +
- +var bool bSyncRotationWithTarget; // Sync our curr rotation to always face target
- +var bool bSyncPositionWithTarget; // Sync cam position with CamTarget's position at a fixed distance
- +
- +var CamTarget camTarget; // camera's target (seperate pawn so we can use flyto interpolation )
- +var vector vForward; // The forward vector (for refrence outside the camera)
- +var rotator rRotationStep; // Rotation Step ( rotation step will be applied over time)
- +
- +var rotator rDestRotation; // Rotation Destination
- +var vector vDestPosition; // Position Destination
- +var rotator rCurrRotation; // Rotation Current
- +var vector vCurrPosition; // Position Current
- +
- +var float fCurrLookAtDistance; // Current LookAt Distance will change
- +var float fMoveBackTightness; // Current MoveBack tightness (used when camera moves back from hitting a wall or a bBlockCamera actor )
- +
- +var float fCurrentMinPitch; // Current Min pitch the camera can have
- +var float fCurrentMaxPitch; // Current Max pitch the camera can have
- +
- +var rotator rBossRotationOffset; // This is always centered around a zero rotation, then as you move the mouse, it stays within a narrow cone, and is
- + // added to rDestRotation. Gives player ability to 'aim' while in boss cam.
- +var rotator rExtraRotation; // An additional rotation which can be added to the final rotation, say, for camera shake. Is zero'd every tick.
- +
- +//standard cam specific (comments copied from HP2 proto)
- +var rotator rSavedRotation; // saved when you leave standard mode and reloaded when you come back
- +var vector vSavedPosition; // saved when you leave standard mode and reloaded when you come back
- +var float fPitchMovingInThreshold; // set by the constant PITCH_MOVING_IN_THRESHOLD
- +var float fPitchMovingInSpread; // set by the constant PITCH_MOVING_IN_SPREAD
- +var float fDistanceScalar; // obtained by comparing the current pitch with the spread (once you attain the threshold)
- +var float fDistanceScalarMin; // min for fDistanceScalar. around 0.15. set by DISTANCE_SCALAR_MIN
- +var vector vLookAtOffset; // Current Offset applyed to our lookAt point
- +var float fLookAtDistance; // How far away from the lookAt point is the camera?
- +var float fRotTightness; // The higher the tighness the faster our curLocation == targetLocation
- +var float fRotSpeed; // How fast are we (per sec) at moving.
- +var float fMoveTightness; // The higher the tighness the faster our curRotation == targetRotation
- +var float fMoveSpeed; // How fast are we (per sec) at rotating.
- +
- +//mouseDelta min and max constants (comments copied from HP2 proto)
- +const MIN_MOUSE_DELTA_X = -20000.0f;
- +const MAX_MOUSE_DELTA_X = 20000.0f;
- +const MIN_MOUSE_DELTA_Y = -10000.0f;
- +const MAX_MOUSE_DELTA_Y = 10000.0f;
- +
- +//standard cam pitch/moving in constants (comments copied from HP2 proto)
- +const PITCH_MOVING_IN_THRESHOLD = 0.0f;
- +const PITCH_MOVING_IN_SPREAD = 10000.0f;
- +const DISTANCE_SCALAR_MIN = 0.15;
- +
- +
- /*------------------------------------------------------*/
- /* LOCAL FUNCTIONS */
- /*------------------------------------------------------*/
- +//AdamJD
- +function PreBeginPlay()
- +{
- + SetCollision(false, false, false);
- + bCollideWorld = false;
- +
- + fPitchMovingInThreshold = PITCH_MOVING_IN_THRESHOLD;
- + fPitchMovingInSpread = PITCH_MOVING_IN_SPREAD;
- + fDistanceScalarMin = DISTANCE_SCALAR_MIN;
- +}
- +
- +//AdamJD
- +function PostBeginPlay()
- +{
- + local int count;
- + local vector tloc;
- + local vector targetoffset;
- +
- + Super.PostBeginPlay();
- +
- + foreach AllActors(class'baseharry', p)
- + {
- + break;
- + }
- +
- + foreach AllActors(class'Target', rectarget)
- + {
- + break;
- + }
- +
- + if( camTarget == None )
- + camTarget = spawn( class'CamTarget' );
- +
- + SetOwner( camTarget );
- + camTarget.Cam = self;
- +
- + rectarget.victim.eVulnerableToSpell=SPELL_None;
- +
- + //old code by me -AdamJD
- + // p.cam=self;
- + // camTarget.vOffset.x= p.SmoothMouseX;
- + // camTarget.vOffset.y= p.SmoothMouseY;
- + // camTarget.vOffset.z= 0;
- + // camTarget.aAttachedTo.IsA('baseHarry');
- +
- + //org retail code -AdamJD
- + CameraDistance=80.000000;
- + CameraHeight=120.000000;
- + CameraSpeed=2.000000;
- + NormalCameraSpeed=CameraSpeed;
- +
- + CameraRotSpeed=10.000000;
- + NormalCameraRotSpeed=RotationRate;
- +
- + RealCameraDistance = CameraDistance;
- + CanSeeCountdown = 4;
- +
- + SetCutCameraProx(NORMAL_PROXIMITY);
- +
- + count=0;
- + StackPointer = 0;
- +
- + while(count<16)
- + {
- + previousLocations[count] = vect(0, 0, 0);
- + count+=1;
- + }
- + currentLocation=0;
- +
- + bUseStrafing = true;
- + bUseBattleCam = false;
- +
- + HarrysPreviousPosition = vect(0, 0, 0);
- +
- + //@PAB
- + trackingDistance=cameraDistance/20;
- + setPhysics(PHYS_Rotating);
- +
- + SetCamera();
- +}
- -function PostBeginPlayIP()
- +//old retail PostBeginPlay -AdamJD
- +/*function PostBeginPlayIP()
- {
- local int count;
- @@ -196,7 +339,7 @@ function PostBeginPlayIP()
- //@PAB
- trackingDistance=cameraDistance/20;
- // trackingDistance=cameraDistance/10;
- - setPhysics(PHYS_Rotating);
- + setPhysics(PHYS_Rotating);*/
- /* CamAimOffset[0] = vect(0, 50, -45);
- CamAimOffset[1] = vect(0, -50, -45);
- @@ -216,7 +359,8 @@ function PostBeginPlayIP()
- BattleCamAimOffset[3] = vect(0, -25, 50);
- BattleCamAimOffset[4] = vect(0, -50, 50);
- */
- - CamAimOffset[0] = vect(0, 0, 0);
- +
- +/* CamAimOffset[0] = vect(0, 0, 0);
- CamAimOffset[1] = vect(0, 0, 0);
- CamAimOffset[2] = vect(0, 0, 0);
- CamAimOffset[3] = vect(0, 0, 0);
- @@ -249,7 +393,7 @@ function PostBeginPlayIP()
- bShake = false;
- p.BossTarget = none;
- SetCamera();
- -}
- +}*/
- function SetCameraSpeed(float Speed)
- {
- @@ -925,7 +1069,7 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
- for (TestCamera = 0; TestCamera < 6 && !bFoundGoodCamera; TestCamera++)
- {
- - if(p.IsInState('playeraiming') && bUseTargetingCamera)
- + if(/*p.IsInState('playeraiming') &&*/ bUseTargetingCamera) //AdamJD
- {
- if (p.Bosstarget != none || bUseBattleCam)
- {
- @@ -999,8 +1143,8 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
- goalpoint = CheckPosition(goalPoint);
- - if (p.IsInState('playeraiming'))
- - {
- + // if (p.IsInState('playeraiming')) //AdamJD
- + // {
- // @PAB we need to find a good camera angle
- if (!CanSeeTarget(goalPoint) && TestCamera != 5) // Don't increment last camera
- @@ -1016,17 +1160,18 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
- bFoundGoodCamera = true;
- }
- }
- - else
- - {
- - CanSeeCountdown = 1.5;
- - bFoundGoodCamera = true;
- - }
- - }
- - else
- - {
- + //AdamJD
- + // else
- + // {
- + // CanSeeCountdown = 1.5;
- + // bFoundGoodCamera = true;
- + // }
- + //}
- + // else //AdamJD
- + // {
- CanSeeCountdown = 1.5;
- bFoundGoodCamera = true;
- - }
- + //}
- }
- if (vsize(goalpoint - p.location) < 50)
- @@ -1051,8 +1196,8 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
- }
- }
- */
- - if (p.IsInState('playeraiming'))
- - {
- + // if (p.IsInState('playeraiming')) //AdamJD
- + // {
- if (vsize(trackingpoint) > 50)
- {
- trackingpoint = (vsize(trackingpoint) - 50) * normal(trackingpoint);
- @@ -1087,7 +1232,7 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
- MoveSmooth(trackingPoint);
- }
- }
- - }
- + //}
- else
- {
- if (bMoveQuick || bShake)
- @@ -1709,15 +1854,15 @@ function PositionCamera(float DeltaTime)
- locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + // cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + //}
- else
- {
- bWasAiming = false;
- @@ -1795,15 +1940,15 @@ function PositionCamera(float DeltaTime)
- locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + // cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + //}
- else
- {
- bWasAiming = false;
- @@ -1897,15 +2042,15 @@ function PositionCamera(float DeltaTime)
- locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + // cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + //}
- else
- {
- bWasAiming = false;
- @@ -2000,15 +2145,15 @@ function PositionCamera(float DeltaTime)
- locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + //cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + //}
- else
- {
- bWasAiming = false;
- @@ -2044,20 +2189,137 @@ function PositionCamera(float DeltaTime)
- goto 'loop';
- }
- +//rotation function for the boss cam because the standard rotation is bugged for boss fights -AdamJD
- +function UpdateRotationForBoss( float fTimeDelta )
- +{
- + local float fTravelScalar;
- + local vector vDestRotation;
- + local vector vCurrRotation;
- +
- + vDestRotation = normal(vector(rDestRotation));
- + vCurrRotation = vForward;
- +
- + //update Rotation
- + if( bSyncRotationWithTarget )
- + {
- + //always face CamTarget
- + vDestRotation = CamTarget.location - location;
- + vCurrRotation = vDestRotation;
- + }
- +
- + else
- + {
- + //clamp travel scalar
- + if( fRotTightness > 0.0f )
- + {
- + fTravelScalar = FMin( 1.0f, fRotTightness * fTimeDelta );
- + }
- +
- + else
- + {
- + fTravelScalar = 1.0f;
- + }
- +
- + vCurrRotation += ( vDestRotation - vCurrRotation ) * fTravelScalar;
- + }
- +
- + vCurrRotation = normal(vCurrRotation);
- + rCurrRotation = rotator(vCurrRotation);
- +
- + vForward = vCurrRotation;
- +
- + //set rotation
- + SetFinalRotation( rotator(vCurrRotation) );
- +}
- +
- /*-----------------------------------------------------*/
- state BossState
- {
- ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, Died, LongFall, PainTimer;
- +
- + function BeginState()
- + {
- + CameraType = CAM_Boss;
- +
- + //not needed -AdamJD
- + /*
- + p.StandardTarget.gotostate('BossFollow');
- + p.StandardTarget.TargetOffset = vect(100, 0 ,50);
- + p.clientmessage("Camera switch to Boss state " $string(p.bosstarget.name) $" " $string(directionactor.name));
- + p.StandardTarget.BossCamBox = BossCamBox;
- + p.StandardTarget.TargetOffset = vect(100, 0 ,50);
- + CameraHeight = 120.000000;
- + CameraDistance = 80.000;
- + CameraAimOffsetState = vect(0, 0, 0);
- + */
- +
- + //AdamJD
- + InitSettings( true, false );
- + InitTarget( p );
- + InitPositionAndRotation( false );
- +
- + //not needed -AdamJD
- + // if (bUseStrafing)
- + // {
- + // p.MovementMode(true);
- + // }
- +
- + //not needed -AdamJD
- + //FT: Hack for voldemort, unless we figure out the real problem, this should work.
- + // if( p.BossTarget.IsA( 'BossQuirrel' ) )
- + // {
- + // p.ClientMessage("BaseCam::BossState - Setting DirectionActor to none for Voldemort battle");
- + // DirectionActor = none;
- + // }
- + }
- +
- + function EndState()
- + {
- + //p.MovementMode(false); //not needed -AdamJD
- + p.BossTarget = none;
- + DirectionActor = none;
- + p.StandardTarget.gotostate('seeking');
- + CameraType = CAM_Standard; //go back to standard cam -AdamJD
- + }
- function Tick(float DeltaTime)
- {
- + local vector v;
- +
- + ApplyMouseXToDestYaw(DeltaTime);
- + ApplyMouseYToDestPitch(DeltaTime);
- +
- + //update camera -AdamJD
- + if( baseBoss(p.BossTarget) != none )
- + {
- + v = baseBoss(p.BossTarget).GetCameraOffset();
- + }
- + else
- + {
- + v = p.BossTarget.Location;
- + }
- +
- + rDestRotation = rotator(normal( v - location ));
- + //add boss offset -AdamJD
- + rDestRotation += rBossRotationOffset;
- +
- + //update rotation -AdamJD
- + UpdateRotationForBoss( DeltaTime );
- +
- + //update position -AdamJD
- + UpdatePosition( DeltaTime );
- +
- if (bInSpecialPause)
- {
- + //not smooth but it does the job... -AdamJD
- SaveState();
- gotostate('FreeCamState');
- }
- +
- + //not needed -AdamJD
- + /*
- else
- {
- CheckForBoss();
- @@ -2069,8 +2331,11 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
- PositionCamera(DeltaTime);
- }
- + */
- }
- -
- +
- + //not needed -AdamJD
- + /*
- function PositionCamera(float DeltaTime)
- {
- local vector goalPoint;
- @@ -2113,11 +2378,12 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
- camDistance = CameraOffset >> locRot;
- - goalPoint = TargetPoint + p.Location + camDistance;
- -
- + goalPoint = TargetPoint + p.Location + camDistance;*/
- +
- +
- // If we are in aiming mode, see if we need to switch target CAM
- - if(p.IsInState('playeraiming') && bUseTargetingCamera)
- - {
- + //if(/*p.IsInState('playeraiming') &&*/ bUseTargetingCamera)
- + /*{
- // Give the camera some variety, change cam each time the player starts aiming
- if (!bWasAiming)
- {
- @@ -2173,41 +2439,9 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
- // @PAB remove when you wish to go back to a colliding camera
- // bCollide = false;
- SetCollisionState();
- - }
- -
- - function EndState()
- - {
- - p.MovementMode(false);
- - p.BossTarget = none;
- - DirectionActor = none;
- - p.StandardTarget.gotostate('seeking');
- - }
- -
- - function BeginState()
- - {
- - CameraType = CAM_Boss;
- - p.clientmessage("Camera switch to Boss state " $string(p.bosstarget.name) $" " $string(directionactor.name));
- - p.StandardTarget.BossCamBox = BossCamBox;
- - p.StandardTarget.gotostate('BossFollow');
- - p.StandardTarget.TargetOffset = vect(100, 0 ,50);
- - CameraHeight = 120.000000;
- - CameraDistance = 80.000;
- - CameraAimOffsetState = vect(0, 0, 0);
- -
- - if (bUseStrafing)
- - {
- - p.MovementMode(true);
- - }
- -
- - //FT: Hack for voldemort, unless we figure out the real problem, this should work.
- - if( p.BossTarget.IsA( 'BossQuirrel' ) )
- - {
- - p.ClientMessage("BaseCam::BossState - Setting DirectionActor to none for Voldemort battle");
- - DirectionActor = none;
- - }
- - }
- + }*/
- - begin:
- + //begin:
- /* if (p != none)
- {
- @@ -2218,14 +2452,15 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
- log("Harry is invalid!");
- }
- */
- -
- - loop:
- - sleep (0.0005);
- - if(!bShake)
- - {
- - turntoward(p.StandardTarget);
- - }
- - goto 'loop';
- +
- + //not needed -AdamJD
- + // loop:
- + // sleep (0.0005);
- + // if(!bShake)
- + // {
- + // turntoward(p.StandardTarget);
- + // }
- + // goto 'loop';
- }
- /*-----------------------------------------------------*/
- @@ -2670,7 +2905,7 @@ function PositionCamera(float DeltaTime)
- GroundSpeed = 320.000000;
- AirSpeed = 320.000000;
- */
- -
- + CameraType = CAM_Standard; //fixes issue where the camera locks sometimes after a cutscene -AdamJD
- }
- function BeginState()
- @@ -2778,19 +3013,19 @@ function PositionCamera(float DeltaTime)
- // locRot.pitch = camPitch;
- // smoothRotate(p.ViewRotation, locRot, deltatime);
- -/* if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + //cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + // }
- else
- - {*/
- + {
- bWasAiming = false;
- -// }
- + }
- // log("Harry " $p.location.x $" " $p.location.y $" " $p.location.z);
- // log("camera " $location.x $" " $location.y $" " $location.z);
- @@ -3039,12 +3274,26 @@ auto state() StartState
- {
- function BeginState()
- {
- - PostBeginPlayIP();
- - p.gotostate('playerwalking');
- - p.ClientMessage("Going to state" $CameraType);
- + //not needed -AdamJD
- + //PostBeginPlayIP();
- + // p.gotostate('playerwalking');
- + // p.ClientMessage("Going to state" $CameraType);
- }
- begin:
- + //AdamJD
- + InitSettings(true, false);
- + InitTarget(p);
- + InitPositionAndRotation( true );
- +
- + CameraType = CAM_Standard;
- + SetCamera();
- +}
- +
- +//AdamJD
- +state StateIdle
- +{
- + //don't do anything
- }
- state Test3state
- @@ -3084,15 +3333,15 @@ function PositionCamera(float DeltaTime)
- /* locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- */
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + //cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + //}
- else
- {
- bWasAiming = false;
- @@ -3163,7 +3412,7 @@ function PositionCamera(float DeltaTime)
- CameraAimOffsetState = vect(0, 0, 0);
- // CameraOffset = vect(140, -100, 0);
- }
- -
- +
- begin:
- loop:
- sleep (0.0005);
- @@ -3451,15 +3700,15 @@ function PositionCamera(float DeltaTime)
- locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + //cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + //}
- else
- {
- bWasAiming = false;
- @@ -3500,22 +3749,24 @@ function PositionCamera(float DeltaTime)
- CameraType = CAM_Quiditch;
- p.clientmessage("Camera switch to Quidditch state");
- p.StandardTarget.TargetOffset = vect(100, 0 ,50);
- - CameraHeight = 60.000000;
- - CameraDistance = 150.000;
- - CameraAimOffsetState = vect(0, 0, 0);
- + //not needed -AdamJD
- + // CameraHeight = 60.000000;
- + // CameraDistance = 150.000;
- + // CameraAimOffsetState = vect(0, 0, 0);
- }
- begin:
- -
- - loop:
- - sleep (0.0005);
- - if(!bShake)
- - {
- - turntoward(p.StandardTarget);
- - }
- -
- - goto 'loop';
- -}
- +
- + //not needed -AdamJD
- + // loop:
- + // sleep (0.0005);
- + // if(!bShake)
- + // {
- + // turntoward(p.StandardTarget);
- + // }
- +
- + // goto 'loop';
- +}
- state FreeCamState
- {
- @@ -3525,30 +3776,72 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
- /*-----------------------------------------------------*/
- -// this function is used to set the camera to a set location and give it something to look at
- +function BeginState()
- +{
- + CameraType = CAM_FreeCam;
- + p.clientmessage("Camera switch to FreeCam state");
- + //AdamJD
- + fDistanceScalar = 1.0f;
- + rRotationStep = rot(0,0,0);
- + rSavedRotation = rotation;
- + bSyncPositionWithTarget = false;
- + bSyncRotationWithTarget = false;
- +}
- -function Tick(float DeltaTime)
- +// this function is used to set the camera to a set location and give it something to look at
- +function Tick(float /*DeltaTime*/ fTimeDelta) //AdamJD
- {
- // PositionCamera(DeltaTime);
- - if (bInSpecialPause)
- +
- + if (bInSpecialPause)
- {
- - PositionCamera(DeltaTime);
- + //PositionCamera(DeltaTime);
- + SetCamera(/*CAM_Standard*/); //AdamJD
- }
- - else
- +
- + //not needed -AdamJD
- + // else
- + // {
- + // RestoreState(true);
- + // }
- +
- + //AdamJD
- + fMouseDeltaX = p.SmoothMouseX * fTimeDelta;
- + fMouseDeltaY = p.SmoothMouseY * fTimeDelta;
- +
- + //cap mouseDelta x -AdamJD
- + if( fMouseDeltaX > MAX_MOUSE_DELTA_X )
- {
- - RestoreState(true);
- + fMouseDeltaX = MAX_MOUSE_DELTA_X;
- }
- -}
- +
- + else if( fMouseDeltaX < MIN_MOUSE_DELTA_X )
- + {
- + fMouseDeltaX = MIN_MOUSE_DELTA_X;
- + }
- +
- + //cap mouseDelta y -AdamJD
- + if( fMouseDeltaY > MAX_MOUSE_DELTA_Y )
- + {
- + fMouseDeltaY = MAX_MOUSE_DELTA_Y;
- + }
- +
- + else if( fMouseDeltaY < MIN_MOUSE_DELTA_Y )
- + {
- + fMouseDeltaY = MIN_MOUSE_DELTA_Y;
- + }
- +//}
- -function PositionCamera(float DeltaTime)
- -{
- - local rotator CurrentRotation;
- +//not needed -AdamJD
- +// function PositionCamera(float DeltaTime)
- +// {
- + /*local rotator CurrentRotation;
- -// BaseHUD(p.MyHUD).Debugstring = string(victim.name);
- -// BaseHUD(p.MyHUD).DebugValx = SmoothMouseX;
- -// BaseHUD(p.MyHUD).DebugValy = SmoothMouseY;
- -// BaseHUD(p.MyHUD).DebugValz = p.aup;
- -// BaseHUD(p.MyHUD).DebugVala = p.TargetHitLocation.z;
- + BaseHUD(p.MyHUD).Debugstring = string(victim.name);
- + BaseHUD(p.MyHUD).DebugValx = SmoothMouseX;
- + BaseHUD(p.MyHUD).DebugValy = SmoothMouseY;
- + BaseHUD(p.MyHUD).DebugValz = p.aup;
- + BaseHUD(p.MyHUD).DebugVala = p.TargetHitLocation.z;
- if (baseconsole(p.player.console).bForwardKeyDown)
- {
- @@ -3576,7 +3869,7 @@ function PositionCamera(float DeltaTime)
- {
- trackingpoint = (vect(0, 0, -25) >> Rotation);
- }
- -
- +
- if (baseconsole(p.player.console).bRotateRightKeyDown)
- {
- CurrentRotation = Rotation;
- @@ -3611,21 +3904,77 @@ function PositionCamera(float DeltaTime)
- movesmooth(trackingPoint);
- bCollide = false;
- - SetCollisionState();
- -}
- -
- - function BeginState()
- + SetCollisionState();*/
- +
- + //AdamJD
- + if( baseconsole(p.player.console).bForwardKeyDown )
- {
- - CameraType = CAM_FreeCam;
- - p.clientmessage("Camera switch to FreeCam state");
- + vDestPosition += (vect(1, 0, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
- }
- -
- +
- + else if( baseconsole(p.player.console).bBackKeyDown )
- + {
- + vDestPosition += (vect(-1, 0, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
- + }
- +
- + if( baseconsole(p.player.console).bRightKeyDown )
- + {
- + vDestPosition += (vect(0, 1, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
- + }
- +
- + else if( baseconsole(p.player.console).bLeftKeyDown )
- + {
- + vDestPosition += (vect(0, -1, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
- + }
- +
- + if( baseconsole(p.player.console).bUpKeyDown )
- + {
- + vDestPosition += (vect(0, 0, 1) >> Rotation) * fMoveSpeed * fTimeDelta;
- +
- + }
- +
- + else if( baseconsole(p.player.console).bDownKeyDown )
- + {
- + vDestPosition += (vect(0, 0, -1) >> Rotation) * fMoveSpeed * fTimeDelta;
- + }
- +
- + //update rotation -AdamJD
- + if( baseconsole(p.player.console).bRotateRightKeyDown)
- + {
- + rDestRotation.Yaw += fRotSpeed * fTimeDelta;
- + }
- +
- + else if( baseconsole(p.player.console).bRotateLeftKeyDown)
- + {
- + rDestRotation.Yaw -= fRotSpeed * fTimeDelta;
- + }
- +
- + if( baseconsole(p.player.console).bRotateUpKeyDown)
- + {
- + rDestRotation.Pitch += fRotSpeed * fTimeDelta;
- + }
- +
- + else if( baseconsole(p.player.console).bRotateDownKeyDown)
- + {
- + rDestRotation.Pitch -= fRotSpeed * fTimeDelta;
- + }
- +
- + //add rotation from mouse input -AdamJD
- + rDestRotation.Yaw += fMouseDeltaX * fRotSpeed;
- + rDestRotation.Pitch += fMouseDeltaY * fRotSpeed;
- +
- + //smoothly update rotation -AdamJD
- + rCurrRotation += (rDestRotation - rCurrRotation ) * FMin( 1.0f, fRotTightness * fTimeDelta );
- + DesiredRotation = rCurrRotation;
- + SetRotation( DesiredRotation );
- +}
- begin:
- - loop:
- - sleep (0.0005);
- + //not needed -AdamJD
- + // loop:
- + // sleep (0.0005);
- // turntoward(p.StandardTarget);
- - goto 'loop';
- + //goto 'loop';
- }
- /*-----------------------------------------------------*/
- @@ -3666,15 +4015,15 @@ function PositionCamera(float DeltaTime)
- /* locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- */
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + //cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + // }
- else
- {
- bWasAiming = false;
- @@ -3722,32 +4071,455 @@ function PositionCamera(float DeltaTime)
- goto 'loop';
- }
- +//AdamJD functions (some are copied from the HP2 proto, I was really struggling...)
- +
- +//old mouse axis functions by me
- +/*
- +function xMouseAxis(float DeltaTime)
- +{
- + local float rotatespeed;
- +
- + rotvalX = p.SmoothMouseX * DeltaTime;
- + rotatespeed = 4.0f;
- +
- + CurrentRot.Yaw = rotvalX * rotatespeed;
- +}
- +
- +function yMouseAxis(float DeltaTime)
- +{
- + local float rotatespeed;
- +
- + rotvalY = p.SmoothMouseY * DeltaTime;
- + rotatespeed = 4.0f;
- +
- + CurrentRot.Pitch = rotvalY * rotatespeed;
- +}
- +*/
- +
- +//set up the camera settings
- +function InitSettings(bool bSyncWithTargetPos, bool bSyncWithTargetRot)
- +{
- + fDistanceScalar = 1.0f;
- + rRotationStep = rot(0,0,0);
- + rSavedRotation = rotation;
- + bSyncRotationWithTarget = bSyncWithTargetRot;
- + bSyncPositionWithTarget = bSyncWithTargetPos;
- + fDistanceScalarMin = DISTANCE_SCALAR_MIN;
- + fCurrLookAtDistance = fLookAtDistance;
- +}
- +
- +//set up cam target settings
- +function InitTarget(actor A)
- +{
- + camTarget.SetAttachedTo(A);
- + camTarget.SetOffset( vLookAtOffset );
- +}
- +
- +//copied from the HP2 proto
- +function InitRotation( rotator rot )
- +{
- + rDestRotation.yaw = rot.yaw & 0xFFFF;
- + rDestRotation.pitch = rot.pitch & 0xFFFF;
- + rDestRotation.roll = rot.roll & 0xFFFF;
- + vForward = normal(vector(DesiredRotation));
- + rCurrRotation = rDestRotation;
- + DesiredRotation = rDestRotation;
- + SetRotation( DesiredRotation );
- +}
- +
- +//copied from the HP2 proto
- +function InitPosition( vector pos, optional float deltatime )
- +{
- + vDestPosition = pos;
- +
- + //check camera collision with world -AdamJD
- + CheckCollisionWithWorld();
- +
- + vCurrPosition = vDestPosition;
- + SetLocation( vDestPosition );
- +}
- +
- +//set up dest rotation
- +function SetDestRotation( rotator newRot )
- +{
- + rDestRotation = newRot;
- +}
- +
- +//set up position and rotation settings
- +function InitPositionAndRotation( bool bSnapToNewPosAndRot, optional float deltatime )
- +{
- + if( bSnapToNewPosAndRot )
- + {
- + InitRotation( camTarget.rotation );
- + InitPosition( camTarget.location+((vec(-fLookAtDistance,0,0))>>rDestRotation) );
- + }
- + else
- + {
- + SetDestRotation( CamTarget.rotation );
- +
- + vDestPosition = CamTarget.location + ((vec(-(fLookAtDistance),0,0))>>rDestRotation);
- +
- + //check camera collision with world
- + CheckCollisionWithWorld();
- + }
- + rDestRotation.roll = 0;
- + rCurrRotation.roll = 0;
- +}
- +
- +//get mouse x axis
- +function ApplyMouseXToDestYaw( float fTimeDelta)
- +{
- + fMouseDeltaX = p.SmoothMouseX * fTimeDelta;
- +
- + //cap the fMouseDeltaX
- + if( fMouseDeltaX > MAX_MOUSE_DELTA_X )
- + {
- + fMouseDeltaX = MAX_MOUSE_DELTA_X;
- + }
- +
- + else if( fMouseDeltaX < MIN_MOUSE_DELTA_X )
- + {
- + fMouseDeltaX = MIN_MOUSE_DELTA_X;
- + }
- +
- + //update dest rotation
- + rDestRotation.Yaw += fMouseDeltaX * fRotSpeed;
- +}
- +
- +//get mouse y axis
- +function ApplyMouseYToDestPitch( float fTimeDelta)
- +{
- + fMouseDeltaY = p.SmoothMouseY * fTimeDelta;
- +
- + //cap the fMouseDeltaY
- + if( fMouseDeltaY > MAX_MOUSE_DELTA_Y )
- + {
- + fMouseDeltaY = MAX_MOUSE_DELTA_Y;
- + }
- +
- + else if( fMouseDeltaY < MIN_MOUSE_DELTA_Y )
- + {
- + fMouseDeltaY = MIN_MOUSE_DELTA_Y;
- + }
- +
- + //update dest rotation
- + rDestRotation.Pitch += fMouseDeltaY * fRotSpeed;
- +
- + //cap the rDestRotation
- + if( rDestRotation.Pitch > fCurrentMaxPitch )
- + {
- + rDestRotation.Pitch = fCurrentMaxPitch;
- + }
- +
- + else if( rDestRotation.Pitch < fCurrentMinPitch )
- + {
- + rDestRotation.Pitch = fCurrentMinPitch;
- + }
- +}
- +
- +//copied from the HP2 proto
- +function SetFinalRotation( rotator r )
- +{
- + r += rExtraRotation;
- + rExtraRotation = rot(0,0,0);
- +
- + DesiredRotation = r;
- + SetRotation( r );
- +}
- +
- +//update rotation
- +function UpdateRotation( float fTimeDelta )
- +{
- + local float fTravelScalar;
- +
- + rDestRotation += rRotationStep * fTimeDelta;
- +
- + //if true immediatly face target
- + if( bSyncRotationWithTarget )
- + {
- + rCurrRotation = rotator(CamTarget.location - location);
- + }
- +
- + else
- + {
- + //clamp travel scalar
- + if( fRotTightness > 0.0f )
- + {
- + fTravelScalar = FMin( 1.0f, fRotTightness * fTimeDelta );
- + }
- +
- + else
- + {
- + fTravelScalar = 1.0f;
- + }
- +
- + rCurrRotation += ( rDestRotation - rCurrRotation ) * fTravelScalar;
- + }
- +
- + //update vForward
- + vForward = normal(vector(rCurrRotation));
- +
- + SetFinalRotation( rCurrRotation );
- +}
- +
- +//update position
- +function UpdatePosition( float fTimeDelta )
- +{
- + local float fTravelScalar;
- +
- + if( bSyncPositionWithTarget )
- + {
- + vDestPosition = CamTarget.location + ((vec(-(fCurrLookAtDistance ),0,0)) >> rCurrRotation );
- + }
- +
- + //check camera collision with world -AdamJD
- + CheckCollisionWithWorld();
- +
- + //clamp travel scalar
- + if( fMoveTightness > 0.0f )
- + {
- + fTravelScalar = FMin( 1.0f, fMoveTightness * fTimeDelta );
- + }
- +
- + else
- + {
- + fTravelScalar = 1.0f;
- + }
- +
- + vCurrPosition += ( vDestPosition - vCurrPosition ) * fTravelScalar;
- + SetLocation( vCurrPosition );
- +}
- +
- +//update distance scalar
- +function UpdateDistanceScalar( float fTimeDelta )
- +{
- + local float fDestLookAtDistance;
- +
- + if( rCurrRotation.Pitch > fPitchMovingInThreshold )
- + {
- + //calculate distance scalar
- + fDistanceScalar = 1.0f - ( rCurrRotation.Pitch / fPitchMovingInSpread );
- +
- + //stop camera at harry's head
- + if( fDistanceScalar < fDistanceScalarMin)
- + {
- + fDistanceScalar = fDistanceScalarMin;
- + }
- +
- + fDestLookAtDistance = fLookAtDistance * fDistanceScalar;
- + }
- + else
- + {
- + fDistanceScalar = 1.0f;
- + fDestLookAtDistance = fLookAtDistance;
- + }
- +
- + //collision stuff
- + if( fCurrLookAtDistance < fDestLookAtDistance )
- + {
- + fCurrLookAtDistance += (fDestLookAtDistance - fCurrLookAtDistance ) * FMin( 1.0f, fMoveBackTightness * fTimeDelta );
- + }
- + else
- + {
- + fCurrLookAtDistance = fDestLookAtDistance;
- + }
- +}
- +
- +//finally add collision to camera
- +function bool CheckCollisionWithWorld()
- +{
- + local vector HitLocation;
- + local vector HitNormal;
- + local actor HitActor;
- + local vector LookAtPoint;
- + local vector LookFromPoint;
- + local vector vCusionFromWorld;
- +
- + LookAtPoint = CamTarget.location;
- +
- + //do a trace with the line from the target actor's location to cam targets location
- + if( CamTarget.aAttachedTo != None && (CamTarget.vOffset.x != 0 || CamTarget.vOffset.y != 0 || CamTarget.vOffset.z != 0) )
- + {
- + //make sure that CamTarget.location is inside the level
- + HitActor = Trace( HitLocation, HitNormal, camTarget.Location, camTarget.aAttachedTo.location, false );
- + if( HitActor != None && HitActor.IsA('levelInfo') )
- + {
- + //the cam target has hit something
- + LookAtPoint = HitLocation + ( normal(camTarget.aAttachedTo.location - HitLocation) * 5.0f) + HitNormal;
- + }
- + }
- +
- + vCusionFromWorld = normal(LookAtPoint-vDestPosition) * 5.0f;
- + LookFromPoint = vDestPosition - vCusionFromWorld;
- +
- + foreach TraceActors(class'actor', HitActor, HitLocation, HitNormal, LookFromPoint, LookAtPoint )
- + {
- + if( HitActor == Owner )
- + {
- + continue;
- + }
- +
- + if( HitActor.IsA('levelInfo') )
- + {
- + if(!IsInState('BossState')) //stop camera going right above Harrys head when hitting something in the boss state -AdamJD
- + {
- + //move camera a bit away from the hit location
- + vDestPosition = HitLocation + vCusionFromWorld;
- + fCurrLookAtDistance = vsize(vDestPosition - LookAtPoint);
- +
- + return true;
- + }
- + }
- + }
- +
- + return false;
- +}
- +
- /*-----------------------------------------------------*/
- state Standardstate
- {
- -ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, Died, LongFall, PainTimer;
- + ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, Died, LongFall, PainTimer;
- /*-----------------------------------------------------*/
- -// this function is used to set the camera to a set location and give it something to look at
- + function BeginState()
- + {
- + //org not needed retail code -AdamJD
- + // CameraType = CAM_Standard;
- + // p.clientmessage("Camera switch to Standard state");
- + // p.StandardTarget.TargetOffset = vect(75, 0 ,50);
- + //SetPhysics(PHYS_NONE);
- + // CameraHeight = 80.000000;
- +// // CameraHeight = 50.000000;
- + // CameraDistance = 150.000;
- +// //CameraAimOffsetState = vect(80, 0, 0);
- +// //CameraAimOffsetState = vect(40, 0, 0);
- + // CameraAimOffsetState = vect(0, 0, 0);
- +// CameraOffset = vect(140, -100, 0);
- -function Tick(float DeltaTime)
- -{
- - local vector tpoint;
- + //Init the camera -AdamJD
- + InitSettings(true, false);
- + InitTarget(p);
- + InitPositionAndRotation(true);
- + }
- - if (bInSpecialPause)
- + function EndState()
- {
- - SaveState();
- - gotostate('FreeCamState');
- +// SetPhysics(PHYS_ROTATING);
- +
- + //AdamJD
- + rSavedRotation = rCurrRotation;
- }
- - else
- +
- + // this function is used to set the camera to a set location and give it something to look at
- + function Tick(float DeltaTime)
- {
- - PositionCamera(DeltaTime);
- + local vector tpoint;
- +
- + local float camTotal;
- +
- + local vector PositionDif;
- + local bool bMoved;
- + local rotator viewrot;
- + local float PitchDif;
- +
- + //bCollide = true;
- +
- + /* locRot.pitch = camPitch;
- + smoothRotate(p.ViewRotation, locRot, deltatime);
- + */
- +
- + // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + //cameraLock = true; //AdamJD
- + //now not needed -AdamJD
- + /*
- + if (!bWasAiming)
- + {
- + bWasAiming = true;
- + NextTargetCam();
- + }
- + //}
- + else
- + {
- + bWasAiming = false;
- + }
- +
- + GeneralStationaryModeCamera(deltatime, true);
- +
- + StoreMove();
- +
- + CheckCollisionState(deltatime);
- +
- + //@PAB remove when you wish to go back to a colliding camera
- + SetCollisionState();
- +
- + Check to see if the camera should change its yaw
- +
- + bTurnToward = true;
- +
- + else
- + {
- + PositionCamera(DeltaTime);
- + }
- +
- + tpoint = p.standardTarget.targetOffset;
- + tpoint = tpoint >> p.rotation;
- + tpoint += p.location;
- +
- + // if (!p.IsInState('playeraiming')) //AdamJD
- + // {
- + SetRotation(rotator(tpoint - location));
- + DesiredRotation = rotator(tpoint - location);
- + ViewRotation = rotator(tpoint - location);
- + // }*/
- +
- + //retail commented out code
- + /*SetRotation(rotator(p.StandardTarget.location - location));
- + DesiredRotation = rotator(p.StandardTarget.location - location);
- + ViewRotation = rotator(p.StandardTarget.location - location);*/
- +
- + //apply mouse input to dest rotation -AdamJD
- + ApplyMouseXToDestYaw( DeltaTime);
- + ApplyMouseYToDestPitch( DeltaTime );
- +
- + //update rotation -AdamJD
- + UpdateRotation( DeltaTime );
- +
- + //update position -AdamJD
- + UpdatePosition( DeltaTime );
- +
- + //update distance scalar -AdamJD
- + UpdateDistanceScalar( DeltaTime );
- +
- + //goto free cam state if in special pause -AdamJD
- + if (bInSpecialPause)
- + {
- + SaveState();
- + gotostate('FreeCamState');
- + }
- }
- + begin:
- + //not needed -AdamJD
- + /*
- + loop:
- + sleep (0.0005);
- + if (bTurnToward)
- + {
- + if (p.IsInState('playeraiming'))
- + {
- + turntoward(p.StandardTarget);
- + }
- + }
- + goto 'loop';
- + */
- +//}
- +
- +//retail commented out code -AdamJD
- // if (p.IsInState('playeraiming'))
- // {
- // tpoint = vect(0, 0, 50);
- @@ -3785,25 +4557,10 @@ function Tick(float DeltaTime)
- // ViewRotation = rotator(p.location + tpoint - location);
- // }
- // }
- -
- -
- - tpoint = p.standardTarget.targetOffset;
- - tpoint = tpoint >> p.rotation;
- - tpoint += p.location;
- -
- - if (!p.IsInState('playeraiming'))
- - {
- - SetRotation(rotator(tpoint - location));
- - DesiredRotation = rotator(tpoint - location);
- - ViewRotation = rotator(tpoint - location);
- - }
- -
- -/* SetRotation(rotator(p.StandardTarget.location - location));
- - DesiredRotation = rotator(p.StandardTarget.location - location);
- - ViewRotation = rotator(p.StandardTarget.location - location);*/
- }
- -function PositionCamera(float DeltaTime)
- +//old retail function (moved code to StandardState) -AdamJD
- +/*function PositionCamera(float DeltaTime)
- {
- local float camTotal;
- @@ -3811,21 +4568,22 @@ function PositionCamera(float DeltaTime)
- local bool bMoved;
- local rotator viewrot;
- local float PitchDif;
- -
- - bCollide = true;
- +
- + bCollide = true;*/
- /* locRot.pitch = camPitch;
- smoothRotate(p.ViewRotation, locRot, deltatime);
- */
- - if(p.IsInState('playeraiming'))
- - {
- - cameraLock = true;
- + //AdamJD
- +/* // if(p.IsInState('playeraiming')) //AdamJD
- + // {
- + //cameraLock = true; //AdamJD
- if (!bWasAiming)
- {
- bWasAiming = true;
- NextTargetCam();
- }
- - }
- + //}
- else
- {
- bWasAiming = false;
- @@ -3867,17 +4625,17 @@ function PositionCamera(float DeltaTime)
- begin:
- loop:
- - sleep (0.0005);
- - if (bTurnToward)
- + sleep (0.0005);*/
- + //AdamJD
- + /*if (bTurnToward)
- {
- if (p.IsInState('playeraiming'))
- {
- turntoward(p.StandardTarget);
- }
- - }
- - goto 'loop';
- -}
- -
- + }*/
- + // goto 'loop';
- +// }
- /*-----------------------------------------------------*/
- @@ -4001,13 +4759,40 @@ moveLoop:
- defaultproperties
- {
- - cameraLock=True
- - lockBias=1
- - bUseStrafing=True
- - bHidden=True
- - bCanMoveInSpecialPause=True
- - CollisionRadius=0.1
- - bBlockActors=False
- - bBlockPlayers=False
- - RotationRate=(Pitch=20000,Yaw=20000,Roll=20000)
- + bRotateToDesired=false
- +
- + bHidden=true
- + bBlockActors=false
- + bBlockPlayers=false
- +
- + bCanMoveInSpecialPause=true
- +
- + //retail not needed defaults -AdamJD
- + //cameraLock=True
- + //lockBias=1
- + //bUseStrafing=True
- + //bHidden=True
- + //bCanMoveInSpecialPause=True
- + //CollisionRadius=0.1
- + //bBlockActors=False
- + //bBlockPlayers=False
- + //RotationRate=(Pitch=20000,Yaw=20000,Roll=20000)
- +
- + //AdamJD defaults
- + bSyncPositionWithTarget=true
- +
- + fCurrentMinPitch=-14000.0f
- + fCurrentMaxPitch=14000.0f
- +
- + fDistanceScalar=1.0f
- +
- + fMoveBackTightness=2.5f
- +
- + //standard cam settings -AdamJD
- + vLookAtOffset=(X=0,Y=0,Z=55.0f)
- + fLookAtDistance=128.0f
- + fRotTightness=8.0f
- + fRotSpeed=4.0f
- + fMoveTightness=0.0f
- + fMoveSpeed=0.0f
- }
- diff --git a/HPBase/Classes/CamTarget.uc b/HPBase/Classes/CamTarget.uc
- index 3c3141d..f28b4a6 100644
- --- a/HPBase/Classes/CamTarget.uc
- +++ b/HPBase/Classes/CamTarget.uc
- @@ -3,17 +3,95 @@
- //=============================================================================
- class CamTarget expands Pawn;
- -var baseharry p;
- -var vector targetOffset;
- -var vector moveTarget;
- -var float previousYaw;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +var vector targetOffset;
- var rotator BossCamBox;
- -var bool bInPlayerAiming;
- -var vector OldOffset;
- -var vector OldRecTargetLocation;
- +//old retail vars -AdamJD
- +//var baseharry p;
- +//var vector moveTarget;
- +//var float previousYaw;
- +//var bool bInPlayerAiming;
- +//var vector OldOffset;
- +//var vector OldRecTargetLocation;
- +
- +//AdamJD vars
- +var actor aAttachedTo; //actor that the target is attached to
- +var vector vOffset;
- +var bool bRelative;
- +var BaseCam Cam;
- +var Target rectarget;
- +
- +function PostBeginPlay()
- +{
- + foreach AllActors(class'Target', rectarget)
- + {
- + break;
- + }
- +
- + rectarget.victim.eVulnerableToSpell=SPELL_None;
- +}
- +
- +//set the cam target offset -AdamJD
- +function SetOffset ( vector v )
- +{
- + vOffset = v;
- + UpdateOrientation();
- +}
- +
- +//set the attached to actor -AdamJD
- +function SetAttachedTo(actor a)
- +{
- + aAttachedTo = a;
- + UpdateOrientation();
- +}
- +
- +//update position and rotation -AdamJD
- +function UpdateOrientation()
- +{
- + local vector delta;
- +
- + if( aAttachedTo != None )
- + {
- + delta = vec(0, 0, 0); //focus cam target on Harry
- +
- + //update rotation
- + SetNewRotation( aAttachedTo.rotation );
- +
- + //update position
- + if( bRelative )
- + {
- + SetLocation( aAttachedTo.location + delta + (vOffset >> rotation) );
- + }
- +
- + else
- + {
- + SetLocation( aAttachedTo.location + delta + vOffset);
- + }
- + }
- +}
- +
- +//set up the new rotation -AdamJD
- +function SetNewRotation( rotator rot )
- +{
- + DesiredRotation = rot;
- + DesiredRotation.Yaw = DesiredRotation.Yaw & 0xFFFF;
- + DesiredRotation.Pitch = DesiredRotation.Pitch & 0xFFFF;
- + DesiredRotation.Roll = DesiredRotation.Roll & 0xFFFF;
- + SetRotation( DesiredRotation );
- +}
- +
- +//make sure the SetAttachedTo actor gets ticked -AdamJD
- +event Tick(optional float fTimeDelta)
- +{
- + Super.Tick( fTimeDelta );
- + SetAttachedTo(aAttachedTo);
- + UpdateOrientation();
- +}
- +//old retail code -AdamJD
- +/*
- auto state seeking
- {
- function startup()
- @@ -34,8 +112,7 @@ auto state seeking
- function touch (actor other)
- {
- }
- -
- -
- +
- function HitWall (vector HitNormal, actor Wall)
- {
- }
- @@ -53,7 +130,7 @@ auto state seeking
- {
- local vector tloc;
- - local vector offset;
- + local vector offset;*/
- /* if (p.IsInState('PlayerAiming'))
- {
- @@ -73,18 +150,18 @@ auto state seeking
- }
- else
- {*/
- - if (bInPlayerAiming)
- - {
- + // if (bInPlayerAiming)
- + // {
- /* TargetOffset = Normal(OldRecTargetLocation - p.cam.Location) * 100;
- TargetOffset.x = OldOffset.x;
- TargetOffset.y = OldOffset.y;
- TargetOffset.z += 50; // Offset in the battle cam aim offset
- */
- - bInPlayerAiming = false;
- - }
- + // bInPlayerAiming = false;
- + // }
- - if (p.bStationary)
- - {
- + // if (p.bStationary)
- + // {
- /* if(p.SmoothMouseY>64 && targetOffset.z < 150)
- {
- targetOffset.z=targetOffset.z+2;
- @@ -95,7 +172,7 @@ auto state seeking
- targetOffset.z=targetOffset.z-2;
- }*/
- - if((p.SmoothMouseY < -64) && targetOffset.z > 0)
- + /*if((p.SmoothMouseY < -64) && targetOffset.z > 0)
- {
- targetOffset.z = targetOffset.z - 3;
- @@ -151,7 +228,7 @@ auto state seeking
- {
- targetOffset.z=targetOffset.z-2;
- }
- -// }
- +// }*/
- /* BaseHUD(p.MyHUD).DebugValx = tloc.x;
- BaseHUD(p.MyHUD).DebugValy = tloc.y;
- @@ -162,12 +239,12 @@ auto state seeking
- BaseHUD(p.MyHUD).DebugValz2 = OldRecTargetLocation.z;
- */
- - offset=tloc-location;
- + /*offset=tloc-location;
- - if (p.IsInState('PlayerAiming'))
- - {
- -// log("Now " $location.x $" " $location.y $" " $location.z);
- -// log("Rectarget " $p.rectarget.location.x $" " $p.rectarget.location.y $" " $p.rectarget.location.z);
- + // if (p.IsInState('PlayerAiming'))
- + // {
- + //log("Now " $location.x $" " $location.y $" " $location.z);
- + //log("Rectarget " $p.rectarget.location.x $" " $p.rectarget.location.y $" " $p.rectarget.location.z);
- if (vsize(offset) > 30)
- {
- @@ -175,7 +252,7 @@ auto state seeking
- // SetLocation(offset + location);
- movesmooth(offset);
- }
- - }
- + //}
- else
- {
- // SetLocation(offset + location);
- @@ -261,14 +338,14 @@ state BossFollow
- if (vsize(offset) > 200)
- {
- offset = (vsize(offset) - 200) * normal(offset);
- - movesmooth(offset);
- + movesmooth(offset);*/
- /* BaseHUD(p.MyHUD).DebugValX = offset.x;
- BaseHUD(p.MyHUD).DebugValY = offset.y;
- BaseHUD(p.MyHUD).DebugValZ = offset.z;*/
- - }
- - }
- - else if (abs(ViewDif.Yaw) > BossCamBox.yaw )
- + // }
- + // }
- + /*else if (abs(ViewDif.Yaw) > BossCamBox.yaw )
- {
- if (ViewDif.Yaw > 0 && ViewDif.Yaw < 0x8000)
- {
- @@ -281,28 +358,28 @@ state BossFollow
- ViewDif.pitch = 0;
- ViewDif.roll = 0;
- ViewDif = Rotator(p.BossTarget.Location - p.location) - ViewDif;
- - tloc = vector(ViewDif) * VSize(p.BossTarget.Location - p.location) + p.Location;
- + tloc = vector(ViewDif) * VSize(p.BossTarget.Location - p.location) + p.Location;*/
- /* BaseHUD(p.MyHUD).DebugValX = tloc.x;
- BaseHUD(p.MyHUD).DebugValY = tloc.y;
- BaseHUD(p.MyHUD).DebugValZ = tloc.z;
- */
- - offset=tloc-location;
- + // offset=tloc-location;
- - if (vsize(offset) > 200)
- - {
- - offset = (vsize(offset) - 200) * normal(offset);
- - SetLocation(offset + location);
- + // if (vsize(offset) > 200)
- + // {
- + // offset = (vsize(offset) - 200) * normal(offset);
- + // SetLocation(offset + location);
- // movesmooth(offset);
- /* BaseHUD(p.MyHUD).DebugValX = offset.x;
- BaseHUD(p.MyHUD).DebugValY = offset.y;
- BaseHUD(p.MyHUD).DebugValZ = offset.z;*/
- - }
- - }
- - }
- + // }
- + // }
- + // }
- - begin:
- + /*begin:
- startup();
- @@ -349,7 +426,7 @@ state Free
- goto 'seekloop';
- -}
- +}*/
- defaultproperties
- {
- diff --git a/HPBase/Classes/SpellLearnTrigger.uc b/HPBase/Classes/SpellLearnTrigger.uc
- index 68e027f..b192ced 100644
- --- a/HPBase/Classes/SpellLearnTrigger.uc
- +++ b/HPBase/Classes/SpellLearnTrigger.uc
- @@ -4,6 +4,8 @@
- class SpellLearnTrigger extends Trigger;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var(Spells) class<BaseSpell> Spell;
- var(Spells) class<SpellLearnFX> LearnFXClass[3];
- @@ -111,73 +113,93 @@ function Trigger(actor Other, pawn EventInstigator)
- break;
- }
- }
- +
- + //if holding down the spacebar then skip the spell learning -AdamJD
- + if (Player.bSkipKeyPressed == true)
- + {
- + //copied from code near the end of this script -AdamJD
- + DestroyWand();
- + DestroyTemplate();
- + baseHUD(player.myHUD).DestroyPopup();
- - Cam = Player.Cam;
- - Cam.SaveState();
- - SpellGesture = Spell.default.Gesture;
- + player.iLevelReached = LessonLevel;
- + player.iLessonPoints = TotalHousePointScore;
- - // Test
- -/* for (i = 0; i < int(SpellGesture.Points); i ++)
- - {
- - log("Spell lesson points " $i $" of " $int(SpellGesture.Points) $SpellGesture.Points[i].x $SpellGesture.Points[i].y);
- + Destroy();
- +
- + Player.CutRelease(); //makes skipping the spell learning smooth -AdamJD
- }
- -*/
- - bSaveSmoothing = Player.bMaxMouseSmoothing;
- - Player.bMaxMouseSmoothing = false;
- -
- - // We can't fail this lesson, add the spell to Harry now
- - BaseWand(Player.Weapon).AddSpell(Spell);
- -
- - // Put player in right state.
- - BaseWand(Player.Weapon).SelectSpell(Spell);
- -
- - Player.gotoState('SpellLearning');
- -
- - // Halt the player.
- - Player.Velocity = vect(0,0,0);
- - Player.Acceleration = vect(0,0,0);
- - Player.PlayAnim('breathe');
- -
- - TempActor = Spawn(class'camtarget');
- - TempActor.GotoState('Free');
- - TempActor.SetLocation(Location + (vec(TemplateDist,0,0) >> Rotation));
- - Cam.DirectionActor = TempActor;
- - // Change the camera mode.
- - Cam.PositionActor = none;
- - CameraDist = 20; // Hard code for the mo
- - Cam.GotoState('CutState');
- - Cam.SetLocation(Location + (vec(CameraDist,0,0) >> Rotation));
- - Cam.SetRotation(rotator(TempActor.Location - Location));
- +
- + //otherwise carry on with the spell learning as normal -AdamJD
- + else
- + {
- + Cam = Player.Cam;
- + Cam.SaveState();
- + SpellGesture = Spell.default.Gesture;
- - // Init spell level.
- - SpellLevel = 0;
- + // Test
- + /* for (i = 0; i < int(SpellGesture.Points); i ++)
- + {
- + log("Spell lesson points " $i $" of " $int(SpellGesture.Points) $SpellGesture.Points[i].x $SpellGesture.Points[i].y);
- + }
- + */
- + bSaveSmoothing = Player.bMaxMouseSmoothing;
- + Player.bMaxMouseSmoothing = false;
- - TemplateDrawTime = DrawTime / 4;
- + // We can't fail this lesson, add the spell to Harry now
- + BaseWand(Player.Weapon).AddSpell(Spell);
- - LessonLevel = 0;
- - TotalHousePointScore = 0;
- + // Put player in right state.
- + BaseWand(Player.Weapon).SelectSpell(Spell);
- - LessonBlackboard = spawn(class'spellblackboard',
- - [SpawnLocation] Location + (vec(TemplateDist + 50, 0, 0) >> Rotation) );
- + Player.gotoState('SpellLearning');
- -/*
- - if (LessonBlackboard == none)
- - {
- - log("Blackboard is none");
- - }
- - else
- - {
- - log("Blackboard is OK");
- - }
- -*/
- + // Halt the player.
- + Player.Velocity = vect(0,0,0);
- + Player.Acceleration = vect(0,0,0);
- + Player.PlayAnim('breathe');
- - if (Teacher != none)
- - {
- - Teacher.GotoState('idle');
- - }
- + TempActor = Spawn(class'camtarget');
- + TempActor.GotoState('Free');
- + TempActor.SetLocation(Location + (vec(TemplateDist,0,0) >> Rotation));
- + Cam.DirectionActor = TempActor;
- + // Change the camera mode.
- + Cam.PositionActor = none;
- + CameraDist = 20; // Hard code for the mo
- + Cam.GotoState('CutState');
- + Cam.SetLocation(Location + (vec(CameraDist,0,0) >> Rotation));
- + Cam.SetRotation(rotator(TempActor.Location - Location));
- +
- + // Init spell level.
- + SpellLevel = 0;
- +
- + TemplateDrawTime = DrawTime / 4;
- +
- + LessonLevel = 0;
- + TotalHousePointScore = 0;
- +
- + LessonBlackboard = spawn(class'spellblackboard',
- + [SpawnLocation] Location + (vec(TemplateDist + 50, 0, 0) >> Rotation) );
- +
- + /*
- + if (LessonBlackboard == none)
- + {
- + log("Blackboard is none");
- + }
- + else
- + {
- + log("Blackboard is OK");
- + }
- + */
- - bFirstTime = true;
- - gotoState('Template', 'Init');
- + if (Teacher != none)
- + {
- + Teacher.GotoState('idle');
- + }
- +
- + bFirstTime = true;
- + gotoState('Template', 'Init');
- + }
- }
- function TriggerNext()
- diff --git a/HPBase/Classes/Target.uc b/HPBase/Classes/Target.uc
- index 57f1993..a4fdc8b 100644
- --- a/HPBase/Classes/Target.uc
- +++ b/HPBase/Classes/Target.uc
- @@ -1,9 +1,11 @@
- //===============================================================================
- -// [FlowerVase]
- +// [Target]
- //===============================================================================
- class target extends ParticleFX;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- #exec MESH MODELIMPORT MESH=ModTarget1Mesh MODELFILE=models\ModTarget1.PSK LODSTYLE=10
- #exec MESH ORIGIN MESH=ModTarget1Mesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
- #exec ANIM IMPORT ANIM=ModTarget1Anims ANIMFILE=models\ModTarget1.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
- @@ -47,6 +49,14 @@ var float TargetSize;
- var bool bNoMove;
- +//AdamJD vars
- +var vector vGestureOffset;
- +var bool bIsLockedOn;
- +var bool bInvisibleCursor;
- +var float fLOS_Distance;
- +
- +
- +
- auto state seeking
- {
- @@ -64,9 +74,9 @@ auto state seeking
- break;
- }
- }
- - TargetCounter = 0;
- + TargetCounter = 0;
- - bNoMove = true;
- + //bNoMove = true; //not needed -AdamJD
- // PlaySound(sound'HPSounds.magic_sfx.spell_aim');
- @@ -86,25 +96,25 @@ auto state seeking
- TargetRotation = rotator(TraceEnd);
- TargetPitch = TargetRotation.Pitch;
- -// TargetPitch = 0;
- +// TargetPitch = 0;
- TargetYaw = 0;
- }
- // @PAB added target glow
- -/* if(baseWand(p.weapon).curSpell != class'spelldud')
- - {*/
- + //if(baseWand(p.weapon).curSpell != class'spelldud')
- + //{
- targetGlowObjRed=spawn(class'targetglow',,,Location);
- targetGlowObjRed.SetColour(255, 0, 0);
- targetGlowObjBlue=spawn(class'targetglow',,,Location);
- targetGlowObjBlue.SetColour(0, 255, 255);
- -/* }*/
- + //}
- /* if (SpellGesture != none)
- {
- log("Spell " $string(SpellGesture.Name));
- - }
- -*/
- + }*/
- +
- // AE:
- StopEffect();
- }
- @@ -126,8 +136,8 @@ auto state seeking
- setTarget(Deltatime);
- }
- - function setTarget(float deltatime)
- - {
- +function setTarget(float deltatime)
- +{
- local rotator TargetRot;
- local vector TraceStart;
- local vector TraceEnd;
- @@ -143,6 +153,9 @@ auto state seeking
- //@PAB test
- local actor HitActor;
- +
- + //AdamJD local int
- + local int TargetPitchX;
- Colorstart.base.r=13;
- Colorstart.base.g=108;
- @@ -213,26 +226,31 @@ auto state seeking
- TargetRot = p.rotation;
- TargetRot.pitch = TargetPitch;
- - TargetRot.yaw = TargetRot.yaw + TargetYaw;
- + TargetRot.yaw += TargetYaw;
- // BaseHUD(p.MyHUD).DebugVala = TargetPitch;
- - TraceStart = p.Location;
- + //TraceStart = p.Location; //old tracestart -AdamJD
- + TraceStart = p.cam.CamTarget.Location; //set tracestart to the cam target location -AdamJD
- TraceEnd = Vector(TargetRot);
- Cushion = TraceEnd;
- +
- + //set TargetPitchX to TargetPitch -AdamJD
- + TargetPitchX = TargetPitch;
- //Right now, this is only used by the Devil's snare level.
- if( p.bExtendedTargetting )
- - TraceEnd = TraceEnd * 1024;//512;
- + TraceEnd *= 1024;//512;
- else
- - TraceEnd = TraceEnd * 512;
- + TraceEnd *= 512;
- - TraceEnd = TraceEnd + p.Location;
- + // TraceEnd = TraceEnd + p.Location; //old traceend -AdamJD
- + TraceEnd = p.cam.CamTarget.Location + p.cam.vForward * (p.cam.fLookAtDistance + fLOS_Distance); //set traceend to the cam target location and try to keep spell locked on -AdamJD
- PossibleVictim = none;
- -
- -/* if(baseWand(p.weapon).curSpell== class'spelldud')
- +
- + /*if(baseWand(p.weapon).curSpell== class'spelldud')
- {
- Colorstart.base.r=0;
- Colorstart.base.g=0;
- @@ -254,12 +272,17 @@ auto state seeking
- {
- HitLocation = TraceEnd;
- }
- - }
- -*/
- + }*/
- +
- foreach TraceActors(class 'actor', HitActor, HitLocation, HitNormal, TraceEnd, TraceStart)
- {
- // log(string(HitActor.name) $" " $vsize(HitLocation - TraceStart));
- + if( HitActor.IsA('baseHarry') || HitActor.IsA('Harry') || HitActor.IsA('BaseCam') || HitActor.IsA('CamTarget') )
- + {
- + continue; //ignore Harry and camera stuff -AdamJD
- + }
- +
- if (HitActor.bprojtarget || HitActor.bBlockActors )
- {
- // Found target,
- @@ -284,19 +307,21 @@ auto state seeking
- {
- if (possiblevictim.bprojtarget == true)
- {
- -/* Colorstart.base.r=169;
- + /*Colorstart.base.r=169;
- Colorstart.base.g=5;
- Colorstart.base.b=5;
- ColorEnd.base.r=0;
- ColorEnd.base.g=0;
- - ColorEnd.base.b=0;
- -*/
- + ColorEnd.base.b=0;*/
- +
- victim = possiblevictim;
- TargetArea = victim.GetWorldCollisionBox(true);
- HitLocation = ((TargetArea.Max - TargetArea.Min) / 2) + TargetArea.Min;
- -
- +
- + //retail original code -AdamJD
- + /*
- if (possiblevictim.CollideType == CT_Box)
- {
- radius = possiblevictim.CollisionWidth;
- @@ -305,8 +330,34 @@ auto state seeking
- {
- radius = possiblevictim.collisionradius;
- }
- - Cushion = Cushion * (radius / 2);
- - HitLocation = HitLocation - Cushion;
- + */
- +
- + //AdamJD code start
- + //get victim width and setup cursor locking onto the victim
- + if(victim.CollideType == CT_Box || victim.CollideType == CT_AlignedCylinder || victim.CollideType == CT_OrientedCylinder || victim.CollisionWidth == 0)
- + {
- + cushion = vec(victim.CollisionRadius, victim.CollisionWidth, victim.CollisionHeight);
- + radius = victim.CollisionWidth;
- + TargetPitchX = radius * p.SmoothMouseX;
- + TargetPitch = radius * p.SmoothMouseY;
- +
- + vGestureOffset = -(vec(radius, 0, 0));
- + }
- + //get victim radius and setup cursor locking onto the victim
- + else
- + {
- + cushion = vec(victim.CollisionRadius, victim.CollisionRadius, victim.CollisionHeight);
- + radius = victim.collisionradius;
- + TargetPitchX = radius * p.SmoothMouseX;
- + TargetPitch = radius * p.SmoothMouseY;
- +
- + vGestureOffset = normal(p.location - victim.location) * radius;
- + }
- + //AdamJD code end
- +
- + Cushion *= (radius / 2);
- +
- + HitLocation -= Cushion;
- victim.Targeted();
- LockOn(victim);
- @@ -331,80 +382,131 @@ auto state seeking
- TargetGlowObjBlue.SetTargetUnlock();
- HitLocation = TraceEnd;
- HitLocation -= Cushion;
- -
- +
- SetFloatTarget();
- TargetGlowObjRed.SetFloatTarget();
- TargetGlowObjBlue.SetFloatTarget();
- }
- -
- +
- movesmooth(HitLocation - location);
- TargetGlowObjRed.MoveSmooth(HitLocation - TargetGlowObjRed.location);
- TargetGlowObjBlue.MoveSmooth(HitLocation - TargetGlowObjBlue.location);
- -
- -/* BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
- +
- + /*BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
- BaseHUD(p.MyHUD).DebugValy = HitLocation.y;
- BaseHUD(p.MyHUD).DebugValz = HitLocation.z;*/
- +
- + //lock cursor onto victim -AdamJD
- + if (bIsLockedOn == true)
- + {
- + //log("locked onto victim test");
- + TargetPitchX = p.SmoothMouseX;
- + TargetPitch = p.SmoothMouseY;
- + TargetRot = victim.rotation;
- + }
- }
- -
- +
- function LockOn(actor TargetActor)
- {
- - local BoundingBox TargetArea;
- + local BoundingBox TargetArea;
- local vector TargetCentre;
- local float fTargetWidth;
- local float fTargetHeight;
- local float fTargetDepth;
- -
- + local int TargetPitchX; //AdamJD local int
- +
- TargetArea = TargetActor.GetWorldCollisionBox(true);
- -
- +
- TargetCentre = ((TargetArea.Max - TargetArea.Min) / 2) + TargetArea.Min + TargetActor.CentreOffset;
- + fTargetDepth = abs(TargetArea.Max.x - TargetArea.Min.x) * TargetActor.SizeModifier;
- fTargetWidth = abs(TargetArea.Max.y - TargetArea.Min.y) * TargetActor.SizeModifier;
- fTargetHeight = abs(TargetArea.Max.z - TargetArea.Min.z) * TargetActor.SizeModifier;
- - fTargetDepth = abs(TargetArea.Max.x - TargetArea.Min.x);
- -
- - SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
- - TargetGlowObjRed.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
- - TargetGlowObjBlue.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
- -
- +
- + SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
- + SetRotation(TargetActor.rotation);
- + //not needed -AdamJD
- + //TargetGlowObjRed.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
- + //TargetGlowObjBlue.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
- +
- baseWand(p.weapon).ChooseSpell(victim.eVulnerableToSpell);
- + BaseHUD(p.MyHUD).DebugValX = TargetActor.SizeModifier; //get debug X value -AdamJD
- BaseHUD(p.MyHUD).DebugValY = TargetActor.SizeModifier;
- -
- + BaseHUD(p.MyHUD).DebugValZ = TargetActor.SizeModifier; //get debug Z value -AdamJD
- +
- + TargetPitchX = TargetPitch; //set TargetPitchX to TargetPitch -AdamJD
- +
- // Get Spell gesture
- -
- - if (baseWand(p.Weapon).curSpell != none && baseWand(p.weapon).curSpell != class'spelldud')
- + if (baseWand(p.Weapon).curSpell != none && baseWand(p.weapon).curSpell != class'spelldud') //&& (!TargetActor.IsA('baseHarry') || !TargetActor.IsA('Harry') || !TargetActor.IsA('baseWand') || !TargetActor.IsA('BaseCam') || !TargetActor.IsA('CamTarget') || TargetActor != p || TargetActor != Owner) )
- {
- - SpellGesture = baseWand(p.Weapon).curSpell.default.gesture;
- + SpellGesture = baseWand(p.Weapon).curSpell.default.gesture;
- }
- -
- +
- if (FXVisible == false)
- {
- - if (victim.isa('basechar'))
- + if (victim.isa('basechar') )
- {
- if (basechar(victim).bGestureOnTargeting)
- {
- FXVisible = true;
- + bIsLockedOn = true; //cursor is locked on -AdamJD
- DrawSpellFX(TargetCentre, fTargetWidth, fTargetDepth);
- + vGestureOffset = -(vec(fTargetWidth, 0, 0)); //get GestureOffset -AdamJD
- + TargetPitchX = p.SmoothMouseX; //set TargetPitch to X mouse axis -AdamJD
- + TargetPitch = p.SmoothMouseY; //set TargetPitch to Y mouse axis -AdamJD
- }
- else
- {
- - // save location of spell, but don't use it
- -
- + //save location of spell, but don't use it
- + bIsLockedOn = true; //cursor is locked on -AdamJD
- TargetHitLocation = TargetCentre;
- TargetSize = fTargetWidth;
- + vGestureOffset = normal(p.location - TargetActor.location) * fTargetWidth; //get GestureOffset -AdamJD
- + TargetPitchX = p.SmoothMouseX; //set TargetPitch to X mouse axis -AdamJD
- + TargetPitch = p.SmoothMouseY; //set TargetPitch to Y mouse axis -AdamJD
- }
- }
- - else
- + else
- {
- - FXVisible = true;
- - DrawSpellFX(TargetCentre, fTargetWidth, fTargetDepth);
- - }
- + FXVisible = true;
- + bIsLockedOn = true; //cursor is locked on -AdamJD
- + DrawSpellFX(TargetCentre, fTargetWidth, fTargetDepth);
- + vGestureOffset = -(vec(fTargetWidth, 0, 0)); //get GestureOffset -AdamJD
- + TargetPitchX = p.SmoothMouseX; //set TargetPitch to X mouse axis -AdamJD
- + TargetPitch = p.SmoothMouseY; //set TargetPitch to Y mouse axis -AdamJD
- + }
- }
- +
- else
- {
- - // rotate FX
- -// RotateSpellFX();
- + //rotate FX
- + //RotateSpellFX();
- }
- - }
- +
- +
- + //lock cursor onto target -AdamJD
- + if (bIsLockedOn == true)
- + {
- + //log("locked onto target test");
- +
- + //get target width and setup cursor locking onto the target
- + if(TargetActor.CollideType == CT_Box || TargetActor.CollideType == CT_AlignedCylinder || TargetActor.CollideType == CT_OrientedCylinder || TargetActor.CollisionWidth == 0)
- + {
- + TargetCentre = vec(TargetActor.CollisionRadius, TargetActor.CollisionWidth, TargetActor.CollisionHeight);
- + fTargetWidth = TargetActor.CollisionWidth;
- + TargetPitchX = p.SmoothMouseX;
- + TargetPitch = p.SmoothMouseY;
- + }
- + //get target radius and setup cursor locking onto the target
- + else
- + {
- + TargetCentre = vec(TargetActor.CollisionRadius, TargetActor.CollisionRadius, TargetActor.CollisionHeight);
- + fTargetWidth = TargetActor.CollisionRadius;
- + TargetPitchX = p.SmoothMouseX;
- + TargetPitch = p.SmoothMouseY;
- + }
- + }
- +}
- function RotateSpellFX()
- {
- @@ -428,7 +530,7 @@ auto state seeking
- function SetTargetLock(float TargetWidth, float TargetHeight, float TargetDepth)
- {
- - ParticlesPerSec.Base=10.000000;
- + ParticlesPerSec.Base=10.000000;
- SourceWidth.Base=TargetWidth;
- SourceHeight.Base=TargetHeight;
- SourceDepth.Base=TargetDepth;
- @@ -541,7 +643,7 @@ auto state seeking
- Winfx.ParticlesMax = 200;
- }
- -/* BaseHUD(p.MyHUD).Debugstring = string(victim.name);
- + /*BaseHUD(p.MyHUD).Debugstring = string(victim.name);
- BaseHUD(p.MyHUD).DebugVala = TargetSize;
- BaseHUD(p.MyHUD).DebugValx = TargetHitLocation.x;
- BaseHUD(p.MyHUD).DebugValy = TargetHitLocation.y;
- @@ -554,7 +656,7 @@ auto state seeking
- }
- }
- -/* begin:
- + /*begin:
- circle.pitch=0;
- circle.yaw=0;
- circle.roll=0;
- @@ -569,8 +671,8 @@ auto state seeking
- // seekloop:
- // sleep(0.001);
- -// goto 'seekloop';
- -*/
- +// goto 'seekloop';*/
- +
- }
- @@ -583,15 +685,15 @@ auto state seeking
- // Spawn an appropriate particle system in front of us.
- -/* if (abs(vsize(HitLocation - p.location)) > abs(vsize(HitLocation - (vec(TargetSize / 2,0,0) << victim.Rotation) - p.Location)))
- + /*if (abs(vsize(HitLocation - p.location)) > abs(vsize(HitLocation - (vec(TargetSize / 2,0,0) << victim.Rotation) - p.Location)))
- {
- SpellLoc = HitLocation - (vec(TargetSize / 2,0,0) << victim.Rotation);
- }
- else
- {
- SpellLoc = HitLocation + (vec(TargetSize / 2,0,0) << victim.Rotation);
- - }
- -*/
- + }*/
- +
- // AE:
- @@ -611,20 +713,20 @@ auto state seeking
- // }
- // BaseHUD(p.MyHUD).Debugstring = string(victim.name);
- -/* BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
- + /*BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
- BaseHUD(p.MyHUD).DebugValy = HitLocation.y;
- BaseHUD(p.MyHUD).DebugValz = HitLocation.z;
- BaseHUD(p.MyHUD).DebugVala2 = TargetSize;
- BaseHUD(p.MyHUD).DebugValx2 = SpellLoc.x;
- BaseHUD(p.MyHUD).DebugValy2 = SpellLoc.y;
- - BaseHUD(p.MyHUD).DebugValz2 = SpellLoc.z;
- -*/
- -// Winfx = p.Spawn( class'Reward01',
- + BaseHUD(p.MyHUD).DebugValz2 = SpellLoc.z; */
- +
- + // Winfx = p.Spawn( class'Reward01',
- Winfx = victim.Spawn( baseWand(p.Weapon).curSpell.default.GestureParticleEffectClass,
- [SpawnLocation] SpellLoc);
- -/* Winfx = victim.Spawn( class'Les_SpellShape',
- - [SpawnLocation] SpellLoc);*/
- + // Winfx = victim.Spawn( class'Les_SpellShape',
- + // [SpawnLocation] SpellLoc);
- // [SpawnLocation] HitLocation);
- // [SpawnLocation] p.location + (vec(vSize(location - p.location),0,0) >> p.Rotation) );
- @@ -637,14 +739,14 @@ auto state seeking
- Winfx.Period.Base = 0.f;
- Winfx.Period.Rand = 1.f;
- Winfx.ParticlesMax = 0;
- -// Winfx.SizeWidth.Base = 8.000000;
- -// Winfx.SizeLength.Base = 8.000000;
- + // Winfx.SizeWidth.Base = 8.000000;
- + // Winfx.SizeLength.Base = 8.000000;
- -// Winfx.SetOwner(victim);
- -// Winfx.SetPhysics(PHYS_Trailer);
- -// Winfx.bTrailerSameRotation = true;
- + // Winfx.SetOwner(victim);
- + // Winfx.SetPhysics(PHYS_Trailer);
- + // Winfx.bTrailerSameRotation = true;
- -// Winfx.Lifetime.Base = 3.0;
- + // Winfx.Lifetime.Base = 3.0;
- }
- @@ -689,9 +791,10 @@ function Destroyed()
- // Textures(0)=Texture'HPParticle.particle_fx.soft_pfx'
- // Textures(0)=Texture'HPParticle.hp_fx.Particles.Sparkle_1'
- +// --------------------------------------------------------------------------------------------
- defaultproperties
- {
- - ParticlesPerSec=(Base=20)
- + ParticlesPerSec=(Base=20)
- SourceWidth=(Base=100)
- SourceHeight=(Base=100)
- SourceDepth=(Base=100)
- @@ -710,4 +813,5 @@ defaultproperties
- Textures(0)=Texture'HPParticle.hp_fx.Particles.Sparkle_1'
- Rotation=(Pitch=16640)
- bRotateToDesired=True
- -}
- + fLOS_Distance=512 //added by me -AdamJD
- +}
- \ No newline at end of file
- diff --git a/HPBase/Classes/baseConsole.uc b/HPBase/Classes/baseConsole.uc
- index c1ecd75..5d61866 100644
- --- a/HPBase/Classes/baseConsole.uc
- +++ b/HPBase/Classes/baseConsole.uc
- @@ -1,5 +1,7 @@
- class baseConsole expands WindowConsole;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var bool bLeftKeyDown;
- var bool bRightKeyDown;
- var bool bForwardKeyDown;
- @@ -15,7 +17,7 @@ var bool bRotateDownKeyDown;
- var bool bSpaceReleased;
- var bool bSpacePressed;
- -var globalconfig bool bDebugMode;
- +var globalconfig bool bDebugMode; //this was already here in the retail code but was only set up to be typed in game... -AdamJD
- var globalconfig bool bUseSystemFonts;
- var bool bUseAsianFont;
- @@ -98,4 +100,6 @@ function DrawLevelAction( canvas C )
- defaultproperties
- {
- bUseSystemFonts=True
- + //bDebugMode=True //old default prop added by me, debug mode is now not hard coded and can be turned on by changing bDebugMode=False to bDebugMode=True in the HP.ini config file or by typing "HarryDebugModeOn" in game -AdamJD
- + bDebugMode=False //debug mode is now turned off by default and can be turned off by pressing F7 in game if turned on -AdamJD
- }
- diff --git a/HPBase/Classes/baseHarry.uc b/HPBase/Classes/baseHarry.uc
- index f01aa16..7ba538c 100644
- --- a/HPBase/Classes/baseHarry.uc
- +++ b/HPBase/Classes/baseHarry.uc
- @@ -1,5 +1,7 @@
- class baseHarry expands PlayerPawn;
- +// Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var bool clearMessages;
- // The following inputs are in addition to the standard inputs defined in PlayerPawn.uc.
- @@ -161,6 +163,31 @@ var travel bool bHasBark;
- // sto: For debugging purposes, below
- var globalconfig bool bDisableDialog;
- +function Cast()
- +{
- + //overridden in Harry.uc (best method to do this the way this cursed code is set up...)-AdamJD
- +}
- +
- +function StartCasting()
- +{
- + //go to StartCasting function in Harry class -AdamJD
- +}
- +
- +function StopCasting()
- +{
- + //nothing to see here... -AdamJD
- +}
- +
- +function PlayFinishCastAnim()
- +{
- + //you know the drill by now -AdamJD
- +}
- +
- +function PlayFinishThrowCrackerAnim()
- +{
- + //same as PlayFinishCastAnim but for wizard crackers -AdamJD
- +}
- +
- function AddStars(int n)
- {
- numStars+=n;
- @@ -168,6 +195,7 @@ function AddStars(int n)
- baseHud(myHud).StarItem.Show();
- }
- +
- function AddBeans(int n)
- {
- numBeans+=n;
- @@ -514,9 +542,9 @@ function actor ExtendTarget()
- local rotator checkAngle, bestAngle;
- local vector objectDir;
- - checkangle = rotator(rectarget.location - location);
- + checkangle = rotator(rectarget.location - location);
- defaultYaw = Rotation.yaw & 0xffff;
- - defaultpitch = rectarget.TargetPitch & 0xffff;
- + defaultpitch = rectarget.TargetPitch & 0xffff;
- BestTarget = none;
- @@ -1090,8 +1118,6 @@ Begin:
- gotostate(CutSaveState);
- }
- -
- -
- state wingspell
- {
- function tick (float deltaTime)
- @@ -1120,6 +1146,8 @@ function endstate()
- {
- baseprops(focusActor).bStopLevitating=true;
- + freeHarry();
- + PlayFinishCastAnim(); //stops Harry running with his arms up after casting wingardium -AdamJD
- }
- @@ -1142,12 +1170,12 @@ function endstate()
- if(bSkipKeyPressed)
- {
- baseprops(focusActor).bStopLevitating=true;
- -
- + freeHarry();
- }
- playanim('wave');
- - rectarget.victim.eVulnerableToSpell=SPELL_WingSustain;
- + rectarget.victim.eVulnerableToSpell=SPELL_WingSustain;
- basewand(weapon).ChooseSpell(SPELL_WingSustain);
- - basewand(weapon).castspell(rectarget.victim);
- + basewand(weapon).castspell(rectarget.victim);
- sleep(0.3);
- goto 'loop';
- @@ -1412,29 +1440,29 @@ defaultproperties
- ConstrainYawVariance=5500
- maxPointsPerHouse=400
- HarryMultipleForGryffindor=3
- - WizardCards(0)=(ID=101)
- - WizardCards(1)=(ID=1)
- - WizardCards(2)=(ID=28)
- - WizardCards(3)=(ID=10)
- - WizardCards(4)=(ID=24)
- - WizardCards(5)=(ID=18)
- - WizardCards(6)=(ID=8)
- - WizardCards(7)=(ID=2)
- - WizardCards(8)=(ID=19)
- - WizardCards(9)=(ID=47)
- - WizardCards(10)=(ID=35)
- - WizardCards(11)=(ID=41)
- - WizardCards(12)=(ID=17)
- - WizardCards(13)=(ID=69)
- - WizardCards(14)=(ID=48)
- - WizardCards(15)=(ID=37)
- - WizardCards(16)=(ID=62)
- - WizardCards(17)=(ID=57)
- - WizardCards(18)=(ID=49)
- - WizardCards(19)=(ID=96)
- - WizardCards(20)=(ID=72)
- - WizardCards(21)=(ID=82)
- - WizardCards(22)=(ID=83)
- - WizardCards(23)=(ID=11)
- - WizardCards(24)=(ID=100)
- + WizardCards(0)=(Id=101)
- + WizardCards(1)=(Id=1)
- + WizardCards(2)=(Id=28)
- + WizardCards(3)=(Id=10)
- + WizardCards(4)=(Id=24)
- + WizardCards(5)=(Id=18)
- + WizardCards(6)=(Id=8)
- + WizardCards(7)=(Id=2)
- + WizardCards(8)=(Id=19)
- + WizardCards(9)=(Id=47)
- + WizardCards(10)=(Id=35)
- + WizardCards(11)=(Id=41)
- + WizardCards(12)=(Id=17)
- + WizardCards(13)=(Id=69)
- + WizardCards(14)=(Id=48)
- + WizardCards(15)=(Id=37)
- + WizardCards(16)=(Id=62)
- + WizardCards(17)=(Id=57)
- + WizardCards(18)=(Id=49)
- + WizardCards(19)=(Id=96)
- + WizardCards(20)=(Id=72)
- + WizardCards(21)=(Id=82)
- + WizardCards(22)=(Id=83)
- + WizardCards(23)=(Id=11)
- + WizardCards(24)=(Id=100)
- }
- diff --git a/HPBase/Classes/baseSpell.uc b/HPBase/Classes/baseSpell.uc
- index f5579ae..6d427da 100644
- --- a/HPBase/Classes/baseSpell.uc
- +++ b/HPBase/Classes/baseSpell.uc
- @@ -3,19 +3,19 @@
- //=============================================================================
- class baseSpell extends Projectile;
- -#exec MESH IMPORT MESH=spellProj ANIVFILE=MODELS\Cross_a.3D DATAFILE=MODELS\Cross_d.3D X=0 Y=0 Z=0
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- -#exec MESH ORIGIN MESH=spellProj X=0 Y=0 Z=0 YAW=64
- -#exec MESH SEQUENCE MESH=spellProj SEQ=All STARTFRAME=0 NUMFRAMES=1
- -#exec MESH SEQUENCE MESH=spellProj SEQ=Still STARTFRAME=0 NUMFRAMES=1
- -#exec MESHMAP SCALE MESHMAP=spellProj X=0.2 Y=0.2 Z=0.2
- +//#exec MESH IMPORT MESH=spellProj ANIVFILE=MODELS\SpellProj_a.3D DATAFILE=MODELS\Cross_d.3D X=0 Y=0 Z=0 //not needed -AdamJD
- -#exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
- +//#exec MESH ORIGIN MESH=spellProj X=0 Y=0 Z=0 YAW=64
- +//#exec MESH SEQUENCE MESH=spellProj SEQ=All STARTFRAME=0 NUMFRAMES=1
- +//#exec MESH SEQUENCE MESH=spellProj SEQ=Still STARTFRAME=0 NUMFRAMES=1
- +//#exec MESHMAP SCALE MESHMAP=spellProj X=0.2 Y=0.2 Z=0.2
- +//#exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage //not needed -AdamJD
- -
- -#EXEC TEXTURE IMPORT NAME=defaultSpellIcon FILE=..\HPMenu\TEXTURES\HUD\transSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- +#EXEC TEXTURE IMPORT NAME=defaultSpellIcon FILE=TEXTURES\transSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- var Texture spellIcon;
- var string spellName;
- @@ -28,7 +28,7 @@ var sound CastSound;
- var string SpellIncantation;
- var string QuietSpellIncantation;
- -var float manaCost;
- +//var float manaCost; //not needed -AdamJD
- var (VisualEffects) Mesh projectileMesh;
- var (VisualEffects) class<baseVisualEffect> hitEffect;
- @@ -48,6 +48,12 @@ var (VisualEffects) gesture Gesture;
- // FX for the spell gesture
- var (VisualEffects)class<ParticleFX>GestureParticleEffectClass;
- +//AdamJD vars
- +var vector CurrentDir;
- +var vector TargetOffset;
- +var float SeekSpeed;
- +var float SpellLifeTime;
- +
- simulated function PostBeginPlay()
- {
- Super.PostBeginPlay();
- @@ -58,6 +64,8 @@ simulated function PostBeginPlay()
- flyParticleEffect=spawn(flyParticleEffectClass);
- flyParticleEffect.setRotation(flyParticleEffect.default.rotation);
- }
- +
- + CurrentDir = vector(rotation); //AdamJD
- }
- function PlaySpellCastSound()
- @@ -86,6 +94,11 @@ event Tick(float deltaTime)
- super.Tick(deltaTime);
- if(flyParticleEffect!=None)
- flyParticleEffect.SetLocation(location);
- +
- + if( (SpellLifeTime -= deltaTime) < 0 )
- + {
- + Destroy();
- + }
- }
- @@ -94,6 +107,28 @@ function AdjustLifeTimer(float NewLifeTimer)
- //Implemented in derived class
- }
- +//target offset -AdamJD
- +function InitSpell(Actor CastedAt, optional vector CastedAtOffset)
- +{
- + target = CastedAt;
- + TargetOffset = CastedAtOffset;
- +}
- +
- +//spell direction -AdamJD
- +function SetSpellDirection( vector dir )
- +{
- + CurrentDir = normal(dir);
- + DesiredRotation = rotator(CurrentDir);
- + SetRotation( DesiredRotation );
- + flyParticleEffect.SetRotation( DesiredRotation );
- +}
- +
- +//hit location -AdamJD
- +function vector GetTargetHitLocation()
- +{
- + return target.location + TargetOffset;
- +}
- +
- //*************************************************************************************************
- auto state Flying
- {
- @@ -224,7 +259,7 @@ simulated function Timer()
- //@PAB removed this, as this caused the spell to go upwards far too much
- - // aimPoint.Z=aimPoint.Z+(target.CollisionHeight)+2;
- + //aimPoint.Z+=(target.CollisionHeight)+2;
- SeekingDir = Normal(aimPoint - Location);
- if ( (SeekingDir Dot InitialDir) > 0 )
- @@ -239,7 +274,7 @@ simulated function Timer()
- }
- //drop off puffs as it flys
- - // b = Spawn(class'ut_SpriteSmokePuff');
- + //b = Spawn(class'ut_SpriteSmokePuff');
- }
- @@ -254,10 +289,12 @@ Log("******** Explode:"$self);
- Destroy();
- }
- -function static Texture GetSpellIcon()
- -{
- - return(default.spellIcon);
- -}
- +
- +//not needed -AdamJD
- +// function static Texture GetSpellIcon()
- +// {
- + // return(default.spellIcon);
- +// }
- //Mover::IsRelevant calls this
- function bool IsRelevantToMover()
- @@ -273,7 +310,7 @@ defaultproperties
- spellIcon=Texture'HPBase.Icons.defaultSpellIcon'
- spellName="baseSpell"
- CastSound=Sound'HPSounds.magic_sfx.spell_cast'
- - manaCost=10
- + //manaCost=10 //not needed -AdamJD
- projectileMesh=LodMesh'HPBase.spellProj'
- GestureParticleEffectClass=Class'HPParticle.Les_SpellShape'
- Speed=170
- @@ -282,7 +319,7 @@ defaultproperties
- bNetTemporary=False
- RemoteRole=ROLE_SimulatedProxy
- LifeSpan=10
- - Mesh=LodMesh'HPBase.spellProj'
- + //Mesh=LodMesh'HPBase.spellProj' //not needed -AdamJD
- DrawScale=0.3
- bUnlit=True
- CollisionRadius=5
- @@ -295,4 +332,6 @@ defaultproperties
- LightSaturation=72
- LightRadius=10
- bFixedRotationDir=True
- + SeekSpeed=7.0f //AdamJD
- + SpellLifeTime=8.0 //AdamJD
- }
- diff --git a/HPBase/Classes/baseWand.uc b/HPBase/Classes/baseWand.uc
- index c19f68c..53b72d2 100644
- --- a/HPBase/Classes/baseWand.uc
- +++ b/HPBase/Classes/baseWand.uc
- @@ -2,6 +2,9 @@
- // baseWand
- //=============================================================================
- class baseWand extends Weapon;
- +
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- #exec MESH MODELIMPORT MESH=WandMesh MODELFILE=models\Wand.PSK LODSTYLE=10
- #exec MESH ORIGIN MESH=WandMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
- #exec ANIM IMPORT ANIM=WandAnims ANIMFILE=models\Wand.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
- @@ -12,16 +15,28 @@ class baseWand extends Weapon;
- // 'VERBOSE' gives more debugging info in UCC.log
- #exec ANIM DIGEST ANIM=WandAnims VERBOSE
- -#EXEC TEXTURE IMPORT NAME=WandTex0 FILE=TEXTURES\WandTexture.bmp GROUP=Skins
- +#EXEC TEXTURE IMPORT NAME=WandTex0 FILE=TEXTURES\WandTex0.bmp GROUP=Skins
- #EXEC MESHMAP SETTEXTURE MESHMAP=WandMesh NUM=0 TEXTURE=WandTex0
- +//AdamJD vars
- +var bool bInstantFire;
- +var baseHarry playerHarry;
- +var float fAutoHitDistance;
- +var particleFX fxChargeParticles;
- +var class<particleFX> fxChargeParticleFXClass;
- +var bool bSpellCharges;
- +var float fSpellCharge;
- +var float fSpellChargeTime;
- +var float fSpellChargeTimeSpan;
- +var float fSpellChargeStartScale;
- +var float fSpellChargeEndScale;
- var() int HitDamage;
- -var Pickup Amp;
- -var bool bBotSpecialMove;
- +//var Pickup Amp; //not needed -AdamJD
- +//var bool bBotSpecialMove; //not needed -AdamJD
- var bool bAutoSelectSpell;
- var bool bUseNoSpell;
- @@ -34,8 +49,10 @@ var class<baseSpell> spellList[16];
- var particleFX wandEffect;
- var baseProps testWand;
- -var float maxMana;
- -var float curMana;
- +//not needed -AdamJD
- +// var float maxMana;
- +// var float curMana;
- +
- var bool bUseMana;
- var bool bCasting;
- @@ -52,14 +69,17 @@ local vector v;
- local rotator r;
- super.tick(deltaTime);
- + //not needed -AdamJD
- + /*
- if(bUseMana)
- {
- curMana+=deltaTime*5;
- if(curMana>maxMana)
- curMana=maxMana;
- }
- + */
- - /*
- +
- if(wandEffect!=None && pawn(owner) != none && pawn(owner).Weapon==self)
- {
- r=pawn(owner).weaponRot;
- @@ -70,7 +90,7 @@ local rotator r;
- wandEffect.ParticlesPerSec.Base=wandEffect.default.ParticlesPerSec.Base;
- else
- wandEffect.ParticlesPerSec.Base=4.1;
- - }*/
- + }
- }
- function BecomeItem()
- @@ -100,7 +120,6 @@ local int i;
- event BeginPlay()
- {
- -
- /*
- if(wandEffect==None)
- {
- @@ -108,7 +127,7 @@ event BeginPlay()
- wandEffect.ParticlesPerSec.Base=0;
- wandEffect.bVelocityRelative=false;
- }
- - */
- + */
- bUseNoSpell = true;
- }
- @@ -136,8 +155,6 @@ function SelectSpell(class<baseSpell> spell)
- curSpell=spell;
- }
- -
- -
- function ChooseSpell(ESpellType Spell)
- {
- switch(Spell)
- @@ -216,8 +233,16 @@ function CastSpell(Actor target)
- local vector HitLocation, HitNormal, Start;
- local sound outSound;
- local string Label, outText, Language;
- + local bool bUseWeaponForProjRot; //AdamJD
- - bPointing=True;//whats this for??
- + bPointing=True;//whats this for??
- +
- + //AdamJD
- + if( target == self )
- + {
- + bUseWeaponForProjRot = true;
- + target = none;
- + }
- // Enable this for the PS1 Conversion O' Joy
- if(bAutoSelectSpell)
- @@ -241,6 +266,8 @@ function CastSpell(Actor target)
- //AE: Moved incantation to after 'LastCastedSpell' is set, because it's used.
- + //not needed -AdamJD
- + /*
- if(bUseMana)
- {
- if(curMana>=curSpell.default.manaCost)
- @@ -248,6 +275,7 @@ function CastSpell(Actor target)
- else
- return;
- }
- + */
- LastCastedSpell=baseSpell( ProjectileFire(curSpell, AltProjectileSpeed, false) );
- LastCastedSpell.target = target;
- @@ -280,13 +308,24 @@ function CastSpell(Actor target)
- }
- }
- }
- -
- +
- + //not needed -AdamJD
- + /*
- //See if there's a matching object we should get rid of. Also set curSpell to none.
- if( DestroyThisOnCast != none) //!= none && curSpell(DestroyThisOnCast) != none )
- {
- DestroyThisOnCast.Destroy();
- SelectSpell(none);
- }
- + */
- +
- + //HP2 code -AdamJD
- + if( target.IsA('Pawn') &&
- + vsize(location - target.location) < fAutoHitDistance )
- + {
- + // We are really close to our target so AutoHit it!
- + LastCastedSpell.ProcessTouch( target, target.location );
- + }
- // Owner.PlaySound(AltFireSound, SLOT_None,Pawn(Owner).SoundDampening*4.0);
- @@ -298,10 +337,25 @@ function CastSpell(Actor target)
- function Texture GetSpellIcon()
- {
- - if(curSpell!=None)
- - return curSpell.Default.spellIcon;
- - else
- - return None;
- + //not needed -AdamJD
- + // if(curSpell!=None)
- + // return curSpell.Default.spellIcon;
- + // else
- + // return None;
- +}
- +
- +//HP2 code -AdamJD
- +function ScaleParticles( ParticleFX FX, float scale )
- +{
- + FX.ParticlesPerSec.Base = FX.default.ParticlesPerSec.Base * scale;
- + FX.SourceHeight.Base = FX.default.SourceHeight.Base * scale;
- + FX.SourceWidth.Base = FX.default.SourceWidth.Base * scale;
- + FX.SourceDepth.Base = FX.default.SourceDepth.Base * scale;
- + FX.SizeWidth.Base = FX.default.SizeWidth.Base * scale;
- + FX.SizeLength.Base = FX.default.SizeLength.Base * scale;
- + FX.AngularSpreadWidth.Base = FX.default.AngularSpreadWidth.Base* scale;
- + FX.AngularSpreadHeight.Base = FX.default.AngularSpreadHeight.Base*scale;
- + FX.SpinRate.Base = FX.default.SpinRate.Base * scale;
- }
- function inventory SpawnCopy( pawn Other )
- @@ -317,16 +371,16 @@ function inventory SpawnCopy( pawn Other )
- function AltFire( float Value )
- {
- - local actor HitActor;
- - local vector HitLocation, HitNormal, Start;
- -
- + //not needed -AdamJD
- + // local actor HitActor;
- + // local vector HitLocation, HitNormal, Start;
- if ( PlayerPawn(Owner) != None )
- {
- PlayerPawn(Owner).ClientInstantFlash( -0.4, vect(0, 0, 800));
- PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
- }
- - bPointing=True;
- + bPointing=True;
- ProjectileFire(AltProjectileClass, AltProjectileSpeed, bAltWarnTarget);
- Owner.PlaySound(AltFireSound, SLOT_None,Pawn(Owner).SoundDampening*4.0);
- @@ -337,7 +391,6 @@ function AltFire( float Value )
- }
- -
- function float RateSelf( out int bUseAltMode )
- {
- return 99.0; //wand is always the best weapon. well, its the _only_ weapon.
- @@ -345,10 +398,12 @@ function float RateSelf( out int bUseAltMode )
- function BecomePickup()
- {
- - Amp = None;
- + //Amp = None; //not needed -AdamJD
- Super.BecomePickup();
- }
- +//not needed -AdamJD
- +/*
- function Timer()
- {
- local actor targ;
- @@ -365,14 +420,14 @@ function Timer()
- targ = Pawn(Owner).PickTarget(bestAim, bestDist, FireDir, Owner.Location);
- if ( Pawn(targ) != None )
- {
- - bPointing = true;
- + bPointing = true;
- Pawn(targ).WarnTarget(Pawn(Owner), 300, FireDir);
- SetTimer(1 + 4 * FRand(), false);
- }
- else
- {
- SetTimer(0.5 + 2 * FRand(), false);
- - bPointing = false;
- + bPointing = false;
- }
- }
- @@ -383,6 +438,7 @@ function Finish()
- Super.Finish();
- }
- +*/
- ///////////////////////////////////////////////////////
- function PlayFiring()
- @@ -394,11 +450,11 @@ function PlayFiring()
- function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
- {
- - local Vector Start, X,Y,Z;
- -
- + local Vector Start, X,Y,Z;
- +
- Owner.MakeNoise(Pawn(Owner).SoundDampening);
- -//Log("Projectile fire owner:" $owner $" Rotation:" $Pawn(owner).ViewRotation);
- +Log("Projectile fire owner:" $owner $" Rotation:" $Pawn(owner).ViewRotation);
- GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
- Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
- @@ -407,14 +463,12 @@ function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed,
- if(ProjClass==Class'spellEcto')
- AdjustedAim = pawn(owner).AdjustToss(ProjSpeed, Start, 0, True, (bWarn || (FRand() < 0.4)));
- else
- - AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn);
- + AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, /*AimError*/ 0, True, bWarn);
- bSplashDamage = true;
- return(Spawn(ProjClass,,, Start,AdjustedAim));
- -
- }
- -
- function SpawnEffect(Vector DVector, int NumPoints, rotator SmokeRotation, vector SmokeLocation)
- {
- //cmp cleanup local RingExplosion4 Smoke;
- @@ -434,7 +488,7 @@ state Idle
- function BeginState()
- {
- - bPointing = false;
- + bPointing = false;
- SetTimer(0.5 + 2 * FRand(), false);
- Super.BeginState();
- if (Pawn(Owner).bFire!=0) Fire(0.0);
- @@ -453,13 +507,14 @@ defaultproperties
- {
- HitDamage=35
- bAutoSelectSpell=True
- - maxMana=100
- - curMana=50
- + //not needed -AdamJD
- + //maxMana=100
- + //curMana=50
- PickupAmmoCount=200
- bSplashDamage=True
- FireOffset=(Y=-6,Z=-7)
- AltProjectileClass=Class'HPBase.baseSpell'
- - AimError=0
- + //AimError=0 //not needed -AdamJD
- AltRefireRate=0.7
- DeathMessage="%k inflicted mortal damage upon %o with the %w."
- AutoSwitchPriority=4
- @@ -473,4 +528,6 @@ defaultproperties
- CollisionRadius=28
- CollisionHeight=8
- Mass=50
- + bUseMana=False //AdamJD
- + fAutoHitDistance=128 //AdamJD
- }
- diff --git a/HPBase/Classes/cHarryAnimChannel.uc b/HPBase/Classes/cHarryAnimChannel.uc
- index d070ace..74d0a7e 100644
- --- a/HPBase/Classes/cHarryAnimChannel.uc
- +++ b/HPBase/Classes/cHarryAnimChannel.uc
- @@ -1,5 +1,7 @@
- class cHarryAnimChannel expands AnimChannel;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- function GotoStateHoldUpArm()
- {
- if( IsInState('stateIdle') )
- @@ -16,10 +18,42 @@ function GotoStateThrow()
- GotoState('stateThrow');
- }
- +//AdamJD
- +function GotoStateCasting()
- +{
- + GotoState('stateCasting');
- +}
- +
- +//AdamJD
- +function GotoStateCancelCasting()
- +{
- + GotoState('stateCancelCasting');
- +}
- +
- +//AdamJD
- +function GotoStateCast()
- +{
- + GotoState('stateCast');
- +}
- +
- +//AdamJD
- +function GotoStateHasCast()
- +{
- + GotoState('stateHasCast');
- +}
- +
- +//go to baseHarry class to get cast function -AdamJD
- +function Cast()
- +{
- + local baseHarry harry;
- + ForEach AllActors (class'baseHarry', harry)
- + harry.Cast();
- +}
- +
- auto state stateIdle
- {
- -// Begin:
- -// AnimFrame = 0;
- + // Begin:
- + // AnimFrame = 0;
- }
- state stateHoldUpArm
- @@ -46,11 +80,85 @@ state stateThrow
- baseHarry(owner).ThrowCarryingActor();
- finishAnim();
- - /*HarryAnimChannel.*/GotoStateIdle();
- + /*HarryAnimChannel.*/ //GotoStateIdle(); //not needed -AdamJD
- baseHarry(Owner).HarryAnimType = AT_Replace;
- + baseHarry(owner).PlayFinishThrowCrackerAnim(); //this fixes the issue where Harry kept his arms held up after throwing a cracker -AdamJD
- //LoopAnim( 'breath' );
- - GotoState('stateIdle');
- + // GotoState('stateIdle'); //not needed -AdamJD
- +}
- +
- +//AdamJD
- +state stateCasting
- +{
- + //move camera when casting and turn spell casting stuff on -AdamJD
- + function BeginState()
- + {
- + local baseHarry harry;
- + ForEach AllActors (class'baseHarry', harry)
- + harry.HarryAnimType = AT_Combine;
- + harry.StartCasting();
- + }
- +
- + begin:
- + LoopAnim('wave', 1.0, 0.2);
- +}
- +
- +//AdamJD
- +state stateCancelCasting
- +{
- + //turn spell casting stuff off -AdamJD
- + function BeginState()
- + {
- + local baseHarry harry;
- + ForEach AllActors (class'baseHarry', harry)
- + harry.HarryAnimType = AT_Combine;
- + harry.StopCasting();
- + }
- +
- + begin:
- + PlayAnim('cast', 2.0 , 0.1); //setting the anim to 'breath' messes up the walking animations so 'cast' will have to do... -AdamJD
- + FinishAnim(); //stops Harry snapping his arm back too early -AdamJD
- + baseHarry(owner).HarryAnimType = AT_Replace;
- + baseHarry(owner).PlayFinishCastAnim();
- +}
- +
- +//AdamJD
- +state stateCast
- +{
- + //turn spell casting stuff off -AdamJD
- + function BeginState()
- + {
- + local baseHarry harry;
- + ForEach AllActors (class'baseHarry', harry)
- + harry.HarryAnimType = AT_Combine;
- + // PlayAnim('cast', 2.0, 0.1);
- + harry.StopCasting();
- + }
- +
- + begin:
- + PlayAnim('cast', 2.0, 0.1);
- + // FinishAnim();
- + baseHarry(owner).HarryAnimType = AT_Replace;
- + baseHarry(owner).PlayFinishCastAnim();
- +}
- +
- +//AdamJD
- +state stateHasCast
- +{
- + //turn spell casting stuff off -AdamJD
- + function BeginState()
- + {
- + local baseHarry harry;
- + ForEach AllActors (class'baseHarry', harry)
- + harry.HarryAnimType = AT_Combine;
- + harry.StopCasting();
- + }
- +
- + begin:
- + FinishAnim(); //stops Harry snapping his arm back too early -AdamJD
- + baseHarry(owner).HarryAnimType = AT_Replace;
- + baseHarry(owner).PlayFinishCastAnim();
- }
- defaultproperties
- diff --git a/HPBase/Classes/spellFlip.uc b/HPBase/Classes/spellFlip.uc
- index 37e2895..b0ddedb 100644
- --- a/HPBase/Classes/spellFlip.uc
- +++ b/HPBase/Classes/spellFlip.uc
- @@ -2,6 +2,8 @@
- class spellFlip extends BASESPELL;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
- #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
- #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
- @@ -13,7 +15,7 @@ class spellFlip extends BASESPELL;
- #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
- #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
- -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- +//#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF //not needed -AdamJD
- #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
- @@ -56,7 +58,7 @@ function PlayIncantateSound(bool bSneaking)
- defaultproperties
- {
- - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
- + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
- spellName="Flipendo"
- SpellIncantation="spells1"
- QuietSpellIncantation="spells10"
- diff --git a/HPBase/Classes/spellIncendio.uc b/HPBase/Classes/spellIncendio.uc
- index 6c06c36..bc70e39 100644
- --- a/HPBase/Classes/spellIncendio.uc
- +++ b/HPBase/Classes/spellIncendio.uc
- @@ -1,6 +1,9 @@
- //===============================================================================
- class spellIncendio extends BASESPELL;
- +
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
- #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
- #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
- @@ -12,7 +15,7 @@ class spellIncendio extends BASESPELL;
- #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
- #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
- -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- +//#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF //not needed -AdamJD
- #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
- @@ -47,7 +50,7 @@ function PlayIncantateSound(bool bSneaking)
- defaultproperties
- {
- - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
- + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
- spellName="Incendio"
- SpellIncantation="spells5"
- QuietSpellIncantation="spells9"
- diff --git a/HPBase/Classes/spelldud.uc b/HPBase/Classes/spelldud.uc
- index 287fedc..8bff647 100644
- --- a/HPBase/Classes/spelldud.uc
- +++ b/HPBase/Classes/spelldud.uc
- @@ -2,6 +2,10 @@
- class spelldud extends BASESPELL;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- +//not needed -AdamJD
- +/*
- #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
- #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
- #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
- @@ -13,7 +17,7 @@ class spelldud extends BASESPELL;
- #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
- #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
- -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- +#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
- @@ -26,15 +30,17 @@ function PostBeginPlay()
- Super.PostBeginPlay();
- LoopAnim('all', 2.0, 0.0);
- }
- -
- +*/
- defaultproperties
- {
- - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
- - spellName="Flipendo"
- - CastSound=None
- - flyParticleEffectClass=Class'HPParticle.SmokeExplo_03'
- - Gesture=Gesture'HPBase.FlipPattern'
- - ImpactSound=None
- - LifeSpan=0.3
- - Style=STY_Translucent
- + //this class is not needed so I've commented out default props -AdamJD
- +
- + // spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
- + // spellName="Flipendo"
- + // CastSound=None
- + // flyParticleEffectClass=Class'HPParticle.SmokeExplo_03'
- + // Gesture=Gesture'HPBase.FlipPattern'
- + // ImpactSound=None
- + // LifeSpan=0.3
- + // Style=STY_Translucent
- }
- diff --git a/HPBase/Classes/spelllumas.uc b/HPBase/Classes/spelllumas.uc
- index 4d0951c..d656d27 100644
- --- a/HPBase/Classes/spelllumas.uc
- +++ b/HPBase/Classes/spelllumas.uc
- @@ -2,6 +2,8 @@
- class spelllumas extends BASESPELL;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
- #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
- #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
- @@ -13,7 +15,7 @@ class spelllumas extends BASESPELL;
- #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
- #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
- -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- +//#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF //not needed -AdamJD
- #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
- @@ -51,7 +53,7 @@ function PlayIncantateSound(bool bSneaking)
- defaultproperties
- {
- - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
- + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
- spellName="Lumas"
- SpellIncantation="spells12"
- QuietSpellIncantation="spells13"
- diff --git a/HPBase/Classes/spellnone.uc b/HPBase/Classes/spellnone.uc
- index cb8c4ce..2981b06 100644
- --- a/HPBase/Classes/spellnone.uc
- +++ b/HPBase/Classes/spellnone.uc
- @@ -2,24 +2,29 @@
- class spellnone extends BASESPELL;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- +//not needed -AdamJD
- +/*
- #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
- #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
- #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
- #exec MESHMAP SCALE MESHMAP=SPELLLEVMesh X=2.0 Y=2.0 Z=2.0
- #exec MESH DEFAULTANIM MESH=SPELLLEVMesh ANIM=SPELLLEVAnims
- -// Digest and compress the animation data. Must come after the sequence declarations.
- -// 'VERBOSE' gives more debugging info in UCC.log
- +Digest and compress the animation data. Must come after the sequence declarations.
- +'VERBOSE' gives more debugging info in UCC.log
- #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
- #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
- -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- +#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
- #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
- -// Import the pattern
- +Import the pattern
- #exec PATTERN IMPORT PATTERN=FlipPattern FILE=Patterns/Flipendo.hpg
- +*/
- function PostBeginPlay()
- {
- @@ -29,13 +34,14 @@ function PostBeginPlay()
- defaultproperties
- {
- - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
- - spellName="Flipendo"
- + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
- + //spellName="Flipendo" //not needed -AdamJD
- CastSound=Sound'HPSounds.magic_sfx.spell_dud'
- - flyParticleEffectClass=Class'HPParticle.SmokeExplo_03'
- - Gesture=Gesture'HPBase.FlipPattern'
- + //flyParticleEffectClass=Class'HPParticle.SmokeExplo_03' //not needed -AdamJD
- + //Gesture=Gesture'HPBase.FlipPattern' //not needed -AdamJD
- ImpactSound=None
- - LifeSpan=0.3
- - Style=STY_Translucent
- - Texture=Texture'HPParticle.hp_fx.Particles.Smoke5'
- + //LifeSpan=0.3 //retail default prop -AdamJD
- + LifeSpan=0.01 //AdamJD
- + //Style=STY_Translucent //not needed -AdamJD
- + //Texture=Texture'HPParticle.hp_fx.Particles.Smoke5' //not needed -AdamJD
- }
- diff --git a/HarryPotter/Classes/BroomHarry.uc b/HarryPotter/Classes/BroomHarry.uc
- index 40a4726..209f673 100644
- --- a/HarryPotter/Classes/BroomHarry.uc
- +++ b/HarryPotter/Classes/BroomHarry.uc
- @@ -3,6 +3,8 @@
- //=============================================================================
- class BroomHarry extends Harry;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var float fPitchControl; // Range +1.0 to -1.0 (up/down)
- var float fYawControl; // Range +1.0 to -1.0 (right/left)
- var float fRotationRateYaw; // Yaw uses this because Roll is tied to RotationRate.Yaw for some reason
- @@ -754,7 +756,7 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
- }
- // Update rotation.
- - UpdateRotation(DeltaTime, 1);
- + UpdateRotation(DeltaTime, 1);
- GetAxes(Rotation,X,Y,Z);
- // Update acceleration.
- @@ -829,16 +831,20 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
- {
- local rotator NewRotation;
- local float YawVal;
- + local float YawValY; //AdamJD local float
- local float DeltaYaw;
- local int nDeltaYaw;
- local float DeltaPitch;
- local float fPitchLimitHi;
- local float fPitchLimitLo;
- local float fEffectiveMousePitch;
- +
- + YawValY = YawVal; //set YawVal to YawValY -AdamJD
- NewRotation = Rotation;
- fPitchLimitHi = PitchLimitUp * (0x4000/90.0);
- fPitchLimitLo = 0x00010000 - (PitchLimitDown * (0x4000/90.0));
- +
- // Modify pitch using current input source
- if ( bPitchUnderMouse )
- @@ -944,7 +950,9 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
- fLastTimeAvoidedWall = -1.0f; // Forget Harry was ever trying to avoid wall; player overrode
- bHittingWall = false;
- -
- +
- + //old retail code -AdamJD
- + /*
- // Apply yaw control
- if ( fYawControl > 1.0 )
- fYawControl = 1.0;
- @@ -953,18 +961,58 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
- YawVal = fRotationRateYaw * DeltaTime * fYawControl;
- if(Acceleration == vect(0,0,0))
- YawVal = 4.0/3.0 * YawVal;
- -
- - ViewRotation.Yaw += yawVal;
- + */
- +
- + //get the SmoothMouseX & SmoothMouseY axis and cap it to not overshoot input -AdamJD
- + YawVal= (SmoothMouseX / 1.5) * DeltaTime;
- + YawValY = (SmoothMouseY / 1.5) * DeltaTime;
- +
- + //limit SmoothMouseX -AdamJD
- + if(YawVal == SmoothMouseX)
- + {
- + if( YawVal > MAX_MOUSE_DELTA_X )
- + {
- + YawVal = MAX_MOUSE_DELTA_X;
- + }
- +
- + else if( YawVal < MIN_MOUSE_DELTA_X )
- + {
- + YawVal = MIN_MOUSE_DELTA_X;
- + }
- + }
- +
- + //limit SmoothMouseY -AdamJD
- + if(YawValY == SmoothMouseY)
- + {
- + if( YawValY > MAX_MOUSE_DELTA_Y )
- + {
- + YawValY = MAX_MOUSE_DELTA_Y;
- + }
- +
- + else if( YawValY < MIN_MOUSE_DELTA_Y )
- + {
- + YawValY = MIN_MOUSE_DELTA_Y;
- + }
- + }
- +
- + ViewRotation.Yaw += YawVal; //retail code -AdamJD
- + ViewRotation.Pitch += YawValY; //set YawValY to ViewRotation.Pitch -AdamJD
- +
- + DesiredRotation.Yaw = ViewRotation.Yaw; //set ViewRotation.Yaw to DesiredRotation.Yaw -AdamJD
- + DesiredRotation.Pitch = ViewRotation.Pitch; //set ViewRotation.Pitch to DesiredRotation.Pitch -AdamJD
- // Log( "YawControl, YawVal: "$fYawControl$", "$YawVal );
- - ViewShake(deltaTime);
- -
- - NewRotation.Yaw = ViewRotation.Yaw;
- + //ViewShake(deltaTime); //old retail code -AdamJD
- +
- + //NewRotation.Yaw = ViewRotation.Yaw; //old retail code -AdamJD
- + NewRotation.Yaw = cam.rotation.Yaw; //move Harry and camera at the same time when moving mouse left or right -AdamJD
- + NewRotation.Pitch = cam.rotation.Pitch; //move Harry and camera at the same time when moving mouse up or down -AdamJD
- // Commit new rotation
- - setRotation(NewRotation);
- - DesiredRotation = Rotation; //Make physicsRotation leave rotation alone
- + setRotation(NewRotation); //retail code -AdamJD
- + DesiredRotation = ViewRotation; //set ViewRotation to DesiredRotation -AdamJD
- + //DesiredRotation = Rotation; //old retail code -AdamJD
- // ClientMessage("Rotation="$Rotation);
- }
- @@ -1246,7 +1294,7 @@ Begin:
- FinishAnim();
- Referee.OnPlayerDying();
- LoopAnim( 'Hang' );
- - Cam.GotoState( 'TopDownState' );
- + // Cam.GotoState( 'TopDownState' ); //not needed -AdamJD
- SetPhysics( PHYS_Falling );
- SetTimer( 10.0, false ); // Watchdog timer in case Harry never reaches ground
- @@ -1273,7 +1321,7 @@ state Catching
- {
- ClientMessage( "BroomHarry: End GetOnPath" );
- Log( "BroomHarry: End GetOnPath" );
- -// StopFlyingOnPath();
- + // StopFlyingOnPath();
- }
- event FinishedInterpolation( InterpolationPoint Other )
- @@ -1289,9 +1337,10 @@ state Catching
- }
- Begin:
- + //not needed -AdamJD
- + // if ( TargetToCatch == LookForTarget )
- + // SetLookForTarget( None );
- // Start catch animation
- - if ( TargetToCatch == LookForTarget )
- - SetLookForTarget( None );
- PlayAnim( 'Catch', , 0.1 );
- Sleep( 0.4 ); // Dead reckon when Catch animation has Harry's hand closing in around target
- @@ -1307,9 +1356,10 @@ Begin:
- FinishAnim();
- SetSecondaryAnimation( 'Hold', , 0.1 );
- + //not needed -AdamJD
- // Reverse camera
- - Cam.GotoState( 'ReverseState' );
- - StandardTarget.TargetOffset = vect(-100, 10 ,50);
- + // Cam.GotoState( 'ReverseState' );
- + // StandardTarget.TargetOffset = vect(-100, 10 ,50);
- // WIll still be in lockaroundharrymode
- // Cam.TargetRot = rot(5000, 0, 0);
- @@ -1339,4 +1389,5 @@ defaultproperties
- Mesh=SkeletalMesh'HarryPotter.skremharryMesh'
- bAlignBottom=False
- RotationRate=(Pitch=24000,Roll=6000)
- + bHidden=False //AdamJD
- }
- diff --git a/HarryPotter/Classes/Harry.uc b/HarryPotter/Classes/Harry.uc
- index 388d32a..dcbf36a 100644
- --- a/HarryPotter/Classes/Harry.uc
- +++ b/HarryPotter/Classes/Harry.uc
- @@ -2,6 +2,13 @@
- // Harry -- hero character
- //=============================================================================
- class Harry extends baseHarry;
- +//---------------------------------------------------------------------------------------------------------------------------------------------------
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +//---------------------------------------------------------------------------------------------------------------------------------------------------
- +//Description- Tried to make Harrys movement similar to HP2 and improved climbing. All edited code is UScript (no C++)
- +//---------------------------------------------------------------------------------------------------------------------------------------------------
- +//Edited Dates- Between: 30/09/2019-20/12/2019 (DD/MM/YYYY)
- +//---------------------------------------------------------------------------------------------------------------------------------------------------
- //#exec MESH ORIGIN MESH=skHarryMesh X=0 Y=0 Z=28 YAW=0 PITCH=0 ROLL=0
- //#exec MESH WEAPONATTACH MESH=skHarryMesh BONE="RightHand"
- @@ -102,9 +109,88 @@ var float fFallingZ; //try and save your z when you start falling.
- var vector MountDelta;
- var actor MountBase;
- +//my playercasting var -AdamJD
- +var bool bPlayerCasting; //is the player casting?
- +//for BroomHarry and the chess board -AdamJD
- +const MIN_MOUSE_DELTA_X = -20000.0f;
- +const MAX_MOUSE_DELTA_X = 20000.0f;
- +const MIN_MOUSE_DELTA_Y = -10000.0f;
- +const MAX_MOUSE_DELTA_Y = 10000.0f;
- -//Play a sound client side (so only client will hear it
- +//**********************************************************************************************
- +//moved to near the top... where it should be -AdamJD
- +event PreBeginPlay()
- +{
- + Super.PreBeginPlay();
- +
- + foreach AllActors(class'baseNarrator', theNarrator)
- + break;
- + if(theNarrator==None)
- + {
- + theNarrator=spawn(class 'Narrator');
- + Log("Narrator spawned:" $theNarrator);
- + }
- +
- +}
- +
- +//moved to near the top... where it should be -AdamJD
- +function PostBeginPlay()
- +{
- + local Pawn p;
- + local weapon weap;
- + Super.PostBeginPlay();
- +
- + b3DSound = bool(ConsoleCommand("get ini:Engine.Engine.AudioDevice Use3dHardware"));
- +
- + bShowMenu=false;
- + log("weapon is" $weapon);
- + if(inventory==none)
- + {
- + weap=spawn(class'baseWand');
- + weap.BecomeItem();
- + AddInventory(weap);
- + weap.WeaponSet(self);
- + weap.GiveAmmo(self);
- + baseWand(weap).bUseMana=false;
- + log(self$ " spawning weap " $weap);
- + }
- + else
- + {
- + log("not spawning weap");
- + }
- +
- + iFireSeedCount = 0;
- +
- + HUDType=class'HPMenu.HPHud';
- +
- + ForEach AllActors( class'baseCam', cam )
- + break;
- + if( cam == none )
- + cam = spawn( class'baseCam' );
- +
- + viewClass(class'baseCam', true);
- + //viewClass(class 'BaseCam', true);
- + // @PAB added new camera target
- + //makeCamTarget(); //not needed -AdamJD
- +
- + // Harry gets a shadow, bigger than normal.
- + Shadow = Spawn(ShadowClass,self);
- + log( self$ " ShadowClass=" $ShadowClass$ " shadow=" $Shadow$ " tex=" $Shadow.Texture );
- +
- +// @PAB temp give a spell to Harry
- + //baseWand(weap).addSpell(Class'spellDud'); //not needed -AdamJD
- +// baseWand(weap).addSpell(Class'spellflip');
- +// baseWand(weap).addSpell(Class'spellALOho');
- +// baseWand(weap).SelectSpell(Class'spellFlip');
- +
- + HarryAnimChannel = cHarryAnimChannel( CreateAnimChannel(class'cHarryAnimChannel', AT_Replace, 'harry spine1') );
- + HarryAnimChannel.SetOwner( self );
- +
- + basewand(weapon).ChooseSpell( SPELL_None ); //set wand to no spell when first loaded -AdamJD
- +}
- +
- +//Play a sound client side (so only client will hear it)
- simulated function ClientPlaySound(sound ASound, optional bool bInterrupt, optional bool bVolumeControl )
- {
- local actor SoundPlayer;
- @@ -142,7 +228,6 @@ simulated function ClientPlaySound(sound ASound, optional bool bInterrupt, optio
- SoundPlayer.PlaySound(ASound, SLOT_Talk, 16.0, bInterrupt);
- }
- -
- function DebugState()
- {
- // BaseHUD(MyHUD).DebugString2 = string(GetStateName());
- @@ -152,7 +237,7 @@ function DebugState()
- }
- function TurnDebugModeOn()
- -{
- +{
- hpconsole(player.console).bDebugMode = true;
- }
- @@ -180,10 +265,10 @@ function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation,
- if( DamageType == 'ZonePain' || DamageType == 'pit' )
- {
- //AE:
- - //if( FRand() < 0.5 )
- - // theNarrator.FindEmote("EmotiveHarry13", snd);
- - //else
- - // theNarrator.FindEmote("EmotiveHarry14", snd);
- + // if( FRand() < 0.5 )
- + // theNarrator.FindEmote("EmotiveHarry13", snd);
- + // else
- + // theNarrator.FindEmote("EmotiveHarry14", snd);
- PlaySound( snd );
- @@ -393,6 +478,7 @@ function DoJump( optional float F )
- {
- local baseProps a;
- local float TmpJumpZ;
- + local float s; //AdamJD local float
- if( bKeepStationary )
- return;
- @@ -420,6 +506,8 @@ function DoJump( optional float F )
- */
- TmpJumpZ = JumpZ;
- + //not needed -AdamJD
- + /*
- //See if you're standing on a double jump actor
- //foreach TouchingActors( class'baseProps', a )
- foreach allactors( class'baseProps', a )
- @@ -437,11 +525,20 @@ function DoJump( optional float F )
- break;
- }
- }
- + */
- Velocity.Z += TmpJumpZ;
- if ( (Base != Level) && (Base != None) )
- - Velocity += Base.Velocity;
- + Velocity += Base.Velocity;
- +
- + //let player cast if jumping -AdamJD
- + if (bPlayerCasting)
- + {
- + HarryAnimType = AT_Replace;
- + HarryAnimChannel.GotoStateCasting();
- + PlayAnim('jump');
- + }
- SetPhysics(PHYS_Falling);
- }
- @@ -534,7 +631,7 @@ function Gasp()
- function PlayTurning()
- {
- - PlayAnim('Turn', [Type] HarryAnimType);
- + PlayAnim('Turn', [Type] HarryAnimType);
- }
- function TweenToRunning(float tweentime)
- @@ -542,15 +639,18 @@ function TweenToRunning(float tweentime)
- local vector X,Y,Z, Dir;
- BaseEyeHeight = Default.BaseEyeHeight;
- -
- - if (bIsWalking)
- - {
- - TweenToWalking(0.1);
- - return;
- - }
- -
- +
- + //not needed -AdamJD
- + // if (bIsWalking)
- + // {
- + // TweenToWalking(0.1);
- + // return;
- + // }
- +
- GetAxes(Rotation, X,Y,Z);
- Dir = Normal(Acceleration);
- + //old retail code -AdamJD
- + /*
- if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) )
- {
- // strafing or backing up
- @@ -558,12 +658,12 @@ function TweenToRunning(float tweentime)
- {
- PlayAnim('runback', 0.9, tweentime, HarryAnimType );
- bMovingBackwards=true;
- - //Velocity.X = Velocity.X / 2;
- + //Velocity.X /= 2;
- }
- else if ( Dir Dot Y > 0 )
- {
- PlayAnim('StrafeRight', 0.9, tweentime, HarryAnimType );
- - //Velocity.Y
- + //Velocity.Y /=2;
- }
- else
- PlayAnim('StrafeLeft', 0.9, tweentime, HarryAnimType );
- @@ -572,11 +672,51 @@ function TweenToRunning(float tweentime)
- {
- PlayAnim('run', 0.9, tweentime, HarryAnimType );
- bMovingBackwards=false;
- - }
- + }
- + */
- +
- + //code copied from PlayRunning -AdamJD
- + if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) )
- + {
- + // strafing or backing up
- + if ( Dir Dot X < -0.75 )
- + {
- + LoopAnim('runback', [Type] HarryAnimType);
- + bMovingBackwards=true;
- + //Velocity.X /= 2;
- + }
- + else if ( Dir Dot Y > 0 )
- + {
- + LoopAnim('StrafeRight', [Type] HarryAnimType);
- + //clientmessage("strafe right");
- + //Velocity.Y /= 2;
- + }
- + else
- + {
- + LoopAnim('StrafeLeft', [Type] HarryAnimType);
- + }
- + }
- +
- + //player has pressed the forward input so play the run anim -AdamJD
- + else if ( Dir Dot X >= 0.75 && (Dir != vect(0,0,0)) )
- + {
- + LoopAnim('run', [Type] HarryAnimType);
- + bMovingBackwards=false;
- + }
- +
- + //stops Harry if player is pressing left and right inputs at the same time -AdamJD
- + else
- + {
- + LoopAnim('breath', [Type] HarryAnimType);
- + Dir = vect(0,0,0);
- + }
- }
- function PlayRunning()
- {
- + TweenToRunning( 0 );
- + //not needed -AdamJD
- + /*
- local vector X,Y,Z, Dir;
- BaseEyeHeight = Default.BaseEyeHeight;
- @@ -592,12 +732,13 @@ function PlayRunning()
- {
- LoopAnim('runback', [Type] HarryAnimType);
- bMovingBackwards=true;
- - Velocity.X = Velocity.X / 2;
- + //Velocity.X /= 2;
- }
- else if ( Dir Dot Y > 0 )
- {
- LoopAnim('StrafeRight', [Type] HarryAnimType);
- - clientmessage("strafe right");
- + //clientmessage("strafe right");
- + //Velocity.Y /= 2;
- }
- else
- {
- @@ -608,9 +749,7 @@ function PlayRunning()
- {
- LoopAnim('run', [Type] HarryAnimType);
- bMovingBackwards=false;
- -
- - }
- -
- + }*/
- }
- @@ -623,9 +762,10 @@ function PlayinAir()
- {
- bPlayedFallSound = true;
- PlaySound( sound'HPSounds.HAR_emotes.falldeep2' );
- +
- }
- }
- -
- +
- loopAnim('fall');
- }
- @@ -643,6 +783,20 @@ function PlayCrawling()
- LoopAnim('SneakF');
- }
- +//stop Harry walking with his arms down after playing the cast anim (he walked like a penguin...) -AdamJD
- +function PlayFinishCastAnim()
- +{
- + LoopAnim('breath', 0.10, 0.5, HarryAnimType);
- + gotoState('PlayerWalking');
- +}
- +
- +//stop Harry walking with his arms up after throwing a wizard cracker -AdamJD
- +function PlayFinishThrowCrackerAnim()
- +{
- + LoopAnim('breath', 0.10, 0.5, HarryAnimType);
- + gotoState('PlayerWalking');
- +}
- +
- function PlayWaiting()
- {
- local name newAnim;
- @@ -652,59 +806,62 @@ function PlayWaiting()
- //keep idle from happening as soon as a level loads
- WaitingCount++;
- - if(WaitingCount<2) //do breath first three times you get here.
- + if(!bPlayerCasting) //don't do this if casting -AdamJD
- + {
- + if(WaitingCount<2) //do breath first three times you get here.
- + {
- + LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
- + return;
- + }
- +
- + if ( FRand() < 0.3)
- {
- - LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
- - return;
- + LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('Look', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('lookwand', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('adjustglasses', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('look2', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('look3', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else if(FRand() < 0.03 )
- + {
- + WaitingCount=0;
- + PlayAnim('look4', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- + }
- + else
- + {
- + LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
- }
- -
- - if ( FRand() < 0.3)
- - {
- - LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('Look', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('lookwand', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('adjustglasses', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('look2', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('look3', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else if(FRand() < 0.03 )
- - {
- - WaitingCount=0;
- - PlayAnim('look4', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
- - }
- - else
- - {
- - LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
- }
- }
- @@ -730,10 +887,23 @@ function Cast()
- defaultAngle.pitch = 0;
- defaultYaw = defaultAngle.yaw;
- defaultYaw = defaultYaw & 0xffff;
- +
- + //old code by me -AdamJD
- + /*
- + bOldStrafingState = (bStrafe != 0);
- +
- + MovementMode(true);
- +
- + if (bPressedJump)
- + {
- + DoJump();
- + bPressedJump = false;
- + }
- + */
- if (defaultyaw > 0x7fff)
- {
- - defaultyaw = defaultyaw - 0x10000;
- + defaultyaw -= 0x10000;
- }
- bestTarget = none;
- @@ -782,20 +952,15 @@ function Cast()
- }
- //Weapon.AltFire(1.0);
- - rectarget.destroy();
- + rectarget.destroy();
- + //turn off wand casting -AdamJD
- + basewand(weapon).bCasting=false;
- }
- // The player wants to fire.
- exec function Fire( optional float F )
- -{
- -
- - if( Weapon!=None && bJustFired == false)
- - {
- -
- - Weapon.bPointing = true;
- - //PlayAnim('wave');
- - }
- +{
- bJustFired = true;
- }
- @@ -806,9 +971,20 @@ exec function AltFire( optional float F )
- local rotator r;
- // If Harry is frozen, disable firing
- -
- - if (IsInState('HarryFrozen') || Physics == PHYS_Falling || baseHud(myhud).bCutSceneMode == true)
- + if (IsInState('HarryFrozen') || baseHud(myhud).bCutSceneMode == true) //|| Physics == PHYS_Falling //can now cast when falling -AdamJD
- {
- + //stop casting if in cutscene/Harry is frozen (can't get cursor to turn off, pissing me off) -AdamJD
- + //Update: Putting this in PlayerWalking instead fixed it... -AdamJD
- + /*
- + if(bPlayerCasting == true)
- + {
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + return;
- + }
- + */
- return;
- }
- @@ -827,20 +1003,52 @@ exec function AltFire( optional float F )
- else
- {
- if( Weapon != None
- - && bJustAltFired == false
- + //&& bJustAltFired == false
- && CarryingActor == none //you're not carrying an actor in your hand
- + && !bPlayerCasting //player is not already casting -AdamJD
- )
- {
- - ClientMessage("Harry::AltFire");
- - Weapon.bPointing = true;
- + //ClientMessage("Harry::AltFire");
- + //Weapon.bPointing = true;
- // PlaySound(sound'spell1', SLOT_Interact, 2.2, false, 1000.0, 1.0);
- // weapon.altfire(1);
- -
- - bJustAltFired = true;
- - gotostate('playeraiming');
- +
- + //turn on player casting -AdamJD
- + //bJustAltFired = true;
- + bPlayerCasting = true;
- + // Weapon.bPointing = true;
- + //basewand(weapon).bCasting=true;
- + StartCasting();
- + //gotostate('playeraiming');
- + }
- +
- + //turn off player casting -AdamJD
- + else
- + {
- + //Weapon.bPointing = false;
- + bPlayerCasting = false;
- + StopCasting();
- }
- }
- +}
- +//AdamJD
- +function StartCasting()
- +{
- + //leaving this empty goes to the StartCasting function in state PlayerWalking instead
- +}
- +
- +//AdamJD
- +function StopCasting()
- +{
- + //leaving this empty goes to the StopCasting function in state PlayerWalking instead
- +}
- +
- +//stop spell/wand noises -AdamJD
- +function StopSoundFX()
- +{
- + StopSound(sound'HPSounds.Magic_sfx.spell_build_nl2', SLOT_Misc);
- + StopSound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
- }
- event Mount( vector Delta )
- @@ -848,15 +1056,40 @@ event Mount( vector Delta )
- // Use Destination to store dest, as moveTo won't be called here.
- Destination = Location+Delta;
- MountBase = Base;
- +
- if( Physics == PHYS_Falling )
- {
- bFallingMount = true;
- gotoState('FallingMount');
- +
- + //stop Harry casting when climbing -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- }
- else
- {
- bFallingMount = false;
- gotoState('Mounting');
- +
- + //stop Harry casting when climbing -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- }
- }
- @@ -867,7 +1100,9 @@ state FallingMount
- event PlayerTick( float DeltaTime )
- {
- global.PlayerTick( DeltaTime );
- -
- +
- + DesiredRotation.Pitch = 0; //copied from the HP2 proto -AdamJD
- +
- // Adjust destination by player and base movement.
- Destination.X += Location.X - OldLocation.X;
- Destination.Y += Location.Y - OldLocation.Y;
- @@ -893,9 +1128,11 @@ state FallingMount
- function Landed(vector HitNormal)
- {
- PlaySound(Sound'HPSounds.HAR_emotes.landing5', SLOT_Interact,1, false, 1000.0, 0.9);
- - gotoState('Mounting');
- + //gotoState('Mounting'); //not needed -AdamJD
- }
- -
- +
- + //not needed -AdamJD
- + /*
- function BeginState()
- {
- DebugState();
- @@ -903,15 +1140,28 @@ state FallingMount
- // Start tweening to proper animation.
- playAnim('climb96end', [Rate] 0, [TweenTime] 0.5, [RootBone] 'move');
- }
- + */
- begin:
- // Start turning here as well.
- - TurnTo( vec(Destination.X, Destination.Y, Location.Z) );
- + //TurnTo( vec(Destination.X, Destination.Y, Location.Z) ); //not needed -AdamJD
- +
- + //copied from the HP2 proto -AdamJD
- + DesiredRotation.Yaw = rotator( vec(Destination.X, Destination.Y, Location.Z) - Location ).yaw;
- + DesiredRotation.Pitch = 0;
- + gotoState ('Mounting');
- }
- state Mounting
- {
- ignores Mount, AltFire;
- +
- + //copied from the HP2 proto -AdamJD
- + event PlayerTick( float DeltaTime )
- + {
- + global.PlayerTick( DeltaTime );
- + DesiredRotation.Pitch = 0;
- + }
- function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
- {
- @@ -933,12 +1183,16 @@ state Mounting
- begin:
- // Finish turning.
- TurnTo( vec(Destination.X, Destination.Y, Location.Z) );
- +
- + DesiredRotation.Pitch = 0; //copied from the HP2 proto -AdamJD
- MountDelta = Destination - Location;
- // Subtract anim movement from delta.
- MountDelta -= vect(30,0,0) >> Rotation;
- -
- +
- + //original mounting code -AdamJD
- + /*
- if( bFallingMount )
- {
- MountDelta.Z -= 82;
- @@ -962,6 +1216,34 @@ begin:
- MountDelta.Z -= 96;
- playAnim('climb96start', [RootBone] 'move');
- }
- + */
- +
- + if( MountDelta.Z < 48 ) //for climbing from a short distance -AdamJD
- + {
- + MountDelta.Z -= 32;
- + playAnim('climb32', [Rate] 1.0, [RootBone] 'move');
- + PlaySound( sound'HPSounds.HAR_emotes.EmotiveHarry5_b_pullup6', , 0.5 );
- + }
- +
- + else if ((MountDelta.Z >=48) && (MountDelta.Z < 80)) //for climbing from a medium distance -AdamJD
- + {
- + MountDelta.Z -= 64;
- + playAnim('climb64', [RootBone] 'move');
- + PlaySound( sound'HPSounds.HAR_emotes.EmotiveHarry5_a_pullup5', , 0.5 );
- + }
- +
- + else if ((MountDelta.Z >=80) && (MountDelta.Z < 98)) //for climbing from a long distance -AdamJD
- + {
- + MountDelta.Z -= 82;
- + playAnim('climb96end', [RootBone] 'move');
- + PlaySound( sound'HPSounds.HAR_emotes.pull_up3', , 0.5 );
- + }
- +
- + else //for climbing from a really long distance -AdamJD
- + {
- + MountDelta.Z -= 96;
- + playAnim('climb96start', [RootBone] 'move');
- + }
- gotoState('MountFinish');
- }
- @@ -1019,6 +1301,18 @@ begin:
- // Play idle anim in case nothing's happening.
- playAnim('breath');
- gotostate('PlayerWalking');
- +
- + //stop casting a spell after climbing something -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- }
- //********************************************************************************************
- @@ -1069,6 +1363,12 @@ state hit
- if( AnimSequence != 'knockback2' )
- playanim('knockback2',[RootBone] 'move');
- +
- + //Harry used to freeze when getting hit by something and casting at the same time -AdamJD
- + if (bPlayerCasting)
- + {
- + gotostate('PlayerWalking');
- + }
- // sleep(0.5);
- @@ -1131,7 +1431,6 @@ function DropCarryingActor()
- }
- //********************************************************************************************
- -
- state PickingUpWizardCard
- {
- ignores AltFire;
- @@ -1142,6 +1441,18 @@ state PickingUpWizardCard
- aStrafe = 0;
- aLookup = 0;
- aTurn = 0;
- +
- + //turn off spell cursor if picking up wizard card -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- }
- function AnimEnd()
- @@ -1160,7 +1471,7 @@ state PickingUpWizardCard
- GroundSpeed = fOldGroundSpeed;
- // basehud(myhud).DebugString2 = "Leaving Picking up wizard card " $LastState;
- cam.gotostate('StandardState');
- - RestoreStateName();
- + // RestoreStateName(); //not needed -AdamJD
- }
- }
- @@ -1185,12 +1496,18 @@ begin:
- GroundSpeed = 0;
- cam.gotostate('RotateAroundHarry');
- PlayAnim('wizardcardcollect');
- + FinishAnim(); //let Harry finish the anim -AdamJD
- + DesiredRotation.Yaw = ViewRotation.Yaw; //fixes the bug where Harry walked with his face down toward the ground after jumping into a card -AdamJD
- + DesiredRotation.Pitch = ViewRotation.Pitch; //fixes the bug where Harry walked with his face down toward the ground after jumping into a card -AdamJD
- + gotoState('PlayerWalking'); //go back to the PlayerWalking state -AdamJD
- }
- -
- //********************************************************************************************
- -state playeraiming
- +//old not needed retail playeraiming state -AdamJD
- +/*state playeraiming
- {
- - ignores SeePlayer, HearNoise, Bump;
- +
- +ignores SeePlayer, HearNoise, Bump;
- +
- // AE:
- function StartSoundFX()
- @@ -1207,7 +1524,7 @@ state playeraiming
- StopSound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
- }
- -
- +
- function BeginState()
- {
- //setphysics(phys_rotating);
- @@ -1216,10 +1533,17 @@ state playeraiming
- // basehud(myhud).DebugString2 = "in playeraiming";
- -// bOldStrafingState = (bStrafe != 0);
- + bOldStrafingState = (bStrafe != 0);
- -// MovementMode(true);
- -// PlaySound(sound'HPSounds.Magic_sfx.HAR_raise_arm', SLOT_Misc);
- + MovementMode(false);
- +
- + // if ( bPressedJump )
- + // {
- + // DoJump(); // jumping
- + // bPressedJump = false;
- + // return;
- + // }
- + //PlaySound(sound'HPSounds.Magic_sfx.HAR_raise_arm', SLOT_Misc);
- StartSoundFX();
- }
- @@ -1233,11 +1557,11 @@ state playeraiming
- bIsCrouching = false;
- //setphysics(phys_walking);
- -/* if (!bOldStrafingState)
- + if (!bOldStrafingState)
- {
- MovementMode(false);
- }
- -*/
- +
- //bStrafe = 0;
- //bLockedOnTarget = false;
- //BossTarget = none;
- @@ -1247,10 +1571,19 @@ state playeraiming
- // basehud(myhud).DebugString2 = "out of playeraiming";
- bJustFired = false;
- bJustAltFired = false;
- +
- + basewand(weapon).bCasting=false;
- +
- + // if ( bPressedJump )
- + // {
- + //DoJump(); // jumping
- + // bPressedJump = false;
- + // }
- }
- exec function AltFire( optional float F )
- {
- +
- }
- function AnimEnd()
- @@ -1265,9 +1598,20 @@ state playeraiming
- ClientUpdatePosition();
- PlayerMove(DeltaTime);
- +
- + bOldStrafingState = (bStrafe != 0);
- + MovementMode(true);
- +
- + // if ( bPressedJump )
- + // {
- + // DoJump(); // jumping
- + // PlayAnim('Jump');
- + // bPressedJump = false;
- + // gotostate('playeraiming');
- + // }
- }
- -
- +
- function PlayerMove( float DeltaTime )
- {
- local vector X,Y,Z, NewAccel;
- @@ -1281,6 +1625,7 @@ state playeraiming
- GetAxes(Rotation,X,Y,Z);
- aForward *= 0.08;
- +
- if( Physics == PHYS_Falling || bLockedOnTarget)
- {
- aStrafe *= 0.4;
- @@ -1359,9 +1704,11 @@ state playeraiming
- }
- }
- - //if ( bPressedJump )
- - // DoJump(); // jumping
- -
- + // if ( bPressedJump )
- + // {
- + // DoJump(); // jumping
- + // bPressedJump = false;
- + // }
- if ( (Physics == PHYS_Walking) )
- {
- if ( !bIsCrouching )
- @@ -1392,7 +1739,7 @@ state playeraiming
- ///bPlayerWalking = false;
- - if( /*!bIsTurning &&*/ (GetAnimGroup(AnimSequence) != 'Waiting'))
- + if( !bIsTurning && (GetAnimGroup(AnimSequence) != 'Waiting'))
- {
- bAnimTransition = true;
- TweenToWaiting(0.2);
- @@ -1447,18 +1794,53 @@ state playeraiming
- while( AnimFrame < 0.95 )
- sleep( 0.001 );
- - basewand(weapon).bCasting=false; //turn on the sparkles.
- + basewand(weapon).bCasting=true; //turn on the sparkles.
- gotostate('PlayerWalking');
- }
- sleep(0.001);
- goto 'loopaim';
- +
- +}*/
- +//********************************************************************************************
- +//Old casting states set up by me (moved to cHarryAnimChannel class) -AdamJD
- +/*
- +state stateCasting
- +{
- + begin:
- + HarryAnimType = AT_Combine;
- + LoopAnim('wave', 1.0, 0.2);
- + gotoState('PlayerWalking');
- +}
- +
- +state stateCancelCasting
- +{
- + begin:
- + PlayAnim('cast', 1.0, 0.2); //can't find a way to play no anims... -AdamJD
- + FinishAnim();
- +
- + StopCasting();
- + gotoState('PlayerWalking');
- }
- +state stateCast
- +{
- + function BeginState()
- + {
- + PlayAnim('cast', 2.0, 0.1);
- + }
- +
- + begin:
- + FinishAnim();
- +
- + StopCasting();
- + gotoState('PlayerWalking');
- +}
- +*/
- //********************************************************************************************
- state PlayerWalking
- {
- -ignores SeePlayer, HearNoise, Bump;
- +ignores SeePlayer, HearNoise, Bump;
- function ZoneChange( ZoneInfo NewZone )
- {
- @@ -1504,7 +1886,7 @@ ignores SeePlayer, HearNoise, Bump;
- }
- if (Physics == PHYS_Walking)
- - {
- + {
- if (bIsCrouching)
- {
- if ( !bIsTurning && ((Velocity.X * Velocity.X + Velocity.Y * Velocity.Y) < 1000) )
- @@ -1522,25 +1904,26 @@ ignores SeePlayer, HearNoise, Bump;
- else
- {
- bAnimTransition = true;
- - TweenToWaiting(0.2);
- + TweenToWaiting(0.4);
- }
- }
- else if (bIsWalking)
- {
- if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
- {
- - TweenToWalking(0.1);
- + TweenToWalking(0.4);
- bAnimTransition = true;
- }
- else
- PlayWalking();
- }
- +
- else
- {
- if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
- {
- bAnimTransition = true;
- - TweenToRunning(0.1);
- + TweenToRunning(0.4);
- }
- else
- PlayRunning();
- @@ -1554,7 +1937,7 @@ ignores SeePlayer, HearNoise, Bump;
- }
- }
- -
- +
- function Landed(vector HitNormal)
- {
- clientMessage("landed: jump dist = " $VSize(Location-MountDelta) $ " tia="$fTimeInAir);
- @@ -1564,14 +1947,103 @@ ignores SeePlayer, HearNoise, Bump;
- PlayLandedSound();
- playanim('land1');
- +
- + //allow player to cast when landing -AdamJD
- + if (bPlayerCasting)
- + {
- + HarryAnimType = AT_Combine;
- + HarryAnimChannel.GotoStateCasting();
- + }
- // log("PLOG PWalking landed");
- }
- - event PlayerTick( float DeltaTime )
- + //PlayerAim start and stop sound functons -AdamJD
- + function StartSoundFX()
- {
- - local baseChar a;
- + PlaySound(sound'HPSounds.Magic_sfx.spell_build_nl2', SLOT_Misc);
- + PlaySound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
- + }
- + function StopSoundFX()
- + {
- + StopSound(sound'HPSounds.Magic_sfx.spell_build_nl2', SLOT_Misc);
- + StopSound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
- + }
- +
- + //turn on player casting -AdamJD
- + function StartCasting()
- + {
- + //setup the casting stuff
- + if (bPlayerCasting && CarryingActor == none ) //&& Physics == PHYS_Walking) //can now cast when jumping -AdamJD
- + {
- + //LoopAnim('wave', 2.0, 0.1);
- + //MovementMode(true); //now not needed because you can now move the camera while casting!
- + Weapon.bPointing = true;
- + basewand(weapon).bCasting=true;
- + baseWand(Weapon).WandEffect.bHidden = false;
- + bJustFired = false;
- + bJustAltFired = false;
- + hpconsole(player.console).bspaceReleased=false;
- + hpconsole(player.console).bSpacePressed = false;
- + StartSoundFX();
- + makeTarget();
- + //HarryAnimType = AT_Combine;
- + HarryAnimChannel.GotoStateCasting();
- + // bCastFastSpells = true;
- + }
- +
- + //go to the StopCasting function if the player has just pressed the wand input
- + if( HarryAnimChannel.AnimSequence == 'cast' )
- + {
- + //LoopAnim('breath');
- + StopCasting();
- + }
- + }
- +
- + //turn off player casting -AdamJD
- + function StopCasting()
- + {
- + //if the player has just pressed the wand input then let Harry finish his anim and turn off the casting stuff until he has finished
- + if( HarryAnimChannel.AnimSequence == 'cast' )
- + {
- + //LoopAnim('breath');
- + HarryAnimChannel.GotoStateHasCast();
- + Weapon.bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + bPlayerCasting = false;
- + }
- +
- + //otherwise stop the casting stuff altogether
- + else
- + {
- + Weapon.bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + //bJustFired = true;
- + //bJustAltFired = true;
- + bPlayerCasting = false;
- + //gotoState('PlayerWalking');
- + //HarryAnimType = AT_Combine;
- + HarryAnimChannel.GotoStateCancelCasting();
- + // bCastFastSpells = false;
- + }
- + }
- +
- + event PlayerTick( float DeltaTime )
- + {
- + local baseChar a;
- +
- + Global.PlayerTick( DeltaTime ); //update playertick -AdamJD
- +
- + foreach allActors(class'BaseCam', cam)
- + break;
- +
- if( bTempKillHarry )// || lifePotions <= 0 )
- {
- bTempKillHarry = false;
- @@ -1585,9 +2057,24 @@ ignores SeePlayer, HearNoise, Bump;
- KillHarry(true);
- return;
- }
- +
- + //stop casting if in cutscene/Harry is frozen -AdamJD
- + if (baseHud(myhud).bCutSceneMode == true)
- + {
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- + }
- - if ( bUpdatePosition )
- - ClientUpdatePosition();
- + // if ( bUpdatePosition )
- + // ClientUpdatePosition();
- //Try and save how long you've been falling, and what you're original height was when you started falling
- ProcessFalling( DeltaTime );
- @@ -1603,7 +2090,7 @@ ignores SeePlayer, HearNoise, Bump;
- // bScreenRelativeMovement = !bScreenRelativeMovement;
- // ClientMessage("ToggleTab");
- //}
- -
- +
- if( CarryingActor != none )
- {
- //r = weaponRot;
- @@ -1619,6 +2106,47 @@ ignores SeePlayer, HearNoise, Bump;
- AltFire(0);
- }
- }
- +
- + //the player wants to fire a spell, so let's see if they can -AdamJD
- + if( bPlayerCasting && HarryAnimChannel.IsInState('stateCasting') && bAltFire == 0 ) //&& Physics == PHYS_Walking && GetAnimGroup(AnimSequence) == 'wave' //now not needed
- + {
- + //the player is aiming at a target or victim so cast the spell
- + if ( rectarget.bIsLockedOn == true && (!IsInState('FallingMount')) || (!IsInState('Mounting')) || (!IsInState('MountFinish')) ) //don't cast the spell if Harry has just climbed something or is currently climbing
- + {
- + HarryAnimChannel.GotoStateCast();
- + // StopSoundFX();
- + //PlayAnim('cast', 2.0, 0.1);
- + // Weapon.bPointing = false;
- + // basewand(weapon).bCasting=false;
- + // baseWand(Weapon).WandEffect.bHidden = true;
- + // rectarget.destroy();
- + // bPlayerCasting = false;
- + //MovementMode(false); //now not needed because you can now move the camera while casting!
- + StopCasting();
- + //gotoState('PlayerWalking');
- + }
- +
- + //the player is not aiming at a target or victim
- + else
- + {
- + // Weapon.bPointing = false;
- + // baseWand(Weapon).WandEffect.bHidden = true;
- + //loopanim('wave', 2.0 , 0.2);
- + // HarryAnimChannel.GotoStateCancelCasting;
- + // bPlayerCasting = false;
- + // rectarget.destroy();
- + //MovementMode(false); //now not needed because you can now move the camera while casting!
- + StopCasting();
- + //gotoState('PlayerWalking');
- + }
- + }
- +
- + //HP2 cam code (keeps camera behind Harry) -AdamJD
- + if( cam.IsInState('Standardstate') )
- + {
- + DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
- + SetRotation( DesiredRotation );
- + }
- }
- //Try and save how long you've been falling, and what you're original height was when you started falling
- @@ -1651,10 +2179,14 @@ ignores SeePlayer, HearNoise, Bump;
- local float Speed2D;
- local bool bSaveJump;
- local name AnimGroupName;
- -
- - //if( PotCam(ViewTarget) != none )
- - // GetAxes(ViewTarget.Rotation,X,Y,Z);
- - //else
- +
- + //find BaseCam -AdamJD
- + foreach allActors(class'BaseCam', cam)
- + break;
- +
- + // if( PotCam(ViewTarget) != none )
- + // GetAxes(ViewTarget.Rotation,X,Y,Z);
- + // else
- if( bReverseInput ) //Right now, just for troll chase.
- {
- @@ -1670,30 +2202,29 @@ ignores SeePlayer, HearNoise, Bump;
- if( Physics == PHYS_Falling || bLockedOnTarget || bFixedFaceDirection )
- {
- - aStrafe *= 0.08*2;
- + aStrafe *= 0.08; //*2; //halved the speed of aStrafe -AdamJD
- aTurn = 0;
- }
- +
- else
- - {
- - aStrafe = 0;
- - aTurn *= 0.24;
- + {
- + aStrafe *= 0.08;
- + aTurn *= 0.24;
- }
- aLookup *= 0; // make harry steady (no pitching with look up)
- - aSideMove *= 0.1;
- -
- - if( bKeepStationary )
- - {
- - aForward = 0;
- - aStrafe = 0;
- - }
- + aSideMove *= 0.1;
- // Update acceleration.
- if( bLockedOnTarget || bFixedFaceDirection )
- {
- - if( aForward < 0 )
- - aForward *= 2;
- -
- + //not needed -AdamJD
- + // if( aForward < 0 )
- + // aForward *= 2;
- +
- + //stop Harry turning on his own axis when fighting troll or vold -AdamJD
- + aTurn = 0;
- +
- //ClientMessage("aForward:" @ aForward @ " aStrafe:" @ aStrafe);
- //NewAccel = aForward*X + aStrafe*Y;
- //ProcessAccel messes with aForward and aStrafe to get a final NewAccel
- @@ -1725,22 +2256,54 @@ ignores SeePlayer, HearNoise, Bump;
- NewAccel = aForward*X + aStrafe*Y;
- }
- }
- -
- +
- + //don't move if input is disabled -AdamJD
- + if( bKeepStationary )
- + {
- + aForward = 0;
- + aStrafe = 0;
- + }
- +
- NewAccel.Z = 0;
- // Check for Dodge move
- AnimGroupName = GetAnimGroup(AnimSequence);
- +
- if ( (Physics == PHYS_Walking) )
- Speed2D = Sqrt(Velocity.X * Velocity.X + Velocity.Y * Velocity.Y);
- // Update rotation.
- OldRotation = Rotation;
- + //not needed -AdamJD
- //When you're locked onto a target, or facing down a fixed direction, other rotation code is performed
- - if( !(bLockedOnTarget || bFixedFaceDirection) ) // && target != none )
- - UpdateRotation(DeltaTime, 1);
- + //if( !(bLockedOnTarget || bFixedFaceDirection) ) // && target != none )
- + //UpdateRotation(DeltaTime, 1);
- ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
- +
- + //HP2 cam code -AdamJD
- + if( cam.IsInState('StandardState') || cam.IsInState('BossState') )
- + {
- + //Harry will always look at what the camera is looking at
- + DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
- + SetRotation( DesiredRotation );
- + }
- +
- + //stop casting if in cutscene/Harry is frozen -AdamJD
- + if (baseHud(myhud).bCutSceneMode == true)
- + {
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- + }
- }
- function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
- @@ -1756,6 +2319,21 @@ ignores SeePlayer, HearNoise, Bump;
- Velocity = vect(0,0,0);
- return;
- }
- +
- + //stop casting if in cutscene/Harry is frozen -AdamJD
- + if (baseHud(myhud).bCutSceneMode == true)
- + {
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- + }
- if ( bPressedJump )
- {
- @@ -1764,7 +2342,7 @@ ignores SeePlayer, HearNoise, Bump;
- }
- if ( (Physics == PHYS_Walking) )
- - {
- + {
- if (!bIsCrouching)
- {
- if (bDuck != 0)
- @@ -1840,24 +2418,59 @@ ignores SeePlayer, HearNoise, Bump;
- if (Physics != PHYS_Falling) SetPhysics(PHYS_Walking);
- if ( !IsAnimating() )
- PlayWaiting();
- +
- + //now not needed -AdamJD
- + /*
- + //AdamJD code start
- + //can't get camera to move when Harry is casting so this is a hack
- + if( !bLockedOnTarget )
- + {
- + if (bPlayerCasting == true)
- + {
- + MovementMode(true);
- + }
- + }
- + //AdamJD End
- + */
- +
- + // foreach allActors(class'BaseCam', cam)
- + // break;
- - foreach allActors(class'BaseCam', cam)
- - break;
- -
- - //LastWalkYaw = Rotation.yaw;
- - //PlayerMoving = MOVING_NOT;
- - //CamPosYawOffset = 0;
- - //CamTargetYawOffset = 0;
- + // LastWalkYaw = Rotation.yaw;
- + // PlayerMoving = MOVING_NOT;
- + // CamPosYawOffset = 0;
- + // CamTargetYawOffset = 0;
- }
- -
- +
- function EndState()
- {
- // log("PLOG PWalking Exited");
- WalkBob = vect(0,0,0);
- bIsCrouching = false;
- +
- + //stop casting if in cutscene/Harry is frozen -AdamJD
- + if (baseHud(myhud).bCutSceneMode == true)
- + {
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- + }
- +
- + //now not needed -AdamJD
- + /*
- + //if not casting go back to normal movement -AdamJD
- + if (bPlayerCasting == false)
- + {
- + MovementMode(false);
- + }
- + */
- }
- -
- -
- }
- //********************************************************************************************
- @@ -1900,7 +2513,7 @@ ignores SeePlayer, HearNoise, Bump;
- hidden=false;
- }
- }
- -
- +
- if (Physics == PHYS_Walking)
- {
- if (bIsCrouching)
- @@ -1925,7 +2538,7 @@ ignores SeePlayer, HearNoise, Bump;
- }
- else if (bIsWalking)
- {
- - if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
- + if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
- {
- TweenToWalking(0.1);
- bAnimTransition = true;
- @@ -1935,7 +2548,7 @@ ignores SeePlayer, HearNoise, Bump;
- }
- else
- {
- - if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
- + if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
- {
- bAnimTransition = true;
- TweenToRunning(0.1);
- @@ -1943,20 +2556,23 @@ ignores SeePlayer, HearNoise, Bump;
- else
- PlayRunning();
- }
- +
- }
- }
- +
- else
- {
- PlayInAir();
- }
- +
- }
- -
- +
- event PlayerTick( float DeltaTime )
- {
- local baseChar a;
- -
- +
- if( bTempKillHarry )
- {
- bTempKillHarry = false;
- @@ -1973,6 +2589,49 @@ ignores SeePlayer, HearNoise, Bump;
- CarryingActor.setLocation( weaponLoc );//- vect(0,0,1 );
- CarryingActor.SetRotation( weaponRot );
- }
- +
- + //stop casting on chess board -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- + }
- +
- + //new rotation function for the chess board -AdamJD
- + function UpdateRotationOnChessBoard(float DeltaTime, float maxPitch)
- + {
- + local rotator NewRotation;
- + local float YawVal;
- +
- + //get the SmoothMouseX axis and cap it to not overshoot input (only need to care about the SmoothMouseX axis) -AdamJD
- + YawVal = (SmoothMouseX / 1.5) * DeltaTime;
- +
- + //limit SmoothMouseX -AdamJD
- + if(YawVal == SmoothMouseX)
- + {
- + if( YawVal > MAX_MOUSE_DELTA_X )
- + {
- + YawVal = MAX_MOUSE_DELTA_X;
- + }
- +
- + else if( YawVal < MIN_MOUSE_DELTA_X )
- + {
- + YawVal = MIN_MOUSE_DELTA_X;
- + }
- + }
- +
- + ViewRotation.Yaw += YawVal; //set YawVal to ViewRotation.Yaw -AdamJD
- + DesiredRotation.Yaw = ViewRotation.Yaw; //set ViewRotation.Yaw to DesiredRotation.Yaw -AdamJD
- + NewRotation.Yaw = cam.rotation.Yaw; //move Harry and chess marker at the same time when moving mouse left or right -AdamJD
- +
- + DesiredRotation = ViewRotation; //set ViewRotation to DesiredRotation -AdamJD
- + setRotation(NewRotation); //use the NewRotation as the camera rotation -AdamJD
- }
- function PlayerMove( float DeltaTime )
- @@ -1985,7 +2644,7 @@ ignores SeePlayer, HearNoise, Bump;
- local float Speed2D;
- local bool bSaveJump;
- local name AnimGroupName;
- -
- +
- //if( PotCam(ViewTarget) != none )
- // GetAxes(ViewTarget.Rotation,X,Y,Z);
- //else
- @@ -2002,6 +2661,7 @@ ignores SeePlayer, HearNoise, Bump;
- if (aForward > 0)
- {
- bChessMoving = true;
- + TweenToRunning(0.4); //make Harry move smoothly -AdamJD
- return;
- }
- }
- @@ -2009,10 +2669,12 @@ ignores SeePlayer, HearNoise, Bump;
- {
- return;
- }
- -
- +
- + //not needed -AdamJD
- + /*
- if( bReverseInput ) //Right now, just for troll chase.
- {
- - //aForward = -aForward;
- + aForward = -aForward;
- aTurn = -aTurn;
- aStrafe = -aStrafe;
- }
- @@ -2029,29 +2691,32 @@ ignores SeePlayer, HearNoise, Bump;
- aStrafe = 0;
- aTurn *= 0.24;
- }
- + */
- aLookup *= 0; // make harry steady (no pitching with look up)
- - aSideMove *= 0.1;
- + // aSideMove *= 0.1; //not needed -AdamJD
- if( bKeepStationary )
- {
- aForward = 0;
- aStrafe = 0;
- }
- -
- +
- + //not needed -AdamJD
- + /*
- // Update acceleration.
- - if( bLockedOnTarget )
- + if( bLockedOnTarget )
- {
- - if( aForward < 0 )
- + if( aForward < 0 )
- aForward *= 2;
- - //ClientMessage("aForward:" @ aForward @ " aStrafe:" @ aStrafe);
- - //NewAccel = aForward*X + aStrafe*Y;
- - //ProcessAccel messes with aForward and aStrafe to get a final NewAccel
- + ClientMessage("aForward:" @ aForward @ " aStrafe:" @ aStrafe);
- + NewAccel = aForward*X + aStrafe*Y;
- + ProcessAccel messes with aForward and aStrafe to get a final NewAccel
- NewAccel = ProcessAccel();
- - }
- - else
- - {
- + }*/
- + // else //not needed -AdamJD
- + // {
- GetAxes(Rotation,X,Y,Z);
- // Update acceleration.
- @@ -2075,7 +2740,7 @@ ignores SeePlayer, HearNoise, Bump;
- {
- NewAccel = aForward*X + aStrafe*Y;
- }
- - }
- + // }
- NewAccel.Z = 0;
- // Check for Dodge move
- @@ -2084,14 +2749,28 @@ ignores SeePlayer, HearNoise, Bump;
- if ( (Physics == PHYS_Walking) )
- Speed2D = Sqrt(Velocity.X * Velocity.X + Velocity.Y * Velocity.Y);
- + //not needed -AdamJD
- // Update rotation.
- - OldRotation = Rotation;
- -
- + // OldRotation = Rotation;
- +
- //When you're locked onto a target, other rotation code is performed
- - if( !bLockedOnTarget ) // && target != none )
- - UpdateRotation(DeltaTime, 1);
- + //if( !bLockedOnTarget ) // && target != none )
- + //UpdateRotation(DeltaTime, 1);
- +
- + UpdateRotationOnChessBoard(DeltaTime, 1); //new rotation function created by me just for the chess board -AdamJD
- +
- + //stop casting on chess board -AdamJD
- + if(bPlayerCasting == true)
- + {
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- - ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
- + // ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation); //commented out because this allows Harry to walk off the chess board breaking the game... -AdamJD
- }
- function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
- @@ -2152,7 +2831,7 @@ ignores SeePlayer, HearNoise, Bump;
- // if ( bIsTurning && (AnimFrame >= 0) )
- // {
- // bAnimTransition = true;
- - // PlayTurning();
- + //PlayTurning();
- // }
- //}
- //else
- @@ -2167,6 +2846,19 @@ ignores SeePlayer, HearNoise, Bump;
- }
- }
- }
- +
- + //stop casting on chess board -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- +
- else
- {
- if ( (OldAccel == vect(0,0,0)) && (Acceleration != vect(0,0,0)) )
- @@ -2176,11 +2868,54 @@ ignores SeePlayer, HearNoise, Bump;
- }
- }
- }
- -
- +
- + //stop Harry moving and casting when first on the chess board -AdamJD
- + function BeginState()
- + {
- + Acceleration = Vec(0, 0, 0);
- + Velocity = Vec(0, 0, 0);
- +
- + if (Physics == PHYS_Falling)
- + {
- + SetPhysics(PHYS_Walking);
- + PlayWalking();
- + }
- +
- + else if (bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + PlayWalking();
- + HarryAnimType = AT_Replace;
- + }
- +
- + else
- + {
- + PlayWalking();
- + }
- + }
- +
- function EndState()
- {
- WalkBob = vect(0,0,0);
- bIsCrouching = false;
- +
- + //stop casting on chess board -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- }
- begin:
- @@ -2196,6 +2931,18 @@ begin:
- if (Physics != PHYS_Falling) SetPhysics(PHYS_Walking);
- if ( !IsAnimating() )
- PlayWaiting();
- +
- + //stop casting on chess board -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- foreach allActors(class'BaseCam', cam)
- break;
- @@ -2222,11 +2969,14 @@ loop:
- }
- //**********************************************************************************************
- +//now not needed -AdamJD
- +/*
- //This is called from 'PlayerWalking' and 'PlayerAim'
- function UpdateRotation(float DeltaTime, float maxPitch)
- {
- local rotator newRotation;
- local float YawVal;
- + local float YawValY; //local YawValY float -AdamJD
- local int RotDist;
- local float FastRotRate;
- @@ -2234,14 +2984,16 @@ function UpdateRotation(float DeltaTime, float maxPitch)
- return;
- FastRotRate = 70000;
- +
- + YawValY = YawVal; //set YawValY to YawVal -AdamJD
- DesiredRotation = ViewRotation;
- ViewRotation.Pitch += 32.0 * DeltaTime * aLookUp;
- ViewRotation.Pitch = ViewRotation.Pitch & 65535;
- -
- - If ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152))
- +
- + if ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152))
- {
- - If (aLookUp > 0)
- + if (aLookUp > 0)
- ViewRotation.Pitch = 18000;
- else
- ViewRotation.Pitch = 49152;
- @@ -2278,17 +3030,95 @@ function UpdateRotation(float DeltaTime, float maxPitch)
- YawVal = -YawVal;
- }
- }
- +
- else
- {
- - //When you're in state 'PlayerAim', and you're in "circle around the boss" (bLockedOnTarget) mode, this function gets called,
- + // When you're in state 'PlayerAim', and you're in "circle around the boss" (bLockedOnTarget) mode, this function gets called,
- // and then overridden, with an absolute rot set towards the Boss.
- -
- - if(Acceleration == vect(0,0,0))
- - YawVal=32.0 * DeltaTime * aTurn;
- +
- + if(Acceleration == vect(0,0,0))
- + {
- + //YawVal= 32.0 * DeltaTime * aTurn; //old retail code -AdamJD
- +
- + //HOLY CRAP- I finally fixed Harry turning when strafing!!! -AdamJD
- + YawVal= (SmoothMouseX / 1.5) * DeltaTime;
- + // YawValY = (SmoothMouseY / 1.5) * DeltaTime;
- +
- + //for a more smoother Mouse X effect -AdamJD
- + if(YawVal == SmoothMouseX)
- + {
- + if( YawVal > MAX_MOUSE_DELTA_X )
- + {
- + YawVal = MAX_MOUSE_DELTA_X;
- + }
- +
- + else if( YawVal < MIN_MOUSE_DELTA_X )
- + {
- + YawVal = MIN_MOUSE_DELTA_X;
- + }
- + }
- +
- + //for a more smoother Mouse Y effect -AdamJD
- + // if(YawValY == SmoothMouseY)
- + // {
- + // if( YawValY > MAX_MOUSE_DELTA_Y )
- + // {
- + // YawValY = MAX_MOUSE_DELTA_Y;
- + // }
- +
- + // else if( YawValY < MIN_MOUSE_DELTA_Y )
- + // {
- + // YawValY = MIN_MOUSE_DELTA_Y;
- + // }
- + // }
- +
- + //keep camera behind Harry -AdamJD
- + // DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
- + // SetRotation( DesiredRotation );
- + }
- +
- else
- - YawVal=24.0 * DeltaTime * aTurn;
- + {
- + //YawVal=24.0 * DeltaTime * aTurn; //old retail code -AdamJD
- +
- + //HOLY CRAP- I finally fixed Harry turning when strafing!!! -AdamJD
- + YawVal= (SmoothMouseX / 1.8) * DeltaTime;
- + // YawValY = (SmoothMouseY / 1.8) * DeltaTime;
- +
- + //for a more smoother Mouse X effect -AdamJD
- + if(YawVal == SmoothMouseX)
- + {
- + if( YawVal > MAX_MOUSE_DELTA_X )
- + {
- + YawVal = MAX_MOUSE_DELTA_X;
- + }
- +
- + else if( YawVal < MIN_MOUSE_DELTA_X )
- + {
- + YawVal = MIN_MOUSE_DELTA_X;
- + }
- + }
- +
- + //for a more smoother Mouse Y effect -AdamJD
- + // if(YawValY == SmoothMouseY)
- + // {
- + // if( YawValY > MAX_MOUSE_DELTA_Y )
- + // {
- + // YawValY = MAX_MOUSE_DELTA_Y;
- + // }
- +
- + // else if( YawValY < MIN_MOUSE_DELTA_Y )
- + // {
- + // YawValY = MIN_MOUSE_DELTA_Y;
- + // }
- + // }
- +
- + //keep camera behind Harry -AdamJD
- + // DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
- + // SetRotation( DesiredRotation );
- + }
- }
- -
- +
- //If bConstrainYaw is set and you're not turning, this tries to turn you back towards the x axis
- if( bConstrainYaw && yawVal == 0 )
- {
- @@ -2301,8 +3131,10 @@ function UpdateRotation(float DeltaTime, float maxPitch)
- else
- yawVal = min( RotDist, 65536 - ViewRotation.Yaw );
- }
- -
- +
- + //AdamJD
- ViewRotation.Yaw += yawVal;
- + //ViewRotation.Pitch = YawValY;
- //This is specially for keeping harry pointing down a specified yaw, with a certain amount of variance. For now, it's hard coded down the x axis.
- if( bConstrainYaw )
- @@ -2315,13 +3147,13 @@ function UpdateRotation(float DeltaTime, float maxPitch)
- if( ViewRotation.Yaw >= 32767 && ViewRotation.Yaw < 65536 - ConstrainYawVariance )
- ViewRotation.Yaw = 65536 - ConstrainYawVariance;
- }
- -
- +
- // Remember pre-shake.
- newRotation = ViewRotation;
- ViewShake(deltaTime);
- if( ViewTarget != none )
- {
- - // Apply the view shake delta to our camera actor.
- + //Apply the view shake delta to our camera actor.
- newRotation = ViewTarget.Rotation + ViewRotation - newRotation;
- newRotation.Roll = newRotation.Roll & 0xffff;
- ViewTarget.SetRotation(newRotation);
- @@ -2330,17 +3162,76 @@ function UpdateRotation(float DeltaTime, float maxPitch)
- newRotation = Rotation;
- newRotation.Yaw = ViewRotation.Yaw;
- newRotation.Pitch = ViewRotation.Pitch;
- -
- - If ( (newRotation.Pitch > maxPitch * RotationRate.Pitch) && (newRotation.Pitch < 65536 - maxPitch * RotationRate.Pitch) )
- +
- + if ( (newRotation.Pitch > maxPitch * RotationRate.Pitch) && (newRotation.Pitch < 65536 - maxPitch * RotationRate.Pitch) )
- {
- - If (ViewRotation.Pitch < 32768)
- + if (ViewRotation.Pitch < 32768)
- newRotation.Pitch = maxPitch * RotationRate.Pitch;
- else
- newRotation.Pitch = 65536 - maxPitch * RotationRate.Pitch;
- }
- setRotation(newRotation);
- -}
- -
- +}*/
- +//**********************************************************************************************
- +//old x mouse function created by me -AdamJD
- +/*
- +function MouseX(float DeltaTime)
- +{
- + local float xMouse;
- + local float fRotSpeed;
- + local float fCurrentMinPitch;
- + local float fCurrentMaxPitch;
- +
- + xMouse = SmoothMouseX * DeltaTime;
- +
- + fRotSpeed = 4.0f;
- + fCurrentMinPitch = -14000.0f;
- + fCurrentMaxPitch = 14000.0f;
- +
- + //for a more smoother effect -AdamJD
- + if( xMouse > MAX_MOUSE_DELTA_X )
- + {
- + xMouse = MAX_MOUSE_DELTA_X;
- + }
- +
- + else if( xMouse < MIN_MOUSE_DELTA_X )
- + {
- + xMouse = MIN_MOUSE_DELTA_X;
- + }
- +
- + //DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
- + // SetRotation( DesiredRotation );
- +}*/
- +//**********************************************************************************************
- +//old y mouse function created by me -AdamJD
- +/*
- +function MouseY(float DeltaTime)
- +{
- + local float yMouse;
- + local float fRotSpeed;
- + local float fCurrentMinPitch;
- + local float fCurrentMaxPitch;
- +
- + yMouse = SmoothMouseY * DeltaTime;
- +
- + fRotSpeed = 4.0f;
- + fCurrentMinPitch = -14000.0f;
- + fCurrentMaxPitch = 14000.0f;
- +
- + //for a more smoother effect -AdamJD
- + if( yMouse > MAX_MOUSE_DELTA_X )
- + {
- + yMouse = MAX_MOUSE_DELTA_X;
- + }
- +
- + else if( yMouse < MIN_MOUSE_DELTA_X )
- + {
- + yMouse = MIN_MOUSE_DELTA_X;
- + }
- +
- + //DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
- + // SetRotation( DesiredRotation );
- +}*/
- //**********************************************************************************************
- function UpdateRotationToTarget()
- {
- @@ -2371,8 +3262,9 @@ function UpdateRotationToTarget()
- //This makes it so when harry goes to state 'hit', he still looks at the boss.
- DesiredRotation = ViewRotation;
- -
- - if( (StandardTarget.Location != TargetLoc && astrafe != 0)
- +
- + //not needed -AdamJD
- + /*if( (StandardTarget.Location != TargetLoc && astrafe != 0)
- || (BossRailMove(BossTarget) != none)
- )
- {
- @@ -2384,13 +3276,16 @@ function UpdateRotationToTarget()
- v = TargetLoc;
- }
- StandardTarget.SetLocation(v);
- - }
- + }*/
- r = rotator(StandardTarget.Location - Location);
- r.pitch = Rotation.pitch;
- - SetRotation( r );
- + //SetRotation( r ); //not needed -AdamJD
- ViewRotation = r;
- + DesiredRotation = r; //set the desired rotation -AdamJD
- }
- + //not needed -AdamJD
- + /*
- else
- {
- TargetLoc = rectarget.location;
- @@ -2400,6 +3295,7 @@ function UpdateRotationToTarget()
- SetRotation( r );
- ViewRotation = r;
- }
- + */
- }
- //**********************************************************************************************
- @@ -2418,7 +3314,7 @@ function vector ProcessAccel()
- fLargestAForward = aForward;
- //Point harry at our foe
- - UpdateRotationToTarget();
- + UpdateRotationToTarget();
- GetAxes(Rotation,X,Y,Z);
- @@ -2662,12 +3558,6 @@ ignores SeePlayer, HearNoise, Bump;
- return;
- }
- - if ( bPressedJump )
- - {
- - DoJump(); // jumping
- - bPressedJump = false;
- - }
- -
- if ( (Physics == PHYS_Walking) )
- {
- if (!bIsCrouching)
- @@ -2763,11 +3653,11 @@ ignores SeePlayer, HearNoise, Bump;
- if ( (Physics == PHYS_Walking) )
- {
- Speed2D = Sqrt(Velocity.X * Velocity.X + Velocity.Y * Velocity.Y);
- - }
- + }
- // Update rotation.
- - OldRotation = Rotation;
- - UpdateRotation(DeltaTime, 1);
- + //OldRotation = Rotation; //not needed -AdamJD
- + //UpdateRotation(DeltaTime, 1); //not needed -AdamJD
- ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
- @@ -2839,8 +3729,8 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
- fireDir = normal(fireDir);
- bestTarget = none;
- - if (rectarget.victim == none)
- - {
- + //if (rectarget.victim == none) //not needed -AdamJD
- + //{
- foreach VisibleActors( class 'ACTOR', hitactor)
- {
- if( HitActor.bprojtarget && PlayerPawn(HitActor) != Self && !HitActor.IsA('BaseCam'))
- @@ -2871,7 +3761,9 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
- }
- }
- - }
- + //}
- + //not needed -AdamJD
- + /*
- else
- {
- bestTarget = rectarget.victim;
- @@ -2881,6 +3773,7 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
- bestYaw = bestYaw & 0xffff;
- bestZ = objectdir.z;
- }
- + */
- if(bestTarget != none)
- {
- @@ -2899,68 +3792,6 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
- return defaultAngle;
- }
- -
- -event PreBeginPlay()
- -{
- - Super.PreBeginPlay();
- -
- - foreach AllActors(class'baseNarrator', theNarrator)
- - break;
- - if(theNarrator==None)
- - {
- - theNarrator=spawn(class 'Narrator');
- - Log("Narrator spawned:" $theNarrator);
- - }
- -
- -}
- -
- -function PostBeginPlay()
- -{
- - local Pawn p;
- - local weapon weap;
- - Super.PostBeginPlay();
- -
- - b3DSound = bool(ConsoleCommand("get ini:Engine.Engine.AudioDevice Use3dHardware"));
- -
- - bShowMenu=false;
- - log("weapon is" $weapon);
- - if(inventory==none)
- - {
- - weap=spawn(class'baseWand');
- - weap.BecomeItem();
- - AddInventory(weap);
- - weap.WeaponSet(self);
- - weap.GiveAmmo(self);
- - baseWand(weap).bUseMana=false;
- - log(self$ " spawning weap " $weap);
- - }
- - else
- - {
- - log("not spawning weap");
- - }
- -
- - iFireSeedCount = 0;
- -
- - HUDType=class'HPMenu.HPHud';
- -
- - viewClass(class 'BaseCam', true);
- - // @PAB added new camera target
- - makeCamTarget();
- -
- - // Harry gets a shadow, bigger than normal.
- - Shadow = Spawn(ShadowClass,self);
- - log( self$ " ShadowClass=" $ShadowClass$ " shadow=" $Shadow$ " tex=" $Shadow.Texture );
- -
- -// @PAB temp give a spell to Harry
- - baseWand(weap).addSpell(Class'spellDud');
- -// baseWand(weap).addSpell(Class'spellflip');
- -// baseWand(weap).addSpell(Class'spellALOho');
- -// baseWand(weap).SelectSpell(Class'spellFlip');
- -
- - HarryAnimChannel = cHarryAnimChannel( CreateAnimChannel(class'cHarryAnimChannel', AT_Replace, 'harry spine1') );
- - HarryAnimChannel.SetOwner( self );
- -}
- -
- function timer()
- {
- @@ -3030,14 +3861,17 @@ function makeTarget()
- local vector tloc;
- local vector targetoffset;
- - targetOffset.y=0;
- targetOffset.x=50;
- + targetOffset.y=0;
- targetOffset.z=0;
- tloc=targetOffset>>viewrotation;
- - tloc=tloc+location;
- -
- + tloc +=location;
- +
- rectarget=spawn(class'target',,,tloc);
- +
- + //not needed -AdamJD
- + /*
- if(rectarget==none)
- {
- targetOffset.y=0;
- @@ -3045,11 +3879,12 @@ function makeTarget()
- targetOffset.z=0;
- tloc=targetOffset>>viewrotation;
- - tloc=tloc+location;
- + tloc +=location;
- rectarget=spawn(class'target',,,tloc);
- }
- -
- + */
- +
- if(rectarget==none)
- {
- gotostate('playerwalking');
- @@ -3057,32 +3892,35 @@ function makeTarget()
- hpconsole(player.console).bspaceReleased=true;
- hpconsole(player.console).bSpacePressed=false;
- }
- -
- - rectarget.p=self;
- - rectarget.targetOffset.y=0;
- - rectarget.targetOffset.x=100;
- - rectarget.targetOffset.z=0;
- +
- + else
- + {
- + // rectarget.p=self;
- + rectarget.targetOffset.x=100;
- + rectarget.targetOffset.y=0;
- + rectarget.targetOffset.z=0;
- + }
- }
- -
- +//now not needed -AdamJD
- +/*
- // @PAB added new camera target
- function makeCamTarget()
- {
- local vector tloc;
- local vector targetoffset;
- -
- - targetOffset.y=0;
- - targetOffset.x=50;
- - targetOffset.z=0;
- -
- -
- -
- -
- - tloc=targetOffset>>viewrotation;
- - tloc=tloc+location;
- + //not needed -AdamJD
- + // targetOffset.y=0;
- + // targetOffset.x=50;
- + // targetOffset.z=0;
- +
- + StandardTarget=spawn(class'camtarget',,,tloc);*/
- + // tloc=targetOffset>>viewrotation; //not needed -AdamJD
- + // tloc+=location; //not needed -AdamJD
- - StandardTarget=spawn(class'camtarget',,,tloc);
- + //not needed -AdamJD
- + /*
- if(StandardTarget==none)
- {
- targetOffset.y=0;
- @@ -3100,13 +3938,17 @@ function makeCamTarget()
- hpconsole(player.console).bspaceReleased = true;
- hpconsole(player.console).bSpacePressed = false;
- }
- -
- - StandardTarget.p=self;
- - StandardTarget.targetOffset.y=0;
- - StandardTarget.targetOffset.x=100;
- - StandardTarget.targetOffset.z=0;
- - StandardTarget.gotostate('seeking');
- -}
- + */
- +
- + /*
- + StandardTarget.p=self;
- + // StandardTarget.targetOffset.y=0; /not needed -AdamJD
- + // StandardTarget.targetOffset.x=100; /not needed -AdamJD
- + StandardTarget.targetOffset.x= SmoothMouseX; //AdamJD
- + StandardTarget.targetOffset.y= SmoothMouseY; //AdamJD
- + StandardTarget.targetOffset.z=0;
- + //StandardTarget.gotostate('seeking'); /not needed -AdamJD
- +}*/
- state SpellLearning
- {
- @@ -3116,36 +3958,37 @@ state SpellLearning
- defaultproperties
- {
- - ShadowClass=Class'HarryPotter.HarryShadow'
- - eaid(0)="xa37dd45ffe10v ptۈ"̦ϝʾρǹ07cb3fa231144fe2e33ae4783feead2b8a73ff021fac326df0ef9753ab9cdf6573ddff0312fab0b0ff39779eaff312x"
- - HurtSound(0)=Sound'HPSounds.Har_Emotes.ouch1'
- - HurtSound(1)=Sound'HPSounds.Har_Emotes.ouch2'
- - HurtSound(2)=Sound'HPSounds.Har_Emotes.ouch3'
- - HurtSound(3)=Sound'HPSounds.Har_Emotes.ouch4'
- - HurtSound(4)=Sound'HPSounds.Har_Emotes.ouch5'
- - HurtSound(5)=Sound'HPSounds.Har_Emotes.ouch6'
- - HurtSound(6)=Sound'HPSounds.Har_Emotes.ouch7'
- - HurtSound(7)=Sound'HPSounds.Har_Emotes.ouch8'
- - HurtSound(8)=Sound'HPSounds.Har_Emotes.ouch9'
- - HurtSound(9)=Sound'HPSounds.Har_Emotes.ouch10'
- - HurtSound(10)=Sound'HPSounds.Har_Emotes.ouch11'
- - HurtSound(11)=Sound'HPSounds.Har_Emotes.ouch12'
- - HurtSound(12)=Sound'HPSounds.Har_Emotes.ouch13'
- - HurtSound(13)=Sound'HPSounds.Har_Emotes.oof1'
- - HurtSound(14)=Sound'HPSounds.Har_Emotes.oof2'
- - GroundSpeed=200
- - AirSpeed=400
- - AccelRate=1024
- - JumpZ=245
- - MaxMountHeight=96.5
- - AirControl=0.25
- - BaseEyeHeight=40.75
- - EyeHeight=40.75
- - MenuName="Harry"
- - DrawType=DT_Mesh
- - Mesh=SkeletalMesh'HarryPotter.skharryMesh'
- - CollisionRadius=15
- - CollisionHeight=42
- - Mass=1
- - Buoyancy=118.8
- -}
- + ShadowClass=Class'HarryPotter.HarryShadow'
- + eaid(0)="xEU-0000004821-SD-001753aabac325f07cb3fa231144fe2e33ae4783feead2b8a73ff021fac326df0ef9753ab9cdf6573ddff0312fab0b0ff39779eaff312x"
- + HurtSound(0)=Sound'HPSounds.Har_Emotes.ouch1'
- + HurtSound(1)=Sound'HPSounds.Har_Emotes.ouch2'
- + HurtSound(2)=Sound'HPSounds.Har_Emotes.ouch3'
- + HurtSound(3)=Sound'HPSounds.Har_Emotes.ouch4'
- + HurtSound(4)=Sound'HPSounds.Har_Emotes.ouch5'
- + HurtSound(5)=Sound'HPSounds.Har_Emotes.ouch6'
- + HurtSound(6)=Sound'HPSounds.Har_Emotes.ouch7'
- + HurtSound(7)=Sound'HPSounds.Har_Emotes.ouch8'
- + HurtSound(8)=Sound'HPSounds.Har_Emotes.ouch9'
- + HurtSound(9)=Sound'HPSounds.Har_Emotes.ouch10'
- + HurtSound(10)=Sound'HPSounds.Har_Emotes.ouch11'
- + HurtSound(11)=Sound'HPSounds.Har_Emotes.ouch12'
- + HurtSound(12)=Sound'HPSounds.Har_Emotes.ouch13'
- + HurtSound(13)=Sound'HPSounds.Har_Emotes.oof1'
- + HurtSound(14)=Sound'HPSounds.Har_Emotes.oof2'
- + GroundSpeed=200
- + AirSpeed=400
- + AccelRate=1024
- + JumpZ=245
- + MaxMountHeight=96.5
- + AirControl=0.25
- + BaseEyeHeight=40.75
- + EyeHeight=40.75
- + MenuName="Harry"
- + DrawType=DT_Mesh
- + Mesh=SkeletalMesh'HarryPotter.skharryMesh'
- + CollisionRadius=15
- + CollisionHeight=42
- + Mass=1
- + Buoyancy=118.8
- + RotationRate=(Pitch=20000,Yaw=70000,Roll=3072) //added the rotation rate in the default props -AdamJD
- +}
- \ No newline at end of file
- diff --git a/Hub2/Classes/BroomDraco.uc b/Hub2/Classes/BroomDraco.uc
- index b27e725..e0148b1 100644
- --- a/Hub2/Classes/BroomDraco.uc
- +++ b/Hub2/Classes/BroomDraco.uc
- @@ -3,6 +3,8 @@
- //=============================================================================
- class BroomDraco extends QuidPlayer;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var GameReferee Referee; // Object in charge of the rules of the current mini-game
- var BroomHarry Harry;
- @@ -78,7 +80,7 @@ function Touch( Actor Other)
- {
- // Just stumble (don't damage, like what a QuidPlayer would do) and count bumps
- - if ( !bHit && Other == Harry && Bumps < BumpsToWin-1 )
- + if ( !bHit && Other == Harry && Bumps < BumpsToWin/*-1*/ ) //makes sure Dracos health goes to 0 -AdamJD
- {
- bHit = true;
- PlayAnim( 'Bumped' );
- @@ -86,7 +88,7 @@ function Touch( Actor Other)
- PlaySound( BumpEmoteSounds[ Rand( NUM_BUMP_EMOTES ) ], SLOT_Talk, , , 2000.0 ); // Radius makes sure he can be heard
- ++Bumps;
- - if ( Bumps >= BumpsToWin-1 )
- + if ( Bumps >= BumpsToWin/*-1*/ ) //makes sure Dracos health goes to 0 -AdamJD
- Referee.Trigger( Self, None ); // Tell referee that Draco almost gives up
- Velocity = vect(0,0,1);
- diff --git a/Hub2/Classes/QuidditchReferee.uc b/Hub2/Classes/QuidditchReferee.uc
- index 1e34d72..f6550dc 100644
- --- a/Hub2/Classes/QuidditchReferee.uc
- +++ b/Hub2/Classes/QuidditchReferee.uc
- @@ -3,6 +3,8 @@
- //=============================================================================
- class QuidditchReferee extends GameReferee;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var BroomHarry Harry;
- var QuidPlayer Seeker; // Opponent team's seeker
- var Snitch Snitch;
- @@ -797,26 +799,29 @@ state GameCatch
- PlayerHarry.ClientMessage( "Entered GameCatch State" );
- Log( "Entered GameCatch State" );
- -
- - CatchTriesLeft = SnitchMaxCatchTries;
- - SetTimer( 10.0, false ); // Watchdog timer in case Harry never reaches ground
- +
- + //not needed -AdamJD
- + // CatchTriesLeft = SnitchMaxCatchTries;
- + // SetTimer( 10.0, false ); // Watchdog timer in case Harry never reaches ground
- // Make Harry trail the snitch
- - Harry.GotoState( 'Pursue' );
- + // Harry.GotoState( 'Pursue' ); //not needed -AdamJD
- + Harry.GotoState( 'Catching' ); //the pursue state is bugged with the new code so go straight to catching the snitch -AdamJD
- // Make bludgers stop seeking Harry
- foreach AllActors( class'Bludger', Bludger )
- Bludger.SeekTarget( None );
- + //not needed -AdamJD
- // Switch to catch-the-snitch hud element
- - QuidHud( Harry.MyHud ).PlayHUDGame(true);
- - QuidHud( Harry.MyHud ).SetHUDGameType(HUDG_QUIDDITCH);
- -
- - Harry.cam.gotostate('LockAroundHarry');
- - Harry.cam.CameraDistance = 200.000;
- - Harry.cam.TargetRot = rot(5000, 5000, 0);
- + // QuidHud( Harry.MyHud ).PlayHUDGame(true);
- + // QuidHud( Harry.MyHud ).SetHUDGameType(HUDG_QUIDDITCH);
- +
- + // Harry.cam.gotostate('LockAroundHarry');
- + // Harry.cam.CameraDistance = 200.000;
- + // Harry.cam.TargetRot = rot(5000, 5000, 0);
- }
- -
- +
- function Tick( float DeltaTime )
- {
- local TeamAffiliation eTeam;
- @@ -844,7 +849,9 @@ state GameCatch
- fTimeToCheer = Level.TimeSeconds + 8.0 + 3.0*FRand();
- }
- }
- -
- +
- + //not needed -AdamJD
- + /*
- function OnActionKeyPressed()
- {
- // Called when the player's "Action" key/button is pressed.
- @@ -852,7 +859,7 @@ state GameCatch
- // Determine if snitch is caught; if so, goto Won state; otherwise
- // either wait for a few more tries, or return to regular game play
- - if ( QuidHud( Harry.MyHud ).HUDGameGrab() /*Snitch caught*/ )
- + if ( QuidHud( Harry.MyHud ).HUDGameGrab() ) //snitch caught
- {
- // Caught the Snitch! Put snitch in harry's hand
- if ( PlayMechanic == PM_ProximityWithHoops )
- @@ -863,7 +870,7 @@ state GameCatch
- QuidHud(Harry.myHUD).DestroyPopup();
- - // Tell seeker to stop looking for the Snitch
- + Tell seeker to stop looking for the Snitch
- if ( Seeker != None )
- Seeker.SetLookForTarget( None );
- @@ -874,7 +881,7 @@ state GameCatch
- --CatchTriesLeft;
- if ( CatchTriesLeft <= 0 )
- {
- - // Turn off hud progress element
- + Turn off hud progress element
- QuidHud( Harry.MyHud ).PlayHUDGame(false);
- QuidHud(Harry.myHUD).DestroyPopup();
- Harry.cam.gotostate('QuidditchState');
- @@ -883,8 +890,10 @@ state GameCatch
- GotoState( 'GamePlay' );
- }
- }
- - }
- -
- + }*/
- +
- + //not needed -AdamJD
- + /*
- function Timer()
- {
- // Never actioned on the snitch; go back to regular gameplay
- @@ -892,11 +901,11 @@ state GameCatch
- // Turn off hud progress element
- QuidHud( Harry.MyHud ).PlayHUDGame(false);
- QuidHud(Harry.myHUD).DestroyPopup();
- - Harry.cam.gotostate('QuidditchState');
- + Harry.cam.gotostate('QuidditchState'); //not needed -AdamJD
- Harry.GotoState( 'PlayerWalking' );
- GotoState( 'GamePlay' );
- - }
- + }*/
- function EndState()
- {
- @@ -907,6 +916,19 @@ state GameCatch
- Harry.StopFlyingOnPath();
- fProgressPercent = 75.0;
- }
- +
- + //code copied from OnActionKeyPressed function to make Harry catch the snitch -AdamJD
- + Begin:
- + Snitch.HoopTrail.GotoState( 'TrailOff' );
- + Snitch.StopFlyingOnPath();
- + Harry.CatchTarget( Snitch, 'IPHarry_Win' );
- + Snitch.Halo.bHidden = true;
- +
- + // Tell seeker to stop looking for the Snitch
- + if ( Seeker != None )
- + Seeker.SetLookForTarget( None );
- +
- + GotoState( 'GameWon' );
- }
- state GameWon
- @@ -952,10 +974,11 @@ Begin:
- Commentator.SayComment( QC_SigningOff );
- Sleep( Commentator.TimeLeftUntilSafeToSayAComment( true ) );
- }
- - else
- - {
- - Sleep( 12.0 );
- - }
- + //not needed- AdamJD
- + // else
- + // {
- + // Sleep( 12.0 );
- + // }
- if ( bLeagueMode )
- {
- diff --git a/Hub2/Classes/RemembrallReferee.uc b/Hub2/Classes/RemembrallReferee.uc
- index 195905a..66cc04b 100644
- --- a/Hub2/Classes/RemembrallReferee.uc
- +++ b/Hub2/Classes/RemembrallReferee.uc
- @@ -3,6 +3,8 @@
- //=============================================================================
- class RemembrallReferee extends GameReferee;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var BroomHarry Harry;
- var BroomDraco Draco;
- @@ -240,7 +242,8 @@ state GamePlay
- // bump away from giving up
- if ( Other == Draco )
- {
- - GotoState( 'GameBump' );
- + // GotoState( 'GameBump' ); //not needed -AdamJD
- + GotoState( 'GameWon' ); // state GameBump is bugged with the new code so go staight to GameWon -AdamJD
- }
- else
- {
- @@ -269,6 +272,8 @@ begin:
- state GameBump
- {
- + //not needed -AdamJD
- + /*
- function BeginState()
- {
- // Start chasing Draco
- @@ -315,14 +320,15 @@ state GameBump
- if ( Other == Draco )
- {
- // Turn off hud bump element and reset camera
- -
- + Draco.OnBroomBump( Harry );
- + QuidHUD(playerHarry.myHUD).DestroyPopup();
- // Make Draco throw Remembrall to Harry
- Harry.SetLookForTarget( None );
- GotoState( 'GameWon' );
- }
- else
- {
- - // Unexpected trigger event
- + Unexpected trigger event
- Super.Trigger( Other, EventInstigator );
- }
- }
- @@ -330,7 +336,7 @@ state GameBump
- function Timer()
- {
- // Never actioned on Draco; go back to regular gameplay
- -
- +
- // Turn off hud bump element and reset camera
- Harry.cam.gotostate('QuidditchState');
- Harry.StandardTarget.TargetOffset = vect(100, 0 ,50);
- @@ -347,14 +353,19 @@ state GameBump
- Log( "Exited GameBump State" );
- SetTimer( 0.0, false );
- - Harry.StopFlyingOnPath();
- - --Draco.Bumps;
- + Harry.StopFlyingOnPath();
- + // --Draco.Bumps;
- }
- + */
- }
- state GameWon
- {
- Begin:
- + Draco.OnBroomBump( Harry ); //Bump Draco -AdamJD
- + Harry.SetLookForTarget( None ); //Harry now looks for no target -AdamJD
- + Draco.GotoState('SpinOut'); //play Dracos spin out anim -AdamJD
- + Sleep(2); //this is needed to make sure Draco appears in the beaten cutscene -AdamJD
- // Go to Win cutscene
- Harry.BossTarget = none;
- TriggerEvent( 'Win', self, None );
- diff --git a/Hub3/Classes/BathroomTroll.uc b/Hub3/Classes/BathroomTroll.uc
- index 19cace8..bc28d0a 100644
- --- a/Hub3/Classes/BathroomTroll.uc
- +++ b/Hub3/Classes/BathroomTroll.uc
- @@ -1,5 +1,7 @@
- class BathroomTroll expands BaseTroll;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- var float TimeRemaining;
- var BaseToiletObject ThrownObject;
- @@ -27,10 +29,10 @@ auto state Initial
- function beginstate()
- {
- - //foreach AllActors(class'baseharry', playerHarry)
- - //{
- - // break;
- - //}
- + // foreach AllActors(class'baseharry', playerHarry)
- + // {
- + // break;
- + // }
- foreach AllActors(class'BathroomRon', CastingRon)
- {
- @@ -40,7 +42,7 @@ auto state Initial
- //Temp set up for this test
- // basewand(playerHarry.weapon).addspell(class'spellflip');
- playerHarry.bosstarget = self;
- -// playerHarry.cam.gotostate('bossstate');
- + //playerHarry.cam.gotostate('bossstate');
- loopanim('breathe');
- // gotostate('combat');
- @@ -155,10 +157,11 @@ state Combat
- if (animframe > 0.6 && bThrowing)
- {
- - if( FRand() < 0.8 )
- + //casting at objects thrown at Ron is bugged for the new Harry code so I've made all the objects go towards Harry -AdamJD
- + // if( FRand() < 0.8 )
- ThrownObject.ThrowObject(playerHarry);
- - else
- - ThrownObject.ThrowObject(CastingRon);
- + // else
- + // ThrownObject.ThrowObject(CastingRon);
- // PlaySound(sound'HPSounds.Hub1_sfx.peeves_Throws', SLOT_None, [Volume]RandRange(0.8, 1.0), [Radius]100000, [Pitch]RandRange(0.9, 1.1) ); //break;
- switch( Rand(3) )
- diff --git a/Hub4/Classes/BaseSneakActor.uc b/Hub4/Classes/BaseSneakActor.uc
- index c530dcf..e7ae319 100644
- --- a/Hub4/Classes/BaseSneakActor.uc
- +++ b/Hub4/Classes/BaseSneakActor.uc
- @@ -4,6 +4,8 @@
- class BaseSneakActor extends baseChar;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- // These are so we can keep track of the running speed and animations, since these characters vary between
- // walking and running pretty often...
- var int OldGroundspeed; // The Original Walk Speed
- @@ -233,11 +235,13 @@ function FindHarryTick(float DeltaTime)
- if(playerHarry.Opacity >= 0.8)
- {
- playerHarry.clientMessage("BaseSneakActor went to state RunLocation");
- - gotostate('RunLocation');
- + //gotostate('RunLocation'); //old retail code -AdamJD
- + gotostate('Caught'); //make Harry caught if Filch sees him when visible instead of running towards him -AdamJD
- }
- }
- - if (playerHarry.IsInState('playeraiming')) // Must be casting a spell
- + //if (playerHarry.IsInState('playeraiming')) // Must be casting a spell //old not needed retail PlayerAiming state -AdamJD
- + if (InvisHarry.bPlayerCasting) //is InvisibleHarry casting? -AdamJD
- {
- if(cansee(playerHarry))
- {
- @@ -252,7 +256,7 @@ function FindHarryTick(float DeltaTime)
- foreach allActors(class'InvisibleHarry', InvisHarry)
- {
- - if( InvisHarry.bIsPlayer&& InvisHarry!=Self)
- + if( InvisHarry.bIsPlayer && InvisHarry!=Self)
- {
- // We can only hear him if he's moving
- if(InvisHarry.IsMoving)
- @@ -482,6 +486,7 @@ state RunLocation
- }
- Begin:
- +
- // Make the Run Speed Really Fast
- groundspeed = RunningSpeed;
- diff --git a/Hub4/Classes/InvisibleHarry.uc b/Hub4/Classes/InvisibleHarry.uc
- index 1297375..6ff2c9a 100644
- --- a/Hub4/Classes/InvisibleHarry.uc
- +++ b/Hub4/Classes/InvisibleHarry.uc
- @@ -5,6 +5,8 @@
- class InvisibleHarry extends Harry;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- +
- // Make this setable in the Editor so we can tweak it...
- var () float InvisibleValue;
- var Texture HitTexture; // This is global to the class here so we can check it from Filch & Norris
- @@ -87,9 +89,12 @@ function MakeVisible(float DeltaTime)
- function OverrideTick(float DeltaTime)
- {
- + local bool isDebugged;
- +
- // This lets us know that, in fact, this function is not called all the time...
- -
- - if(!IsInState('playeraiming'))
- +
- + //if(!IsInState('playeraiming')) //old not needed retail PlayerAiming state -AdamJD
- + if(!bPlayerCasting) //is player not casting? -AdamJD
- {
- if(bHasCloak)
- MakeInvisible(DeltaTime);
- @@ -100,23 +105,40 @@ function OverrideTick(float DeltaTime)
- {
- MakeVisible(DeltaTime);
- }
- -
- +
- + //old retail code -AdamJD
- + /*
- // Now signal for Movement
- if(VSize (LastLocation - location) > FlagMovementRadius)
- {
- - // ***************** Diagnostics
- - //if(!IsMoving)
- - // clientmessage("Harry Started Moving.");
- + //Diagnostics
- + if(!IsMoving)
- + clientmessage("Harry Started Moving.");
- IsMoving = true;
- }
- else
- {
- - // ***************** Diagnostics
- - //if(IsMoving)
- - // clientmessage("Harry Stopped Moving.");
- + //Diagnostics
- + if(IsMoving)
- + clientmessage("Harry Stopped Moving.");
- IsMoving = false;
- }
- -
- + */
- +
- + //Player is not touching a movement key or is in a cutscene -AdamJD
- + if( Acceleration == vect(0,0,0) )
- + {
- + IsMoving = false;
- + //ClientMessage("Harry not moving"); //for testing -AdamJD
- + }
- +
- + //Player has touched a movement key so therefore Harry is now moving -AdamJD
- + else
- + {
- + IsMoving = true;
- + //ClientMessage("Harry is moving"); //for testing -AdamJD
- + }
- +
- LastLocation = location;
- }
- @@ -195,6 +217,18 @@ state harryfrozen
- Super.PlayerTick(DeltaTime);
- OverrideTick(DeltaTime);
- +
- + //stop casting and turn off cursor if caught -AdamJD
- + if(bPlayerCasting == true)
- + {
- + bPlayerCasting = false;
- + StopCasting();
- + baseWand(weapon).bPointing = false;
- + basewand(weapon).bCasting=false;
- + baseWand(Weapon).WandEffect.bHidden = true;
- + rectarget.destroy();
- + StopSoundFX();
- + }
- }
- function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
- @@ -218,7 +252,7 @@ state harryfrozen
- bPressedJump = false;
- }
- - if ( (Physics == PHYS_Walking) )
- + if ( (Physics == PHYS_Walking) )
- {
- loopanim('caughtbyfilch');
- }
- @@ -299,6 +333,8 @@ state Mounting
- }
- }
- +//old not needed retail PlayerAiming state -AdamJD
- +/*
- state playeraiming
- {
- event PlayerTick(float DeltaTime)
- @@ -308,7 +344,7 @@ state playeraiming
- Super.PlayerTick(DeltaTime);
- }
- }
- -
- +*/
- state PlayerWalking
- {
- @@ -317,6 +353,12 @@ state PlayerWalking
- Super.PlayerTick(DeltaTime);
- OverrideTick(DeltaTime);
- +
- + //if player is casting then make Harry visible -AdamJD
- + if (bPlayerCasting == true)
- + {
- + MakeVisible(DeltaTime);
- + }
- }
- }
- diff --git a/Hub5/Classes/FlyingKeyReferee.uc b/Hub5/Classes/FlyingKeyReferee.uc
- index 43f6949..faecf6c 100644
- --- a/Hub5/Classes/FlyingKeyReferee.uc
- +++ b/Hub5/Classes/FlyingKeyReferee.uc
- @@ -3,6 +3,7 @@
- //=============================================================================
- class FlyingKeyReferee extends QuidditchReferee;
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- //-------------------------------------------------------------------------------------------
- // PostBeginPlay()
- @@ -61,6 +62,10 @@ Begin:
- // Go to Win cutscene
- Sleep( 3.0 );
- TriggerEvent( 'Win', self, None );
- + //makes broomHarry and snitch invisible during the end cutscene -AdamJD
- + Sleep(2);
- + Harry.bHidden = true;
- + Snitch.bHidden = true;
- loop:
- Sleep( 0.1 );
- @@ -94,6 +99,18 @@ state GameCatch
- super.BeginState();
- QuidHud( Harry.MyHud ).SetHUDGameType(HUDG_FLYINGKEYS);
- }
- +
- + //go back to chasing the key if the player didn't get the key in Harrys hand -AdamJD
- + function Timer()
- + {
- + super.Timer();
- + }
- +
- + //go back to chasing the key if the player didn't get the key in Harrys hand -AdamJD
- + function EndState()
- + {
- + super.EndState();
- + }
- }
- defaultproperties
- diff --git a/Tut1/Classes/tut1Peeves.uc b/Tut1/Classes/tut1Peeves.uc
- index 29e084a..097f824 100644
- --- a/Tut1/Classes/tut1Peeves.uc
- +++ b/Tut1/Classes/tut1Peeves.uc
- @@ -1,6 +1,6 @@
- class tut1Peeves expands peeves;
- -
- +//Edited by- AdamJD (edited code will have AdamJD by it)
- var float hitCount;
- var sound peevesVoice;
- @@ -239,7 +239,7 @@ begin:
- findcam();
- Opacity=1;
- hugcamera=true;
- - pcam.gotostate('cutstate');
- + //pcam.gotostate('cutstate'); //the camera locks when hitting Peeves in the new camera code so I've turned this off -AdamJD
- SetPhysics(PHYS_rotating);
- // PlaySound(sound 'HPSounds.peeves_sfx.pee_009', SLOT_Talk, 3.2, false, 2000.0, 1.0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement