Advertisement
Guest User

Untitled

a guest
Jan 14th, 2020
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 182.83 KB | None | 0 0
  1. diff --git a/HPBase/Classes/BaseCam.uc b/HPBase/Classes/BaseCam.uc
  2. index 61b55b9..2c4755e 100644
  3. --- a/HPBase/Classes/BaseCam.uc
  4. +++ b/HPBase/Classes/BaseCam.uc
  5. @@ -2,6 +2,32 @@
  6. //________________________________________________________________________________________
  7. class BaseCam extends Pawn;
  8.  
  9. +//Edited by- AdamJD (edited code will have AdamJD by it)
  10. +
  11. +// Enumeration of camera types, some of these are not currently used
  12. +enum ECameraType
  13. +{
  14. + CAM_Standard,
  15. + CAM_Quiditch,
  16. + CAM_Far,
  17. +// CAM_Combat,
  18. + CAM_Boss,
  19. + CAM_High,
  20. + CAM_Reverse,
  21. +// CAM_Fixed,
  22. +// CAM_Rotate,
  23. +// CAM_Free,
  24. + CAM_FreeCam,
  25. + CAM_Cut,
  26. + CAM_TrollChase,
  27. + CAM_Patrol,
  28. + CAM_TopDown,
  29. + CAM_Test,
  30. + CAM_Test2,
  31. + CAM_Test3,
  32. + CAM_LockAroundHarry,
  33. +};
  34. +
  35. var vector TrackingPoint; //vector to the player
  36. var baseharry p; // the pawn the camera is tracking
  37. var rotator lastRot; // what the last rotation was
  38. @@ -98,30 +124,6 @@ var float fShakeDuration;
  39. var float fStartShakeDuration;
  40. var float fShakeMagnitude;
  41.  
  42. -// Enumeration of camera types, some of these are not currently used
  43. -enum ECameraType
  44. -{
  45. - CAM_Standard,
  46. - CAM_Quiditch,
  47. - CAM_Far,
  48. -// CAM_Combat,
  49. - CAM_Boss,
  50. - CAM_High,
  51. - CAM_Reverse,
  52. -// CAM_Fixed,
  53. -// CAM_Rotate,
  54. -// CAM_Free,
  55. - CAM_FreeCam,
  56. - CAM_Cut,
  57. - CAM_TrollChase,
  58. - CAM_Patrol,
  59. - CAM_TopDown,
  60. - CAM_Test,
  61. - CAM_Test2,
  62. - CAM_Test3,
  63. - CAM_LockAroundHarry,
  64. -};
  65. -
  66. var(camera) ECameraType CameraType;
  67.  
  68. // Used to save and restore states
  69. @@ -154,11 +156,152 @@ var NavigationPoint tempNavP, LastNavP;
  70.  
  71. var float NormalCameraSpeed; //used by SetCameraSpeed to set the speed as a fraction of full speed.
  72. var rotator NormalCameraRotSpeed; // ""
  73. +
  74. +
  75. +//AdamJD vars
  76. +// var float rotvalX; //old -AdamJD
  77. +// var float rotvalY; //old -AdamJD
  78. +
  79. +var Target rectarget;
  80. +
  81. +//mouse data (comments copied from HP2 proto)
  82. +var float fMouseDeltaX; // saved mouse deltaX and deltaY playerHarry
  83. +var float fMouseDeltaY;
  84. +
  85. +var bool bSyncRotationWithTarget; // Sync our curr rotation to always face target
  86. +var bool bSyncPositionWithTarget; // Sync cam position with CamTarget's position at a fixed distance
  87. +
  88. +var CamTarget camTarget; // camera's target (seperate pawn so we can use flyto interpolation )
  89. +var vector vForward; // The forward vector (for refrence outside the camera)
  90. +var rotator rRotationStep; // Rotation Step ( rotation step will be applied over time)
  91. +
  92. +var rotator rDestRotation; // Rotation Destination
  93. +var vector vDestPosition; // Position Destination
  94. +var rotator rCurrRotation; // Rotation Current
  95. +var vector vCurrPosition; // Position Current
  96. +
  97. +var float fCurrLookAtDistance; // Current LookAt Distance will change
  98. +var float fMoveBackTightness; // Current MoveBack tightness (used when camera moves back from hitting a wall or a bBlockCamera actor )
  99. +
  100. +var float fCurrentMinPitch; // Current Min pitch the camera can have
  101. +var float fCurrentMaxPitch; // Current Max pitch the camera can have
  102. +
  103. +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
  104. + // added to rDestRotation. Gives player ability to 'aim' while in boss cam.
  105. +var rotator rExtraRotation; // An additional rotation which can be added to the final rotation, say, for camera shake. Is zero'd every tick.
  106. +
  107. +//standard cam specific (comments copied from HP2 proto)
  108. +var rotator rSavedRotation; // saved when you leave standard mode and reloaded when you come back
  109. +var vector vSavedPosition; // saved when you leave standard mode and reloaded when you come back
  110. +var float fPitchMovingInThreshold; // set by the constant PITCH_MOVING_IN_THRESHOLD
  111. +var float fPitchMovingInSpread; // set by the constant PITCH_MOVING_IN_SPREAD
  112. +var float fDistanceScalar; // obtained by comparing the current pitch with the spread (once you attain the threshold)
  113. +var float fDistanceScalarMin; // min for fDistanceScalar. around 0.15. set by DISTANCE_SCALAR_MIN
  114. +var vector vLookAtOffset; // Current Offset applyed to our lookAt point
  115. +var float fLookAtDistance; // How far away from the lookAt point is the camera?
  116. +var float fRotTightness; // The higher the tighness the faster our curLocation == targetLocation
  117. +var float fRotSpeed; // How fast are we (per sec) at moving.
  118. +var float fMoveTightness; // The higher the tighness the faster our curRotation == targetRotation
  119. +var float fMoveSpeed; // How fast are we (per sec) at rotating.
  120. +
  121. +//mouseDelta min and max constants (comments copied from HP2 proto)
  122. +const MIN_MOUSE_DELTA_X = -20000.0f;
  123. +const MAX_MOUSE_DELTA_X = 20000.0f;
  124. +const MIN_MOUSE_DELTA_Y = -10000.0f;
  125. +const MAX_MOUSE_DELTA_Y = 10000.0f;
  126. +
  127. +//standard cam pitch/moving in constants (comments copied from HP2 proto)
  128. +const PITCH_MOVING_IN_THRESHOLD = 0.0f;
  129. +const PITCH_MOVING_IN_SPREAD = 10000.0f;
  130. +const DISTANCE_SCALAR_MIN = 0.15;
  131. +
  132. +
  133. /*------------------------------------------------------*/
  134. /* LOCAL FUNCTIONS */
  135. /*------------------------------------------------------*/
  136. +//AdamJD
  137. +function PreBeginPlay()
  138. +{
  139. + SetCollision(false, false, false);
  140. + bCollideWorld = false;
  141. +
  142. + fPitchMovingInThreshold = PITCH_MOVING_IN_THRESHOLD;
  143. + fPitchMovingInSpread = PITCH_MOVING_IN_SPREAD;
  144. + fDistanceScalarMin = DISTANCE_SCALAR_MIN;
  145. +}
  146. +
  147. +//AdamJD
  148. +function PostBeginPlay()
  149. +{
  150. + local int count;
  151. + local vector tloc;
  152. + local vector targetoffset;
  153. +
  154. + Super.PostBeginPlay();
  155. +
  156. + foreach AllActors(class'baseharry', p)
  157. + {
  158. + break;
  159. + }
  160. +
  161. + foreach AllActors(class'Target', rectarget)
  162. + {
  163. + break;
  164. + }
  165. +
  166. + if( camTarget == None )
  167. + camTarget = spawn( class'CamTarget' );
  168. +
  169. + SetOwner( camTarget );
  170. + camTarget.Cam = self;
  171. +
  172. + rectarget.victim.eVulnerableToSpell=SPELL_None;
  173. +
  174. + //old code by me -AdamJD
  175. + // p.cam=self;
  176. + // camTarget.vOffset.x= p.SmoothMouseX;
  177. + // camTarget.vOffset.y= p.SmoothMouseY;
  178. + // camTarget.vOffset.z= 0;
  179. + // camTarget.aAttachedTo.IsA('baseHarry');
  180. +
  181. + //org retail code -AdamJD
  182. + CameraDistance=80.000000;
  183. + CameraHeight=120.000000;
  184. + CameraSpeed=2.000000;
  185. + NormalCameraSpeed=CameraSpeed;
  186. +
  187. + CameraRotSpeed=10.000000;
  188. + NormalCameraRotSpeed=RotationRate;
  189. +
  190. + RealCameraDistance = CameraDistance;
  191. + CanSeeCountdown = 4;
  192. +
  193. + SetCutCameraProx(NORMAL_PROXIMITY);
  194. +
  195. + count=0;
  196. + StackPointer = 0;
  197. +
  198. + while(count<16)
  199. + {
  200. + previousLocations[count] = vect(0, 0, 0);
  201. + count+=1;
  202. + }
  203. + currentLocation=0;
  204. +
  205. + bUseStrafing = true;
  206. + bUseBattleCam = false;
  207. +
  208. + HarrysPreviousPosition = vect(0, 0, 0);
  209. +
  210. + //@PAB
  211. + trackingDistance=cameraDistance/20;
  212. + setPhysics(PHYS_Rotating);
  213. +
  214. + SetCamera();
  215. +}
  216.  
  217. -function PostBeginPlayIP()
  218. +//old retail PostBeginPlay -AdamJD
  219. +/*function PostBeginPlayIP()
  220. {
  221. local int count;
  222.  
  223. @@ -196,7 +339,7 @@ function PostBeginPlayIP()
  224. //@PAB
  225. trackingDistance=cameraDistance/20;
  226. // trackingDistance=cameraDistance/10;
  227. - setPhysics(PHYS_Rotating);
  228. + setPhysics(PHYS_Rotating);*/
  229.  
  230. /* CamAimOffset[0] = vect(0, 50, -45);
  231. CamAimOffset[1] = vect(0, -50, -45);
  232. @@ -216,7 +359,8 @@ function PostBeginPlayIP()
  233. BattleCamAimOffset[3] = vect(0, -25, 50);
  234. BattleCamAimOffset[4] = vect(0, -50, 50);
  235. */
  236. - CamAimOffset[0] = vect(0, 0, 0);
  237. +
  238. +/* CamAimOffset[0] = vect(0, 0, 0);
  239. CamAimOffset[1] = vect(0, 0, 0);
  240. CamAimOffset[2] = vect(0, 0, 0);
  241. CamAimOffset[3] = vect(0, 0, 0);
  242. @@ -249,7 +393,7 @@ function PostBeginPlayIP()
  243. bShake = false;
  244. p.BossTarget = none;
  245. SetCamera();
  246. -}
  247. +}*/
  248.  
  249. function SetCameraSpeed(float Speed)
  250. {
  251. @@ -925,7 +1069,7 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
  252.  
  253. for (TestCamera = 0; TestCamera < 6 && !bFoundGoodCamera; TestCamera++)
  254. {
  255. - if(p.IsInState('playeraiming') && bUseTargetingCamera)
  256. + if(/*p.IsInState('playeraiming') &&*/ bUseTargetingCamera) //AdamJD
  257. {
  258. if (p.Bosstarget != none || bUseBattleCam)
  259. {
  260. @@ -999,8 +1143,8 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
  261.  
  262. goalpoint = CheckPosition(goalPoint);
  263.  
  264. - if (p.IsInState('playeraiming'))
  265. - {
  266. + // if (p.IsInState('playeraiming')) //AdamJD
  267. + // {
  268. // @PAB we need to find a good camera angle
  269.  
  270. if (!CanSeeTarget(goalPoint) && TestCamera != 5) // Don't increment last camera
  271. @@ -1016,17 +1160,18 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
  272. bFoundGoodCamera = true;
  273. }
  274. }
  275. - else
  276. - {
  277. - CanSeeCountdown = 1.5;
  278. - bFoundGoodCamera = true;
  279. - }
  280. - }
  281. - else
  282. - {
  283. + //AdamJD
  284. + // else
  285. + // {
  286. + // CanSeeCountdown = 1.5;
  287. + // bFoundGoodCamera = true;
  288. + // }
  289. + //}
  290. + // else //AdamJD
  291. + // {
  292. CanSeeCountdown = 1.5;
  293. bFoundGoodCamera = true;
  294. - }
  295. + //}
  296. }
  297.  
  298. if (vsize(goalpoint - p.location) < 50)
  299. @@ -1051,8 +1196,8 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
  300. }
  301. }
  302. */
  303. - if (p.IsInState('playeraiming'))
  304. - {
  305. + // if (p.IsInState('playeraiming')) //AdamJD
  306. + // {
  307. if (vsize(trackingpoint) > 50)
  308. {
  309. trackingpoint = (vsize(trackingpoint) - 50) * normal(trackingpoint);
  310. @@ -1087,7 +1232,7 @@ function GeneralStationaryModeCamera(float deltatime, optional bool bMoveQuick)
  311. MoveSmooth(trackingPoint);
  312. }
  313. }
  314. - }
  315. + //}
  316. else
  317. {
  318. if (bMoveQuick || bShake)
  319. @@ -1709,15 +1854,15 @@ function PositionCamera(float DeltaTime)
  320. locRot.pitch = camPitch;
  321. smoothRotate(p.ViewRotation, locRot, deltatime);
  322.  
  323. - if(p.IsInState('playeraiming'))
  324. - {
  325. - cameraLock = true;
  326. + // if(p.IsInState('playeraiming')) //AdamJD
  327. + // {
  328. + // cameraLock = true; //AdamJD
  329. if (!bWasAiming)
  330. {
  331. bWasAiming = true;
  332. NextTargetCam();
  333. }
  334. - }
  335. + //}
  336. else
  337. {
  338. bWasAiming = false;
  339. @@ -1795,15 +1940,15 @@ function PositionCamera(float DeltaTime)
  340. locRot.pitch = camPitch;
  341. smoothRotate(p.ViewRotation, locRot, deltatime);
  342.  
  343. - if(p.IsInState('playeraiming'))
  344. - {
  345. - cameraLock = true;
  346. + // if(p.IsInState('playeraiming')) //AdamJD
  347. + // {
  348. + // cameraLock = true; //AdamJD
  349. if (!bWasAiming)
  350. {
  351. bWasAiming = true;
  352. NextTargetCam();
  353. }
  354. - }
  355. + //}
  356. else
  357. {
  358. bWasAiming = false;
  359. @@ -1897,15 +2042,15 @@ function PositionCamera(float DeltaTime)
  360. locRot.pitch = camPitch;
  361. smoothRotate(p.ViewRotation, locRot, deltatime);
  362.  
  363. - if(p.IsInState('playeraiming'))
  364. - {
  365. - cameraLock = true;
  366. + // if(p.IsInState('playeraiming')) //AdamJD
  367. + // {
  368. + // cameraLock = true; //AdamJD
  369. if (!bWasAiming)
  370. {
  371. bWasAiming = true;
  372. NextTargetCam();
  373. }
  374. - }
  375. + //}
  376. else
  377. {
  378. bWasAiming = false;
  379. @@ -2000,15 +2145,15 @@ function PositionCamera(float DeltaTime)
  380. locRot.pitch = camPitch;
  381. smoothRotate(p.ViewRotation, locRot, deltatime);
  382.  
  383. - if(p.IsInState('playeraiming'))
  384. - {
  385. - cameraLock = true;
  386. + // if(p.IsInState('playeraiming')) //AdamJD
  387. + // {
  388. + //cameraLock = true; //AdamJD
  389. if (!bWasAiming)
  390. {
  391. bWasAiming = true;
  392. NextTargetCam();
  393. }
  394. - }
  395. + //}
  396. else
  397. {
  398. bWasAiming = false;
  399. @@ -2044,20 +2189,137 @@ function PositionCamera(float DeltaTime)
  400. goto 'loop';
  401. }
  402.  
  403. +//rotation function for the boss cam because the standard rotation is bugged for boss fights -AdamJD
  404. +function UpdateRotationForBoss( float fTimeDelta )
  405. +{
  406. + local float fTravelScalar;
  407. + local vector vDestRotation;
  408. + local vector vCurrRotation;
  409. +
  410. + vDestRotation = normal(vector(rDestRotation));
  411. + vCurrRotation = vForward;
  412. +
  413. + //update Rotation
  414. + if( bSyncRotationWithTarget )
  415. + {
  416. + //always face CamTarget
  417. + vDestRotation = CamTarget.location - location;
  418. + vCurrRotation = vDestRotation;
  419. + }
  420. +
  421. + else
  422. + {
  423. + //clamp travel scalar
  424. + if( fRotTightness > 0.0f )
  425. + {
  426. + fTravelScalar = FMin( 1.0f, fRotTightness * fTimeDelta );
  427. + }
  428. +
  429. + else
  430. + {
  431. + fTravelScalar = 1.0f;
  432. + }
  433. +
  434. + vCurrRotation += ( vDestRotation - vCurrRotation ) * fTravelScalar;
  435. + }
  436. +
  437. + vCurrRotation = normal(vCurrRotation);
  438. + rCurrRotation = rotator(vCurrRotation);
  439. +
  440. + vForward = vCurrRotation;
  441. +
  442. + //set rotation
  443. + SetFinalRotation( rotator(vCurrRotation) );
  444. +}
  445. +
  446. /*-----------------------------------------------------*/
  447.  
  448. state BossState
  449. {
  450. ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, Died, LongFall, PainTimer;
  451. +
  452. + function BeginState()
  453. + {
  454. + CameraType = CAM_Boss;
  455. +
  456. + //not needed -AdamJD
  457. + /*
  458. + p.StandardTarget.gotostate('BossFollow');
  459. + p.StandardTarget.TargetOffset = vect(100, 0 ,50);
  460. + p.clientmessage("Camera switch to Boss state " $string(p.bosstarget.name) $" " $string(directionactor.name));
  461. + p.StandardTarget.BossCamBox = BossCamBox;
  462. + p.StandardTarget.TargetOffset = vect(100, 0 ,50);
  463. + CameraHeight = 120.000000;
  464. + CameraDistance = 80.000;
  465. + CameraAimOffsetState = vect(0, 0, 0);
  466. + */
  467. +
  468. + //AdamJD
  469. + InitSettings( true, false );
  470. + InitTarget( p );
  471. + InitPositionAndRotation( false );
  472. +
  473. + //not needed -AdamJD
  474. + // if (bUseStrafing)
  475. + // {
  476. + // p.MovementMode(true);
  477. + // }
  478. +
  479. + //not needed -AdamJD
  480. + //FT: Hack for voldemort, unless we figure out the real problem, this should work.
  481. + // if( p.BossTarget.IsA( 'BossQuirrel' ) )
  482. + // {
  483. + // p.ClientMessage("BaseCam::BossState - Setting DirectionActor to none for Voldemort battle");
  484. + // DirectionActor = none;
  485. + // }
  486. + }
  487. +
  488. + function EndState()
  489. + {
  490. + //p.MovementMode(false); //not needed -AdamJD
  491. + p.BossTarget = none;
  492. + DirectionActor = none;
  493. + p.StandardTarget.gotostate('seeking');
  494. + CameraType = CAM_Standard; //go back to standard cam -AdamJD
  495. + }
  496.  
  497.  
  498. function Tick(float DeltaTime)
  499. {
  500. + local vector v;
  501. +
  502. + ApplyMouseXToDestYaw(DeltaTime);
  503. + ApplyMouseYToDestPitch(DeltaTime);
  504. +
  505. + //update camera -AdamJD
  506. + if( baseBoss(p.BossTarget) != none )
  507. + {
  508. + v = baseBoss(p.BossTarget).GetCameraOffset();
  509. + }
  510. + else
  511. + {
  512. + v = p.BossTarget.Location;
  513. + }
  514. +
  515. + rDestRotation = rotator(normal( v - location ));
  516. + //add boss offset -AdamJD
  517. + rDestRotation += rBossRotationOffset;
  518. +
  519. + //update rotation -AdamJD
  520. + UpdateRotationForBoss( DeltaTime );
  521. +
  522. + //update position -AdamJD
  523. + UpdatePosition( DeltaTime );
  524. +
  525. if (bInSpecialPause)
  526. {
  527. + //not smooth but it does the job... -AdamJD
  528. SaveState();
  529. gotostate('FreeCamState');
  530. }
  531. +
  532. + //not needed -AdamJD
  533. + /*
  534. else
  535. {
  536. CheckForBoss();
  537. @@ -2069,8 +2331,11 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
  538.  
  539. PositionCamera(DeltaTime);
  540. }
  541. + */
  542. }
  543. -
  544. +
  545. + //not needed -AdamJD
  546. + /*
  547. function PositionCamera(float DeltaTime)
  548. {
  549. local vector goalPoint;
  550. @@ -2113,11 +2378,12 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
  551.  
  552. camDistance = CameraOffset >> locRot;
  553.  
  554. - goalPoint = TargetPoint + p.Location + camDistance;
  555. -
  556. + goalPoint = TargetPoint + p.Location + camDistance;*/
  557. +
  558. +
  559. // If we are in aiming mode, see if we need to switch target CAM
  560. - if(p.IsInState('playeraiming') && bUseTargetingCamera)
  561. - {
  562. + //if(/*p.IsInState('playeraiming') &&*/ bUseTargetingCamera)
  563. + /*{
  564. // Give the camera some variety, change cam each time the player starts aiming
  565. if (!bWasAiming)
  566. {
  567. @@ -2173,41 +2439,9 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
  568. // @PAB remove when you wish to go back to a colliding camera
  569. // bCollide = false;
  570. SetCollisionState();
  571. - }
  572. -
  573. - function EndState()
  574. - {
  575. - p.MovementMode(false);
  576. - p.BossTarget = none;
  577. - DirectionActor = none;
  578. - p.StandardTarget.gotostate('seeking');
  579. - }
  580. -
  581. - function BeginState()
  582. - {
  583. - CameraType = CAM_Boss;
  584. - p.clientmessage("Camera switch to Boss state " $string(p.bosstarget.name) $" " $string(directionactor.name));
  585. - p.StandardTarget.BossCamBox = BossCamBox;
  586. - p.StandardTarget.gotostate('BossFollow');
  587. - p.StandardTarget.TargetOffset = vect(100, 0 ,50);
  588. - CameraHeight = 120.000000;
  589. - CameraDistance = 80.000;
  590. - CameraAimOffsetState = vect(0, 0, 0);
  591. -
  592. - if (bUseStrafing)
  593. - {
  594. - p.MovementMode(true);
  595. - }
  596. -
  597. - //FT: Hack for voldemort, unless we figure out the real problem, this should work.
  598. - if( p.BossTarget.IsA( 'BossQuirrel' ) )
  599. - {
  600. - p.ClientMessage("BaseCam::BossState - Setting DirectionActor to none for Voldemort battle");
  601. - DirectionActor = none;
  602. - }
  603. - }
  604. + }*/
  605.  
  606. - begin:
  607. + //begin:
  608.  
  609. /* if (p != none)
  610. {
  611. @@ -2218,14 +2452,15 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
  612. log("Harry is invalid!");
  613. }
  614. */
  615. -
  616. - loop:
  617. - sleep (0.0005);
  618. - if(!bShake)
  619. - {
  620. - turntoward(p.StandardTarget);
  621. - }
  622. - goto 'loop';
  623. +
  624. + //not needed -AdamJD
  625. + // loop:
  626. + // sleep (0.0005);
  627. + // if(!bShake)
  628. + // {
  629. + // turntoward(p.StandardTarget);
  630. + // }
  631. + // goto 'loop';
  632. }
  633.  
  634. /*-----------------------------------------------------*/
  635. @@ -2670,7 +2905,7 @@ function PositionCamera(float DeltaTime)
  636. GroundSpeed = 320.000000;
  637. AirSpeed = 320.000000;
  638. */
  639. -
  640. + CameraType = CAM_Standard; //fixes issue where the camera locks sometimes after a cutscene -AdamJD
  641. }
  642.  
  643. function BeginState()
  644. @@ -2778,19 +3013,19 @@ function PositionCamera(float DeltaTime)
  645. // locRot.pitch = camPitch;
  646. // smoothRotate(p.ViewRotation, locRot, deltatime);
  647.  
  648. -/* if(p.IsInState('playeraiming'))
  649. - {
  650. - cameraLock = true;
  651. + // if(p.IsInState('playeraiming')) //AdamJD
  652. + // {
  653. + //cameraLock = true; //AdamJD
  654. if (!bWasAiming)
  655. {
  656. bWasAiming = true;
  657. NextTargetCam();
  658. }
  659. - }
  660. + // }
  661. else
  662. - {*/
  663. + {
  664. bWasAiming = false;
  665. -// }
  666. + }
  667.  
  668. // log("Harry " $p.location.x $" " $p.location.y $" " $p.location.z);
  669. // log("camera " $location.x $" " $location.y $" " $location.z);
  670. @@ -3039,12 +3274,26 @@ auto state() StartState
  671. {
  672. function BeginState()
  673. {
  674. - PostBeginPlayIP();
  675. - p.gotostate('playerwalking');
  676. - p.ClientMessage("Going to state" $CameraType);
  677. + //not needed -AdamJD
  678. + //PostBeginPlayIP();
  679. + // p.gotostate('playerwalking');
  680. + // p.ClientMessage("Going to state" $CameraType);
  681. }
  682.  
  683. begin:
  684. + //AdamJD
  685. + InitSettings(true, false);
  686. + InitTarget(p);
  687. + InitPositionAndRotation( true );
  688. +
  689. + CameraType = CAM_Standard;
  690. + SetCamera();
  691. +}
  692. +
  693. +//AdamJD
  694. +state StateIdle
  695. +{
  696. + //don't do anything
  697. }
  698.  
  699. state Test3state
  700. @@ -3084,15 +3333,15 @@ function PositionCamera(float DeltaTime)
  701. /* locRot.pitch = camPitch;
  702. smoothRotate(p.ViewRotation, locRot, deltatime);
  703. */
  704. - if(p.IsInState('playeraiming'))
  705. - {
  706. - cameraLock = true;
  707. + // if(p.IsInState('playeraiming')) //AdamJD
  708. + // {
  709. + //cameraLock = true; //AdamJD
  710. if (!bWasAiming)
  711. {
  712. bWasAiming = true;
  713. NextTargetCam();
  714. }
  715. - }
  716. + //}
  717. else
  718. {
  719. bWasAiming = false;
  720. @@ -3163,7 +3412,7 @@ function PositionCamera(float DeltaTime)
  721. CameraAimOffsetState = vect(0, 0, 0);
  722. // CameraOffset = vect(140, -100, 0);
  723. }
  724. -
  725. +
  726. begin:
  727. loop:
  728. sleep (0.0005);
  729. @@ -3451,15 +3700,15 @@ function PositionCamera(float DeltaTime)
  730. locRot.pitch = camPitch;
  731. smoothRotate(p.ViewRotation, locRot, deltatime);
  732.  
  733. - if(p.IsInState('playeraiming'))
  734. - {
  735. - cameraLock = true;
  736. + // if(p.IsInState('playeraiming')) //AdamJD
  737. + // {
  738. + //cameraLock = true; //AdamJD
  739. if (!bWasAiming)
  740. {
  741. bWasAiming = true;
  742. NextTargetCam();
  743. }
  744. - }
  745. + //}
  746. else
  747. {
  748. bWasAiming = false;
  749. @@ -3500,22 +3749,24 @@ function PositionCamera(float DeltaTime)
  750. CameraType = CAM_Quiditch;
  751. p.clientmessage("Camera switch to Quidditch state");
  752. p.StandardTarget.TargetOffset = vect(100, 0 ,50);
  753. - CameraHeight = 60.000000;
  754. - CameraDistance = 150.000;
  755. - CameraAimOffsetState = vect(0, 0, 0);
  756. + //not needed -AdamJD
  757. + // CameraHeight = 60.000000;
  758. + // CameraDistance = 150.000;
  759. + // CameraAimOffsetState = vect(0, 0, 0);
  760. }
  761.  
  762. begin:
  763. -
  764. - loop:
  765. - sleep (0.0005);
  766. - if(!bShake)
  767. - {
  768. - turntoward(p.StandardTarget);
  769. - }
  770. -
  771. - goto 'loop';
  772. -}
  773. +
  774. + //not needed -AdamJD
  775. + // loop:
  776. + // sleep (0.0005);
  777. + // if(!bShake)
  778. + // {
  779. + // turntoward(p.StandardTarget);
  780. + // }
  781. +
  782. + // goto 'loop';
  783. +}
  784.  
  785. state FreeCamState
  786. {
  787. @@ -3525,30 +3776,72 @@ ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bu
  788.  
  789. /*-----------------------------------------------------*/
  790.  
  791. -// this function is used to set the camera to a set location and give it something to look at
  792. +function BeginState()
  793. +{
  794. + CameraType = CAM_FreeCam;
  795. + p.clientmessage("Camera switch to FreeCam state");
  796. + //AdamJD
  797. + fDistanceScalar = 1.0f;
  798. + rRotationStep = rot(0,0,0);
  799. + rSavedRotation = rotation;
  800. + bSyncPositionWithTarget = false;
  801. + bSyncRotationWithTarget = false;
  802. +}
  803.  
  804. -function Tick(float DeltaTime)
  805. +// this function is used to set the camera to a set location and give it something to look at
  806. +function Tick(float /*DeltaTime*/ fTimeDelta) //AdamJD
  807. {
  808. // PositionCamera(DeltaTime);
  809. - if (bInSpecialPause)
  810. +
  811. + if (bInSpecialPause)
  812. {
  813. - PositionCamera(DeltaTime);
  814. + //PositionCamera(DeltaTime);
  815. + SetCamera(/*CAM_Standard*/); //AdamJD
  816. }
  817. - else
  818. +
  819. + //not needed -AdamJD
  820. + // else
  821. + // {
  822. + // RestoreState(true);
  823. + // }
  824. +
  825. + //AdamJD
  826. + fMouseDeltaX = p.SmoothMouseX * fTimeDelta;
  827. + fMouseDeltaY = p.SmoothMouseY * fTimeDelta;
  828. +
  829. + //cap mouseDelta x -AdamJD
  830. + if( fMouseDeltaX > MAX_MOUSE_DELTA_X )
  831. {
  832. - RestoreState(true);
  833. + fMouseDeltaX = MAX_MOUSE_DELTA_X;
  834. }
  835. -}
  836. +
  837. + else if( fMouseDeltaX < MIN_MOUSE_DELTA_X )
  838. + {
  839. + fMouseDeltaX = MIN_MOUSE_DELTA_X;
  840. + }
  841. +
  842. + //cap mouseDelta y -AdamJD
  843. + if( fMouseDeltaY > MAX_MOUSE_DELTA_Y )
  844. + {
  845. + fMouseDeltaY = MAX_MOUSE_DELTA_Y;
  846. + }
  847. +
  848. + else if( fMouseDeltaY < MIN_MOUSE_DELTA_Y )
  849. + {
  850. + fMouseDeltaY = MIN_MOUSE_DELTA_Y;
  851. + }
  852. +//}
  853.  
  854. -function PositionCamera(float DeltaTime)
  855. -{
  856. - local rotator CurrentRotation;
  857. +//not needed -AdamJD
  858. +// function PositionCamera(float DeltaTime)
  859. +// {
  860. + /*local rotator CurrentRotation;
  861.  
  862. -// BaseHUD(p.MyHUD).Debugstring = string(victim.name);
  863. -// BaseHUD(p.MyHUD).DebugValx = SmoothMouseX;
  864. -// BaseHUD(p.MyHUD).DebugValy = SmoothMouseY;
  865. -// BaseHUD(p.MyHUD).DebugValz = p.aup;
  866. -// BaseHUD(p.MyHUD).DebugVala = p.TargetHitLocation.z;
  867. + BaseHUD(p.MyHUD).Debugstring = string(victim.name);
  868. + BaseHUD(p.MyHUD).DebugValx = SmoothMouseX;
  869. + BaseHUD(p.MyHUD).DebugValy = SmoothMouseY;
  870. + BaseHUD(p.MyHUD).DebugValz = p.aup;
  871. + BaseHUD(p.MyHUD).DebugVala = p.TargetHitLocation.z;
  872.  
  873. if (baseconsole(p.player.console).bForwardKeyDown)
  874. {
  875. @@ -3576,7 +3869,7 @@ function PositionCamera(float DeltaTime)
  876. {
  877. trackingpoint = (vect(0, 0, -25) >> Rotation);
  878. }
  879. -
  880. +
  881. if (baseconsole(p.player.console).bRotateRightKeyDown)
  882. {
  883. CurrentRotation = Rotation;
  884. @@ -3611,21 +3904,77 @@ function PositionCamera(float DeltaTime)
  885. movesmooth(trackingPoint);
  886.  
  887. bCollide = false;
  888. - SetCollisionState();
  889. -}
  890. -
  891. - function BeginState()
  892. + SetCollisionState();*/
  893. +
  894. + //AdamJD
  895. + if( baseconsole(p.player.console).bForwardKeyDown )
  896. {
  897. - CameraType = CAM_FreeCam;
  898. - p.clientmessage("Camera switch to FreeCam state");
  899. + vDestPosition += (vect(1, 0, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
  900. }
  901. -
  902. +
  903. + else if( baseconsole(p.player.console).bBackKeyDown )
  904. + {
  905. + vDestPosition += (vect(-1, 0, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
  906. + }
  907. +
  908. + if( baseconsole(p.player.console).bRightKeyDown )
  909. + {
  910. + vDestPosition += (vect(0, 1, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
  911. + }
  912. +
  913. + else if( baseconsole(p.player.console).bLeftKeyDown )
  914. + {
  915. + vDestPosition += (vect(0, -1, 0) >> Rotation) * fMoveSpeed * fTimeDelta;
  916. + }
  917. +
  918. + if( baseconsole(p.player.console).bUpKeyDown )
  919. + {
  920. + vDestPosition += (vect(0, 0, 1) >> Rotation) * fMoveSpeed * fTimeDelta;
  921. +
  922. + }
  923. +
  924. + else if( baseconsole(p.player.console).bDownKeyDown )
  925. + {
  926. + vDestPosition += (vect(0, 0, -1) >> Rotation) * fMoveSpeed * fTimeDelta;
  927. + }
  928. +
  929. + //update rotation -AdamJD
  930. + if( baseconsole(p.player.console).bRotateRightKeyDown)
  931. + {
  932. + rDestRotation.Yaw += fRotSpeed * fTimeDelta;
  933. + }
  934. +
  935. + else if( baseconsole(p.player.console).bRotateLeftKeyDown)
  936. + {
  937. + rDestRotation.Yaw -= fRotSpeed * fTimeDelta;
  938. + }
  939. +
  940. + if( baseconsole(p.player.console).bRotateUpKeyDown)
  941. + {
  942. + rDestRotation.Pitch += fRotSpeed * fTimeDelta;
  943. + }
  944. +
  945. + else if( baseconsole(p.player.console).bRotateDownKeyDown)
  946. + {
  947. + rDestRotation.Pitch -= fRotSpeed * fTimeDelta;
  948. + }
  949. +
  950. + //add rotation from mouse input -AdamJD
  951. + rDestRotation.Yaw += fMouseDeltaX * fRotSpeed;
  952. + rDestRotation.Pitch += fMouseDeltaY * fRotSpeed;
  953. +
  954. + //smoothly update rotation -AdamJD
  955. + rCurrRotation += (rDestRotation - rCurrRotation ) * FMin( 1.0f, fRotTightness * fTimeDelta );
  956. + DesiredRotation = rCurrRotation;
  957. + SetRotation( DesiredRotation );
  958. +}
  959. begin:
  960. - loop:
  961. - sleep (0.0005);
  962. + //not needed -AdamJD
  963. + // loop:
  964. + // sleep (0.0005);
  965. // turntoward(p.StandardTarget);
  966.  
  967. - goto 'loop';
  968. + //goto 'loop';
  969. }
  970.  
  971. /*-----------------------------------------------------*/
  972. @@ -3666,15 +4015,15 @@ function PositionCamera(float DeltaTime)
  973. /* locRot.pitch = camPitch;
  974. smoothRotate(p.ViewRotation, locRot, deltatime);
  975. */
  976. - if(p.IsInState('playeraiming'))
  977. - {
  978. - cameraLock = true;
  979. + // if(p.IsInState('playeraiming')) //AdamJD
  980. + // {
  981. + //cameraLock = true; //AdamJD
  982. if (!bWasAiming)
  983. {
  984. bWasAiming = true;
  985. NextTargetCam();
  986. }
  987. - }
  988. + // }
  989. else
  990. {
  991. bWasAiming = false;
  992. @@ -3722,32 +4071,455 @@ function PositionCamera(float DeltaTime)
  993. goto 'loop';
  994. }
  995.  
  996. +//AdamJD functions (some are copied from the HP2 proto, I was really struggling...)
  997. +
  998. +//old mouse axis functions by me
  999. +/*
  1000. +function xMouseAxis(float DeltaTime)
  1001. +{
  1002. + local float rotatespeed;
  1003. +
  1004. + rotvalX = p.SmoothMouseX * DeltaTime;
  1005. + rotatespeed = 4.0f;
  1006. +
  1007. + CurrentRot.Yaw = rotvalX * rotatespeed;
  1008. +}
  1009. +
  1010. +function yMouseAxis(float DeltaTime)
  1011. +{
  1012. + local float rotatespeed;
  1013. +
  1014. + rotvalY = p.SmoothMouseY * DeltaTime;
  1015. + rotatespeed = 4.0f;
  1016. +
  1017. + CurrentRot.Pitch = rotvalY * rotatespeed;
  1018. +}
  1019. +*/
  1020. +
  1021. +//set up the camera settings
  1022. +function InitSettings(bool bSyncWithTargetPos, bool bSyncWithTargetRot)
  1023. +{
  1024. + fDistanceScalar = 1.0f;
  1025. + rRotationStep = rot(0,0,0);
  1026. + rSavedRotation = rotation;
  1027. + bSyncRotationWithTarget = bSyncWithTargetRot;
  1028. + bSyncPositionWithTarget = bSyncWithTargetPos;
  1029. + fDistanceScalarMin = DISTANCE_SCALAR_MIN;
  1030. + fCurrLookAtDistance = fLookAtDistance;
  1031. +}
  1032. +
  1033. +//set up cam target settings
  1034. +function InitTarget(actor A)
  1035. +{
  1036. + camTarget.SetAttachedTo(A);
  1037. + camTarget.SetOffset( vLookAtOffset );
  1038. +}
  1039. +
  1040. +//copied from the HP2 proto
  1041. +function InitRotation( rotator rot )
  1042. +{
  1043. + rDestRotation.yaw = rot.yaw & 0xFFFF;
  1044. + rDestRotation.pitch = rot.pitch & 0xFFFF;
  1045. + rDestRotation.roll = rot.roll & 0xFFFF;
  1046. + vForward = normal(vector(DesiredRotation));
  1047. + rCurrRotation = rDestRotation;
  1048. + DesiredRotation = rDestRotation;
  1049. + SetRotation( DesiredRotation );
  1050. +}
  1051. +
  1052. +//copied from the HP2 proto
  1053. +function InitPosition( vector pos, optional float deltatime )
  1054. +{
  1055. + vDestPosition = pos;
  1056. +
  1057. + //check camera collision with world -AdamJD
  1058. + CheckCollisionWithWorld();
  1059. +
  1060. + vCurrPosition = vDestPosition;
  1061. + SetLocation( vDestPosition );
  1062. +}
  1063. +
  1064. +//set up dest rotation
  1065. +function SetDestRotation( rotator newRot )
  1066. +{
  1067. + rDestRotation = newRot;
  1068. +}
  1069. +
  1070. +//set up position and rotation settings
  1071. +function InitPositionAndRotation( bool bSnapToNewPosAndRot, optional float deltatime )
  1072. +{
  1073. + if( bSnapToNewPosAndRot )
  1074. + {
  1075. + InitRotation( camTarget.rotation );
  1076. + InitPosition( camTarget.location+((vec(-fLookAtDistance,0,0))>>rDestRotation) );
  1077. + }
  1078. + else
  1079. + {
  1080. + SetDestRotation( CamTarget.rotation );
  1081. +
  1082. + vDestPosition = CamTarget.location + ((vec(-(fLookAtDistance),0,0))>>rDestRotation);
  1083. +
  1084. + //check camera collision with world
  1085. + CheckCollisionWithWorld();
  1086. + }
  1087. + rDestRotation.roll = 0;
  1088. + rCurrRotation.roll = 0;
  1089. +}
  1090. +
  1091. +//get mouse x axis
  1092. +function ApplyMouseXToDestYaw( float fTimeDelta)
  1093. +{
  1094. + fMouseDeltaX = p.SmoothMouseX * fTimeDelta;
  1095. +
  1096. + //cap the fMouseDeltaX
  1097. + if( fMouseDeltaX > MAX_MOUSE_DELTA_X )
  1098. + {
  1099. + fMouseDeltaX = MAX_MOUSE_DELTA_X;
  1100. + }
  1101. +
  1102. + else if( fMouseDeltaX < MIN_MOUSE_DELTA_X )
  1103. + {
  1104. + fMouseDeltaX = MIN_MOUSE_DELTA_X;
  1105. + }
  1106. +
  1107. + //update dest rotation
  1108. + rDestRotation.Yaw += fMouseDeltaX * fRotSpeed;
  1109. +}
  1110. +
  1111. +//get mouse y axis
  1112. +function ApplyMouseYToDestPitch( float fTimeDelta)
  1113. +{
  1114. + fMouseDeltaY = p.SmoothMouseY * fTimeDelta;
  1115. +
  1116. + //cap the fMouseDeltaY
  1117. + if( fMouseDeltaY > MAX_MOUSE_DELTA_Y )
  1118. + {
  1119. + fMouseDeltaY = MAX_MOUSE_DELTA_Y;
  1120. + }
  1121. +
  1122. + else if( fMouseDeltaY < MIN_MOUSE_DELTA_Y )
  1123. + {
  1124. + fMouseDeltaY = MIN_MOUSE_DELTA_Y;
  1125. + }
  1126. +
  1127. + //update dest rotation
  1128. + rDestRotation.Pitch += fMouseDeltaY * fRotSpeed;
  1129. +
  1130. + //cap the rDestRotation
  1131. + if( rDestRotation.Pitch > fCurrentMaxPitch )
  1132. + {
  1133. + rDestRotation.Pitch = fCurrentMaxPitch;
  1134. + }
  1135. +
  1136. + else if( rDestRotation.Pitch < fCurrentMinPitch )
  1137. + {
  1138. + rDestRotation.Pitch = fCurrentMinPitch;
  1139. + }
  1140. +}
  1141. +
  1142. +//copied from the HP2 proto
  1143. +function SetFinalRotation( rotator r )
  1144. +{
  1145. + r += rExtraRotation;
  1146. + rExtraRotation = rot(0,0,0);
  1147. +
  1148. + DesiredRotation = r;
  1149. + SetRotation( r );
  1150. +}
  1151. +
  1152. +//update rotation
  1153. +function UpdateRotation( float fTimeDelta )
  1154. +{
  1155. + local float fTravelScalar;
  1156. +
  1157. + rDestRotation += rRotationStep * fTimeDelta;
  1158. +
  1159. + //if true immediatly face target
  1160. + if( bSyncRotationWithTarget )
  1161. + {
  1162. + rCurrRotation = rotator(CamTarget.location - location);
  1163. + }
  1164. +
  1165. + else
  1166. + {
  1167. + //clamp travel scalar
  1168. + if( fRotTightness > 0.0f )
  1169. + {
  1170. + fTravelScalar = FMin( 1.0f, fRotTightness * fTimeDelta );
  1171. + }
  1172. +
  1173. + else
  1174. + {
  1175. + fTravelScalar = 1.0f;
  1176. + }
  1177. +
  1178. + rCurrRotation += ( rDestRotation - rCurrRotation ) * fTravelScalar;
  1179. + }
  1180. +
  1181. + //update vForward
  1182. + vForward = normal(vector(rCurrRotation));
  1183. +
  1184. + SetFinalRotation( rCurrRotation );
  1185. +}
  1186. +
  1187. +//update position
  1188. +function UpdatePosition( float fTimeDelta )
  1189. +{
  1190. + local float fTravelScalar;
  1191. +
  1192. + if( bSyncPositionWithTarget )
  1193. + {
  1194. + vDestPosition = CamTarget.location + ((vec(-(fCurrLookAtDistance ),0,0)) >> rCurrRotation );
  1195. + }
  1196. +
  1197. + //check camera collision with world -AdamJD
  1198. + CheckCollisionWithWorld();
  1199. +
  1200. + //clamp travel scalar
  1201. + if( fMoveTightness > 0.0f )
  1202. + {
  1203. + fTravelScalar = FMin( 1.0f, fMoveTightness * fTimeDelta );
  1204. + }
  1205. +
  1206. + else
  1207. + {
  1208. + fTravelScalar = 1.0f;
  1209. + }
  1210. +
  1211. + vCurrPosition += ( vDestPosition - vCurrPosition ) * fTravelScalar;
  1212. + SetLocation( vCurrPosition );
  1213. +}
  1214. +
  1215. +//update distance scalar
  1216. +function UpdateDistanceScalar( float fTimeDelta )
  1217. +{
  1218. + local float fDestLookAtDistance;
  1219. +
  1220. + if( rCurrRotation.Pitch > fPitchMovingInThreshold )
  1221. + {
  1222. + //calculate distance scalar
  1223. + fDistanceScalar = 1.0f - ( rCurrRotation.Pitch / fPitchMovingInSpread );
  1224. +
  1225. + //stop camera at harry's head
  1226. + if( fDistanceScalar < fDistanceScalarMin)
  1227. + {
  1228. + fDistanceScalar = fDistanceScalarMin;
  1229. + }
  1230. +
  1231. + fDestLookAtDistance = fLookAtDistance * fDistanceScalar;
  1232. + }
  1233. + else
  1234. + {
  1235. + fDistanceScalar = 1.0f;
  1236. + fDestLookAtDistance = fLookAtDistance;
  1237. + }
  1238. +
  1239. + //collision stuff
  1240. + if( fCurrLookAtDistance < fDestLookAtDistance )
  1241. + {
  1242. + fCurrLookAtDistance += (fDestLookAtDistance - fCurrLookAtDistance ) * FMin( 1.0f, fMoveBackTightness * fTimeDelta );
  1243. + }
  1244. + else
  1245. + {
  1246. + fCurrLookAtDistance = fDestLookAtDistance;
  1247. + }
  1248. +}
  1249. +
  1250. +//finally add collision to camera
  1251. +function bool CheckCollisionWithWorld()
  1252. +{
  1253. + local vector HitLocation;
  1254. + local vector HitNormal;
  1255. + local actor HitActor;
  1256. + local vector LookAtPoint;
  1257. + local vector LookFromPoint;
  1258. + local vector vCusionFromWorld;
  1259. +
  1260. + LookAtPoint = CamTarget.location;
  1261. +
  1262. + //do a trace with the line from the target actor's location to cam targets location
  1263. + if( CamTarget.aAttachedTo != None && (CamTarget.vOffset.x != 0 || CamTarget.vOffset.y != 0 || CamTarget.vOffset.z != 0) )
  1264. + {
  1265. + //make sure that CamTarget.location is inside the level
  1266. + HitActor = Trace( HitLocation, HitNormal, camTarget.Location, camTarget.aAttachedTo.location, false );
  1267. + if( HitActor != None && HitActor.IsA('levelInfo') )
  1268. + {
  1269. + //the cam target has hit something
  1270. + LookAtPoint = HitLocation + ( normal(camTarget.aAttachedTo.location - HitLocation) * 5.0f) + HitNormal;
  1271. + }
  1272. + }
  1273. +
  1274. + vCusionFromWorld = normal(LookAtPoint-vDestPosition) * 5.0f;
  1275. + LookFromPoint = vDestPosition - vCusionFromWorld;
  1276. +
  1277. + foreach TraceActors(class'actor', HitActor, HitLocation, HitNormal, LookFromPoint, LookAtPoint )
  1278. + {
  1279. + if( HitActor == Owner )
  1280. + {
  1281. + continue;
  1282. + }
  1283. +
  1284. + if( HitActor.IsA('levelInfo') )
  1285. + {
  1286. + if(!IsInState('BossState')) //stop camera going right above Harrys head when hitting something in the boss state -AdamJD
  1287. + {
  1288. + //move camera a bit away from the hit location
  1289. + vDestPosition = HitLocation + vCusionFromWorld;
  1290. + fCurrLookAtDistance = vsize(vDestPosition - LookAtPoint);
  1291. +
  1292. + return true;
  1293. + }
  1294. + }
  1295. + }
  1296. +
  1297. + return false;
  1298. +}
  1299. +
  1300. /*-----------------------------------------------------*/
  1301.  
  1302. state Standardstate
  1303. {
  1304. -ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, Died, LongFall, PainTimer;
  1305. + ignores takeDamage, SeePlayer, EnemyNotVisible, HearNoise, KilledBy, Trigger, Bump, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, Died, LongFall, PainTimer;
  1306.  
  1307.  
  1308.  
  1309. /*-----------------------------------------------------*/
  1310.  
  1311. -// this function is used to set the camera to a set location and give it something to look at
  1312. + function BeginState()
  1313. + {
  1314. + //org not needed retail code -AdamJD
  1315. + // CameraType = CAM_Standard;
  1316. + // p.clientmessage("Camera switch to Standard state");
  1317. + // p.StandardTarget.TargetOffset = vect(75, 0 ,50);
  1318. + //SetPhysics(PHYS_NONE);
  1319. + // CameraHeight = 80.000000;
  1320. +// // CameraHeight = 50.000000;
  1321. + // CameraDistance = 150.000;
  1322. +// //CameraAimOffsetState = vect(80, 0, 0);
  1323. +// //CameraAimOffsetState = vect(40, 0, 0);
  1324. + // CameraAimOffsetState = vect(0, 0, 0);
  1325. +// CameraOffset = vect(140, -100, 0);
  1326.  
  1327. -function Tick(float DeltaTime)
  1328. -{
  1329. - local vector tpoint;
  1330. + //Init the camera -AdamJD
  1331. + InitSettings(true, false);
  1332. + InitTarget(p);
  1333. + InitPositionAndRotation(true);
  1334. + }
  1335.  
  1336. - if (bInSpecialPause)
  1337. + function EndState()
  1338. {
  1339. - SaveState();
  1340. - gotostate('FreeCamState');
  1341. +// SetPhysics(PHYS_ROTATING);
  1342. +
  1343. + //AdamJD
  1344. + rSavedRotation = rCurrRotation;
  1345. }
  1346. - else
  1347. +
  1348. + // this function is used to set the camera to a set location and give it something to look at
  1349. + function Tick(float DeltaTime)
  1350. {
  1351. - PositionCamera(DeltaTime);
  1352. + local vector tpoint;
  1353. +
  1354. + local float camTotal;
  1355. +
  1356. + local vector PositionDif;
  1357. + local bool bMoved;
  1358. + local rotator viewrot;
  1359. + local float PitchDif;
  1360. +
  1361. + //bCollide = true;
  1362. +
  1363. + /* locRot.pitch = camPitch;
  1364. + smoothRotate(p.ViewRotation, locRot, deltatime);
  1365. + */
  1366. +
  1367. + // if(p.IsInState('playeraiming')) //AdamJD
  1368. + // {
  1369. + //cameraLock = true; //AdamJD
  1370. + //now not needed -AdamJD
  1371. + /*
  1372. + if (!bWasAiming)
  1373. + {
  1374. + bWasAiming = true;
  1375. + NextTargetCam();
  1376. + }
  1377. + //}
  1378. + else
  1379. + {
  1380. + bWasAiming = false;
  1381. + }
  1382. +
  1383. + GeneralStationaryModeCamera(deltatime, true);
  1384. +
  1385. + StoreMove();
  1386. +
  1387. + CheckCollisionState(deltatime);
  1388. +
  1389. + //@PAB remove when you wish to go back to a colliding camera
  1390. + SetCollisionState();
  1391. +
  1392. + Check to see if the camera should change its yaw
  1393. +
  1394. + bTurnToward = true;
  1395. +
  1396. + else
  1397. + {
  1398. + PositionCamera(DeltaTime);
  1399. + }
  1400. +
  1401. + tpoint = p.standardTarget.targetOffset;
  1402. + tpoint = tpoint >> p.rotation;
  1403. + tpoint += p.location;
  1404. +
  1405. + // if (!p.IsInState('playeraiming')) //AdamJD
  1406. + // {
  1407. + SetRotation(rotator(tpoint - location));
  1408. + DesiredRotation = rotator(tpoint - location);
  1409. + ViewRotation = rotator(tpoint - location);
  1410. + // }*/
  1411. +
  1412. + //retail commented out code
  1413. + /*SetRotation(rotator(p.StandardTarget.location - location));
  1414. + DesiredRotation = rotator(p.StandardTarget.location - location);
  1415. + ViewRotation = rotator(p.StandardTarget.location - location);*/
  1416. +
  1417. + //apply mouse input to dest rotation -AdamJD
  1418. + ApplyMouseXToDestYaw( DeltaTime);
  1419. + ApplyMouseYToDestPitch( DeltaTime );
  1420. +
  1421. + //update rotation -AdamJD
  1422. + UpdateRotation( DeltaTime );
  1423. +
  1424. + //update position -AdamJD
  1425. + UpdatePosition( DeltaTime );
  1426. +
  1427. + //update distance scalar -AdamJD
  1428. + UpdateDistanceScalar( DeltaTime );
  1429. +
  1430. + //goto free cam state if in special pause -AdamJD
  1431. + if (bInSpecialPause)
  1432. + {
  1433. + SaveState();
  1434. + gotostate('FreeCamState');
  1435. + }
  1436. }
  1437.  
  1438. + begin:
  1439. + //not needed -AdamJD
  1440. + /*
  1441. + loop:
  1442. + sleep (0.0005);
  1443. + if (bTurnToward)
  1444. + {
  1445. + if (p.IsInState('playeraiming'))
  1446. + {
  1447. + turntoward(p.StandardTarget);
  1448. + }
  1449. + }
  1450. + goto 'loop';
  1451. + */
  1452. +//}
  1453. +
  1454. +//retail commented out code -AdamJD
  1455. // if (p.IsInState('playeraiming'))
  1456. // {
  1457. // tpoint = vect(0, 0, 50);
  1458. @@ -3785,25 +4557,10 @@ function Tick(float DeltaTime)
  1459. // ViewRotation = rotator(p.location + tpoint - location);
  1460. // }
  1461. // }
  1462. -
  1463. -
  1464. - tpoint = p.standardTarget.targetOffset;
  1465. - tpoint = tpoint >> p.rotation;
  1466. - tpoint += p.location;
  1467. -
  1468. - if (!p.IsInState('playeraiming'))
  1469. - {
  1470. - SetRotation(rotator(tpoint - location));
  1471. - DesiredRotation = rotator(tpoint - location);
  1472. - ViewRotation = rotator(tpoint - location);
  1473. - }
  1474. -
  1475. -/* SetRotation(rotator(p.StandardTarget.location - location));
  1476. - DesiredRotation = rotator(p.StandardTarget.location - location);
  1477. - ViewRotation = rotator(p.StandardTarget.location - location);*/
  1478. }
  1479.  
  1480. -function PositionCamera(float DeltaTime)
  1481. +//old retail function (moved code to StandardState) -AdamJD
  1482. +/*function PositionCamera(float DeltaTime)
  1483. {
  1484. local float camTotal;
  1485.  
  1486. @@ -3811,21 +4568,22 @@ function PositionCamera(float DeltaTime)
  1487. local bool bMoved;
  1488. local rotator viewrot;
  1489. local float PitchDif;
  1490. -
  1491. - bCollide = true;
  1492. +
  1493. + bCollide = true;*/
  1494.  
  1495. /* locRot.pitch = camPitch;
  1496. smoothRotate(p.ViewRotation, locRot, deltatime);
  1497. */
  1498. - if(p.IsInState('playeraiming'))
  1499. - {
  1500. - cameraLock = true;
  1501. + //AdamJD
  1502. +/* // if(p.IsInState('playeraiming')) //AdamJD
  1503. + // {
  1504. + //cameraLock = true; //AdamJD
  1505. if (!bWasAiming)
  1506. {
  1507. bWasAiming = true;
  1508. NextTargetCam();
  1509. }
  1510. - }
  1511. + //}
  1512. else
  1513. {
  1514. bWasAiming = false;
  1515. @@ -3867,17 +4625,17 @@ function PositionCamera(float DeltaTime)
  1516.  
  1517. begin:
  1518. loop:
  1519. - sleep (0.0005);
  1520. - if (bTurnToward)
  1521. + sleep (0.0005);*/
  1522. + //AdamJD
  1523. + /*if (bTurnToward)
  1524. {
  1525. if (p.IsInState('playeraiming'))
  1526. {
  1527. turntoward(p.StandardTarget);
  1528. }
  1529. - }
  1530. - goto 'loop';
  1531. -}
  1532. -
  1533. + }*/
  1534. + // goto 'loop';
  1535. +// }
  1536.  
  1537. /*-----------------------------------------------------*/
  1538.  
  1539. @@ -4001,13 +4759,40 @@ moveLoop:
  1540.  
  1541. defaultproperties
  1542. {
  1543. - cameraLock=True
  1544. - lockBias=1
  1545. - bUseStrafing=True
  1546. - bHidden=True
  1547. - bCanMoveInSpecialPause=True
  1548. - CollisionRadius=0.1
  1549. - bBlockActors=False
  1550. - bBlockPlayers=False
  1551. - RotationRate=(Pitch=20000,Yaw=20000,Roll=20000)
  1552. + bRotateToDesired=false
  1553. +
  1554. + bHidden=true
  1555. + bBlockActors=false
  1556. + bBlockPlayers=false
  1557. +
  1558. + bCanMoveInSpecialPause=true
  1559. +
  1560. + //retail not needed defaults -AdamJD
  1561. + //cameraLock=True
  1562. + //lockBias=1
  1563. + //bUseStrafing=True
  1564. + //bHidden=True
  1565. + //bCanMoveInSpecialPause=True
  1566. + //CollisionRadius=0.1
  1567. + //bBlockActors=False
  1568. + //bBlockPlayers=False
  1569. + //RotationRate=(Pitch=20000,Yaw=20000,Roll=20000)
  1570. +
  1571. + //AdamJD defaults
  1572. + bSyncPositionWithTarget=true
  1573. +
  1574. + fCurrentMinPitch=-14000.0f
  1575. + fCurrentMaxPitch=14000.0f
  1576. +
  1577. + fDistanceScalar=1.0f
  1578. +
  1579. + fMoveBackTightness=2.5f
  1580. +
  1581. + //standard cam settings -AdamJD
  1582. + vLookAtOffset=(X=0,Y=0,Z=55.0f)
  1583. + fLookAtDistance=128.0f
  1584. + fRotTightness=8.0f
  1585. + fRotSpeed=4.0f
  1586. + fMoveTightness=0.0f
  1587. + fMoveSpeed=0.0f
  1588. }
  1589. diff --git a/HPBase/Classes/CamTarget.uc b/HPBase/Classes/CamTarget.uc
  1590. index 3c3141d..f28b4a6 100644
  1591. --- a/HPBase/Classes/CamTarget.uc
  1592. +++ b/HPBase/Classes/CamTarget.uc
  1593. @@ -3,17 +3,95 @@
  1594. //=============================================================================
  1595. class CamTarget expands Pawn;
  1596.  
  1597. -var baseharry p;
  1598. -var vector targetOffset;
  1599. -var vector moveTarget;
  1600. -var float previousYaw;
  1601. +//Edited by- AdamJD (edited code will have AdamJD by it)
  1602.  
  1603. +var vector targetOffset;
  1604. var rotator BossCamBox;
  1605.  
  1606. -var bool bInPlayerAiming;
  1607. -var vector OldOffset;
  1608. -var vector OldRecTargetLocation;
  1609. +//old retail vars -AdamJD
  1610. +//var baseharry p;
  1611. +//var vector moveTarget;
  1612. +//var float previousYaw;
  1613. +//var bool bInPlayerAiming;
  1614. +//var vector OldOffset;
  1615. +//var vector OldRecTargetLocation;
  1616. +
  1617. +//AdamJD vars
  1618. +var actor aAttachedTo; //actor that the target is attached to
  1619. +var vector vOffset;
  1620. +var bool bRelative;
  1621. +var BaseCam Cam;
  1622. +var Target rectarget;
  1623. +
  1624. +function PostBeginPlay()
  1625. +{
  1626. + foreach AllActors(class'Target', rectarget)
  1627. + {
  1628. + break;
  1629. + }
  1630. +
  1631. + rectarget.victim.eVulnerableToSpell=SPELL_None;
  1632. +}
  1633. +
  1634. +//set the cam target offset -AdamJD
  1635. +function SetOffset ( vector v )
  1636. +{
  1637. + vOffset = v;
  1638. + UpdateOrientation();
  1639. +}
  1640. +
  1641. +//set the attached to actor -AdamJD
  1642. +function SetAttachedTo(actor a)
  1643. +{
  1644. + aAttachedTo = a;
  1645. + UpdateOrientation();
  1646. +}
  1647. +
  1648. +//update position and rotation -AdamJD
  1649. +function UpdateOrientation()
  1650. +{
  1651. + local vector delta;
  1652. +
  1653. + if( aAttachedTo != None )
  1654. + {
  1655. + delta = vec(0, 0, 0); //focus cam target on Harry
  1656. +
  1657. + //update rotation
  1658. + SetNewRotation( aAttachedTo.rotation );
  1659. +
  1660. + //update position
  1661. + if( bRelative )
  1662. + {
  1663. + SetLocation( aAttachedTo.location + delta + (vOffset >> rotation) );
  1664. + }
  1665. +
  1666. + else
  1667. + {
  1668. + SetLocation( aAttachedTo.location + delta + vOffset);
  1669. + }
  1670. + }
  1671. +}
  1672. +
  1673. +//set up the new rotation -AdamJD
  1674. +function SetNewRotation( rotator rot )
  1675. +{
  1676. + DesiredRotation = rot;
  1677. + DesiredRotation.Yaw = DesiredRotation.Yaw & 0xFFFF;
  1678. + DesiredRotation.Pitch = DesiredRotation.Pitch & 0xFFFF;
  1679. + DesiredRotation.Roll = DesiredRotation.Roll & 0xFFFF;
  1680. + SetRotation( DesiredRotation );
  1681. +}
  1682. +
  1683. +//make sure the SetAttachedTo actor gets ticked -AdamJD
  1684. +event Tick(optional float fTimeDelta)
  1685. +{
  1686. + Super.Tick( fTimeDelta );
  1687. + SetAttachedTo(aAttachedTo);
  1688. + UpdateOrientation();
  1689. +}
  1690.  
  1691. +//old retail code -AdamJD
  1692. +/*
  1693. auto state seeking
  1694. {
  1695. function startup()
  1696. @@ -34,8 +112,7 @@ auto state seeking
  1697. function touch (actor other)
  1698. {
  1699. }
  1700. -
  1701. -
  1702. +
  1703. function HitWall (vector HitNormal, actor Wall)
  1704. {
  1705. }
  1706. @@ -53,7 +130,7 @@ auto state seeking
  1707. {
  1708.  
  1709. local vector tloc;
  1710. - local vector offset;
  1711. + local vector offset;*/
  1712.  
  1713. /* if (p.IsInState('PlayerAiming'))
  1714. {
  1715. @@ -73,18 +150,18 @@ auto state seeking
  1716. }
  1717. else
  1718. {*/
  1719. - if (bInPlayerAiming)
  1720. - {
  1721. + // if (bInPlayerAiming)
  1722. + // {
  1723. /* TargetOffset = Normal(OldRecTargetLocation - p.cam.Location) * 100;
  1724. TargetOffset.x = OldOffset.x;
  1725. TargetOffset.y = OldOffset.y;
  1726. TargetOffset.z += 50; // Offset in the battle cam aim offset
  1727. */
  1728. - bInPlayerAiming = false;
  1729. - }
  1730. + // bInPlayerAiming = false;
  1731. + // }
  1732.  
  1733. - if (p.bStationary)
  1734. - {
  1735. + // if (p.bStationary)
  1736. + // {
  1737. /* if(p.SmoothMouseY>64 && targetOffset.z < 150)
  1738. {
  1739. targetOffset.z=targetOffset.z+2;
  1740. @@ -95,7 +172,7 @@ auto state seeking
  1741. targetOffset.z=targetOffset.z-2;
  1742. }*/
  1743.  
  1744. - if((p.SmoothMouseY < -64) && targetOffset.z > 0)
  1745. + /*if((p.SmoothMouseY < -64) && targetOffset.z > 0)
  1746. {
  1747. targetOffset.z = targetOffset.z - 3;
  1748.  
  1749. @@ -151,7 +228,7 @@ auto state seeking
  1750. {
  1751. targetOffset.z=targetOffset.z-2;
  1752. }
  1753. -// }
  1754. +// }*/
  1755.  
  1756. /* BaseHUD(p.MyHUD).DebugValx = tloc.x;
  1757. BaseHUD(p.MyHUD).DebugValy = tloc.y;
  1758. @@ -162,12 +239,12 @@ auto state seeking
  1759. BaseHUD(p.MyHUD).DebugValz2 = OldRecTargetLocation.z;
  1760. */
  1761.  
  1762. - offset=tloc-location;
  1763. + /*offset=tloc-location;
  1764.  
  1765. - if (p.IsInState('PlayerAiming'))
  1766. - {
  1767. -// log("Now " $location.x $" " $location.y $" " $location.z);
  1768. -// log("Rectarget " $p.rectarget.location.x $" " $p.rectarget.location.y $" " $p.rectarget.location.z);
  1769. + // if (p.IsInState('PlayerAiming'))
  1770. + // {
  1771. + //log("Now " $location.x $" " $location.y $" " $location.z);
  1772. + //log("Rectarget " $p.rectarget.location.x $" " $p.rectarget.location.y $" " $p.rectarget.location.z);
  1773.  
  1774. if (vsize(offset) > 30)
  1775. {
  1776. @@ -175,7 +252,7 @@ auto state seeking
  1777. // SetLocation(offset + location);
  1778. movesmooth(offset);
  1779. }
  1780. - }
  1781. + //}
  1782. else
  1783. {
  1784. // SetLocation(offset + location);
  1785. @@ -261,14 +338,14 @@ state BossFollow
  1786. if (vsize(offset) > 200)
  1787. {
  1788. offset = (vsize(offset) - 200) * normal(offset);
  1789. - movesmooth(offset);
  1790. + movesmooth(offset);*/
  1791.  
  1792. /* BaseHUD(p.MyHUD).DebugValX = offset.x;
  1793. BaseHUD(p.MyHUD).DebugValY = offset.y;
  1794. BaseHUD(p.MyHUD).DebugValZ = offset.z;*/
  1795. - }
  1796. - }
  1797. - else if (abs(ViewDif.Yaw) > BossCamBox.yaw )
  1798. + // }
  1799. + // }
  1800. + /*else if (abs(ViewDif.Yaw) > BossCamBox.yaw )
  1801. {
  1802. if (ViewDif.Yaw > 0 && ViewDif.Yaw < 0x8000)
  1803. {
  1804. @@ -281,28 +358,28 @@ state BossFollow
  1805. ViewDif.pitch = 0;
  1806. ViewDif.roll = 0;
  1807. ViewDif = Rotator(p.BossTarget.Location - p.location) - ViewDif;
  1808. - tloc = vector(ViewDif) * VSize(p.BossTarget.Location - p.location) + p.Location;
  1809. + tloc = vector(ViewDif) * VSize(p.BossTarget.Location - p.location) + p.Location;*/
  1810.  
  1811. /* BaseHUD(p.MyHUD).DebugValX = tloc.x;
  1812. BaseHUD(p.MyHUD).DebugValY = tloc.y;
  1813. BaseHUD(p.MyHUD).DebugValZ = tloc.z;
  1814. */
  1815. - offset=tloc-location;
  1816. + // offset=tloc-location;
  1817.  
  1818. - if (vsize(offset) > 200)
  1819. - {
  1820. - offset = (vsize(offset) - 200) * normal(offset);
  1821. - SetLocation(offset + location);
  1822. + // if (vsize(offset) > 200)
  1823. + // {
  1824. + // offset = (vsize(offset) - 200) * normal(offset);
  1825. + // SetLocation(offset + location);
  1826. // movesmooth(offset);
  1827.  
  1828. /* BaseHUD(p.MyHUD).DebugValX = offset.x;
  1829. BaseHUD(p.MyHUD).DebugValY = offset.y;
  1830. BaseHUD(p.MyHUD).DebugValZ = offset.z;*/
  1831. - }
  1832. - }
  1833. - }
  1834. + // }
  1835. + // }
  1836. + // }
  1837.  
  1838. - begin:
  1839. + /*begin:
  1840. startup();
  1841.  
  1842.  
  1843. @@ -349,7 +426,7 @@ state Free
  1844. goto 'seekloop';
  1845.  
  1846.  
  1847. -}
  1848. +}*/
  1849.  
  1850. defaultproperties
  1851. {
  1852. diff --git a/HPBase/Classes/SpellLearnTrigger.uc b/HPBase/Classes/SpellLearnTrigger.uc
  1853. index 68e027f..b192ced 100644
  1854. --- a/HPBase/Classes/SpellLearnTrigger.uc
  1855. +++ b/HPBase/Classes/SpellLearnTrigger.uc
  1856. @@ -4,6 +4,8 @@
  1857.  
  1858. class SpellLearnTrigger extends Trigger;
  1859.  
  1860. +//Edited by- AdamJD (edited code will have AdamJD by it)
  1861. +
  1862. var(Spells) class<BaseSpell> Spell;
  1863.  
  1864. var(Spells) class<SpellLearnFX> LearnFXClass[3];
  1865. @@ -111,73 +113,93 @@ function Trigger(actor Other, pawn EventInstigator)
  1866. break;
  1867. }
  1868. }
  1869. +
  1870. + //if holding down the spacebar then skip the spell learning -AdamJD
  1871. + if (Player.bSkipKeyPressed == true)
  1872. + {
  1873. + //copied from code near the end of this script -AdamJD
  1874. + DestroyWand();
  1875. + DestroyTemplate();
  1876. + baseHUD(player.myHUD).DestroyPopup();
  1877.  
  1878. - Cam = Player.Cam;
  1879. - Cam.SaveState();
  1880. - SpellGesture = Spell.default.Gesture;
  1881. + player.iLevelReached = LessonLevel;
  1882. + player.iLessonPoints = TotalHousePointScore;
  1883.  
  1884. - // Test
  1885. -/* for (i = 0; i < int(SpellGesture.Points); i ++)
  1886. - {
  1887. - log("Spell lesson points " $i $" of " $int(SpellGesture.Points) $SpellGesture.Points[i].x $SpellGesture.Points[i].y);
  1888. + Destroy();
  1889. +
  1890. + Player.CutRelease(); //makes skipping the spell learning smooth -AdamJD
  1891. }
  1892. -*/
  1893. - bSaveSmoothing = Player.bMaxMouseSmoothing;
  1894. - Player.bMaxMouseSmoothing = false;
  1895. -
  1896. - // We can't fail this lesson, add the spell to Harry now
  1897. - BaseWand(Player.Weapon).AddSpell(Spell);
  1898. -
  1899. - // Put player in right state.
  1900. - BaseWand(Player.Weapon).SelectSpell(Spell);
  1901. -
  1902. - Player.gotoState('SpellLearning');
  1903. -
  1904. - // Halt the player.
  1905. - Player.Velocity = vect(0,0,0);
  1906. - Player.Acceleration = vect(0,0,0);
  1907. - Player.PlayAnim('breathe');
  1908. -
  1909. - TempActor = Spawn(class'camtarget');
  1910. - TempActor.GotoState('Free');
  1911. - TempActor.SetLocation(Location + (vec(TemplateDist,0,0) >> Rotation));
  1912. - Cam.DirectionActor = TempActor;
  1913. - // Change the camera mode.
  1914. - Cam.PositionActor = none;
  1915. - CameraDist = 20; // Hard code for the mo
  1916. - Cam.GotoState('CutState');
  1917. - Cam.SetLocation(Location + (vec(CameraDist,0,0) >> Rotation));
  1918. - Cam.SetRotation(rotator(TempActor.Location - Location));
  1919. +
  1920. + //otherwise carry on with the spell learning as normal -AdamJD
  1921. + else
  1922. + {
  1923. + Cam = Player.Cam;
  1924. + Cam.SaveState();
  1925. + SpellGesture = Spell.default.Gesture;
  1926.  
  1927. - // Init spell level.
  1928. - SpellLevel = 0;
  1929. + // Test
  1930. + /* for (i = 0; i < int(SpellGesture.Points); i ++)
  1931. + {
  1932. + log("Spell lesson points " $i $" of " $int(SpellGesture.Points) $SpellGesture.Points[i].x $SpellGesture.Points[i].y);
  1933. + }
  1934. + */
  1935. + bSaveSmoothing = Player.bMaxMouseSmoothing;
  1936. + Player.bMaxMouseSmoothing = false;
  1937.  
  1938. - TemplateDrawTime = DrawTime / 4;
  1939. + // We can't fail this lesson, add the spell to Harry now
  1940. + BaseWand(Player.Weapon).AddSpell(Spell);
  1941.  
  1942. - LessonLevel = 0;
  1943. - TotalHousePointScore = 0;
  1944. + // Put player in right state.
  1945. + BaseWand(Player.Weapon).SelectSpell(Spell);
  1946.  
  1947. - LessonBlackboard = spawn(class'spellblackboard',
  1948. - [SpawnLocation] Location + (vec(TemplateDist + 50, 0, 0) >> Rotation) );
  1949. + Player.gotoState('SpellLearning');
  1950.  
  1951. -/*
  1952. - if (LessonBlackboard == none)
  1953. - {
  1954. - log("Blackboard is none");
  1955. - }
  1956. - else
  1957. - {
  1958. - log("Blackboard is OK");
  1959. - }
  1960. -*/
  1961. + // Halt the player.
  1962. + Player.Velocity = vect(0,0,0);
  1963. + Player.Acceleration = vect(0,0,0);
  1964. + Player.PlayAnim('breathe');
  1965.  
  1966. - if (Teacher != none)
  1967. - {
  1968. - Teacher.GotoState('idle');
  1969. - }
  1970. + TempActor = Spawn(class'camtarget');
  1971. + TempActor.GotoState('Free');
  1972. + TempActor.SetLocation(Location + (vec(TemplateDist,0,0) >> Rotation));
  1973. + Cam.DirectionActor = TempActor;
  1974. + // Change the camera mode.
  1975. + Cam.PositionActor = none;
  1976. + CameraDist = 20; // Hard code for the mo
  1977. + Cam.GotoState('CutState');
  1978. + Cam.SetLocation(Location + (vec(CameraDist,0,0) >> Rotation));
  1979. + Cam.SetRotation(rotator(TempActor.Location - Location));
  1980. +
  1981. + // Init spell level.
  1982. + SpellLevel = 0;
  1983. +
  1984. + TemplateDrawTime = DrawTime / 4;
  1985. +
  1986. + LessonLevel = 0;
  1987. + TotalHousePointScore = 0;
  1988. +
  1989. + LessonBlackboard = spawn(class'spellblackboard',
  1990. + [SpawnLocation] Location + (vec(TemplateDist + 50, 0, 0) >> Rotation) );
  1991. +
  1992. + /*
  1993. + if (LessonBlackboard == none)
  1994. + {
  1995. + log("Blackboard is none");
  1996. + }
  1997. + else
  1998. + {
  1999. + log("Blackboard is OK");
  2000. + }
  2001. + */
  2002.  
  2003. - bFirstTime = true;
  2004. - gotoState('Template', 'Init');
  2005. + if (Teacher != none)
  2006. + {
  2007. + Teacher.GotoState('idle');
  2008. + }
  2009. +
  2010. + bFirstTime = true;
  2011. + gotoState('Template', 'Init');
  2012. + }
  2013. }
  2014.  
  2015. function TriggerNext()
  2016. diff --git a/HPBase/Classes/Target.uc b/HPBase/Classes/Target.uc
  2017. index 57f1993..a4fdc8b 100644
  2018. --- a/HPBase/Classes/Target.uc
  2019. +++ b/HPBase/Classes/Target.uc
  2020. @@ -1,9 +1,11 @@
  2021. //===============================================================================
  2022. -// [FlowerVase]
  2023. +// [Target]
  2024. //===============================================================================
  2025.  
  2026. class target extends ParticleFX;
  2027.  
  2028. +//Edited by- AdamJD (edited code will have AdamJD by it)
  2029. +
  2030. #exec MESH MODELIMPORT MESH=ModTarget1Mesh MODELFILE=models\ModTarget1.PSK LODSTYLE=10
  2031. #exec MESH ORIGIN MESH=ModTarget1Mesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
  2032. #exec ANIM IMPORT ANIM=ModTarget1Anims ANIMFILE=models\ModTarget1.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
  2033. @@ -47,6 +49,14 @@ var float TargetSize;
  2034.  
  2035. var bool bNoMove;
  2036.  
  2037. +//AdamJD vars
  2038. +var vector vGestureOffset;
  2039. +var bool bIsLockedOn;
  2040. +var bool bInvisibleCursor;
  2041. +var float fLOS_Distance;
  2042. +
  2043. +
  2044. +
  2045. auto state seeking
  2046. {
  2047.  
  2048. @@ -64,9 +74,9 @@ auto state seeking
  2049. break;
  2050. }
  2051. }
  2052. - TargetCounter = 0;
  2053. + TargetCounter = 0;
  2054.  
  2055. - bNoMove = true;
  2056. + //bNoMove = true; //not needed -AdamJD
  2057.  
  2058. // PlaySound(sound'HPSounds.magic_sfx.spell_aim');
  2059.  
  2060. @@ -86,25 +96,25 @@ auto state seeking
  2061. TargetRotation = rotator(TraceEnd);
  2062. TargetPitch = TargetRotation.Pitch;
  2063.  
  2064. -// TargetPitch = 0;
  2065. +// TargetPitch = 0;
  2066. TargetYaw = 0;
  2067. }
  2068.  
  2069. // @PAB added target glow
  2070.  
  2071. -/* if(baseWand(p.weapon).curSpell != class'spelldud')
  2072. - {*/
  2073. + //if(baseWand(p.weapon).curSpell != class'spelldud')
  2074. + //{
  2075. targetGlowObjRed=spawn(class'targetglow',,,Location);
  2076. targetGlowObjRed.SetColour(255, 0, 0);
  2077. targetGlowObjBlue=spawn(class'targetglow',,,Location);
  2078. targetGlowObjBlue.SetColour(0, 255, 255);
  2079. -/* }*/
  2080. + //}
  2081.  
  2082. /* if (SpellGesture != none)
  2083. {
  2084. log("Spell " $string(SpellGesture.Name));
  2085. - }
  2086. -*/
  2087. + }*/
  2088. +
  2089. // AE:
  2090. StopEffect();
  2091. }
  2092. @@ -126,8 +136,8 @@ auto state seeking
  2093. setTarget(Deltatime);
  2094. }
  2095.  
  2096. - function setTarget(float deltatime)
  2097. - {
  2098. +function setTarget(float deltatime)
  2099. +{
  2100. local rotator TargetRot;
  2101. local vector TraceStart;
  2102. local vector TraceEnd;
  2103. @@ -143,6 +153,9 @@ auto state seeking
  2104.  
  2105. //@PAB test
  2106. local actor HitActor;
  2107. +
  2108. + //AdamJD local int
  2109. + local int TargetPitchX;
  2110.  
  2111. Colorstart.base.r=13;
  2112. Colorstart.base.g=108;
  2113. @@ -213,26 +226,31 @@ auto state seeking
  2114.  
  2115. TargetRot = p.rotation;
  2116. TargetRot.pitch = TargetPitch;
  2117. - TargetRot.yaw = TargetRot.yaw + TargetYaw;
  2118. + TargetRot.yaw += TargetYaw;
  2119.  
  2120. // BaseHUD(p.MyHUD).DebugVala = TargetPitch;
  2121.  
  2122. - TraceStart = p.Location;
  2123. + //TraceStart = p.Location; //old tracestart -AdamJD
  2124. + TraceStart = p.cam.CamTarget.Location; //set tracestart to the cam target location -AdamJD
  2125.  
  2126. TraceEnd = Vector(TargetRot);
  2127. Cushion = TraceEnd;
  2128. +
  2129. + //set TargetPitchX to TargetPitch -AdamJD
  2130. + TargetPitchX = TargetPitch;
  2131.  
  2132. //Right now, this is only used by the Devil's snare level.
  2133. if( p.bExtendedTargetting )
  2134. - TraceEnd = TraceEnd * 1024;//512;
  2135. + TraceEnd *= 1024;//512;
  2136. else
  2137. - TraceEnd = TraceEnd * 512;
  2138. + TraceEnd *= 512;
  2139.  
  2140. - TraceEnd = TraceEnd + p.Location;
  2141. + // TraceEnd = TraceEnd + p.Location; //old traceend -AdamJD
  2142. + 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
  2143.  
  2144. PossibleVictim = none;
  2145. -
  2146. -/* if(baseWand(p.weapon).curSpell== class'spelldud')
  2147. +
  2148. + /*if(baseWand(p.weapon).curSpell== class'spelldud')
  2149. {
  2150. Colorstart.base.r=0;
  2151. Colorstart.base.g=0;
  2152. @@ -254,12 +272,17 @@ auto state seeking
  2153. {
  2154. HitLocation = TraceEnd;
  2155. }
  2156. - }
  2157. -*/
  2158. + }*/
  2159. +
  2160. foreach TraceActors(class 'actor', HitActor, HitLocation, HitNormal, TraceEnd, TraceStart)
  2161. {
  2162. // log(string(HitActor.name) $" " $vsize(HitLocation - TraceStart));
  2163.  
  2164. + if( HitActor.IsA('baseHarry') || HitActor.IsA('Harry') || HitActor.IsA('BaseCam') || HitActor.IsA('CamTarget') )
  2165. + {
  2166. + continue; //ignore Harry and camera stuff -AdamJD
  2167. + }
  2168. +
  2169. if (HitActor.bprojtarget || HitActor.bBlockActors )
  2170. {
  2171. // Found target,
  2172. @@ -284,19 +307,21 @@ auto state seeking
  2173. {
  2174. if (possiblevictim.bprojtarget == true)
  2175. {
  2176. -/* Colorstart.base.r=169;
  2177. + /*Colorstart.base.r=169;
  2178. Colorstart.base.g=5;
  2179. Colorstart.base.b=5;
  2180.  
  2181. ColorEnd.base.r=0;
  2182. ColorEnd.base.g=0;
  2183. - ColorEnd.base.b=0;
  2184. -*/
  2185. + ColorEnd.base.b=0;*/
  2186. +
  2187. victim = possiblevictim;
  2188.  
  2189. TargetArea = victim.GetWorldCollisionBox(true);
  2190. HitLocation = ((TargetArea.Max - TargetArea.Min) / 2) + TargetArea.Min;
  2191. -
  2192. +
  2193. + //retail original code -AdamJD
  2194. + /*
  2195. if (possiblevictim.CollideType == CT_Box)
  2196. {
  2197. radius = possiblevictim.CollisionWidth;
  2198. @@ -305,8 +330,34 @@ auto state seeking
  2199. {
  2200. radius = possiblevictim.collisionradius;
  2201. }
  2202. - Cushion = Cushion * (radius / 2);
  2203. - HitLocation = HitLocation - Cushion;
  2204. + */
  2205. +
  2206. + //AdamJD code start
  2207. + //get victim width and setup cursor locking onto the victim
  2208. + if(victim.CollideType == CT_Box || victim.CollideType == CT_AlignedCylinder || victim.CollideType == CT_OrientedCylinder || victim.CollisionWidth == 0)
  2209. + {
  2210. + cushion = vec(victim.CollisionRadius, victim.CollisionWidth, victim.CollisionHeight);
  2211. + radius = victim.CollisionWidth;
  2212. + TargetPitchX = radius * p.SmoothMouseX;
  2213. + TargetPitch = radius * p.SmoothMouseY;
  2214. +
  2215. + vGestureOffset = -(vec(radius, 0, 0));
  2216. + }
  2217. + //get victim radius and setup cursor locking onto the victim
  2218. + else
  2219. + {
  2220. + cushion = vec(victim.CollisionRadius, victim.CollisionRadius, victim.CollisionHeight);
  2221. + radius = victim.collisionradius;
  2222. + TargetPitchX = radius * p.SmoothMouseX;
  2223. + TargetPitch = radius * p.SmoothMouseY;
  2224. +
  2225. + vGestureOffset = normal(p.location - victim.location) * radius;
  2226. + }
  2227. + //AdamJD code end
  2228. +
  2229. + Cushion *= (radius / 2);
  2230. +
  2231. + HitLocation -= Cushion;
  2232. victim.Targeted();
  2233.  
  2234. LockOn(victim);
  2235. @@ -331,80 +382,131 @@ auto state seeking
  2236. TargetGlowObjBlue.SetTargetUnlock();
  2237. HitLocation = TraceEnd;
  2238. HitLocation -= Cushion;
  2239. -
  2240. +
  2241. SetFloatTarget();
  2242. TargetGlowObjRed.SetFloatTarget();
  2243. TargetGlowObjBlue.SetFloatTarget();
  2244. }
  2245. -
  2246. +
  2247. movesmooth(HitLocation - location);
  2248. TargetGlowObjRed.MoveSmooth(HitLocation - TargetGlowObjRed.location);
  2249. TargetGlowObjBlue.MoveSmooth(HitLocation - TargetGlowObjBlue.location);
  2250. -
  2251. -/* BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
  2252. +
  2253. + /*BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
  2254. BaseHUD(p.MyHUD).DebugValy = HitLocation.y;
  2255. BaseHUD(p.MyHUD).DebugValz = HitLocation.z;*/
  2256. +
  2257. + //lock cursor onto victim -AdamJD
  2258. + if (bIsLockedOn == true)
  2259. + {
  2260. + //log("locked onto victim test");
  2261. + TargetPitchX = p.SmoothMouseX;
  2262. + TargetPitch = p.SmoothMouseY;
  2263. + TargetRot = victim.rotation;
  2264. + }
  2265. }
  2266. -
  2267. +
  2268. function LockOn(actor TargetActor)
  2269. {
  2270. - local BoundingBox TargetArea;
  2271. + local BoundingBox TargetArea;
  2272. local vector TargetCentre;
  2273. local float fTargetWidth;
  2274. local float fTargetHeight;
  2275. local float fTargetDepth;
  2276. -
  2277. + local int TargetPitchX; //AdamJD local int
  2278. +
  2279. TargetArea = TargetActor.GetWorldCollisionBox(true);
  2280. -
  2281. +
  2282. TargetCentre = ((TargetArea.Max - TargetArea.Min) / 2) + TargetArea.Min + TargetActor.CentreOffset;
  2283. + fTargetDepth = abs(TargetArea.Max.x - TargetArea.Min.x) * TargetActor.SizeModifier;
  2284. fTargetWidth = abs(TargetArea.Max.y - TargetArea.Min.y) * TargetActor.SizeModifier;
  2285. fTargetHeight = abs(TargetArea.Max.z - TargetArea.Min.z) * TargetActor.SizeModifier;
  2286. - fTargetDepth = abs(TargetArea.Max.x - TargetArea.Min.x);
  2287. -
  2288. - SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
  2289. - TargetGlowObjRed.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
  2290. - TargetGlowObjBlue.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
  2291. -
  2292. +
  2293. + SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
  2294. + SetRotation(TargetActor.rotation);
  2295. + //not needed -AdamJD
  2296. + //TargetGlowObjRed.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
  2297. + //TargetGlowObjBlue.SetTargetLock(fTargetWidth, fTargetHeight, fTargetDepth);
  2298. +
  2299. baseWand(p.weapon).ChooseSpell(victim.eVulnerableToSpell);
  2300.  
  2301. + BaseHUD(p.MyHUD).DebugValX = TargetActor.SizeModifier; //get debug X value -AdamJD
  2302. BaseHUD(p.MyHUD).DebugValY = TargetActor.SizeModifier;
  2303. -
  2304. + BaseHUD(p.MyHUD).DebugValZ = TargetActor.SizeModifier; //get debug Z value -AdamJD
  2305. +
  2306. + TargetPitchX = TargetPitch; //set TargetPitchX to TargetPitch -AdamJD
  2307. +
  2308. // Get Spell gesture
  2309. -
  2310. - if (baseWand(p.Weapon).curSpell != none && baseWand(p.weapon).curSpell != class'spelldud')
  2311. + 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) )
  2312. {
  2313. - SpellGesture = baseWand(p.Weapon).curSpell.default.gesture;
  2314. + SpellGesture = baseWand(p.Weapon).curSpell.default.gesture;
  2315. }
  2316. -
  2317. +
  2318. if (FXVisible == false)
  2319. {
  2320. - if (victim.isa('basechar'))
  2321. + if (victim.isa('basechar') )
  2322. {
  2323. if (basechar(victim).bGestureOnTargeting)
  2324. {
  2325. FXVisible = true;
  2326. + bIsLockedOn = true; //cursor is locked on -AdamJD
  2327. DrawSpellFX(TargetCentre, fTargetWidth, fTargetDepth);
  2328. + vGestureOffset = -(vec(fTargetWidth, 0, 0)); //get GestureOffset -AdamJD
  2329. + TargetPitchX = p.SmoothMouseX; //set TargetPitch to X mouse axis -AdamJD
  2330. + TargetPitch = p.SmoothMouseY; //set TargetPitch to Y mouse axis -AdamJD
  2331. }
  2332. else
  2333. {
  2334. - // save location of spell, but don't use it
  2335. -
  2336. + //save location of spell, but don't use it
  2337. + bIsLockedOn = true; //cursor is locked on -AdamJD
  2338. TargetHitLocation = TargetCentre;
  2339. TargetSize = fTargetWidth;
  2340. + vGestureOffset = normal(p.location - TargetActor.location) * fTargetWidth; //get GestureOffset -AdamJD
  2341. + TargetPitchX = p.SmoothMouseX; //set TargetPitch to X mouse axis -AdamJD
  2342. + TargetPitch = p.SmoothMouseY; //set TargetPitch to Y mouse axis -AdamJD
  2343. }
  2344. }
  2345. - else
  2346. + else
  2347. {
  2348. - FXVisible = true;
  2349. - DrawSpellFX(TargetCentre, fTargetWidth, fTargetDepth);
  2350. - }
  2351. + FXVisible = true;
  2352. + bIsLockedOn = true; //cursor is locked on -AdamJD
  2353. + DrawSpellFX(TargetCentre, fTargetWidth, fTargetDepth);
  2354. + vGestureOffset = -(vec(fTargetWidth, 0, 0)); //get GestureOffset -AdamJD
  2355. + TargetPitchX = p.SmoothMouseX; //set TargetPitch to X mouse axis -AdamJD
  2356. + TargetPitch = p.SmoothMouseY; //set TargetPitch to Y mouse axis -AdamJD
  2357. + }
  2358. }
  2359. +
  2360. else
  2361. {
  2362. - // rotate FX
  2363. -// RotateSpellFX();
  2364. + //rotate FX
  2365. + //RotateSpellFX();
  2366. }
  2367. - }
  2368. +
  2369. +
  2370. + //lock cursor onto target -AdamJD
  2371. + if (bIsLockedOn == true)
  2372. + {
  2373. + //log("locked onto target test");
  2374. +
  2375. + //get target width and setup cursor locking onto the target
  2376. + if(TargetActor.CollideType == CT_Box || TargetActor.CollideType == CT_AlignedCylinder || TargetActor.CollideType == CT_OrientedCylinder || TargetActor.CollisionWidth == 0)
  2377. + {
  2378. + TargetCentre = vec(TargetActor.CollisionRadius, TargetActor.CollisionWidth, TargetActor.CollisionHeight);
  2379. + fTargetWidth = TargetActor.CollisionWidth;
  2380. + TargetPitchX = p.SmoothMouseX;
  2381. + TargetPitch = p.SmoothMouseY;
  2382. + }
  2383. + //get target radius and setup cursor locking onto the target
  2384. + else
  2385. + {
  2386. + TargetCentre = vec(TargetActor.CollisionRadius, TargetActor.CollisionRadius, TargetActor.CollisionHeight);
  2387. + fTargetWidth = TargetActor.CollisionRadius;
  2388. + TargetPitchX = p.SmoothMouseX;
  2389. + TargetPitch = p.SmoothMouseY;
  2390. + }
  2391. + }
  2392. +}
  2393.  
  2394. function RotateSpellFX()
  2395. {
  2396. @@ -428,7 +530,7 @@ auto state seeking
  2397.  
  2398. function SetTargetLock(float TargetWidth, float TargetHeight, float TargetDepth)
  2399. {
  2400. - ParticlesPerSec.Base=10.000000;
  2401. + ParticlesPerSec.Base=10.000000;
  2402. SourceWidth.Base=TargetWidth;
  2403. SourceHeight.Base=TargetHeight;
  2404. SourceDepth.Base=TargetDepth;
  2405. @@ -541,7 +643,7 @@ auto state seeking
  2406. Winfx.ParticlesMax = 200;
  2407. }
  2408.  
  2409. -/* BaseHUD(p.MyHUD).Debugstring = string(victim.name);
  2410. + /*BaseHUD(p.MyHUD).Debugstring = string(victim.name);
  2411. BaseHUD(p.MyHUD).DebugVala = TargetSize;
  2412. BaseHUD(p.MyHUD).DebugValx = TargetHitLocation.x;
  2413. BaseHUD(p.MyHUD).DebugValy = TargetHitLocation.y;
  2414. @@ -554,7 +656,7 @@ auto state seeking
  2415. }
  2416. }
  2417.  
  2418. -/* begin:
  2419. + /*begin:
  2420. circle.pitch=0;
  2421. circle.yaw=0;
  2422. circle.roll=0;
  2423. @@ -569,8 +671,8 @@ auto state seeking
  2424.  
  2425. // seekloop:
  2426. // sleep(0.001);
  2427. -// goto 'seekloop';
  2428. -*/
  2429. +// goto 'seekloop';*/
  2430. +
  2431.  
  2432. }
  2433.  
  2434. @@ -583,15 +685,15 @@ auto state seeking
  2435.  
  2436. // Spawn an appropriate particle system in front of us.
  2437.  
  2438. -/* if (abs(vsize(HitLocation - p.location)) > abs(vsize(HitLocation - (vec(TargetSize / 2,0,0) << victim.Rotation) - p.Location)))
  2439. + /*if (abs(vsize(HitLocation - p.location)) > abs(vsize(HitLocation - (vec(TargetSize / 2,0,0) << victim.Rotation) - p.Location)))
  2440. {
  2441. SpellLoc = HitLocation - (vec(TargetSize / 2,0,0) << victim.Rotation);
  2442. }
  2443. else
  2444. {
  2445. SpellLoc = HitLocation + (vec(TargetSize / 2,0,0) << victim.Rotation);
  2446. - }
  2447. -*/
  2448. + }*/
  2449. +
  2450.  
  2451.  
  2452. // AE:
  2453. @@ -611,20 +713,20 @@ auto state seeking
  2454. // }
  2455.  
  2456. // BaseHUD(p.MyHUD).Debugstring = string(victim.name);
  2457. -/* BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
  2458. + /*BaseHUD(p.MyHUD).DebugValx = HitLocation.x;
  2459. BaseHUD(p.MyHUD).DebugValy = HitLocation.y;
  2460. BaseHUD(p.MyHUD).DebugValz = HitLocation.z;
  2461.  
  2462. BaseHUD(p.MyHUD).DebugVala2 = TargetSize;
  2463. BaseHUD(p.MyHUD).DebugValx2 = SpellLoc.x;
  2464. BaseHUD(p.MyHUD).DebugValy2 = SpellLoc.y;
  2465. - BaseHUD(p.MyHUD).DebugValz2 = SpellLoc.z;
  2466. -*/
  2467. -// Winfx = p.Spawn( class'Reward01',
  2468. + BaseHUD(p.MyHUD).DebugValz2 = SpellLoc.z; */
  2469. +
  2470. + // Winfx = p.Spawn( class'Reward01',
  2471. Winfx = victim.Spawn( baseWand(p.Weapon).curSpell.default.GestureParticleEffectClass,
  2472. [SpawnLocation] SpellLoc);
  2473. -/* Winfx = victim.Spawn( class'Les_SpellShape',
  2474. - [SpawnLocation] SpellLoc);*/
  2475. + // Winfx = victim.Spawn( class'Les_SpellShape',
  2476. + // [SpawnLocation] SpellLoc);
  2477. // [SpawnLocation] HitLocation);
  2478. // [SpawnLocation] p.location + (vec(vSize(location - p.location),0,0) >> p.Rotation) );
  2479.  
  2480. @@ -637,14 +739,14 @@ auto state seeking
  2481. Winfx.Period.Base = 0.f;
  2482. Winfx.Period.Rand = 1.f;
  2483. Winfx.ParticlesMax = 0;
  2484. -// Winfx.SizeWidth.Base = 8.000000;
  2485. -// Winfx.SizeLength.Base = 8.000000;
  2486. + // Winfx.SizeWidth.Base = 8.000000;
  2487. + // Winfx.SizeLength.Base = 8.000000;
  2488.  
  2489. -// Winfx.SetOwner(victim);
  2490. -// Winfx.SetPhysics(PHYS_Trailer);
  2491. -// Winfx.bTrailerSameRotation = true;
  2492. + // Winfx.SetOwner(victim);
  2493. + // Winfx.SetPhysics(PHYS_Trailer);
  2494. + // Winfx.bTrailerSameRotation = true;
  2495.  
  2496. -// Winfx.Lifetime.Base = 3.0;
  2497. + // Winfx.Lifetime.Base = 3.0;
  2498. }
  2499.  
  2500.  
  2501. @@ -689,9 +791,10 @@ function Destroyed()
  2502. // Textures(0)=Texture'HPParticle.particle_fx.soft_pfx'
  2503. // Textures(0)=Texture'HPParticle.hp_fx.Particles.Sparkle_1'
  2504.  
  2505. +// --------------------------------------------------------------------------------------------
  2506. defaultproperties
  2507. {
  2508. - ParticlesPerSec=(Base=20)
  2509. + ParticlesPerSec=(Base=20)
  2510. SourceWidth=(Base=100)
  2511. SourceHeight=(Base=100)
  2512. SourceDepth=(Base=100)
  2513. @@ -710,4 +813,5 @@ defaultproperties
  2514. Textures(0)=Texture'HPParticle.hp_fx.Particles.Sparkle_1'
  2515. Rotation=(Pitch=16640)
  2516. bRotateToDesired=True
  2517. -}
  2518. + fLOS_Distance=512 //added by me -AdamJD
  2519. +}
  2520. \ No newline at end of file
  2521. diff --git a/HPBase/Classes/baseConsole.uc b/HPBase/Classes/baseConsole.uc
  2522. index c1ecd75..5d61866 100644
  2523. --- a/HPBase/Classes/baseConsole.uc
  2524. +++ b/HPBase/Classes/baseConsole.uc
  2525. @@ -1,5 +1,7 @@
  2526. class baseConsole expands WindowConsole;
  2527.  
  2528. +//Edited by- AdamJD (edited code will have AdamJD by it)
  2529. +
  2530. var bool bLeftKeyDown;
  2531. var bool bRightKeyDown;
  2532. var bool bForwardKeyDown;
  2533. @@ -15,7 +17,7 @@ var bool bRotateDownKeyDown;
  2534. var bool bSpaceReleased;
  2535. var bool bSpacePressed;
  2536.  
  2537. -var globalconfig bool bDebugMode;
  2538. +var globalconfig bool bDebugMode; //this was already here in the retail code but was only set up to be typed in game... -AdamJD
  2539. var globalconfig bool bUseSystemFonts;
  2540.  
  2541. var bool bUseAsianFont;
  2542. @@ -98,4 +100,6 @@ function DrawLevelAction( canvas C )
  2543. defaultproperties
  2544. {
  2545. bUseSystemFonts=True
  2546. + //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
  2547. + bDebugMode=False //debug mode is now turned off by default and can be turned off by pressing F7 in game if turned on -AdamJD
  2548. }
  2549. diff --git a/HPBase/Classes/baseHarry.uc b/HPBase/Classes/baseHarry.uc
  2550. index f01aa16..7ba538c 100644
  2551. --- a/HPBase/Classes/baseHarry.uc
  2552. +++ b/HPBase/Classes/baseHarry.uc
  2553. @@ -1,5 +1,7 @@
  2554. class baseHarry expands PlayerPawn;
  2555.  
  2556. +// Edited by- AdamJD (edited code will have AdamJD by it)
  2557. +
  2558. var bool clearMessages;
  2559.  
  2560. // The following inputs are in addition to the standard inputs defined in PlayerPawn.uc.
  2561. @@ -161,6 +163,31 @@ var travel bool bHasBark;
  2562. // sto: For debugging purposes, below
  2563. var globalconfig bool bDisableDialog;
  2564.  
  2565. +function Cast()
  2566. +{
  2567. + //overridden in Harry.uc (best method to do this the way this cursed code is set up...)-AdamJD
  2568. +}
  2569. +
  2570. +function StartCasting()
  2571. +{
  2572. + //go to StartCasting function in Harry class -AdamJD
  2573. +}
  2574. +
  2575. +function StopCasting()
  2576. +{
  2577. + //nothing to see here... -AdamJD
  2578. +}
  2579. +
  2580. +function PlayFinishCastAnim()
  2581. +{
  2582. + //you know the drill by now -AdamJD
  2583. +}
  2584. +
  2585. +function PlayFinishThrowCrackerAnim()
  2586. +{
  2587. + //same as PlayFinishCastAnim but for wizard crackers -AdamJD
  2588. +}
  2589. +
  2590. function AddStars(int n)
  2591. {
  2592. numStars+=n;
  2593. @@ -168,6 +195,7 @@ function AddStars(int n)
  2594. baseHud(myHud).StarItem.Show();
  2595.  
  2596. }
  2597. +
  2598. function AddBeans(int n)
  2599. {
  2600. numBeans+=n;
  2601. @@ -514,9 +542,9 @@ function actor ExtendTarget()
  2602. local rotator checkAngle, bestAngle;
  2603. local vector objectDir;
  2604.  
  2605. - checkangle = rotator(rectarget.location - location);
  2606. + checkangle = rotator(rectarget.location - location);
  2607. defaultYaw = Rotation.yaw & 0xffff;
  2608. - defaultpitch = rectarget.TargetPitch & 0xffff;
  2609. + defaultpitch = rectarget.TargetPitch & 0xffff;
  2610.  
  2611. BestTarget = none;
  2612.  
  2613. @@ -1090,8 +1118,6 @@ Begin:
  2614. gotostate(CutSaveState);
  2615. }
  2616.  
  2617. -
  2618. -
  2619. state wingspell
  2620. {
  2621. function tick (float deltaTime)
  2622. @@ -1120,6 +1146,8 @@ function endstate()
  2623.  
  2624. {
  2625. baseprops(focusActor).bStopLevitating=true;
  2626. + freeHarry();
  2627. + PlayFinishCastAnim(); //stops Harry running with his arms up after casting wingardium -AdamJD
  2628. }
  2629.  
  2630.  
  2631. @@ -1142,12 +1170,12 @@ function endstate()
  2632. if(bSkipKeyPressed)
  2633. {
  2634. baseprops(focusActor).bStopLevitating=true;
  2635. -
  2636. + freeHarry();
  2637. }
  2638. playanim('wave');
  2639. - rectarget.victim.eVulnerableToSpell=SPELL_WingSustain;
  2640. + rectarget.victim.eVulnerableToSpell=SPELL_WingSustain;
  2641. basewand(weapon).ChooseSpell(SPELL_WingSustain);
  2642. - basewand(weapon).castspell(rectarget.victim);
  2643. + basewand(weapon).castspell(rectarget.victim);
  2644. sleep(0.3);
  2645. goto 'loop';
  2646.  
  2647. @@ -1412,29 +1440,29 @@ defaultproperties
  2648. ConstrainYawVariance=5500
  2649. maxPointsPerHouse=400
  2650. HarryMultipleForGryffindor=3
  2651. - WizardCards(0)=(ID=101)
  2652. - WizardCards(1)=(ID=1)
  2653. - WizardCards(2)=(ID=28)
  2654. - WizardCards(3)=(ID=10)
  2655. - WizardCards(4)=(ID=24)
  2656. - WizardCards(5)=(ID=18)
  2657. - WizardCards(6)=(ID=8)
  2658. - WizardCards(7)=(ID=2)
  2659. - WizardCards(8)=(ID=19)
  2660. - WizardCards(9)=(ID=47)
  2661. - WizardCards(10)=(ID=35)
  2662. - WizardCards(11)=(ID=41)
  2663. - WizardCards(12)=(ID=17)
  2664. - WizardCards(13)=(ID=69)
  2665. - WizardCards(14)=(ID=48)
  2666. - WizardCards(15)=(ID=37)
  2667. - WizardCards(16)=(ID=62)
  2668. - WizardCards(17)=(ID=57)
  2669. - WizardCards(18)=(ID=49)
  2670. - WizardCards(19)=(ID=96)
  2671. - WizardCards(20)=(ID=72)
  2672. - WizardCards(21)=(ID=82)
  2673. - WizardCards(22)=(ID=83)
  2674. - WizardCards(23)=(ID=11)
  2675. - WizardCards(24)=(ID=100)
  2676. + WizardCards(0)=(Id=101)
  2677. + WizardCards(1)=(Id=1)
  2678. + WizardCards(2)=(Id=28)
  2679. + WizardCards(3)=(Id=10)
  2680. + WizardCards(4)=(Id=24)
  2681. + WizardCards(5)=(Id=18)
  2682. + WizardCards(6)=(Id=8)
  2683. + WizardCards(7)=(Id=2)
  2684. + WizardCards(8)=(Id=19)
  2685. + WizardCards(9)=(Id=47)
  2686. + WizardCards(10)=(Id=35)
  2687. + WizardCards(11)=(Id=41)
  2688. + WizardCards(12)=(Id=17)
  2689. + WizardCards(13)=(Id=69)
  2690. + WizardCards(14)=(Id=48)
  2691. + WizardCards(15)=(Id=37)
  2692. + WizardCards(16)=(Id=62)
  2693. + WizardCards(17)=(Id=57)
  2694. + WizardCards(18)=(Id=49)
  2695. + WizardCards(19)=(Id=96)
  2696. + WizardCards(20)=(Id=72)
  2697. + WizardCards(21)=(Id=82)
  2698. + WizardCards(22)=(Id=83)
  2699. + WizardCards(23)=(Id=11)
  2700. + WizardCards(24)=(Id=100)
  2701. }
  2702. diff --git a/HPBase/Classes/baseSpell.uc b/HPBase/Classes/baseSpell.uc
  2703. index f5579ae..6d427da 100644
  2704. --- a/HPBase/Classes/baseSpell.uc
  2705. +++ b/HPBase/Classes/baseSpell.uc
  2706. @@ -3,19 +3,19 @@
  2707. //=============================================================================
  2708. class baseSpell extends Projectile;
  2709.  
  2710. -#exec MESH IMPORT MESH=spellProj ANIVFILE=MODELS\Cross_a.3D DATAFILE=MODELS\Cross_d.3D X=0 Y=0 Z=0
  2711. +//Edited by- AdamJD (edited code will have AdamJD by it)
  2712.  
  2713. -#exec MESH ORIGIN MESH=spellProj X=0 Y=0 Z=0 YAW=64
  2714. -#exec MESH SEQUENCE MESH=spellProj SEQ=All STARTFRAME=0 NUMFRAMES=1
  2715. -#exec MESH SEQUENCE MESH=spellProj SEQ=Still STARTFRAME=0 NUMFRAMES=1
  2716. -#exec MESHMAP SCALE MESHMAP=spellProj X=0.2 Y=0.2 Z=0.2
  2717. +//#exec MESH IMPORT MESH=spellProj ANIVFILE=MODELS\SpellProj_a.3D DATAFILE=MODELS\Cross_d.3D X=0 Y=0 Z=0 //not needed -AdamJD
  2718.  
  2719. -#exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
  2720. +//#exec MESH ORIGIN MESH=spellProj X=0 Y=0 Z=0 YAW=64
  2721. +//#exec MESH SEQUENCE MESH=spellProj SEQ=All STARTFRAME=0 NUMFRAMES=1
  2722. +//#exec MESH SEQUENCE MESH=spellProj SEQ=Still STARTFRAME=0 NUMFRAMES=1
  2723. +//#exec MESHMAP SCALE MESHMAP=spellProj X=0.2 Y=0.2 Z=0.2
  2724.  
  2725. +//#exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage //not needed -AdamJD
  2726.  
  2727.  
  2728. -
  2729. -#EXEC TEXTURE IMPORT NAME=defaultSpellIcon FILE=..\HPMenu\TEXTURES\HUD\transSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  2730. +#EXEC TEXTURE IMPORT NAME=defaultSpellIcon FILE=TEXTURES\transSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  2731.  
  2732. var Texture spellIcon;
  2733. var string spellName;
  2734. @@ -28,7 +28,7 @@ var sound CastSound;
  2735. var string SpellIncantation;
  2736. var string QuietSpellIncantation;
  2737.  
  2738. -var float manaCost;
  2739. +//var float manaCost; //not needed -AdamJD
  2740.  
  2741. var (VisualEffects) Mesh projectileMesh;
  2742. var (VisualEffects) class<baseVisualEffect> hitEffect;
  2743. @@ -48,6 +48,12 @@ var (VisualEffects) gesture Gesture;
  2744. // FX for the spell gesture
  2745. var (VisualEffects)class<ParticleFX>GestureParticleEffectClass;
  2746.  
  2747. +//AdamJD vars
  2748. +var vector CurrentDir;
  2749. +var vector TargetOffset;
  2750. +var float SeekSpeed;
  2751. +var float SpellLifeTime;
  2752. +
  2753. simulated function PostBeginPlay()
  2754. {
  2755. Super.PostBeginPlay();
  2756. @@ -58,6 +64,8 @@ simulated function PostBeginPlay()
  2757. flyParticleEffect=spawn(flyParticleEffectClass);
  2758. flyParticleEffect.setRotation(flyParticleEffect.default.rotation);
  2759. }
  2760. +
  2761. + CurrentDir = vector(rotation); //AdamJD
  2762. }
  2763.  
  2764. function PlaySpellCastSound()
  2765. @@ -86,6 +94,11 @@ event Tick(float deltaTime)
  2766. super.Tick(deltaTime);
  2767. if(flyParticleEffect!=None)
  2768. flyParticleEffect.SetLocation(location);
  2769. +
  2770. + if( (SpellLifeTime -= deltaTime) < 0 )
  2771. + {
  2772. + Destroy();
  2773. + }
  2774.  
  2775. }
  2776.  
  2777. @@ -94,6 +107,28 @@ function AdjustLifeTimer(float NewLifeTimer)
  2778. //Implemented in derived class
  2779. }
  2780.  
  2781. +//target offset -AdamJD
  2782. +function InitSpell(Actor CastedAt, optional vector CastedAtOffset)
  2783. +{
  2784. + target = CastedAt;
  2785. + TargetOffset = CastedAtOffset;
  2786. +}
  2787. +
  2788. +//spell direction -AdamJD
  2789. +function SetSpellDirection( vector dir )
  2790. +{
  2791. + CurrentDir = normal(dir);
  2792. + DesiredRotation = rotator(CurrentDir);
  2793. + SetRotation( DesiredRotation );
  2794. + flyParticleEffect.SetRotation( DesiredRotation );
  2795. +}
  2796. +
  2797. +//hit location -AdamJD
  2798. +function vector GetTargetHitLocation()
  2799. +{
  2800. + return target.location + TargetOffset;
  2801. +}
  2802. +
  2803. //*************************************************************************************************
  2804. auto state Flying
  2805. {
  2806. @@ -224,7 +259,7 @@ simulated function Timer()
  2807.  
  2808.  
  2809. //@PAB removed this, as this caused the spell to go upwards far too much
  2810. - // aimPoint.Z=aimPoint.Z+(target.CollisionHeight)+2;
  2811. + //aimPoint.Z+=(target.CollisionHeight)+2;
  2812.  
  2813. SeekingDir = Normal(aimPoint - Location);
  2814. if ( (SeekingDir Dot InitialDir) > 0 )
  2815. @@ -239,7 +274,7 @@ simulated function Timer()
  2816. }
  2817.  
  2818. //drop off puffs as it flys
  2819. - // b = Spawn(class'ut_SpriteSmokePuff');
  2820. + //b = Spawn(class'ut_SpriteSmokePuff');
  2821. }
  2822.  
  2823.  
  2824. @@ -254,10 +289,12 @@ Log("******** Explode:"$self);
  2825.  
  2826. Destroy();
  2827. }
  2828. -function static Texture GetSpellIcon()
  2829. -{
  2830. - return(default.spellIcon);
  2831. -}
  2832. +
  2833. +//not needed -AdamJD
  2834. +// function static Texture GetSpellIcon()
  2835. +// {
  2836. + // return(default.spellIcon);
  2837. +// }
  2838.  
  2839. //Mover::IsRelevant calls this
  2840. function bool IsRelevantToMover()
  2841. @@ -273,7 +310,7 @@ defaultproperties
  2842. spellIcon=Texture'HPBase.Icons.defaultSpellIcon'
  2843. spellName="baseSpell"
  2844. CastSound=Sound'HPSounds.magic_sfx.spell_cast'
  2845. - manaCost=10
  2846. + //manaCost=10 //not needed -AdamJD
  2847. projectileMesh=LodMesh'HPBase.spellProj'
  2848. GestureParticleEffectClass=Class'HPParticle.Les_SpellShape'
  2849. Speed=170
  2850. @@ -282,7 +319,7 @@ defaultproperties
  2851. bNetTemporary=False
  2852. RemoteRole=ROLE_SimulatedProxy
  2853. LifeSpan=10
  2854. - Mesh=LodMesh'HPBase.spellProj'
  2855. + //Mesh=LodMesh'HPBase.spellProj' //not needed -AdamJD
  2856. DrawScale=0.3
  2857. bUnlit=True
  2858. CollisionRadius=5
  2859. @@ -295,4 +332,6 @@ defaultproperties
  2860. LightSaturation=72
  2861. LightRadius=10
  2862. bFixedRotationDir=True
  2863. + SeekSpeed=7.0f //AdamJD
  2864. + SpellLifeTime=8.0 //AdamJD
  2865. }
  2866. diff --git a/HPBase/Classes/baseWand.uc b/HPBase/Classes/baseWand.uc
  2867. index c19f68c..53b72d2 100644
  2868. --- a/HPBase/Classes/baseWand.uc
  2869. +++ b/HPBase/Classes/baseWand.uc
  2870. @@ -2,6 +2,9 @@
  2871. // baseWand
  2872. //=============================================================================
  2873. class baseWand extends Weapon;
  2874. +
  2875. +//Edited by- AdamJD (edited code will have AdamJD by it)
  2876. +
  2877. #exec MESH MODELIMPORT MESH=WandMesh MODELFILE=models\Wand.PSK LODSTYLE=10
  2878. #exec MESH ORIGIN MESH=WandMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
  2879. #exec ANIM IMPORT ANIM=WandAnims ANIMFILE=models\Wand.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
  2880. @@ -12,16 +15,28 @@ class baseWand extends Weapon;
  2881. // 'VERBOSE' gives more debugging info in UCC.log
  2882. #exec ANIM DIGEST ANIM=WandAnims VERBOSE
  2883.  
  2884. -#EXEC TEXTURE IMPORT NAME=WandTex0 FILE=TEXTURES\WandTexture.bmp GROUP=Skins
  2885. +#EXEC TEXTURE IMPORT NAME=WandTex0 FILE=TEXTURES\WandTex0.bmp GROUP=Skins
  2886.  
  2887. #EXEC MESHMAP SETTEXTURE MESHMAP=WandMesh NUM=0 TEXTURE=WandTex0
  2888.  
  2889.  
  2890. +//AdamJD vars
  2891. +var bool bInstantFire;
  2892. +var baseHarry playerHarry;
  2893. +var float fAutoHitDistance;
  2894. +var particleFX fxChargeParticles;
  2895. +var class<particleFX> fxChargeParticleFXClass;
  2896. +var bool bSpellCharges;
  2897. +var float fSpellCharge;
  2898. +var float fSpellChargeTime;
  2899. +var float fSpellChargeTimeSpan;
  2900. +var float fSpellChargeStartScale;
  2901. +var float fSpellChargeEndScale;
  2902.  
  2903.  
  2904. var() int HitDamage;
  2905. -var Pickup Amp;
  2906. -var bool bBotSpecialMove;
  2907. +//var Pickup Amp; //not needed -AdamJD
  2908. +//var bool bBotSpecialMove; //not needed -AdamJD
  2909.  
  2910. var bool bAutoSelectSpell;
  2911. var bool bUseNoSpell;
  2912. @@ -34,8 +49,10 @@ var class<baseSpell> spellList[16];
  2913. var particleFX wandEffect;
  2914. var baseProps testWand;
  2915.  
  2916. -var float maxMana;
  2917. -var float curMana;
  2918. +//not needed -AdamJD
  2919. +// var float maxMana;
  2920. +// var float curMana;
  2921. +
  2922. var bool bUseMana;
  2923. var bool bCasting;
  2924.  
  2925. @@ -52,14 +69,17 @@ local vector v;
  2926. local rotator r;
  2927.  
  2928. super.tick(deltaTime);
  2929. + //not needed -AdamJD
  2930. + /*
  2931. if(bUseMana)
  2932. {
  2933. curMana+=deltaTime*5;
  2934. if(curMana>maxMana)
  2935. curMana=maxMana;
  2936. }
  2937. + */
  2938.  
  2939. - /*
  2940. +
  2941. if(wandEffect!=None && pawn(owner) != none && pawn(owner).Weapon==self)
  2942. {
  2943. r=pawn(owner).weaponRot;
  2944. @@ -70,7 +90,7 @@ local rotator r;
  2945. wandEffect.ParticlesPerSec.Base=wandEffect.default.ParticlesPerSec.Base;
  2946. else
  2947. wandEffect.ParticlesPerSec.Base=4.1;
  2948. - }*/
  2949. + }
  2950. }
  2951.  
  2952. function BecomeItem()
  2953. @@ -100,7 +120,6 @@ local int i;
  2954.  
  2955. event BeginPlay()
  2956. {
  2957. -
  2958. /*
  2959. if(wandEffect==None)
  2960. {
  2961. @@ -108,7 +127,7 @@ event BeginPlay()
  2962. wandEffect.ParticlesPerSec.Base=0;
  2963. wandEffect.bVelocityRelative=false;
  2964. }
  2965. - */
  2966. + */
  2967.  
  2968. bUseNoSpell = true;
  2969. }
  2970. @@ -136,8 +155,6 @@ function SelectSpell(class<baseSpell> spell)
  2971. curSpell=spell;
  2972. }
  2973.  
  2974. -
  2975. -
  2976. function ChooseSpell(ESpellType Spell)
  2977. {
  2978. switch(Spell)
  2979. @@ -216,8 +233,16 @@ function CastSpell(Actor target)
  2980. local vector HitLocation, HitNormal, Start;
  2981. local sound outSound;
  2982. local string Label, outText, Language;
  2983. + local bool bUseWeaponForProjRot; //AdamJD
  2984.  
  2985. - bPointing=True;//whats this for??
  2986. + bPointing=True;//whats this for??
  2987. +
  2988. + //AdamJD
  2989. + if( target == self )
  2990. + {
  2991. + bUseWeaponForProjRot = true;
  2992. + target = none;
  2993. + }
  2994.  
  2995. // Enable this for the PS1 Conversion O' Joy
  2996. if(bAutoSelectSpell)
  2997. @@ -241,6 +266,8 @@ function CastSpell(Actor target)
  2998.  
  2999. //AE: Moved incantation to after 'LastCastedSpell' is set, because it's used.
  3000.  
  3001. + //not needed -AdamJD
  3002. + /*
  3003. if(bUseMana)
  3004. {
  3005. if(curMana>=curSpell.default.manaCost)
  3006. @@ -248,6 +275,7 @@ function CastSpell(Actor target)
  3007. else
  3008. return;
  3009. }
  3010. + */
  3011.  
  3012. LastCastedSpell=baseSpell( ProjectileFire(curSpell, AltProjectileSpeed, false) );
  3013. LastCastedSpell.target = target;
  3014. @@ -280,13 +308,24 @@ function CastSpell(Actor target)
  3015. }
  3016. }
  3017. }
  3018. -
  3019. +
  3020. + //not needed -AdamJD
  3021. + /*
  3022. //See if there's a matching object we should get rid of. Also set curSpell to none.
  3023. if( DestroyThisOnCast != none) //!= none && curSpell(DestroyThisOnCast) != none )
  3024. {
  3025. DestroyThisOnCast.Destroy();
  3026. SelectSpell(none);
  3027. }
  3028. + */
  3029. +
  3030. + //HP2 code -AdamJD
  3031. + if( target.IsA('Pawn') &&
  3032. + vsize(location - target.location) < fAutoHitDistance )
  3033. + {
  3034. + // We are really close to our target so AutoHit it!
  3035. + LastCastedSpell.ProcessTouch( target, target.location );
  3036. + }
  3037.  
  3038. // Owner.PlaySound(AltFireSound, SLOT_None,Pawn(Owner).SoundDampening*4.0);
  3039.  
  3040. @@ -298,10 +337,25 @@ function CastSpell(Actor target)
  3041.  
  3042. function Texture GetSpellIcon()
  3043. {
  3044. - if(curSpell!=None)
  3045. - return curSpell.Default.spellIcon;
  3046. - else
  3047. - return None;
  3048. + //not needed -AdamJD
  3049. + // if(curSpell!=None)
  3050. + // return curSpell.Default.spellIcon;
  3051. + // else
  3052. + // return None;
  3053. +}
  3054. +
  3055. +//HP2 code -AdamJD
  3056. +function ScaleParticles( ParticleFX FX, float scale )
  3057. +{
  3058. + FX.ParticlesPerSec.Base = FX.default.ParticlesPerSec.Base * scale;
  3059. + FX.SourceHeight.Base = FX.default.SourceHeight.Base * scale;
  3060. + FX.SourceWidth.Base = FX.default.SourceWidth.Base * scale;
  3061. + FX.SourceDepth.Base = FX.default.SourceDepth.Base * scale;
  3062. + FX.SizeWidth.Base = FX.default.SizeWidth.Base * scale;
  3063. + FX.SizeLength.Base = FX.default.SizeLength.Base * scale;
  3064. + FX.AngularSpreadWidth.Base = FX.default.AngularSpreadWidth.Base* scale;
  3065. + FX.AngularSpreadHeight.Base = FX.default.AngularSpreadHeight.Base*scale;
  3066. + FX.SpinRate.Base = FX.default.SpinRate.Base * scale;
  3067. }
  3068.  
  3069. function inventory SpawnCopy( pawn Other )
  3070. @@ -317,16 +371,16 @@ function inventory SpawnCopy( pawn Other )
  3071.  
  3072. function AltFire( float Value )
  3073. {
  3074. - local actor HitActor;
  3075. - local vector HitLocation, HitNormal, Start;
  3076. -
  3077. + //not needed -AdamJD
  3078. + // local actor HitActor;
  3079. + // local vector HitLocation, HitNormal, Start;
  3080.  
  3081. if ( PlayerPawn(Owner) != None )
  3082. {
  3083. PlayerPawn(Owner).ClientInstantFlash( -0.4, vect(0, 0, 800));
  3084. PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
  3085. }
  3086. - bPointing=True;
  3087. + bPointing=True;
  3088. ProjectileFire(AltProjectileClass, AltProjectileSpeed, bAltWarnTarget);
  3089.  
  3090. Owner.PlaySound(AltFireSound, SLOT_None,Pawn(Owner).SoundDampening*4.0);
  3091. @@ -337,7 +391,6 @@ function AltFire( float Value )
  3092. }
  3093.  
  3094.  
  3095. -
  3096. function float RateSelf( out int bUseAltMode )
  3097. {
  3098. return 99.0; //wand is always the best weapon. well, its the _only_ weapon.
  3099. @@ -345,10 +398,12 @@ function float RateSelf( out int bUseAltMode )
  3100.  
  3101. function BecomePickup()
  3102. {
  3103. - Amp = None;
  3104. + //Amp = None; //not needed -AdamJD
  3105. Super.BecomePickup();
  3106. }
  3107.  
  3108. +//not needed -AdamJD
  3109. +/*
  3110. function Timer()
  3111. {
  3112. local actor targ;
  3113. @@ -365,14 +420,14 @@ function Timer()
  3114. targ = Pawn(Owner).PickTarget(bestAim, bestDist, FireDir, Owner.Location);
  3115. if ( Pawn(targ) != None )
  3116. {
  3117. - bPointing = true;
  3118. + bPointing = true;
  3119. Pawn(targ).WarnTarget(Pawn(Owner), 300, FireDir);
  3120. SetTimer(1 + 4 * FRand(), false);
  3121. }
  3122. else
  3123. {
  3124. SetTimer(0.5 + 2 * FRand(), false);
  3125. - bPointing = false;
  3126. + bPointing = false;
  3127. }
  3128. }
  3129.  
  3130. @@ -383,6 +438,7 @@ function Finish()
  3131.  
  3132. Super.Finish();
  3133. }
  3134. +*/
  3135.  
  3136. ///////////////////////////////////////////////////////
  3137. function PlayFiring()
  3138. @@ -394,11 +450,11 @@ function PlayFiring()
  3139.  
  3140. function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
  3141. {
  3142. - local Vector Start, X,Y,Z;
  3143. -
  3144. + local Vector Start, X,Y,Z;
  3145. +
  3146. Owner.MakeNoise(Pawn(Owner).SoundDampening);
  3147.  
  3148. -//Log("Projectile fire owner:" $owner $" Rotation:" $Pawn(owner).ViewRotation);
  3149. +Log("Projectile fire owner:" $owner $" Rotation:" $Pawn(owner).ViewRotation);
  3150.  
  3151. GetAxes(Pawn(owner).ViewRotation,X,Y,Z);
  3152. Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
  3153. @@ -407,14 +463,12 @@ function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed,
  3154. if(ProjClass==Class'spellEcto')
  3155. AdjustedAim = pawn(owner).AdjustToss(ProjSpeed, Start, 0, True, (bWarn || (FRand() < 0.4)));
  3156. else
  3157. - AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn);
  3158. + AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, /*AimError*/ 0, True, bWarn);
  3159. bSplashDamage = true;
  3160. return(Spawn(ProjClass,,, Start,AdjustedAim));
  3161. -
  3162. }
  3163.  
  3164.  
  3165. -
  3166. function SpawnEffect(Vector DVector, int NumPoints, rotator SmokeRotation, vector SmokeLocation)
  3167. {
  3168. //cmp cleanup local RingExplosion4 Smoke;
  3169. @@ -434,7 +488,7 @@ state Idle
  3170.  
  3171. function BeginState()
  3172. {
  3173. - bPointing = false;
  3174. + bPointing = false;
  3175. SetTimer(0.5 + 2 * FRand(), false);
  3176. Super.BeginState();
  3177. if (Pawn(Owner).bFire!=0) Fire(0.0);
  3178. @@ -453,13 +507,14 @@ defaultproperties
  3179. {
  3180. HitDamage=35
  3181. bAutoSelectSpell=True
  3182. - maxMana=100
  3183. - curMana=50
  3184. + //not needed -AdamJD
  3185. + //maxMana=100
  3186. + //curMana=50
  3187. PickupAmmoCount=200
  3188. bSplashDamage=True
  3189. FireOffset=(Y=-6,Z=-7)
  3190. AltProjectileClass=Class'HPBase.baseSpell'
  3191. - AimError=0
  3192. + //AimError=0 //not needed -AdamJD
  3193. AltRefireRate=0.7
  3194. DeathMessage="%k inflicted mortal damage upon %o with the %w."
  3195. AutoSwitchPriority=4
  3196. @@ -473,4 +528,6 @@ defaultproperties
  3197. CollisionRadius=28
  3198. CollisionHeight=8
  3199. Mass=50
  3200. + bUseMana=False //AdamJD
  3201. + fAutoHitDistance=128 //AdamJD
  3202. }
  3203. diff --git a/HPBase/Classes/cHarryAnimChannel.uc b/HPBase/Classes/cHarryAnimChannel.uc
  3204. index d070ace..74d0a7e 100644
  3205. --- a/HPBase/Classes/cHarryAnimChannel.uc
  3206. +++ b/HPBase/Classes/cHarryAnimChannel.uc
  3207. @@ -1,5 +1,7 @@
  3208. class cHarryAnimChannel expands AnimChannel;
  3209.  
  3210. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3211. +
  3212. function GotoStateHoldUpArm()
  3213. {
  3214. if( IsInState('stateIdle') )
  3215. @@ -16,10 +18,42 @@ function GotoStateThrow()
  3216. GotoState('stateThrow');
  3217. }
  3218.  
  3219. +//AdamJD
  3220. +function GotoStateCasting()
  3221. +{
  3222. + GotoState('stateCasting');
  3223. +}
  3224. +
  3225. +//AdamJD
  3226. +function GotoStateCancelCasting()
  3227. +{
  3228. + GotoState('stateCancelCasting');
  3229. +}
  3230. +
  3231. +//AdamJD
  3232. +function GotoStateCast()
  3233. +{
  3234. + GotoState('stateCast');
  3235. +}
  3236. +
  3237. +//AdamJD
  3238. +function GotoStateHasCast()
  3239. +{
  3240. + GotoState('stateHasCast');
  3241. +}
  3242. +
  3243. +//go to baseHarry class to get cast function -AdamJD
  3244. +function Cast()
  3245. +{
  3246. + local baseHarry harry;
  3247. + ForEach AllActors (class'baseHarry', harry)
  3248. + harry.Cast();
  3249. +}
  3250. +
  3251. auto state stateIdle
  3252. {
  3253. -// Begin:
  3254. -// AnimFrame = 0;
  3255. + // Begin:
  3256. + // AnimFrame = 0;
  3257. }
  3258.  
  3259. state stateHoldUpArm
  3260. @@ -46,11 +80,85 @@ state stateThrow
  3261. baseHarry(owner).ThrowCarryingActor();
  3262. finishAnim();
  3263.  
  3264. - /*HarryAnimChannel.*/GotoStateIdle();
  3265. + /*HarryAnimChannel.*/ //GotoStateIdle(); //not needed -AdamJD
  3266. baseHarry(Owner).HarryAnimType = AT_Replace;
  3267. + baseHarry(owner).PlayFinishThrowCrackerAnim(); //this fixes the issue where Harry kept his arms held up after throwing a cracker -AdamJD
  3268.  
  3269. //LoopAnim( 'breath' );
  3270. - GotoState('stateIdle');
  3271. + // GotoState('stateIdle'); //not needed -AdamJD
  3272. +}
  3273. +
  3274. +//AdamJD
  3275. +state stateCasting
  3276. +{
  3277. + //move camera when casting and turn spell casting stuff on -AdamJD
  3278. + function BeginState()
  3279. + {
  3280. + local baseHarry harry;
  3281. + ForEach AllActors (class'baseHarry', harry)
  3282. + harry.HarryAnimType = AT_Combine;
  3283. + harry.StartCasting();
  3284. + }
  3285. +
  3286. + begin:
  3287. + LoopAnim('wave', 1.0, 0.2);
  3288. +}
  3289. +
  3290. +//AdamJD
  3291. +state stateCancelCasting
  3292. +{
  3293. + //turn spell casting stuff off -AdamJD
  3294. + function BeginState()
  3295. + {
  3296. + local baseHarry harry;
  3297. + ForEach AllActors (class'baseHarry', harry)
  3298. + harry.HarryAnimType = AT_Combine;
  3299. + harry.StopCasting();
  3300. + }
  3301. +
  3302. + begin:
  3303. + PlayAnim('cast', 2.0 , 0.1); //setting the anim to 'breath' messes up the walking animations so 'cast' will have to do... -AdamJD
  3304. + FinishAnim(); //stops Harry snapping his arm back too early -AdamJD
  3305. + baseHarry(owner).HarryAnimType = AT_Replace;
  3306. + baseHarry(owner).PlayFinishCastAnim();
  3307. +}
  3308. +
  3309. +//AdamJD
  3310. +state stateCast
  3311. +{
  3312. + //turn spell casting stuff off -AdamJD
  3313. + function BeginState()
  3314. + {
  3315. + local baseHarry harry;
  3316. + ForEach AllActors (class'baseHarry', harry)
  3317. + harry.HarryAnimType = AT_Combine;
  3318. + // PlayAnim('cast', 2.0, 0.1);
  3319. + harry.StopCasting();
  3320. + }
  3321. +
  3322. + begin:
  3323. + PlayAnim('cast', 2.0, 0.1);
  3324. + // FinishAnim();
  3325. + baseHarry(owner).HarryAnimType = AT_Replace;
  3326. + baseHarry(owner).PlayFinishCastAnim();
  3327. +}
  3328. +
  3329. +//AdamJD
  3330. +state stateHasCast
  3331. +{
  3332. + //turn spell casting stuff off -AdamJD
  3333. + function BeginState()
  3334. + {
  3335. + local baseHarry harry;
  3336. + ForEach AllActors (class'baseHarry', harry)
  3337. + harry.HarryAnimType = AT_Combine;
  3338. + harry.StopCasting();
  3339. + }
  3340. +
  3341. + begin:
  3342. + FinishAnim(); //stops Harry snapping his arm back too early -AdamJD
  3343. + baseHarry(owner).HarryAnimType = AT_Replace;
  3344. + baseHarry(owner).PlayFinishCastAnim();
  3345. }
  3346.  
  3347. defaultproperties
  3348. diff --git a/HPBase/Classes/spellFlip.uc b/HPBase/Classes/spellFlip.uc
  3349. index 37e2895..b0ddedb 100644
  3350. --- a/HPBase/Classes/spellFlip.uc
  3351. +++ b/HPBase/Classes/spellFlip.uc
  3352. @@ -2,6 +2,8 @@
  3353.  
  3354. class spellFlip extends BASESPELL;
  3355.  
  3356. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3357. +
  3358. #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
  3359. #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
  3360. #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
  3361. @@ -13,7 +15,7 @@ class spellFlip extends BASESPELL;
  3362. #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
  3363. #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
  3364.  
  3365. -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  3366. +//#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF //not needed -AdamJD
  3367.  
  3368. #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
  3369.  
  3370. @@ -56,7 +58,7 @@ function PlayIncantateSound(bool bSneaking)
  3371.  
  3372. defaultproperties
  3373. {
  3374. - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
  3375. + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
  3376. spellName="Flipendo"
  3377. SpellIncantation="spells1"
  3378. QuietSpellIncantation="spells10"
  3379. diff --git a/HPBase/Classes/spellIncendio.uc b/HPBase/Classes/spellIncendio.uc
  3380. index 6c06c36..bc70e39 100644
  3381. --- a/HPBase/Classes/spellIncendio.uc
  3382. +++ b/HPBase/Classes/spellIncendio.uc
  3383. @@ -1,6 +1,9 @@
  3384. //===============================================================================
  3385.  
  3386. class spellIncendio extends BASESPELL;
  3387. +
  3388. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3389. +
  3390. #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
  3391. #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
  3392. #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
  3393. @@ -12,7 +15,7 @@ class spellIncendio extends BASESPELL;
  3394. #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
  3395. #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
  3396.  
  3397. -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  3398. +//#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF //not needed -AdamJD
  3399.  
  3400. #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
  3401.  
  3402. @@ -47,7 +50,7 @@ function PlayIncantateSound(bool bSneaking)
  3403.  
  3404. defaultproperties
  3405. {
  3406. - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
  3407. + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
  3408. spellName="Incendio"
  3409. SpellIncantation="spells5"
  3410. QuietSpellIncantation="spells9"
  3411. diff --git a/HPBase/Classes/spelldud.uc b/HPBase/Classes/spelldud.uc
  3412. index 287fedc..8bff647 100644
  3413. --- a/HPBase/Classes/spelldud.uc
  3414. +++ b/HPBase/Classes/spelldud.uc
  3415. @@ -2,6 +2,10 @@
  3416.  
  3417. class spelldud extends BASESPELL;
  3418.  
  3419. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3420. +
  3421. +//not needed -AdamJD
  3422. +/*
  3423. #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
  3424. #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
  3425. #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
  3426. @@ -13,7 +17,7 @@ class spelldud extends BASESPELL;
  3427. #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
  3428. #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
  3429.  
  3430. -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  3431. +#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  3432.  
  3433. #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
  3434.  
  3435. @@ -26,15 +30,17 @@ function PostBeginPlay()
  3436. Super.PostBeginPlay();
  3437. LoopAnim('all', 2.0, 0.0);
  3438. }
  3439. -
  3440. +*/
  3441. defaultproperties
  3442. {
  3443. - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
  3444. - spellName="Flipendo"
  3445. - CastSound=None
  3446. - flyParticleEffectClass=Class'HPParticle.SmokeExplo_03'
  3447. - Gesture=Gesture'HPBase.FlipPattern'
  3448. - ImpactSound=None
  3449. - LifeSpan=0.3
  3450. - Style=STY_Translucent
  3451. + //this class is not needed so I've commented out default props -AdamJD
  3452. +
  3453. + // spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
  3454. + // spellName="Flipendo"
  3455. + // CastSound=None
  3456. + // flyParticleEffectClass=Class'HPParticle.SmokeExplo_03'
  3457. + // Gesture=Gesture'HPBase.FlipPattern'
  3458. + // ImpactSound=None
  3459. + // LifeSpan=0.3
  3460. + // Style=STY_Translucent
  3461. }
  3462. diff --git a/HPBase/Classes/spelllumas.uc b/HPBase/Classes/spelllumas.uc
  3463. index 4d0951c..d656d27 100644
  3464. --- a/HPBase/Classes/spelllumas.uc
  3465. +++ b/HPBase/Classes/spelllumas.uc
  3466. @@ -2,6 +2,8 @@
  3467.  
  3468. class spelllumas extends BASESPELL;
  3469.  
  3470. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3471. +
  3472. #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
  3473. #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
  3474. #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
  3475. @@ -13,7 +15,7 @@ class spelllumas extends BASESPELL;
  3476. #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
  3477. #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
  3478.  
  3479. -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  3480. +//#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF //not needed -AdamJD
  3481.  
  3482. #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
  3483.  
  3484. @@ -51,7 +53,7 @@ function PlayIncantateSound(bool bSneaking)
  3485.  
  3486. defaultproperties
  3487. {
  3488. - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
  3489. + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
  3490. spellName="Lumas"
  3491. SpellIncantation="spells12"
  3492. QuietSpellIncantation="spells13"
  3493. diff --git a/HPBase/Classes/spellnone.uc b/HPBase/Classes/spellnone.uc
  3494. index cb8c4ce..2981b06 100644
  3495. --- a/HPBase/Classes/spellnone.uc
  3496. +++ b/HPBase/Classes/spellnone.uc
  3497. @@ -2,24 +2,29 @@
  3498.  
  3499. class spellnone extends BASESPELL;
  3500.  
  3501. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3502. +
  3503. +//not needed -AdamJD
  3504. +/*
  3505. #exec MESH MODELIMPORT MESH=SPELLLEVMesh MODELFILE=models\LevProjectile.PSK LODSTYLE=10
  3506. #exec MESH ORIGIN MESH=SPELLLEVMesh X=0 Y=0 Z=0 YAW=0 PITCH=0 ROLL=0
  3507. #exec ANIM IMPORT ANIM=SPELLLEVAnims ANIMFILE=models\LevProjectile.PSA COMPRESS=1 MAXKEYS=999999 IMPORTSEQS=1
  3508. #exec MESHMAP SCALE MESHMAP=SPELLLEVMesh X=2.0 Y=2.0 Z=2.0
  3509. #exec MESH DEFAULTANIM MESH=SPELLLEVMesh ANIM=SPELLLEVAnims
  3510.  
  3511. -// Digest and compress the animation data. Must come after the sequence declarations.
  3512. -// 'VERBOSE' gives more debugging info in UCC.log
  3513. +Digest and compress the animation data. Must come after the sequence declarations.
  3514. +'VERBOSE' gives more debugging info in UCC.log
  3515. #exec ANIM DIGEST ANIM=SPELLLEVAnims VERBOSE
  3516. #exec OBJ LOAD FILE=..\textures\HP_FX.utx PACKAGE=HPBase.FXPackage
  3517.  
  3518. -#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=..\HPMenu\TEXTURES\HUD\alohSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  3519. +#EXEC TEXTURE IMPORT NAME=alohoSpellIcon FILE=TEXTURES\alohoSpellIcon.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
  3520.  
  3521. #EXEC MESHMAP SETTEXTURE MESHMAP=SPELLLEVMesh NUM=0 TEXTURE=HPBase.FXPackage.win_p
  3522.  
  3523.  
  3524. -// Import the pattern
  3525. +Import the pattern
  3526. #exec PATTERN IMPORT PATTERN=FlipPattern FILE=Patterns/Flipendo.hpg
  3527. +*/
  3528.  
  3529. function PostBeginPlay()
  3530. {
  3531. @@ -29,13 +34,14 @@ function PostBeginPlay()
  3532.  
  3533. defaultproperties
  3534. {
  3535. - spellIcon=Texture'HPBase.Icons.alohoSpellIcon'
  3536. - spellName="Flipendo"
  3537. + //spellIcon=Texture'HPBase.Icons.alohoSpellIcon' //not needed -AdamJD
  3538. + //spellName="Flipendo" //not needed -AdamJD
  3539. CastSound=Sound'HPSounds.magic_sfx.spell_dud'
  3540. - flyParticleEffectClass=Class'HPParticle.SmokeExplo_03'
  3541. - Gesture=Gesture'HPBase.FlipPattern'
  3542. + //flyParticleEffectClass=Class'HPParticle.SmokeExplo_03' //not needed -AdamJD
  3543. + //Gesture=Gesture'HPBase.FlipPattern' //not needed -AdamJD
  3544. ImpactSound=None
  3545. - LifeSpan=0.3
  3546. - Style=STY_Translucent
  3547. - Texture=Texture'HPParticle.hp_fx.Particles.Smoke5'
  3548. + //LifeSpan=0.3 //retail default prop -AdamJD
  3549. + LifeSpan=0.01 //AdamJD
  3550. + //Style=STY_Translucent //not needed -AdamJD
  3551. + //Texture=Texture'HPParticle.hp_fx.Particles.Smoke5' //not needed -AdamJD
  3552. }
  3553. diff --git a/HarryPotter/Classes/BroomHarry.uc b/HarryPotter/Classes/BroomHarry.uc
  3554. index 40a4726..209f673 100644
  3555. --- a/HarryPotter/Classes/BroomHarry.uc
  3556. +++ b/HarryPotter/Classes/BroomHarry.uc
  3557. @@ -3,6 +3,8 @@
  3558. //=============================================================================
  3559. class BroomHarry extends Harry;
  3560.  
  3561. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3562. +
  3563. var float fPitchControl; // Range +1.0 to -1.0 (up/down)
  3564. var float fYawControl; // Range +1.0 to -1.0 (right/left)
  3565. var float fRotationRateYaw; // Yaw uses this because Roll is tied to RotationRate.Yaw for some reason
  3566. @@ -754,7 +756,7 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
  3567. }
  3568.  
  3569. // Update rotation.
  3570. - UpdateRotation(DeltaTime, 1);
  3571. + UpdateRotation(DeltaTime, 1);
  3572. GetAxes(Rotation,X,Y,Z);
  3573.  
  3574. // Update acceleration.
  3575. @@ -829,16 +831,20 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
  3576. {
  3577. local rotator NewRotation;
  3578. local float YawVal;
  3579. + local float YawValY; //AdamJD local float
  3580. local float DeltaYaw;
  3581. local int nDeltaYaw;
  3582. local float DeltaPitch;
  3583. local float fPitchLimitHi;
  3584. local float fPitchLimitLo;
  3585. local float fEffectiveMousePitch;
  3586. +
  3587. + YawValY = YawVal; //set YawVal to YawValY -AdamJD
  3588.  
  3589. NewRotation = Rotation;
  3590. fPitchLimitHi = PitchLimitUp * (0x4000/90.0);
  3591. fPitchLimitLo = 0x00010000 - (PitchLimitDown * (0x4000/90.0));
  3592. +
  3593.  
  3594. // Modify pitch using current input source
  3595. if ( bPitchUnderMouse )
  3596. @@ -944,7 +950,9 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
  3597. fLastTimeAvoidedWall = -1.0f; // Forget Harry was ever trying to avoid wall; player overrode
  3598.  
  3599. bHittingWall = false;
  3600. -
  3601. +
  3602. + //old retail code -AdamJD
  3603. + /*
  3604. // Apply yaw control
  3605. if ( fYawControl > 1.0 )
  3606. fYawControl = 1.0;
  3607. @@ -953,18 +961,58 @@ state PlayerWalking // Well, flying actually; but as his normal mode of getting
  3608. YawVal = fRotationRateYaw * DeltaTime * fYawControl;
  3609. if(Acceleration == vect(0,0,0))
  3610. YawVal = 4.0/3.0 * YawVal;
  3611. -
  3612. - ViewRotation.Yaw += yawVal;
  3613. + */
  3614. +
  3615. + //get the SmoothMouseX & SmoothMouseY axis and cap it to not overshoot input -AdamJD
  3616. + YawVal= (SmoothMouseX / 1.5) * DeltaTime;
  3617. + YawValY = (SmoothMouseY / 1.5) * DeltaTime;
  3618. +
  3619. + //limit SmoothMouseX -AdamJD
  3620. + if(YawVal == SmoothMouseX)
  3621. + {
  3622. + if( YawVal > MAX_MOUSE_DELTA_X )
  3623. + {
  3624. + YawVal = MAX_MOUSE_DELTA_X;
  3625. + }
  3626. +
  3627. + else if( YawVal < MIN_MOUSE_DELTA_X )
  3628. + {
  3629. + YawVal = MIN_MOUSE_DELTA_X;
  3630. + }
  3631. + }
  3632. +
  3633. + //limit SmoothMouseY -AdamJD
  3634. + if(YawValY == SmoothMouseY)
  3635. + {
  3636. + if( YawValY > MAX_MOUSE_DELTA_Y )
  3637. + {
  3638. + YawValY = MAX_MOUSE_DELTA_Y;
  3639. + }
  3640. +
  3641. + else if( YawValY < MIN_MOUSE_DELTA_Y )
  3642. + {
  3643. + YawValY = MIN_MOUSE_DELTA_Y;
  3644. + }
  3645. + }
  3646. +
  3647. + ViewRotation.Yaw += YawVal; //retail code -AdamJD
  3648. + ViewRotation.Pitch += YawValY; //set YawValY to ViewRotation.Pitch -AdamJD
  3649. +
  3650. + DesiredRotation.Yaw = ViewRotation.Yaw; //set ViewRotation.Yaw to DesiredRotation.Yaw -AdamJD
  3651. + DesiredRotation.Pitch = ViewRotation.Pitch; //set ViewRotation.Pitch to DesiredRotation.Pitch -AdamJD
  3652.  
  3653. // Log( "YawControl, YawVal: "$fYawControl$", "$YawVal );
  3654.  
  3655. - ViewShake(deltaTime);
  3656. -
  3657. - NewRotation.Yaw = ViewRotation.Yaw;
  3658. + //ViewShake(deltaTime); //old retail code -AdamJD
  3659. +
  3660. + //NewRotation.Yaw = ViewRotation.Yaw; //old retail code -AdamJD
  3661. + NewRotation.Yaw = cam.rotation.Yaw; //move Harry and camera at the same time when moving mouse left or right -AdamJD
  3662. + NewRotation.Pitch = cam.rotation.Pitch; //move Harry and camera at the same time when moving mouse up or down -AdamJD
  3663.  
  3664. // Commit new rotation
  3665. - setRotation(NewRotation);
  3666. - DesiredRotation = Rotation; //Make physicsRotation leave rotation alone
  3667. + setRotation(NewRotation); //retail code -AdamJD
  3668. + DesiredRotation = ViewRotation; //set ViewRotation to DesiredRotation -AdamJD
  3669. + //DesiredRotation = Rotation; //old retail code -AdamJD
  3670. // ClientMessage("Rotation="$Rotation);
  3671. }
  3672.  
  3673. @@ -1246,7 +1294,7 @@ Begin:
  3674. FinishAnim();
  3675. Referee.OnPlayerDying();
  3676. LoopAnim( 'Hang' );
  3677. - Cam.GotoState( 'TopDownState' );
  3678. + // Cam.GotoState( 'TopDownState' ); //not needed -AdamJD
  3679. SetPhysics( PHYS_Falling );
  3680. SetTimer( 10.0, false ); // Watchdog timer in case Harry never reaches ground
  3681.  
  3682. @@ -1273,7 +1321,7 @@ state Catching
  3683. {
  3684. ClientMessage( "BroomHarry: End GetOnPath" );
  3685. Log( "BroomHarry: End GetOnPath" );
  3686. -// StopFlyingOnPath();
  3687. + // StopFlyingOnPath();
  3688. }
  3689.  
  3690. event FinishedInterpolation( InterpolationPoint Other )
  3691. @@ -1289,9 +1337,10 @@ state Catching
  3692. }
  3693.  
  3694. Begin:
  3695. + //not needed -AdamJD
  3696. + // if ( TargetToCatch == LookForTarget )
  3697. + // SetLookForTarget( None );
  3698. // Start catch animation
  3699. - if ( TargetToCatch == LookForTarget )
  3700. - SetLookForTarget( None );
  3701. PlayAnim( 'Catch', , 0.1 );
  3702.  
  3703. Sleep( 0.4 ); // Dead reckon when Catch animation has Harry's hand closing in around target
  3704. @@ -1307,9 +1356,10 @@ Begin:
  3705. FinishAnim();
  3706. SetSecondaryAnimation( 'Hold', , 0.1 );
  3707.  
  3708. + //not needed -AdamJD
  3709. // Reverse camera
  3710. - Cam.GotoState( 'ReverseState' );
  3711. - StandardTarget.TargetOffset = vect(-100, 10 ,50);
  3712. + // Cam.GotoState( 'ReverseState' );
  3713. + // StandardTarget.TargetOffset = vect(-100, 10 ,50);
  3714.  
  3715. // WIll still be in lockaroundharrymode
  3716. // Cam.TargetRot = rot(5000, 0, 0);
  3717. @@ -1339,4 +1389,5 @@ defaultproperties
  3718. Mesh=SkeletalMesh'HarryPotter.skremharryMesh'
  3719. bAlignBottom=False
  3720. RotationRate=(Pitch=24000,Roll=6000)
  3721. + bHidden=False //AdamJD
  3722. }
  3723. diff --git a/HarryPotter/Classes/Harry.uc b/HarryPotter/Classes/Harry.uc
  3724. index 388d32a..dcbf36a 100644
  3725. --- a/HarryPotter/Classes/Harry.uc
  3726. +++ b/HarryPotter/Classes/Harry.uc
  3727. @@ -2,6 +2,13 @@
  3728. // Harry -- hero character
  3729. //=============================================================================
  3730. class Harry extends baseHarry;
  3731. +//---------------------------------------------------------------------------------------------------------------------------------------------------
  3732. +//Edited by- AdamJD (edited code will have AdamJD by it)
  3733. +//---------------------------------------------------------------------------------------------------------------------------------------------------
  3734. +//Description- Tried to make Harrys movement similar to HP2 and improved climbing. All edited code is UScript (no C++)
  3735. +//---------------------------------------------------------------------------------------------------------------------------------------------------
  3736. +//Edited Dates- Between: 30/09/2019-20/12/2019 (DD/MM/YYYY)
  3737. +//---------------------------------------------------------------------------------------------------------------------------------------------------
  3738.  
  3739. //#exec MESH ORIGIN MESH=skHarryMesh X=0 Y=0 Z=28 YAW=0 PITCH=0 ROLL=0
  3740. //#exec MESH WEAPONATTACH MESH=skHarryMesh BONE="RightHand"
  3741. @@ -102,9 +109,88 @@ var float fFallingZ; //try and save your z when you start falling.
  3742. var vector MountDelta;
  3743. var actor MountBase;
  3744.  
  3745. +//my playercasting var -AdamJD
  3746. +var bool bPlayerCasting; //is the player casting?
  3747.  
  3748. +//for BroomHarry and the chess board -AdamJD
  3749. +const MIN_MOUSE_DELTA_X = -20000.0f;
  3750. +const MAX_MOUSE_DELTA_X = 20000.0f;
  3751. +const MIN_MOUSE_DELTA_Y = -10000.0f;
  3752. +const MAX_MOUSE_DELTA_Y = 10000.0f;
  3753.  
  3754. -//Play a sound client side (so only client will hear it
  3755. +//**********************************************************************************************
  3756. +//moved to near the top... where it should be -AdamJD
  3757. +event PreBeginPlay()
  3758. +{
  3759. + Super.PreBeginPlay();
  3760. +
  3761. + foreach AllActors(class'baseNarrator', theNarrator)
  3762. + break;
  3763. + if(theNarrator==None)
  3764. + {
  3765. + theNarrator=spawn(class 'Narrator');
  3766. + Log("Narrator spawned:" $theNarrator);
  3767. + }
  3768. +
  3769. +}
  3770. +
  3771. +//moved to near the top... where it should be -AdamJD
  3772. +function PostBeginPlay()
  3773. +{
  3774. + local Pawn p;
  3775. + local weapon weap;
  3776. + Super.PostBeginPlay();
  3777. +
  3778. + b3DSound = bool(ConsoleCommand("get ini:Engine.Engine.AudioDevice Use3dHardware"));
  3779. +
  3780. + bShowMenu=false;
  3781. + log("weapon is" $weapon);
  3782. + if(inventory==none)
  3783. + {
  3784. + weap=spawn(class'baseWand');
  3785. + weap.BecomeItem();
  3786. + AddInventory(weap);
  3787. + weap.WeaponSet(self);
  3788. + weap.GiveAmmo(self);
  3789. + baseWand(weap).bUseMana=false;
  3790. + log(self$ " spawning weap " $weap);
  3791. + }
  3792. + else
  3793. + {
  3794. + log("not spawning weap");
  3795. + }
  3796. +
  3797. + iFireSeedCount = 0;
  3798. +
  3799. + HUDType=class'HPMenu.HPHud';
  3800. +
  3801. + ForEach AllActors( class'baseCam', cam )
  3802. + break;
  3803. + if( cam == none )
  3804. + cam = spawn( class'baseCam' );
  3805. +
  3806. + viewClass(class'baseCam', true);
  3807. + //viewClass(class 'BaseCam', true);
  3808. + // @PAB added new camera target
  3809. + //makeCamTarget(); //not needed -AdamJD
  3810. +
  3811. + // Harry gets a shadow, bigger than normal.
  3812. + Shadow = Spawn(ShadowClass,self);
  3813. + log( self$ " ShadowClass=" $ShadowClass$ " shadow=" $Shadow$ " tex=" $Shadow.Texture );
  3814. +
  3815. +// @PAB temp give a spell to Harry
  3816. + //baseWand(weap).addSpell(Class'spellDud'); //not needed -AdamJD
  3817. +// baseWand(weap).addSpell(Class'spellflip');
  3818. +// baseWand(weap).addSpell(Class'spellALOho');
  3819. +// baseWand(weap).SelectSpell(Class'spellFlip');
  3820. +
  3821. + HarryAnimChannel = cHarryAnimChannel( CreateAnimChannel(class'cHarryAnimChannel', AT_Replace, 'harry spine1') );
  3822. + HarryAnimChannel.SetOwner( self );
  3823. +
  3824. + basewand(weapon).ChooseSpell( SPELL_None ); //set wand to no spell when first loaded -AdamJD
  3825. +}
  3826. +
  3827. +//Play a sound client side (so only client will hear it)
  3828. simulated function ClientPlaySound(sound ASound, optional bool bInterrupt, optional bool bVolumeControl )
  3829. {
  3830. local actor SoundPlayer;
  3831. @@ -142,7 +228,6 @@ simulated function ClientPlaySound(sound ASound, optional bool bInterrupt, optio
  3832. SoundPlayer.PlaySound(ASound, SLOT_Talk, 16.0, bInterrupt);
  3833. }
  3834.  
  3835. -
  3836. function DebugState()
  3837. {
  3838. // BaseHUD(MyHUD).DebugString2 = string(GetStateName());
  3839. @@ -152,7 +237,7 @@ function DebugState()
  3840. }
  3841.  
  3842. function TurnDebugModeOn()
  3843. -{
  3844. +{
  3845. hpconsole(player.console).bDebugMode = true;
  3846. }
  3847.  
  3848. @@ -180,10 +265,10 @@ function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation,
  3849. if( DamageType == 'ZonePain' || DamageType == 'pit' )
  3850. {
  3851. //AE:
  3852. - //if( FRand() < 0.5 )
  3853. - // theNarrator.FindEmote("EmotiveHarry13", snd);
  3854. - //else
  3855. - // theNarrator.FindEmote("EmotiveHarry14", snd);
  3856. + // if( FRand() < 0.5 )
  3857. + // theNarrator.FindEmote("EmotiveHarry13", snd);
  3858. + // else
  3859. + // theNarrator.FindEmote("EmotiveHarry14", snd);
  3860.  
  3861. PlaySound( snd );
  3862.  
  3863. @@ -393,6 +478,7 @@ function DoJump( optional float F )
  3864. {
  3865. local baseProps a;
  3866. local float TmpJumpZ;
  3867. + local float s; //AdamJD local float
  3868.  
  3869. if( bKeepStationary )
  3870. return;
  3871. @@ -420,6 +506,8 @@ function DoJump( optional float F )
  3872. */
  3873. TmpJumpZ = JumpZ;
  3874.  
  3875. + //not needed -AdamJD
  3876. + /*
  3877. //See if you're standing on a double jump actor
  3878. //foreach TouchingActors( class'baseProps', a )
  3879. foreach allactors( class'baseProps', a )
  3880. @@ -437,11 +525,20 @@ function DoJump( optional float F )
  3881. break;
  3882. }
  3883. }
  3884. + */
  3885.  
  3886. Velocity.Z += TmpJumpZ;
  3887.  
  3888. if ( (Base != Level) && (Base != None) )
  3889. - Velocity += Base.Velocity;
  3890. + Velocity += Base.Velocity;
  3891. +
  3892. + //let player cast if jumping -AdamJD
  3893. + if (bPlayerCasting)
  3894. + {
  3895. + HarryAnimType = AT_Replace;
  3896. + HarryAnimChannel.GotoStateCasting();
  3897. + PlayAnim('jump');
  3898. + }
  3899.  
  3900. SetPhysics(PHYS_Falling);
  3901. }
  3902. @@ -534,7 +631,7 @@ function Gasp()
  3903.  
  3904. function PlayTurning()
  3905. {
  3906. - PlayAnim('Turn', [Type] HarryAnimType);
  3907. + PlayAnim('Turn', [Type] HarryAnimType);
  3908. }
  3909.  
  3910. function TweenToRunning(float tweentime)
  3911. @@ -542,15 +639,18 @@ function TweenToRunning(float tweentime)
  3912. local vector X,Y,Z, Dir;
  3913.  
  3914. BaseEyeHeight = Default.BaseEyeHeight;
  3915. -
  3916. - if (bIsWalking)
  3917. - {
  3918. - TweenToWalking(0.1);
  3919. - return;
  3920. - }
  3921. -
  3922. +
  3923. + //not needed -AdamJD
  3924. + // if (bIsWalking)
  3925. + // {
  3926. + // TweenToWalking(0.1);
  3927. + // return;
  3928. + // }
  3929. +
  3930. GetAxes(Rotation, X,Y,Z);
  3931. Dir = Normal(Acceleration);
  3932. + //old retail code -AdamJD
  3933. + /*
  3934. if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) )
  3935. {
  3936. // strafing or backing up
  3937. @@ -558,12 +658,12 @@ function TweenToRunning(float tweentime)
  3938. {
  3939. PlayAnim('runback', 0.9, tweentime, HarryAnimType );
  3940. bMovingBackwards=true;
  3941. - //Velocity.X = Velocity.X / 2;
  3942. + //Velocity.X /= 2;
  3943. }
  3944. else if ( Dir Dot Y > 0 )
  3945. {
  3946. PlayAnim('StrafeRight', 0.9, tweentime, HarryAnimType );
  3947. - //Velocity.Y
  3948. + //Velocity.Y /=2;
  3949. }
  3950. else
  3951. PlayAnim('StrafeLeft', 0.9, tweentime, HarryAnimType );
  3952. @@ -572,11 +672,51 @@ function TweenToRunning(float tweentime)
  3953. {
  3954. PlayAnim('run', 0.9, tweentime, HarryAnimType );
  3955. bMovingBackwards=false;
  3956. - }
  3957. + }
  3958. + */
  3959. +
  3960. + //code copied from PlayRunning -AdamJD
  3961. + if ( (Dir Dot X < 0.75) && (Dir != vect(0,0,0)) )
  3962. + {
  3963. + // strafing or backing up
  3964. + if ( Dir Dot X < -0.75 )
  3965. + {
  3966. + LoopAnim('runback', [Type] HarryAnimType);
  3967. + bMovingBackwards=true;
  3968. + //Velocity.X /= 2;
  3969. + }
  3970. + else if ( Dir Dot Y > 0 )
  3971. + {
  3972. + LoopAnim('StrafeRight', [Type] HarryAnimType);
  3973. + //clientmessage("strafe right");
  3974. + //Velocity.Y /= 2;
  3975. + }
  3976. + else
  3977. + {
  3978. + LoopAnim('StrafeLeft', [Type] HarryAnimType);
  3979. + }
  3980. + }
  3981. +
  3982. + //player has pressed the forward input so play the run anim -AdamJD
  3983. + else if ( Dir Dot X >= 0.75 && (Dir != vect(0,0,0)) )
  3984. + {
  3985. + LoopAnim('run', [Type] HarryAnimType);
  3986. + bMovingBackwards=false;
  3987. + }
  3988. +
  3989. + //stops Harry if player is pressing left and right inputs at the same time -AdamJD
  3990. + else
  3991. + {
  3992. + LoopAnim('breath', [Type] HarryAnimType);
  3993. + Dir = vect(0,0,0);
  3994. + }
  3995. }
  3996.  
  3997. function PlayRunning()
  3998. {
  3999. + TweenToRunning( 0 );
  4000. + //not needed -AdamJD
  4001. + /*
  4002. local vector X,Y,Z, Dir;
  4003.  
  4004. BaseEyeHeight = Default.BaseEyeHeight;
  4005. @@ -592,12 +732,13 @@ function PlayRunning()
  4006. {
  4007. LoopAnim('runback', [Type] HarryAnimType);
  4008. bMovingBackwards=true;
  4009. - Velocity.X = Velocity.X / 2;
  4010. + //Velocity.X /= 2;
  4011. }
  4012. else if ( Dir Dot Y > 0 )
  4013. {
  4014. LoopAnim('StrafeRight', [Type] HarryAnimType);
  4015. - clientmessage("strafe right");
  4016. + //clientmessage("strafe right");
  4017. + //Velocity.Y /= 2;
  4018. }
  4019. else
  4020. {
  4021. @@ -608,9 +749,7 @@ function PlayRunning()
  4022. {
  4023. LoopAnim('run', [Type] HarryAnimType);
  4024. bMovingBackwards=false;
  4025. -
  4026. - }
  4027. -
  4028. + }*/
  4029. }
  4030.  
  4031.  
  4032. @@ -623,9 +762,10 @@ function PlayinAir()
  4033. {
  4034. bPlayedFallSound = true;
  4035. PlaySound( sound'HPSounds.HAR_emotes.falldeep2' );
  4036. +
  4037. }
  4038. }
  4039. -
  4040. +
  4041. loopAnim('fall');
  4042. }
  4043.  
  4044. @@ -643,6 +783,20 @@ function PlayCrawling()
  4045. LoopAnim('SneakF');
  4046. }
  4047.  
  4048. +//stop Harry walking with his arms down after playing the cast anim (he walked like a penguin...) -AdamJD
  4049. +function PlayFinishCastAnim()
  4050. +{
  4051. + LoopAnim('breath', 0.10, 0.5, HarryAnimType);
  4052. + gotoState('PlayerWalking');
  4053. +}
  4054. +
  4055. +//stop Harry walking with his arms up after throwing a wizard cracker -AdamJD
  4056. +function PlayFinishThrowCrackerAnim()
  4057. +{
  4058. + LoopAnim('breath', 0.10, 0.5, HarryAnimType);
  4059. + gotoState('PlayerWalking');
  4060. +}
  4061. +
  4062. function PlayWaiting()
  4063. {
  4064. local name newAnim;
  4065. @@ -652,59 +806,62 @@ function PlayWaiting()
  4066.  
  4067. //keep idle from happening as soon as a level loads
  4068. WaitingCount++;
  4069. - if(WaitingCount<2) //do breath first three times you get here.
  4070. + if(!bPlayerCasting) //don't do this if casting -AdamJD
  4071. + {
  4072. + if(WaitingCount<2) //do breath first three times you get here.
  4073. + {
  4074. + LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
  4075. + return;
  4076. + }
  4077. +
  4078. + if ( FRand() < 0.3)
  4079. {
  4080. - LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
  4081. - return;
  4082. + LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
  4083. + }
  4084. + else if(FRand() < 0.03 )
  4085. + {
  4086. + WaitingCount=0;
  4087. + PlayAnim('Look', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4088. + }
  4089. + else if(FRand() < 0.03 )
  4090. + {
  4091. + WaitingCount=0;
  4092. + PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4093. + }
  4094. + else if(FRand() < 0.03 )
  4095. + {
  4096. + WaitingCount=0;
  4097. + PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4098. + }
  4099. + else if(FRand() < 0.03 )
  4100. + {
  4101. + WaitingCount=0;
  4102. + PlayAnim('lookwand', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4103. + }
  4104. + else if(FRand() < 0.03 )
  4105. + {
  4106. + WaitingCount=0;
  4107. + PlayAnim('adjustglasses', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4108. + }
  4109. + else if(FRand() < 0.03 )
  4110. + {
  4111. + WaitingCount=0;
  4112. + PlayAnim('look2', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4113. + }
  4114. + else if(FRand() < 0.03 )
  4115. + {
  4116. + WaitingCount=0;
  4117. + PlayAnim('look3', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4118. + }
  4119. + else if(FRand() < 0.03 )
  4120. + {
  4121. + WaitingCount=0;
  4122. + PlayAnim('look4', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4123. + }
  4124. + else
  4125. + {
  4126. + LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
  4127. }
  4128. -
  4129. - if ( FRand() < 0.3)
  4130. - {
  4131. - LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
  4132. - }
  4133. - else if(FRand() < 0.03 )
  4134. - {
  4135. - WaitingCount=0;
  4136. - PlayAnim('Look', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4137. - }
  4138. - else if(FRand() < 0.03 )
  4139. - {
  4140. - WaitingCount=0;
  4141. - PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4142. - }
  4143. - else if(FRand() < 0.03 )
  4144. - {
  4145. - WaitingCount=0;
  4146. - PlayAnim('Scratch', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4147. - }
  4148. - else if(FRand() < 0.03 )
  4149. - {
  4150. - WaitingCount=0;
  4151. - PlayAnim('lookwand', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4152. - }
  4153. - else if(FRand() < 0.03 )
  4154. - {
  4155. - WaitingCount=0;
  4156. - PlayAnim('adjustglasses', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4157. - }
  4158. - else if(FRand() < 0.03 )
  4159. - {
  4160. - WaitingCount=0;
  4161. - PlayAnim('look2', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4162. - }
  4163. - else if(FRand() < 0.03 )
  4164. - {
  4165. - WaitingCount=0;
  4166. - PlayAnim('look3', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4167. - }
  4168. - else if(FRand() < 0.03 )
  4169. - {
  4170. - WaitingCount=0;
  4171. - PlayAnim('look4', 0.5 + 0.5 * FRand(), 0.3, HarryAnimType);
  4172. - }
  4173. - else
  4174. - {
  4175. - LoopAnim('breath', 0.4 + 0.4 * FRand(), 0.25, , HarryAnimType);
  4176. }
  4177. }
  4178.  
  4179. @@ -730,10 +887,23 @@ function Cast()
  4180. defaultAngle.pitch = 0;
  4181. defaultYaw = defaultAngle.yaw;
  4182. defaultYaw = defaultYaw & 0xffff;
  4183. +
  4184. + //old code by me -AdamJD
  4185. + /*
  4186. + bOldStrafingState = (bStrafe != 0);
  4187. +
  4188. + MovementMode(true);
  4189. +
  4190. + if (bPressedJump)
  4191. + {
  4192. + DoJump();
  4193. + bPressedJump = false;
  4194. + }
  4195. + */
  4196.  
  4197. if (defaultyaw > 0x7fff)
  4198. {
  4199. - defaultyaw = defaultyaw - 0x10000;
  4200. + defaultyaw -= 0x10000;
  4201. }
  4202.  
  4203. bestTarget = none;
  4204. @@ -782,20 +952,15 @@ function Cast()
  4205. }
  4206.  
  4207. //Weapon.AltFire(1.0);
  4208. - rectarget.destroy();
  4209. + rectarget.destroy();
  4210. + //turn off wand casting -AdamJD
  4211. + basewand(weapon).bCasting=false;
  4212. }
  4213.  
  4214.  
  4215. // The player wants to fire.
  4216. exec function Fire( optional float F )
  4217. -{
  4218. -
  4219. - if( Weapon!=None && bJustFired == false)
  4220. - {
  4221. -
  4222. - Weapon.bPointing = true;
  4223. - //PlayAnim('wave');
  4224. - }
  4225. +{
  4226. bJustFired = true;
  4227. }
  4228.  
  4229. @@ -806,9 +971,20 @@ exec function AltFire( optional float F )
  4230. local rotator r;
  4231.  
  4232. // If Harry is frozen, disable firing
  4233. -
  4234. - if (IsInState('HarryFrozen') || Physics == PHYS_Falling || baseHud(myhud).bCutSceneMode == true)
  4235. + if (IsInState('HarryFrozen') || baseHud(myhud).bCutSceneMode == true) //|| Physics == PHYS_Falling //can now cast when falling -AdamJD
  4236. {
  4237. + //stop casting if in cutscene/Harry is frozen (can't get cursor to turn off, pissing me off) -AdamJD
  4238. + //Update: Putting this in PlayerWalking instead fixed it... -AdamJD
  4239. + /*
  4240. + if(bPlayerCasting == true)
  4241. + {
  4242. + baseWand(weapon).bPointing = false;
  4243. + basewand(weapon).bCasting=false;
  4244. + baseWand(weapon).WandEffect.bHidden = true;
  4245. + rectarget.destroy();
  4246. + return;
  4247. + }
  4248. + */
  4249. return;
  4250. }
  4251.  
  4252. @@ -827,20 +1003,52 @@ exec function AltFire( optional float F )
  4253. else
  4254. {
  4255. if( Weapon != None
  4256. - && bJustAltFired == false
  4257. + //&& bJustAltFired == false
  4258. && CarryingActor == none //you're not carrying an actor in your hand
  4259. + && !bPlayerCasting //player is not already casting -AdamJD
  4260. )
  4261. {
  4262. - ClientMessage("Harry::AltFire");
  4263. - Weapon.bPointing = true;
  4264. + //ClientMessage("Harry::AltFire");
  4265. + //Weapon.bPointing = true;
  4266. // PlaySound(sound'spell1', SLOT_Interact, 2.2, false, 1000.0, 1.0);
  4267. // weapon.altfire(1);
  4268. -
  4269. - bJustAltFired = true;
  4270. - gotostate('playeraiming');
  4271. +
  4272. + //turn on player casting -AdamJD
  4273. + //bJustAltFired = true;
  4274. + bPlayerCasting = true;
  4275. + // Weapon.bPointing = true;
  4276. + //basewand(weapon).bCasting=true;
  4277. + StartCasting();
  4278. + //gotostate('playeraiming');
  4279. + }
  4280. +
  4281. + //turn off player casting -AdamJD
  4282. + else
  4283. + {
  4284. + //Weapon.bPointing = false;
  4285. + bPlayerCasting = false;
  4286. + StopCasting();
  4287. }
  4288. }
  4289. +}
  4290.  
  4291. +//AdamJD
  4292. +function StartCasting()
  4293. +{
  4294. + //leaving this empty goes to the StartCasting function in state PlayerWalking instead
  4295. +}
  4296. +
  4297. +//AdamJD
  4298. +function StopCasting()
  4299. +{
  4300. + //leaving this empty goes to the StopCasting function in state PlayerWalking instead
  4301. +}
  4302. +
  4303. +//stop spell/wand noises -AdamJD
  4304. +function StopSoundFX()
  4305. +{
  4306. + StopSound(sound'HPSounds.Magic_sfx.spell_build_nl2', SLOT_Misc);
  4307. + StopSound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
  4308. }
  4309.  
  4310. event Mount( vector Delta )
  4311. @@ -848,15 +1056,40 @@ event Mount( vector Delta )
  4312. // Use Destination to store dest, as moveTo won't be called here.
  4313. Destination = Location+Delta;
  4314. MountBase = Base;
  4315. +
  4316. if( Physics == PHYS_Falling )
  4317. {
  4318. bFallingMount = true;
  4319. gotoState('FallingMount');
  4320. +
  4321. + //stop Harry casting when climbing -AdamJD
  4322. + if(bPlayerCasting == true)
  4323. + {
  4324. + bPlayerCasting = false;
  4325. + StopCasting();
  4326. + baseWand(weapon).bPointing = false;
  4327. + basewand(weapon).bCasting=false;
  4328. + baseWand(Weapon).WandEffect.bHidden = true;
  4329. + rectarget.destroy();
  4330. + StopSoundFX();
  4331. + }
  4332. }
  4333. else
  4334. {
  4335. bFallingMount = false;
  4336. gotoState('Mounting');
  4337. +
  4338. + //stop Harry casting when climbing -AdamJD
  4339. + if(bPlayerCasting == true)
  4340. + {
  4341. + bPlayerCasting = false;
  4342. + StopCasting();
  4343. + baseWand(weapon).bPointing = false;
  4344. + basewand(weapon).bCasting=false;
  4345. + baseWand(Weapon).WandEffect.bHidden = true;
  4346. + rectarget.destroy();
  4347. + StopSoundFX();
  4348. + }
  4349. }
  4350. }
  4351.  
  4352. @@ -867,7 +1100,9 @@ state FallingMount
  4353. event PlayerTick( float DeltaTime )
  4354. {
  4355. global.PlayerTick( DeltaTime );
  4356. -
  4357. +
  4358. + DesiredRotation.Pitch = 0; //copied from the HP2 proto -AdamJD
  4359. +
  4360. // Adjust destination by player and base movement.
  4361. Destination.X += Location.X - OldLocation.X;
  4362. Destination.Y += Location.Y - OldLocation.Y;
  4363. @@ -893,9 +1128,11 @@ state FallingMount
  4364. function Landed(vector HitNormal)
  4365. {
  4366. PlaySound(Sound'HPSounds.HAR_emotes.landing5', SLOT_Interact,1, false, 1000.0, 0.9);
  4367. - gotoState('Mounting');
  4368. + //gotoState('Mounting'); //not needed -AdamJD
  4369. }
  4370. -
  4371. +
  4372. + //not needed -AdamJD
  4373. + /*
  4374. function BeginState()
  4375. {
  4376. DebugState();
  4377. @@ -903,15 +1140,28 @@ state FallingMount
  4378. // Start tweening to proper animation.
  4379. playAnim('climb96end', [Rate] 0, [TweenTime] 0.5, [RootBone] 'move');
  4380. }
  4381. + */
  4382.  
  4383. begin:
  4384. // Start turning here as well.
  4385. - TurnTo( vec(Destination.X, Destination.Y, Location.Z) );
  4386. + //TurnTo( vec(Destination.X, Destination.Y, Location.Z) ); //not needed -AdamJD
  4387. +
  4388. + //copied from the HP2 proto -AdamJD
  4389. + DesiredRotation.Yaw = rotator( vec(Destination.X, Destination.Y, Location.Z) - Location ).yaw;
  4390. + DesiredRotation.Pitch = 0;
  4391. + gotoState ('Mounting');
  4392. }
  4393.  
  4394. state Mounting
  4395. {
  4396. ignores Mount, AltFire;
  4397. +
  4398. + //copied from the HP2 proto -AdamJD
  4399. + event PlayerTick( float DeltaTime )
  4400. + {
  4401. + global.PlayerTick( DeltaTime );
  4402. + DesiredRotation.Pitch = 0;
  4403. + }
  4404.  
  4405. function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
  4406. {
  4407. @@ -933,12 +1183,16 @@ state Mounting
  4408. begin:
  4409. // Finish turning.
  4410. TurnTo( vec(Destination.X, Destination.Y, Location.Z) );
  4411. +
  4412. + DesiredRotation.Pitch = 0; //copied from the HP2 proto -AdamJD
  4413.  
  4414. MountDelta = Destination - Location;
  4415.  
  4416. // Subtract anim movement from delta.
  4417. MountDelta -= vect(30,0,0) >> Rotation;
  4418. -
  4419. +
  4420. + //original mounting code -AdamJD
  4421. + /*
  4422. if( bFallingMount )
  4423. {
  4424. MountDelta.Z -= 82;
  4425. @@ -962,6 +1216,34 @@ begin:
  4426. MountDelta.Z -= 96;
  4427. playAnim('climb96start', [RootBone] 'move');
  4428. }
  4429. + */
  4430. +
  4431. + if( MountDelta.Z < 48 ) //for climbing from a short distance -AdamJD
  4432. + {
  4433. + MountDelta.Z -= 32;
  4434. + playAnim('climb32', [Rate] 1.0, [RootBone] 'move');
  4435. + PlaySound( sound'HPSounds.HAR_emotes.EmotiveHarry5_b_pullup6', , 0.5 );
  4436. + }
  4437. +
  4438. + else if ((MountDelta.Z >=48) && (MountDelta.Z < 80)) //for climbing from a medium distance -AdamJD
  4439. + {
  4440. + MountDelta.Z -= 64;
  4441. + playAnim('climb64', [RootBone] 'move');
  4442. + PlaySound( sound'HPSounds.HAR_emotes.EmotiveHarry5_a_pullup5', , 0.5 );
  4443. + }
  4444. +
  4445. + else if ((MountDelta.Z >=80) && (MountDelta.Z < 98)) //for climbing from a long distance -AdamJD
  4446. + {
  4447. + MountDelta.Z -= 82;
  4448. + playAnim('climb96end', [RootBone] 'move');
  4449. + PlaySound( sound'HPSounds.HAR_emotes.pull_up3', , 0.5 );
  4450. + }
  4451. +
  4452. + else //for climbing from a really long distance -AdamJD
  4453. + {
  4454. + MountDelta.Z -= 96;
  4455. + playAnim('climb96start', [RootBone] 'move');
  4456. + }
  4457.  
  4458. gotoState('MountFinish');
  4459. }
  4460. @@ -1019,6 +1301,18 @@ begin:
  4461. // Play idle anim in case nothing's happening.
  4462. playAnim('breath');
  4463. gotostate('PlayerWalking');
  4464. +
  4465. + //stop casting a spell after climbing something -AdamJD
  4466. + if(bPlayerCasting == true)
  4467. + {
  4468. + bPlayerCasting = false;
  4469. + StopCasting();
  4470. + baseWand(weapon).bPointing = false;
  4471. + basewand(weapon).bCasting=false;
  4472. + baseWand(Weapon).WandEffect.bHidden = true;
  4473. + rectarget.destroy();
  4474. + StopSoundFX();
  4475. + }
  4476. }
  4477.  
  4478. //********************************************************************************************
  4479. @@ -1069,6 +1363,12 @@ state hit
  4480.  
  4481. if( AnimSequence != 'knockback2' )
  4482. playanim('knockback2',[RootBone] 'move');
  4483. +
  4484. + //Harry used to freeze when getting hit by something and casting at the same time -AdamJD
  4485. + if (bPlayerCasting)
  4486. + {
  4487. + gotostate('PlayerWalking');
  4488. + }
  4489.  
  4490. // sleep(0.5);
  4491.  
  4492. @@ -1131,7 +1431,6 @@ function DropCarryingActor()
  4493. }
  4494.  
  4495. //********************************************************************************************
  4496. -
  4497. state PickingUpWizardCard
  4498. {
  4499. ignores AltFire;
  4500. @@ -1142,6 +1441,18 @@ state PickingUpWizardCard
  4501. aStrafe = 0;
  4502. aLookup = 0;
  4503. aTurn = 0;
  4504. +
  4505. + //turn off spell cursor if picking up wizard card -AdamJD
  4506. + if(bPlayerCasting == true)
  4507. + {
  4508. + bPlayerCasting = false;
  4509. + StopCasting();
  4510. + baseWand(weapon).bPointing = false;
  4511. + basewand(weapon).bCasting=false;
  4512. + baseWand(weapon).WandEffect.bHidden = true;
  4513. + rectarget.destroy();
  4514. + StopSoundFX();
  4515. + }
  4516. }
  4517.  
  4518. function AnimEnd()
  4519. @@ -1160,7 +1471,7 @@ state PickingUpWizardCard
  4520. GroundSpeed = fOldGroundSpeed;
  4521. // basehud(myhud).DebugString2 = "Leaving Picking up wizard card " $LastState;
  4522. cam.gotostate('StandardState');
  4523. - RestoreStateName();
  4524. + // RestoreStateName(); //not needed -AdamJD
  4525. }
  4526. }
  4527.  
  4528. @@ -1185,12 +1496,18 @@ begin:
  4529. GroundSpeed = 0;
  4530. cam.gotostate('RotateAroundHarry');
  4531. PlayAnim('wizardcardcollect');
  4532. + FinishAnim(); //let Harry finish the anim -AdamJD
  4533. + DesiredRotation.Yaw = ViewRotation.Yaw; //fixes the bug where Harry walked with his face down toward the ground after jumping into a card -AdamJD
  4534. + DesiredRotation.Pitch = ViewRotation.Pitch; //fixes the bug where Harry walked with his face down toward the ground after jumping into a card -AdamJD
  4535. + gotoState('PlayerWalking'); //go back to the PlayerWalking state -AdamJD
  4536. }
  4537. -
  4538. //********************************************************************************************
  4539. -state playeraiming
  4540. +//old not needed retail playeraiming state -AdamJD
  4541. +/*state playeraiming
  4542. {
  4543. - ignores SeePlayer, HearNoise, Bump;
  4544. +
  4545. +ignores SeePlayer, HearNoise, Bump;
  4546. +
  4547.  
  4548. // AE:
  4549. function StartSoundFX()
  4550. @@ -1207,7 +1524,7 @@ state playeraiming
  4551.  
  4552. StopSound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
  4553. }
  4554. -
  4555. +
  4556. function BeginState()
  4557. {
  4558. //setphysics(phys_rotating);
  4559. @@ -1216,10 +1533,17 @@ state playeraiming
  4560.  
  4561. // basehud(myhud).DebugString2 = "in playeraiming";
  4562.  
  4563. -// bOldStrafingState = (bStrafe != 0);
  4564. + bOldStrafingState = (bStrafe != 0);
  4565.  
  4566. -// MovementMode(true);
  4567. -// PlaySound(sound'HPSounds.Magic_sfx.HAR_raise_arm', SLOT_Misc);
  4568. + MovementMode(false);
  4569. +
  4570. + // if ( bPressedJump )
  4571. + // {
  4572. + // DoJump(); // jumping
  4573. + // bPressedJump = false;
  4574. + // return;
  4575. + // }
  4576. + //PlaySound(sound'HPSounds.Magic_sfx.HAR_raise_arm', SLOT_Misc);
  4577.  
  4578. StartSoundFX();
  4579. }
  4580. @@ -1233,11 +1557,11 @@ state playeraiming
  4581. bIsCrouching = false;
  4582. //setphysics(phys_walking);
  4583.  
  4584. -/* if (!bOldStrafingState)
  4585. + if (!bOldStrafingState)
  4586. {
  4587. MovementMode(false);
  4588. }
  4589. -*/
  4590. +
  4591. //bStrafe = 0;
  4592. //bLockedOnTarget = false;
  4593. //BossTarget = none;
  4594. @@ -1247,10 +1571,19 @@ state playeraiming
  4595. // basehud(myhud).DebugString2 = "out of playeraiming";
  4596. bJustFired = false;
  4597. bJustAltFired = false;
  4598. +
  4599. + basewand(weapon).bCasting=false;
  4600. +
  4601. + // if ( bPressedJump )
  4602. + // {
  4603. + //DoJump(); // jumping
  4604. + // bPressedJump = false;
  4605. + // }
  4606. }
  4607.  
  4608. exec function AltFire( optional float F )
  4609. {
  4610. +
  4611. }
  4612.  
  4613. function AnimEnd()
  4614. @@ -1265,9 +1598,20 @@ state playeraiming
  4615. ClientUpdatePosition();
  4616.  
  4617. PlayerMove(DeltaTime);
  4618. +
  4619. + bOldStrafingState = (bStrafe != 0);
  4620.  
  4621. + MovementMode(true);
  4622. +
  4623. + // if ( bPressedJump )
  4624. + // {
  4625. + // DoJump(); // jumping
  4626. + // PlayAnim('Jump');
  4627. + // bPressedJump = false;
  4628. + // gotostate('playeraiming');
  4629. + // }
  4630. }
  4631. -
  4632. +
  4633. function PlayerMove( float DeltaTime )
  4634. {
  4635. local vector X,Y,Z, NewAccel;
  4636. @@ -1281,6 +1625,7 @@ state playeraiming
  4637. GetAxes(Rotation,X,Y,Z);
  4638.  
  4639. aForward *= 0.08;
  4640. +
  4641. if( Physics == PHYS_Falling || bLockedOnTarget)
  4642. {
  4643. aStrafe *= 0.4;
  4644. @@ -1359,9 +1704,11 @@ state playeraiming
  4645. }
  4646. }
  4647.  
  4648. - //if ( bPressedJump )
  4649. - // DoJump(); // jumping
  4650. -
  4651. + // if ( bPressedJump )
  4652. + // {
  4653. + // DoJump(); // jumping
  4654. + // bPressedJump = false;
  4655. + // }
  4656. if ( (Physics == PHYS_Walking) )
  4657. {
  4658. if ( !bIsCrouching )
  4659. @@ -1392,7 +1739,7 @@ state playeraiming
  4660.  
  4661. ///bPlayerWalking = false;
  4662.  
  4663. - if( /*!bIsTurning &&*/ (GetAnimGroup(AnimSequence) != 'Waiting'))
  4664. + if( !bIsTurning && (GetAnimGroup(AnimSequence) != 'Waiting'))
  4665. {
  4666. bAnimTransition = true;
  4667. TweenToWaiting(0.2);
  4668. @@ -1447,18 +1794,53 @@ state playeraiming
  4669. while( AnimFrame < 0.95 )
  4670. sleep( 0.001 );
  4671.  
  4672. - basewand(weapon).bCasting=false; //turn on the sparkles.
  4673. + basewand(weapon).bCasting=true; //turn on the sparkles.
  4674.  
  4675. gotostate('PlayerWalking');
  4676. }
  4677. sleep(0.001);
  4678. goto 'loopaim';
  4679. +
  4680. +}*/
  4681. +//********************************************************************************************
  4682. +//Old casting states set up by me (moved to cHarryAnimChannel class) -AdamJD
  4683. +/*
  4684. +state stateCasting
  4685. +{
  4686. + begin:
  4687. + HarryAnimType = AT_Combine;
  4688. + LoopAnim('wave', 1.0, 0.2);
  4689. + gotoState('PlayerWalking');
  4690. +}
  4691. +
  4692. +state stateCancelCasting
  4693. +{
  4694. + begin:
  4695. + PlayAnim('cast', 1.0, 0.2); //can't find a way to play no anims... -AdamJD
  4696. + FinishAnim();
  4697. +
  4698. + StopCasting();
  4699. + gotoState('PlayerWalking');
  4700. }
  4701.  
  4702. +state stateCast
  4703. +{
  4704. + function BeginState()
  4705. + {
  4706. + PlayAnim('cast', 2.0, 0.1);
  4707. + }
  4708. +
  4709. + begin:
  4710. + FinishAnim();
  4711. +
  4712. + StopCasting();
  4713. + gotoState('PlayerWalking');
  4714. +}
  4715. +*/
  4716. //********************************************************************************************
  4717. state PlayerWalking
  4718. {
  4719. -ignores SeePlayer, HearNoise, Bump;
  4720. +ignores SeePlayer, HearNoise, Bump;
  4721.  
  4722. function ZoneChange( ZoneInfo NewZone )
  4723. {
  4724. @@ -1504,7 +1886,7 @@ ignores SeePlayer, HearNoise, Bump;
  4725. }
  4726.  
  4727. if (Physics == PHYS_Walking)
  4728. - {
  4729. + {
  4730. if (bIsCrouching)
  4731. {
  4732. if ( !bIsTurning && ((Velocity.X * Velocity.X + Velocity.Y * Velocity.Y) < 1000) )
  4733. @@ -1522,25 +1904,26 @@ ignores SeePlayer, HearNoise, Bump;
  4734. else
  4735. {
  4736. bAnimTransition = true;
  4737. - TweenToWaiting(0.2);
  4738. + TweenToWaiting(0.4);
  4739. }
  4740. }
  4741. else if (bIsWalking)
  4742. {
  4743. if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
  4744. {
  4745. - TweenToWalking(0.1);
  4746. + TweenToWalking(0.4);
  4747. bAnimTransition = true;
  4748. }
  4749. else
  4750. PlayWalking();
  4751. }
  4752. +
  4753. else
  4754. {
  4755. if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
  4756. {
  4757. bAnimTransition = true;
  4758. - TweenToRunning(0.1);
  4759. + TweenToRunning(0.4);
  4760. }
  4761. else
  4762. PlayRunning();
  4763. @@ -1554,7 +1937,7 @@ ignores SeePlayer, HearNoise, Bump;
  4764. }
  4765.  
  4766. }
  4767. -
  4768. +
  4769. function Landed(vector HitNormal)
  4770. {
  4771. clientMessage("landed: jump dist = " $VSize(Location-MountDelta) $ " tia="$fTimeInAir);
  4772. @@ -1564,14 +1947,103 @@ ignores SeePlayer, HearNoise, Bump;
  4773. PlayLandedSound();
  4774.  
  4775. playanim('land1');
  4776. +
  4777. + //allow player to cast when landing -AdamJD
  4778. + if (bPlayerCasting)
  4779. + {
  4780. + HarryAnimType = AT_Combine;
  4781. + HarryAnimChannel.GotoStateCasting();
  4782. + }
  4783.  
  4784. // log("PLOG PWalking landed");
  4785. }
  4786.  
  4787. - event PlayerTick( float DeltaTime )
  4788. + //PlayerAim start and stop sound functons -AdamJD
  4789. + function StartSoundFX()
  4790. {
  4791. - local baseChar a;
  4792. + PlaySound(sound'HPSounds.Magic_sfx.spell_build_nl2', SLOT_Misc);
  4793. + PlaySound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
  4794. + }
  4795.  
  4796. + function StopSoundFX()
  4797. + {
  4798. + StopSound(sound'HPSounds.Magic_sfx.spell_build_nl2', SLOT_Misc);
  4799. + StopSound(sound'HPSounds.Magic_sfx.spell_loop_nl', SLOT_Interact);
  4800. + }
  4801. +
  4802. + //turn on player casting -AdamJD
  4803. + function StartCasting()
  4804. + {
  4805. + //setup the casting stuff
  4806. + if (bPlayerCasting && CarryingActor == none ) //&& Physics == PHYS_Walking) //can now cast when jumping -AdamJD
  4807. + {
  4808. + //LoopAnim('wave', 2.0, 0.1);
  4809. + //MovementMode(true); //now not needed because you can now move the camera while casting!
  4810. + Weapon.bPointing = true;
  4811. + basewand(weapon).bCasting=true;
  4812. + baseWand(Weapon).WandEffect.bHidden = false;
  4813. + bJustFired = false;
  4814. + bJustAltFired = false;
  4815. + hpconsole(player.console).bspaceReleased=false;
  4816. + hpconsole(player.console).bSpacePressed = false;
  4817. + StartSoundFX();
  4818. + makeTarget();
  4819. + //HarryAnimType = AT_Combine;
  4820. + HarryAnimChannel.GotoStateCasting();
  4821. + // bCastFastSpells = true;
  4822. + }
  4823. +
  4824. + //go to the StopCasting function if the player has just pressed the wand input
  4825. + if( HarryAnimChannel.AnimSequence == 'cast' )
  4826. + {
  4827. + //LoopAnim('breath');
  4828. + StopCasting();
  4829. + }
  4830. + }
  4831. +
  4832. + //turn off player casting -AdamJD
  4833. + function StopCasting()
  4834. + {
  4835. + //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
  4836. + if( HarryAnimChannel.AnimSequence == 'cast' )
  4837. + {
  4838. + //LoopAnim('breath');
  4839. + HarryAnimChannel.GotoStateHasCast();
  4840. + Weapon.bPointing = false;
  4841. + basewand(weapon).bCasting=false;
  4842. + baseWand(Weapon).WandEffect.bHidden = true;
  4843. + rectarget.destroy();
  4844. + StopSoundFX();
  4845. + bPlayerCasting = false;
  4846. + }
  4847. +
  4848. + //otherwise stop the casting stuff altogether
  4849. + else
  4850. + {
  4851. + Weapon.bPointing = false;
  4852. + basewand(weapon).bCasting=false;
  4853. + baseWand(Weapon).WandEffect.bHidden = true;
  4854. + rectarget.destroy();
  4855. + StopSoundFX();
  4856. + //bJustFired = true;
  4857. + //bJustAltFired = true;
  4858. + bPlayerCasting = false;
  4859. + //gotoState('PlayerWalking');
  4860. + //HarryAnimType = AT_Combine;
  4861. + HarryAnimChannel.GotoStateCancelCasting();
  4862. + // bCastFastSpells = false;
  4863. + }
  4864. + }
  4865. +
  4866. + event PlayerTick( float DeltaTime )
  4867. + {
  4868. + local baseChar a;
  4869. +
  4870. + Global.PlayerTick( DeltaTime ); //update playertick -AdamJD
  4871. +
  4872. + foreach allActors(class'BaseCam', cam)
  4873. + break;
  4874. +
  4875. if( bTempKillHarry )// || lifePotions <= 0 )
  4876. {
  4877. bTempKillHarry = false;
  4878. @@ -1585,9 +2057,24 @@ ignores SeePlayer, HearNoise, Bump;
  4879. KillHarry(true);
  4880. return;
  4881. }
  4882. +
  4883. + //stop casting if in cutscene/Harry is frozen -AdamJD
  4884. + if (baseHud(myhud).bCutSceneMode == true)
  4885. + {
  4886. + if(bPlayerCasting == true)
  4887. + {
  4888. + bPlayerCasting = false;
  4889. + StopCasting();
  4890. + baseWand(weapon).bPointing = false;
  4891. + basewand(weapon).bCasting=false;
  4892. + baseWand(weapon).WandEffect.bHidden = true;
  4893. + rectarget.destroy();
  4894. + StopSoundFX();
  4895. + }
  4896. + }
  4897.  
  4898. - if ( bUpdatePosition )
  4899. - ClientUpdatePosition();
  4900. + // if ( bUpdatePosition )
  4901. + // ClientUpdatePosition();
  4902.  
  4903. //Try and save how long you've been falling, and what you're original height was when you started falling
  4904. ProcessFalling( DeltaTime );
  4905. @@ -1603,7 +2090,7 @@ ignores SeePlayer, HearNoise, Bump;
  4906. // bScreenRelativeMovement = !bScreenRelativeMovement;
  4907. // ClientMessage("ToggleTab");
  4908. //}
  4909. -
  4910. +
  4911. if( CarryingActor != none )
  4912. {
  4913. //r = weaponRot;
  4914. @@ -1619,6 +2106,47 @@ ignores SeePlayer, HearNoise, Bump;
  4915. AltFire(0);
  4916. }
  4917. }
  4918. +
  4919. + //the player wants to fire a spell, so let's see if they can -AdamJD
  4920. + if( bPlayerCasting && HarryAnimChannel.IsInState('stateCasting') && bAltFire == 0 ) //&& Physics == PHYS_Walking && GetAnimGroup(AnimSequence) == 'wave' //now not needed
  4921. + {
  4922. + //the player is aiming at a target or victim so cast the spell
  4923. + 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
  4924. + {
  4925. + HarryAnimChannel.GotoStateCast();
  4926. + // StopSoundFX();
  4927. + //PlayAnim('cast', 2.0, 0.1);
  4928. + // Weapon.bPointing = false;
  4929. + // basewand(weapon).bCasting=false;
  4930. + // baseWand(Weapon).WandEffect.bHidden = true;
  4931. + // rectarget.destroy();
  4932. + // bPlayerCasting = false;
  4933. + //MovementMode(false); //now not needed because you can now move the camera while casting!
  4934. + StopCasting();
  4935. + //gotoState('PlayerWalking');
  4936. + }
  4937. +
  4938. + //the player is not aiming at a target or victim
  4939. + else
  4940. + {
  4941. + // Weapon.bPointing = false;
  4942. + // baseWand(Weapon).WandEffect.bHidden = true;
  4943. + //loopanim('wave', 2.0 , 0.2);
  4944. + // HarryAnimChannel.GotoStateCancelCasting;
  4945. + // bPlayerCasting = false;
  4946. + // rectarget.destroy();
  4947. + //MovementMode(false); //now not needed because you can now move the camera while casting!
  4948. + StopCasting();
  4949. + //gotoState('PlayerWalking');
  4950. + }
  4951. + }
  4952. +
  4953. + //HP2 cam code (keeps camera behind Harry) -AdamJD
  4954. + if( cam.IsInState('Standardstate') )
  4955. + {
  4956. + DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
  4957. + SetRotation( DesiredRotation );
  4958. + }
  4959. }
  4960.  
  4961. //Try and save how long you've been falling, and what you're original height was when you started falling
  4962. @@ -1651,10 +2179,14 @@ ignores SeePlayer, HearNoise, Bump;
  4963. local float Speed2D;
  4964. local bool bSaveJump;
  4965. local name AnimGroupName;
  4966. -
  4967. - //if( PotCam(ViewTarget) != none )
  4968. - // GetAxes(ViewTarget.Rotation,X,Y,Z);
  4969. - //else
  4970. +
  4971. + //find BaseCam -AdamJD
  4972. + foreach allActors(class'BaseCam', cam)
  4973. + break;
  4974. +
  4975. + // if( PotCam(ViewTarget) != none )
  4976. + // GetAxes(ViewTarget.Rotation,X,Y,Z);
  4977. + // else
  4978.  
  4979. if( bReverseInput ) //Right now, just for troll chase.
  4980. {
  4981. @@ -1670,30 +2202,29 @@ ignores SeePlayer, HearNoise, Bump;
  4982.  
  4983. if( Physics == PHYS_Falling || bLockedOnTarget || bFixedFaceDirection )
  4984. {
  4985. - aStrafe *= 0.08*2;
  4986. + aStrafe *= 0.08; //*2; //halved the speed of aStrafe -AdamJD
  4987. aTurn = 0;
  4988. }
  4989. +
  4990. else
  4991. - {
  4992. - aStrafe = 0;
  4993. - aTurn *= 0.24;
  4994. + {
  4995. + aStrafe *= 0.08;
  4996. + aTurn *= 0.24;
  4997. }
  4998.  
  4999. aLookup *= 0; // make harry steady (no pitching with look up)
  5000. - aSideMove *= 0.1;
  5001. -
  5002. - if( bKeepStationary )
  5003. - {
  5004. - aForward = 0;
  5005. - aStrafe = 0;
  5006. - }
  5007. + aSideMove *= 0.1;
  5008.  
  5009. // Update acceleration.
  5010. if( bLockedOnTarget || bFixedFaceDirection )
  5011. {
  5012. - if( aForward < 0 )
  5013. - aForward *= 2;
  5014. -
  5015. + //not needed -AdamJD
  5016. + // if( aForward < 0 )
  5017. + // aForward *= 2;
  5018. +
  5019. + //stop Harry turning on his own axis when fighting troll or vold -AdamJD
  5020. + aTurn = 0;
  5021. +
  5022. //ClientMessage("aForward:" @ aForward @ " aStrafe:" @ aStrafe);
  5023. //NewAccel = aForward*X + aStrafe*Y;
  5024. //ProcessAccel messes with aForward and aStrafe to get a final NewAccel
  5025. @@ -1725,22 +2256,54 @@ ignores SeePlayer, HearNoise, Bump;
  5026. NewAccel = aForward*X + aStrafe*Y;
  5027. }
  5028. }
  5029. -
  5030. +
  5031. + //don't move if input is disabled -AdamJD
  5032. + if( bKeepStationary )
  5033. + {
  5034. + aForward = 0;
  5035. + aStrafe = 0;
  5036. + }
  5037. +
  5038. NewAccel.Z = 0;
  5039. // Check for Dodge move
  5040.  
  5041. AnimGroupName = GetAnimGroup(AnimSequence);
  5042. +
  5043. if ( (Physics == PHYS_Walking) )
  5044. Speed2D = Sqrt(Velocity.X * Velocity.X + Velocity.Y * Velocity.Y);
  5045.  
  5046. // Update rotation.
  5047. OldRotation = Rotation;
  5048.  
  5049. + //not needed -AdamJD
  5050. //When you're locked onto a target, or facing down a fixed direction, other rotation code is performed
  5051. - if( !(bLockedOnTarget || bFixedFaceDirection) ) // && target != none )
  5052. - UpdateRotation(DeltaTime, 1);
  5053. + //if( !(bLockedOnTarget || bFixedFaceDirection) ) // && target != none )
  5054. + //UpdateRotation(DeltaTime, 1);
  5055.  
  5056. ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
  5057. +
  5058. + //HP2 cam code -AdamJD
  5059. + if( cam.IsInState('StandardState') || cam.IsInState('BossState') )
  5060. + {
  5061. + //Harry will always look at what the camera is looking at
  5062. + DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
  5063. + SetRotation( DesiredRotation );
  5064. + }
  5065. +
  5066. + //stop casting if in cutscene/Harry is frozen -AdamJD
  5067. + if (baseHud(myhud).bCutSceneMode == true)
  5068. + {
  5069. + if(bPlayerCasting == true)
  5070. + {
  5071. + bPlayerCasting = false;
  5072. + StopCasting();
  5073. + baseWand(weapon).bPointing = false;
  5074. + basewand(weapon).bCasting=false;
  5075. + baseWand(weapon).WandEffect.bHidden = true;
  5076. + rectarget.destroy();
  5077. + StopSoundFX();
  5078. + }
  5079. + }
  5080. }
  5081.  
  5082. function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
  5083. @@ -1756,6 +2319,21 @@ ignores SeePlayer, HearNoise, Bump;
  5084. Velocity = vect(0,0,0);
  5085. return;
  5086. }
  5087. +
  5088. + //stop casting if in cutscene/Harry is frozen -AdamJD
  5089. + if (baseHud(myhud).bCutSceneMode == true)
  5090. + {
  5091. + if(bPlayerCasting == true)
  5092. + {
  5093. + bPlayerCasting = false;
  5094. + StopCasting();
  5095. + baseWand(weapon).bPointing = false;
  5096. + basewand(weapon).bCasting=false;
  5097. + baseWand(weapon).WandEffect.bHidden = true;
  5098. + rectarget.destroy();
  5099. + StopSoundFX();
  5100. + }
  5101. + }
  5102.  
  5103. if ( bPressedJump )
  5104. {
  5105. @@ -1764,7 +2342,7 @@ ignores SeePlayer, HearNoise, Bump;
  5106. }
  5107.  
  5108. if ( (Physics == PHYS_Walking) )
  5109. - {
  5110. + {
  5111. if (!bIsCrouching)
  5112. {
  5113. if (bDuck != 0)
  5114. @@ -1840,24 +2418,59 @@ ignores SeePlayer, HearNoise, Bump;
  5115. if (Physics != PHYS_Falling) SetPhysics(PHYS_Walking);
  5116. if ( !IsAnimating() )
  5117. PlayWaiting();
  5118. +
  5119. + //now not needed -AdamJD
  5120. + /*
  5121. + //AdamJD code start
  5122. + //can't get camera to move when Harry is casting so this is a hack
  5123. + if( !bLockedOnTarget )
  5124. + {
  5125. + if (bPlayerCasting == true)
  5126. + {
  5127. + MovementMode(true);
  5128. + }
  5129. + }
  5130. + //AdamJD End
  5131. + */
  5132. +
  5133. + // foreach allActors(class'BaseCam', cam)
  5134. + // break;
  5135.  
  5136. - foreach allActors(class'BaseCam', cam)
  5137. - break;
  5138. -
  5139. - //LastWalkYaw = Rotation.yaw;
  5140. - //PlayerMoving = MOVING_NOT;
  5141. - //CamPosYawOffset = 0;
  5142. - //CamTargetYawOffset = 0;
  5143. + // LastWalkYaw = Rotation.yaw;
  5144. + // PlayerMoving = MOVING_NOT;
  5145. + // CamPosYawOffset = 0;
  5146. + // CamTargetYawOffset = 0;
  5147. }
  5148. -
  5149. +
  5150. function EndState()
  5151. {
  5152. // log("PLOG PWalking Exited");
  5153. WalkBob = vect(0,0,0);
  5154. bIsCrouching = false;
  5155. +
  5156. + //stop casting if in cutscene/Harry is frozen -AdamJD
  5157. + if (baseHud(myhud).bCutSceneMode == true)
  5158. + {
  5159. + if(bPlayerCasting == true)
  5160. + {
  5161. + bPlayerCasting = false;
  5162. + baseWand(weapon).bPointing = false;
  5163. + basewand(weapon).bCasting=false;
  5164. + baseWand(weapon).WandEffect.bHidden = true;
  5165. + rectarget.destroy();
  5166. + StopSoundFX();
  5167. + }
  5168. + }
  5169. +
  5170. + //now not needed -AdamJD
  5171. + /*
  5172. + //if not casting go back to normal movement -AdamJD
  5173. + if (bPlayerCasting == false)
  5174. + {
  5175. + MovementMode(false);
  5176. + }
  5177. + */
  5178. }
  5179. -
  5180. -
  5181. }
  5182.  
  5183. //********************************************************************************************
  5184. @@ -1900,7 +2513,7 @@ ignores SeePlayer, HearNoise, Bump;
  5185. hidden=false;
  5186. }
  5187. }
  5188. -
  5189. +
  5190. if (Physics == PHYS_Walking)
  5191. {
  5192. if (bIsCrouching)
  5193. @@ -1925,7 +2538,7 @@ ignores SeePlayer, HearNoise, Bump;
  5194. }
  5195. else if (bIsWalking)
  5196. {
  5197. - if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
  5198. + if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
  5199. {
  5200. TweenToWalking(0.1);
  5201. bAnimTransition = true;
  5202. @@ -1935,7 +2548,7 @@ ignores SeePlayer, HearNoise, Bump;
  5203. }
  5204. else
  5205. {
  5206. - if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
  5207. + if ( (MyAnimGroup == 'Waiting') || (MyAnimGroup == 'Landing') )
  5208. {
  5209. bAnimTransition = true;
  5210. TweenToRunning(0.1);
  5211. @@ -1943,20 +2556,23 @@ ignores SeePlayer, HearNoise, Bump;
  5212. else
  5213. PlayRunning();
  5214. }
  5215. +
  5216. }
  5217. }
  5218. +
  5219. else
  5220. {
  5221. PlayInAir();
  5222.  
  5223. }
  5224. +
  5225.  
  5226. }
  5227. -
  5228. +
  5229. event PlayerTick( float DeltaTime )
  5230. {
  5231. local baseChar a;
  5232. -
  5233. +
  5234. if( bTempKillHarry )
  5235. {
  5236. bTempKillHarry = false;
  5237. @@ -1973,6 +2589,49 @@ ignores SeePlayer, HearNoise, Bump;
  5238. CarryingActor.setLocation( weaponLoc );//- vect(0,0,1 );
  5239. CarryingActor.SetRotation( weaponRot );
  5240. }
  5241. +
  5242. + //stop casting on chess board -AdamJD
  5243. + if(bPlayerCasting == true)
  5244. + {
  5245. + bPlayerCasting = false;
  5246. + StopCasting();
  5247. + baseWand(weapon).bPointing = false;
  5248. + basewand(weapon).bCasting=false;
  5249. + baseWand(Weapon).WandEffect.bHidden = true;
  5250. + rectarget.destroy();
  5251. + StopSoundFX();
  5252. + }
  5253. + }
  5254. +
  5255. + //new rotation function for the chess board -AdamJD
  5256. + function UpdateRotationOnChessBoard(float DeltaTime, float maxPitch)
  5257. + {
  5258. + local rotator NewRotation;
  5259. + local float YawVal;
  5260. +
  5261. + //get the SmoothMouseX axis and cap it to not overshoot input (only need to care about the SmoothMouseX axis) -AdamJD
  5262. + YawVal = (SmoothMouseX / 1.5) * DeltaTime;
  5263. +
  5264. + //limit SmoothMouseX -AdamJD
  5265. + if(YawVal == SmoothMouseX)
  5266. + {
  5267. + if( YawVal > MAX_MOUSE_DELTA_X )
  5268. + {
  5269. + YawVal = MAX_MOUSE_DELTA_X;
  5270. + }
  5271. +
  5272. + else if( YawVal < MIN_MOUSE_DELTA_X )
  5273. + {
  5274. + YawVal = MIN_MOUSE_DELTA_X;
  5275. + }
  5276. + }
  5277. +
  5278. + ViewRotation.Yaw += YawVal; //set YawVal to ViewRotation.Yaw -AdamJD
  5279. + DesiredRotation.Yaw = ViewRotation.Yaw; //set ViewRotation.Yaw to DesiredRotation.Yaw -AdamJD
  5280. + NewRotation.Yaw = cam.rotation.Yaw; //move Harry and chess marker at the same time when moving mouse left or right -AdamJD
  5281. +
  5282. + DesiredRotation = ViewRotation; //set ViewRotation to DesiredRotation -AdamJD
  5283. + setRotation(NewRotation); //use the NewRotation as the camera rotation -AdamJD
  5284. }
  5285.  
  5286. function PlayerMove( float DeltaTime )
  5287. @@ -1985,7 +2644,7 @@ ignores SeePlayer, HearNoise, Bump;
  5288. local float Speed2D;
  5289. local bool bSaveJump;
  5290. local name AnimGroupName;
  5291. -
  5292. +
  5293. //if( PotCam(ViewTarget) != none )
  5294. // GetAxes(ViewTarget.Rotation,X,Y,Z);
  5295. //else
  5296. @@ -2002,6 +2661,7 @@ ignores SeePlayer, HearNoise, Bump;
  5297. if (aForward > 0)
  5298. {
  5299. bChessMoving = true;
  5300. + TweenToRunning(0.4); //make Harry move smoothly -AdamJD
  5301. return;
  5302. }
  5303. }
  5304. @@ -2009,10 +2669,12 @@ ignores SeePlayer, HearNoise, Bump;
  5305. {
  5306. return;
  5307. }
  5308. -
  5309. +
  5310. + //not needed -AdamJD
  5311. + /*
  5312. if( bReverseInput ) //Right now, just for troll chase.
  5313. {
  5314. - //aForward = -aForward;
  5315. + aForward = -aForward;
  5316. aTurn = -aTurn;
  5317. aStrafe = -aStrafe;
  5318. }
  5319. @@ -2029,29 +2691,32 @@ ignores SeePlayer, HearNoise, Bump;
  5320. aStrafe = 0;
  5321. aTurn *= 0.24;
  5322. }
  5323. + */
  5324.  
  5325. aLookup *= 0; // make harry steady (no pitching with look up)
  5326. - aSideMove *= 0.1;
  5327. + // aSideMove *= 0.1; //not needed -AdamJD
  5328.  
  5329. if( bKeepStationary )
  5330. {
  5331. aForward = 0;
  5332. aStrafe = 0;
  5333. }
  5334. -
  5335. +
  5336. + //not needed -AdamJD
  5337. + /*
  5338. // Update acceleration.
  5339. - if( bLockedOnTarget )
  5340. + if( bLockedOnTarget )
  5341. {
  5342. - if( aForward < 0 )
  5343. + if( aForward < 0 )
  5344. aForward *= 2;
  5345.  
  5346. - //ClientMessage("aForward:" @ aForward @ " aStrafe:" @ aStrafe);
  5347. - //NewAccel = aForward*X + aStrafe*Y;
  5348. - //ProcessAccel messes with aForward and aStrafe to get a final NewAccel
  5349. + ClientMessage("aForward:" @ aForward @ " aStrafe:" @ aStrafe);
  5350. + NewAccel = aForward*X + aStrafe*Y;
  5351. + ProcessAccel messes with aForward and aStrafe to get a final NewAccel
  5352. NewAccel = ProcessAccel();
  5353. - }
  5354. - else
  5355. - {
  5356. + }*/
  5357. + // else //not needed -AdamJD
  5358. + // {
  5359. GetAxes(Rotation,X,Y,Z);
  5360.  
  5361. // Update acceleration.
  5362. @@ -2075,7 +2740,7 @@ ignores SeePlayer, HearNoise, Bump;
  5363. {
  5364. NewAccel = aForward*X + aStrafe*Y;
  5365. }
  5366. - }
  5367. + // }
  5368.  
  5369. NewAccel.Z = 0;
  5370. // Check for Dodge move
  5371. @@ -2084,14 +2749,28 @@ ignores SeePlayer, HearNoise, Bump;
  5372. if ( (Physics == PHYS_Walking) )
  5373. Speed2D = Sqrt(Velocity.X * Velocity.X + Velocity.Y * Velocity.Y);
  5374.  
  5375. + //not needed -AdamJD
  5376. // Update rotation.
  5377. - OldRotation = Rotation;
  5378. -
  5379. + // OldRotation = Rotation;
  5380. +
  5381. //When you're locked onto a target, other rotation code is performed
  5382. - if( !bLockedOnTarget ) // && target != none )
  5383. - UpdateRotation(DeltaTime, 1);
  5384. + //if( !bLockedOnTarget ) // && target != none )
  5385. + //UpdateRotation(DeltaTime, 1);
  5386. +
  5387. + UpdateRotationOnChessBoard(DeltaTime, 1); //new rotation function created by me just for the chess board -AdamJD
  5388. +
  5389. + //stop casting on chess board -AdamJD
  5390. + if(bPlayerCasting == true)
  5391. + {
  5392. + StopCasting();
  5393. + baseWand(weapon).bPointing = false;
  5394. + basewand(weapon).bCasting=false;
  5395. + baseWand(weapon).WandEffect.bHidden = true;
  5396. + rectarget.destroy();
  5397. + StopSoundFX();
  5398. + }
  5399.  
  5400. - ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
  5401. + // ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation); //commented out because this allows Harry to walk off the chess board breaking the game... -AdamJD
  5402. }
  5403.  
  5404. function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
  5405. @@ -2152,7 +2831,7 @@ ignores SeePlayer, HearNoise, Bump;
  5406. // if ( bIsTurning && (AnimFrame >= 0) )
  5407. // {
  5408. // bAnimTransition = true;
  5409. - // PlayTurning();
  5410. + //PlayTurning();
  5411. // }
  5412. //}
  5413. //else
  5414. @@ -2167,6 +2846,19 @@ ignores SeePlayer, HearNoise, Bump;
  5415. }
  5416. }
  5417. }
  5418. +
  5419. + //stop casting on chess board -AdamJD
  5420. + if(bPlayerCasting == true)
  5421. + {
  5422. + bPlayerCasting = false;
  5423. + StopCasting();
  5424. + baseWand(weapon).bPointing = false;
  5425. + basewand(weapon).bCasting=false;
  5426. + baseWand(Weapon).WandEffect.bHidden = true;
  5427. + rectarget.destroy();
  5428. + StopSoundFX();
  5429. + }
  5430. +
  5431. else
  5432. {
  5433. if ( (OldAccel == vect(0,0,0)) && (Acceleration != vect(0,0,0)) )
  5434. @@ -2176,11 +2868,54 @@ ignores SeePlayer, HearNoise, Bump;
  5435. }
  5436. }
  5437. }
  5438. -
  5439. +
  5440. + //stop Harry moving and casting when first on the chess board -AdamJD
  5441. + function BeginState()
  5442. + {
  5443. + Acceleration = Vec(0, 0, 0);
  5444. + Velocity = Vec(0, 0, 0);
  5445. +
  5446. + if (Physics == PHYS_Falling)
  5447. + {
  5448. + SetPhysics(PHYS_Walking);
  5449. + PlayWalking();
  5450. + }
  5451. +
  5452. + else if (bPlayerCasting == true)
  5453. + {
  5454. + bPlayerCasting = false;
  5455. + StopCasting();
  5456. + baseWand(weapon).bPointing = false;
  5457. + basewand(weapon).bCasting=false;
  5458. + baseWand(Weapon).WandEffect.bHidden = true;
  5459. + rectarget.destroy();
  5460. + StopSoundFX();
  5461. + PlayWalking();
  5462. + HarryAnimType = AT_Replace;
  5463. + }
  5464. +
  5465. + else
  5466. + {
  5467. + PlayWalking();
  5468. + }
  5469. + }
  5470. +
  5471. function EndState()
  5472. {
  5473. WalkBob = vect(0,0,0);
  5474. bIsCrouching = false;
  5475. +
  5476. + //stop casting on chess board -AdamJD
  5477. + if(bPlayerCasting == true)
  5478. + {
  5479. + bPlayerCasting = false;
  5480. + StopCasting();
  5481. + baseWand(weapon).bPointing = false;
  5482. + basewand(weapon).bCasting=false;
  5483. + baseWand(Weapon).WandEffect.bHidden = true;
  5484. + rectarget.destroy();
  5485. + StopSoundFX();
  5486. + }
  5487. }
  5488.  
  5489. begin:
  5490. @@ -2196,6 +2931,18 @@ begin:
  5491. if (Physics != PHYS_Falling) SetPhysics(PHYS_Walking);
  5492. if ( !IsAnimating() )
  5493. PlayWaiting();
  5494. +
  5495. + //stop casting on chess board -AdamJD
  5496. + if(bPlayerCasting == true)
  5497. + {
  5498. + bPlayerCasting = false;
  5499. + StopCasting();
  5500. + baseWand(weapon).bPointing = false;
  5501. + basewand(weapon).bCasting=false;
  5502. + baseWand(Weapon).WandEffect.bHidden = true;
  5503. + rectarget.destroy();
  5504. + StopSoundFX();
  5505. + }
  5506.  
  5507. foreach allActors(class'BaseCam', cam)
  5508. break;
  5509. @@ -2222,11 +2969,14 @@ loop:
  5510. }
  5511.  
  5512. //**********************************************************************************************
  5513. +//now not needed -AdamJD
  5514. +/*
  5515. //This is called from 'PlayerWalking' and 'PlayerAim'
  5516. function UpdateRotation(float DeltaTime, float maxPitch)
  5517. {
  5518. local rotator newRotation;
  5519. local float YawVal;
  5520. + local float YawValY; //local YawValY float -AdamJD
  5521. local int RotDist;
  5522. local float FastRotRate;
  5523.  
  5524. @@ -2234,14 +2984,16 @@ function UpdateRotation(float DeltaTime, float maxPitch)
  5525. return;
  5526.  
  5527. FastRotRate = 70000;
  5528. +
  5529. + YawValY = YawVal; //set YawValY to YawVal -AdamJD
  5530.  
  5531. DesiredRotation = ViewRotation;
  5532. ViewRotation.Pitch += 32.0 * DeltaTime * aLookUp;
  5533. ViewRotation.Pitch = ViewRotation.Pitch & 65535;
  5534. -
  5535. - If ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152))
  5536. +
  5537. + if ((ViewRotation.Pitch > 18000) && (ViewRotation.Pitch < 49152))
  5538. {
  5539. - If (aLookUp > 0)
  5540. + if (aLookUp > 0)
  5541. ViewRotation.Pitch = 18000;
  5542. else
  5543. ViewRotation.Pitch = 49152;
  5544. @@ -2278,17 +3030,95 @@ function UpdateRotation(float DeltaTime, float maxPitch)
  5545. YawVal = -YawVal;
  5546. }
  5547. }
  5548. +
  5549. else
  5550. {
  5551. - //When you're in state 'PlayerAim', and you're in "circle around the boss" (bLockedOnTarget) mode, this function gets called,
  5552. + // When you're in state 'PlayerAim', and you're in "circle around the boss" (bLockedOnTarget) mode, this function gets called,
  5553. // and then overridden, with an absolute rot set towards the Boss.
  5554. -
  5555. - if(Acceleration == vect(0,0,0))
  5556. - YawVal=32.0 * DeltaTime * aTurn;
  5557. +
  5558. + if(Acceleration == vect(0,0,0))
  5559. + {
  5560. + //YawVal= 32.0 * DeltaTime * aTurn; //old retail code -AdamJD
  5561. +
  5562. + //HOLY CRAP- I finally fixed Harry turning when strafing!!! -AdamJD
  5563. + YawVal= (SmoothMouseX / 1.5) * DeltaTime;
  5564. + // YawValY = (SmoothMouseY / 1.5) * DeltaTime;
  5565. +
  5566. + //for a more smoother Mouse X effect -AdamJD
  5567. + if(YawVal == SmoothMouseX)
  5568. + {
  5569. + if( YawVal > MAX_MOUSE_DELTA_X )
  5570. + {
  5571. + YawVal = MAX_MOUSE_DELTA_X;
  5572. + }
  5573. +
  5574. + else if( YawVal < MIN_MOUSE_DELTA_X )
  5575. + {
  5576. + YawVal = MIN_MOUSE_DELTA_X;
  5577. + }
  5578. + }
  5579. +
  5580. + //for a more smoother Mouse Y effect -AdamJD
  5581. + // if(YawValY == SmoothMouseY)
  5582. + // {
  5583. + // if( YawValY > MAX_MOUSE_DELTA_Y )
  5584. + // {
  5585. + // YawValY = MAX_MOUSE_DELTA_Y;
  5586. + // }
  5587. +
  5588. + // else if( YawValY < MIN_MOUSE_DELTA_Y )
  5589. + // {
  5590. + // YawValY = MIN_MOUSE_DELTA_Y;
  5591. + // }
  5592. + // }
  5593. +
  5594. + //keep camera behind Harry -AdamJD
  5595. + // DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
  5596. + // SetRotation( DesiredRotation );
  5597. + }
  5598. +
  5599. else
  5600. - YawVal=24.0 * DeltaTime * aTurn;
  5601. + {
  5602. + //YawVal=24.0 * DeltaTime * aTurn; //old retail code -AdamJD
  5603. +
  5604. + //HOLY CRAP- I finally fixed Harry turning when strafing!!! -AdamJD
  5605. + YawVal= (SmoothMouseX / 1.8) * DeltaTime;
  5606. + // YawValY = (SmoothMouseY / 1.8) * DeltaTime;
  5607. +
  5608. + //for a more smoother Mouse X effect -AdamJD
  5609. + if(YawVal == SmoothMouseX)
  5610. + {
  5611. + if( YawVal > MAX_MOUSE_DELTA_X )
  5612. + {
  5613. + YawVal = MAX_MOUSE_DELTA_X;
  5614. + }
  5615. +
  5616. + else if( YawVal < MIN_MOUSE_DELTA_X )
  5617. + {
  5618. + YawVal = MIN_MOUSE_DELTA_X;
  5619. + }
  5620. + }
  5621. +
  5622. + //for a more smoother Mouse Y effect -AdamJD
  5623. + // if(YawValY == SmoothMouseY)
  5624. + // {
  5625. + // if( YawValY > MAX_MOUSE_DELTA_Y )
  5626. + // {
  5627. + // YawValY = MAX_MOUSE_DELTA_Y;
  5628. + // }
  5629. +
  5630. + // else if( YawValY < MIN_MOUSE_DELTA_Y )
  5631. + // {
  5632. + // YawValY = MIN_MOUSE_DELTA_Y;
  5633. + // }
  5634. + // }
  5635. +
  5636. + //keep camera behind Harry -AdamJD
  5637. + // DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
  5638. + // SetRotation( DesiredRotation );
  5639. + }
  5640. }
  5641. -
  5642. +
  5643. //If bConstrainYaw is set and you're not turning, this tries to turn you back towards the x axis
  5644. if( bConstrainYaw && yawVal == 0 )
  5645. {
  5646. @@ -2301,8 +3131,10 @@ function UpdateRotation(float DeltaTime, float maxPitch)
  5647. else
  5648. yawVal = min( RotDist, 65536 - ViewRotation.Yaw );
  5649. }
  5650. -
  5651. +
  5652. + //AdamJD
  5653. ViewRotation.Yaw += yawVal;
  5654. + //ViewRotation.Pitch = YawValY;
  5655.  
  5656. //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.
  5657. if( bConstrainYaw )
  5658. @@ -2315,13 +3147,13 @@ function UpdateRotation(float DeltaTime, float maxPitch)
  5659. if( ViewRotation.Yaw >= 32767 && ViewRotation.Yaw < 65536 - ConstrainYawVariance )
  5660. ViewRotation.Yaw = 65536 - ConstrainYawVariance;
  5661. }
  5662. -
  5663. +
  5664. // Remember pre-shake.
  5665. newRotation = ViewRotation;
  5666. ViewShake(deltaTime);
  5667. if( ViewTarget != none )
  5668. {
  5669. - // Apply the view shake delta to our camera actor.
  5670. + //Apply the view shake delta to our camera actor.
  5671. newRotation = ViewTarget.Rotation + ViewRotation - newRotation;
  5672. newRotation.Roll = newRotation.Roll & 0xffff;
  5673. ViewTarget.SetRotation(newRotation);
  5674. @@ -2330,17 +3162,76 @@ function UpdateRotation(float DeltaTime, float maxPitch)
  5675. newRotation = Rotation;
  5676. newRotation.Yaw = ViewRotation.Yaw;
  5677. newRotation.Pitch = ViewRotation.Pitch;
  5678. -
  5679. - If ( (newRotation.Pitch > maxPitch * RotationRate.Pitch) && (newRotation.Pitch < 65536 - maxPitch * RotationRate.Pitch) )
  5680. +
  5681. + if ( (newRotation.Pitch > maxPitch * RotationRate.Pitch) && (newRotation.Pitch < 65536 - maxPitch * RotationRate.Pitch) )
  5682. {
  5683. - If (ViewRotation.Pitch < 32768)
  5684. + if (ViewRotation.Pitch < 32768)
  5685. newRotation.Pitch = maxPitch * RotationRate.Pitch;
  5686. else
  5687. newRotation.Pitch = 65536 - maxPitch * RotationRate.Pitch;
  5688. }
  5689. setRotation(newRotation);
  5690. -}
  5691. -
  5692. +}*/
  5693. +//**********************************************************************************************
  5694. +//old x mouse function created by me -AdamJD
  5695. +/*
  5696. +function MouseX(float DeltaTime)
  5697. +{
  5698. + local float xMouse;
  5699. + local float fRotSpeed;
  5700. + local float fCurrentMinPitch;
  5701. + local float fCurrentMaxPitch;
  5702. +
  5703. + xMouse = SmoothMouseX * DeltaTime;
  5704. +
  5705. + fRotSpeed = 4.0f;
  5706. + fCurrentMinPitch = -14000.0f;
  5707. + fCurrentMaxPitch = 14000.0f;
  5708. +
  5709. + //for a more smoother effect -AdamJD
  5710. + if( xMouse > MAX_MOUSE_DELTA_X )
  5711. + {
  5712. + xMouse = MAX_MOUSE_DELTA_X;
  5713. + }
  5714. +
  5715. + else if( xMouse < MIN_MOUSE_DELTA_X )
  5716. + {
  5717. + xMouse = MIN_MOUSE_DELTA_X;
  5718. + }
  5719. +
  5720. + //DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
  5721. + // SetRotation( DesiredRotation );
  5722. +}*/
  5723. +//**********************************************************************************************
  5724. +//old y mouse function created by me -AdamJD
  5725. +/*
  5726. +function MouseY(float DeltaTime)
  5727. +{
  5728. + local float yMouse;
  5729. + local float fRotSpeed;
  5730. + local float fCurrentMinPitch;
  5731. + local float fCurrentMaxPitch;
  5732. +
  5733. + yMouse = SmoothMouseY * DeltaTime;
  5734. +
  5735. + fRotSpeed = 4.0f;
  5736. + fCurrentMinPitch = -14000.0f;
  5737. + fCurrentMaxPitch = 14000.0f;
  5738. +
  5739. + //for a more smoother effect -AdamJD
  5740. + if( yMouse > MAX_MOUSE_DELTA_X )
  5741. + {
  5742. + yMouse = MAX_MOUSE_DELTA_X;
  5743. + }
  5744. +
  5745. + else if( yMouse < MIN_MOUSE_DELTA_X )
  5746. + {
  5747. + yMouse = MIN_MOUSE_DELTA_X;
  5748. + }
  5749. +
  5750. + //DesiredRotation.Yaw = cam.rotation.Yaw & 0xFFFF;
  5751. + // SetRotation( DesiredRotation );
  5752. +}*/
  5753. //**********************************************************************************************
  5754. function UpdateRotationToTarget()
  5755. {
  5756. @@ -2371,8 +3262,9 @@ function UpdateRotationToTarget()
  5757.  
  5758. //This makes it so when harry goes to state 'hit', he still looks at the boss.
  5759. DesiredRotation = ViewRotation;
  5760. -
  5761. - if( (StandardTarget.Location != TargetLoc && astrafe != 0)
  5762. +
  5763. + //not needed -AdamJD
  5764. + /*if( (StandardTarget.Location != TargetLoc && astrafe != 0)
  5765. || (BossRailMove(BossTarget) != none)
  5766. )
  5767. {
  5768. @@ -2384,13 +3276,16 @@ function UpdateRotationToTarget()
  5769. v = TargetLoc;
  5770. }
  5771. StandardTarget.SetLocation(v);
  5772. - }
  5773. + }*/
  5774.  
  5775. r = rotator(StandardTarget.Location - Location);
  5776. r.pitch = Rotation.pitch;
  5777. - SetRotation( r );
  5778. + //SetRotation( r ); //not needed -AdamJD
  5779. ViewRotation = r;
  5780. + DesiredRotation = r; //set the desired rotation -AdamJD
  5781. }
  5782. + //not needed -AdamJD
  5783. + /*
  5784. else
  5785. {
  5786. TargetLoc = rectarget.location;
  5787. @@ -2400,6 +3295,7 @@ function UpdateRotationToTarget()
  5788. SetRotation( r );
  5789. ViewRotation = r;
  5790. }
  5791. + */
  5792. }
  5793.  
  5794. //**********************************************************************************************
  5795. @@ -2418,7 +3314,7 @@ function vector ProcessAccel()
  5796. fLargestAForward = aForward;
  5797.  
  5798. //Point harry at our foe
  5799. - UpdateRotationToTarget();
  5800. + UpdateRotationToTarget();
  5801.  
  5802. GetAxes(Rotation,X,Y,Z);
  5803.  
  5804. @@ -2662,12 +3558,6 @@ ignores SeePlayer, HearNoise, Bump;
  5805. return;
  5806. }
  5807.  
  5808. - if ( bPressedJump )
  5809. - {
  5810. - DoJump(); // jumping
  5811. - bPressedJump = false;
  5812. - }
  5813. -
  5814. if ( (Physics == PHYS_Walking) )
  5815. {
  5816. if (!bIsCrouching)
  5817. @@ -2763,11 +3653,11 @@ ignores SeePlayer, HearNoise, Bump;
  5818. if ( (Physics == PHYS_Walking) )
  5819. {
  5820. Speed2D = Sqrt(Velocity.X * Velocity.X + Velocity.Y * Velocity.Y);
  5821. - }
  5822. + }
  5823.  
  5824. // Update rotation.
  5825. - OldRotation = Rotation;
  5826. - UpdateRotation(DeltaTime, 1);
  5827. + //OldRotation = Rotation; //not needed -AdamJD
  5828. + //UpdateRotation(DeltaTime, 1); //not needed -AdamJD
  5829.  
  5830.  
  5831. ProcessMove(DeltaTime, NewAccel, DodgeMove, OldRotation - Rotation);
  5832. @@ -2839,8 +3729,8 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
  5833. fireDir = normal(fireDir);
  5834. bestTarget = none;
  5835.  
  5836. - if (rectarget.victim == none)
  5837. - {
  5838. + //if (rectarget.victim == none) //not needed -AdamJD
  5839. + //{
  5840. foreach VisibleActors( class 'ACTOR', hitactor)
  5841. {
  5842. if( HitActor.bprojtarget && PlayerPawn(HitActor) != Self && !HitActor.IsA('BaseCam'))
  5843. @@ -2871,7 +3761,9 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
  5844. }
  5845.  
  5846. }
  5847. - }
  5848. + //}
  5849. + //not needed -AdamJD
  5850. + /*
  5851. else
  5852. {
  5853. bestTarget = rectarget.victim;
  5854. @@ -2881,6 +3773,7 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
  5855. bestYaw = bestYaw & 0xffff;
  5856. bestZ = objectdir.z;
  5857. }
  5858. + */
  5859.  
  5860. if(bestTarget != none)
  5861. {
  5862. @@ -2899,68 +3792,6 @@ function rotator AdjustAim(float projSpeed, vector projStart, int aimerror, bool
  5863. return defaultAngle;
  5864. }
  5865.  
  5866. -
  5867. -event PreBeginPlay()
  5868. -{
  5869. - Super.PreBeginPlay();
  5870. -
  5871. - foreach AllActors(class'baseNarrator', theNarrator)
  5872. - break;
  5873. - if(theNarrator==None)
  5874. - {
  5875. - theNarrator=spawn(class 'Narrator');
  5876. - Log("Narrator spawned:" $theNarrator);
  5877. - }
  5878. -
  5879. -}
  5880. -
  5881. -function PostBeginPlay()
  5882. -{
  5883. - local Pawn p;
  5884. - local weapon weap;
  5885. - Super.PostBeginPlay();
  5886. -
  5887. - b3DSound = bool(ConsoleCommand("get ini:Engine.Engine.AudioDevice Use3dHardware"));
  5888. -
  5889. - bShowMenu=false;
  5890. - log("weapon is" $weapon);
  5891. - if(inventory==none)
  5892. - {
  5893. - weap=spawn(class'baseWand');
  5894. - weap.BecomeItem();
  5895. - AddInventory(weap);
  5896. - weap.WeaponSet(self);
  5897. - weap.GiveAmmo(self);
  5898. - baseWand(weap).bUseMana=false;
  5899. - log(self$ " spawning weap " $weap);
  5900. - }
  5901. - else
  5902. - {
  5903. - log("not spawning weap");
  5904. - }
  5905. -
  5906. - iFireSeedCount = 0;
  5907. -
  5908. - HUDType=class'HPMenu.HPHud';
  5909. -
  5910. - viewClass(class 'BaseCam', true);
  5911. - // @PAB added new camera target
  5912. - makeCamTarget();
  5913. -
  5914. - // Harry gets a shadow, bigger than normal.
  5915. - Shadow = Spawn(ShadowClass,self);
  5916. - log( self$ " ShadowClass=" $ShadowClass$ " shadow=" $Shadow$ " tex=" $Shadow.Texture );
  5917. -
  5918. -// @PAB temp give a spell to Harry
  5919. - baseWand(weap).addSpell(Class'spellDud');
  5920. -// baseWand(weap).addSpell(Class'spellflip');
  5921. -// baseWand(weap).addSpell(Class'spellALOho');
  5922. -// baseWand(weap).SelectSpell(Class'spellFlip');
  5923. -
  5924. - HarryAnimChannel = cHarryAnimChannel( CreateAnimChannel(class'cHarryAnimChannel', AT_Replace, 'harry spine1') );
  5925. - HarryAnimChannel.SetOwner( self );
  5926. -}
  5927. -
  5928. function timer()
  5929. {
  5930.  
  5931. @@ -3030,14 +3861,17 @@ function makeTarget()
  5932. local vector tloc;
  5933. local vector targetoffset;
  5934.  
  5935. - targetOffset.y=0;
  5936. targetOffset.x=50;
  5937. + targetOffset.y=0;
  5938. targetOffset.z=0;
  5939.  
  5940. tloc=targetOffset>>viewrotation;
  5941. - tloc=tloc+location;
  5942. -
  5943. + tloc +=location;
  5944. +
  5945. rectarget=spawn(class'target',,,tloc);
  5946. +
  5947. + //not needed -AdamJD
  5948. + /*
  5949. if(rectarget==none)
  5950. {
  5951. targetOffset.y=0;
  5952. @@ -3045,11 +3879,12 @@ function makeTarget()
  5953. targetOffset.z=0;
  5954.  
  5955. tloc=targetOffset>>viewrotation;
  5956. - tloc=tloc+location;
  5957. + tloc +=location;
  5958.  
  5959. rectarget=spawn(class'target',,,tloc);
  5960. }
  5961. -
  5962. + */
  5963. +
  5964. if(rectarget==none)
  5965. {
  5966. gotostate('playerwalking');
  5967. @@ -3057,32 +3892,35 @@ function makeTarget()
  5968. hpconsole(player.console).bspaceReleased=true;
  5969. hpconsole(player.console).bSpacePressed=false;
  5970. }
  5971. -
  5972. - rectarget.p=self;
  5973. - rectarget.targetOffset.y=0;
  5974. - rectarget.targetOffset.x=100;
  5975. - rectarget.targetOffset.z=0;
  5976. +
  5977. + else
  5978. + {
  5979. + // rectarget.p=self;
  5980. + rectarget.targetOffset.x=100;
  5981. + rectarget.targetOffset.y=0;
  5982. + rectarget.targetOffset.z=0;
  5983. + }
  5984. }
  5985.  
  5986. -
  5987. +//now not needed -AdamJD
  5988. +/*
  5989. // @PAB added new camera target
  5990. function makeCamTarget()
  5991. {
  5992. local vector tloc;
  5993. local vector targetoffset;
  5994.  
  5995. -
  5996. - targetOffset.y=0;
  5997. - targetOffset.x=50;
  5998. - targetOffset.z=0;
  5999. -
  6000. -
  6001. -
  6002. -
  6003. - tloc=targetOffset>>viewrotation;
  6004. - tloc=tloc+location;
  6005. + //not needed -AdamJD
  6006. + // targetOffset.y=0;
  6007. + // targetOffset.x=50;
  6008. + // targetOffset.z=0;
  6009. +
  6010. + StandardTarget=spawn(class'camtarget',,,tloc);*/
  6011. + // tloc=targetOffset>>viewrotation; //not needed -AdamJD
  6012. + // tloc+=location; //not needed -AdamJD
  6013.  
  6014. - StandardTarget=spawn(class'camtarget',,,tloc);
  6015. + //not needed -AdamJD
  6016. + /*
  6017. if(StandardTarget==none)
  6018. {
  6019. targetOffset.y=0;
  6020. @@ -3100,13 +3938,17 @@ function makeCamTarget()
  6021. hpconsole(player.console).bspaceReleased = true;
  6022. hpconsole(player.console).bSpacePressed = false;
  6023. }
  6024. -
  6025. - StandardTarget.p=self;
  6026. - StandardTarget.targetOffset.y=0;
  6027. - StandardTarget.targetOffset.x=100;
  6028. - StandardTarget.targetOffset.z=0;
  6029. - StandardTarget.gotostate('seeking');
  6030. -}
  6031. + */
  6032. +
  6033. + /*
  6034. + StandardTarget.p=self;
  6035. + // StandardTarget.targetOffset.y=0; /not needed -AdamJD
  6036. + // StandardTarget.targetOffset.x=100; /not needed -AdamJD
  6037. + StandardTarget.targetOffset.x= SmoothMouseX; //AdamJD
  6038. + StandardTarget.targetOffset.y= SmoothMouseY; //AdamJD
  6039. + StandardTarget.targetOffset.z=0;
  6040. + //StandardTarget.gotostate('seeking'); /not needed -AdamJD
  6041. +}*/
  6042.  
  6043. state SpellLearning
  6044. {
  6045. @@ -3116,36 +3958,37 @@ state SpellLearning
  6046.  
  6047. defaultproperties
  6048. {
  6049. - ShadowClass=Class'HarryPotter.HarryShadow'
  6050. - eaid(0)="xa37dd45ffe10v ptۈ"̦ϝʾρǹ07cb3fa231144fe2e33ae4783feead2b8a73ff021fac326df0ef9753ab9cdf6573ddff0312fab0b0ff39779eaff312x"
  6051. - HurtSound(0)=Sound'HPSounds.Har_Emotes.ouch1'
  6052. - HurtSound(1)=Sound'HPSounds.Har_Emotes.ouch2'
  6053. - HurtSound(2)=Sound'HPSounds.Har_Emotes.ouch3'
  6054. - HurtSound(3)=Sound'HPSounds.Har_Emotes.ouch4'
  6055. - HurtSound(4)=Sound'HPSounds.Har_Emotes.ouch5'
  6056. - HurtSound(5)=Sound'HPSounds.Har_Emotes.ouch6'
  6057. - HurtSound(6)=Sound'HPSounds.Har_Emotes.ouch7'
  6058. - HurtSound(7)=Sound'HPSounds.Har_Emotes.ouch8'
  6059. - HurtSound(8)=Sound'HPSounds.Har_Emotes.ouch9'
  6060. - HurtSound(9)=Sound'HPSounds.Har_Emotes.ouch10'
  6061. - HurtSound(10)=Sound'HPSounds.Har_Emotes.ouch11'
  6062. - HurtSound(11)=Sound'HPSounds.Har_Emotes.ouch12'
  6063. - HurtSound(12)=Sound'HPSounds.Har_Emotes.ouch13'
  6064. - HurtSound(13)=Sound'HPSounds.Har_Emotes.oof1'
  6065. - HurtSound(14)=Sound'HPSounds.Har_Emotes.oof2'
  6066. - GroundSpeed=200
  6067. - AirSpeed=400
  6068. - AccelRate=1024
  6069. - JumpZ=245
  6070. - MaxMountHeight=96.5
  6071. - AirControl=0.25
  6072. - BaseEyeHeight=40.75
  6073. - EyeHeight=40.75
  6074. - MenuName="Harry"
  6075. - DrawType=DT_Mesh
  6076. - Mesh=SkeletalMesh'HarryPotter.skharryMesh'
  6077. - CollisionRadius=15
  6078. - CollisionHeight=42
  6079. - Mass=1
  6080. - Buoyancy=118.8
  6081. -}
  6082. + ShadowClass=Class'HarryPotter.HarryShadow'
  6083. + eaid(0)="xEU-0000004821-SD-001753aabac325f07cb3fa231144fe2e33ae4783feead2b8a73ff021fac326df0ef9753ab9cdf6573ddff0312fab0b0ff39779eaff312x"
  6084. + HurtSound(0)=Sound'HPSounds.Har_Emotes.ouch1'
  6085. + HurtSound(1)=Sound'HPSounds.Har_Emotes.ouch2'
  6086. + HurtSound(2)=Sound'HPSounds.Har_Emotes.ouch3'
  6087. + HurtSound(3)=Sound'HPSounds.Har_Emotes.ouch4'
  6088. + HurtSound(4)=Sound'HPSounds.Har_Emotes.ouch5'
  6089. + HurtSound(5)=Sound'HPSounds.Har_Emotes.ouch6'
  6090. + HurtSound(6)=Sound'HPSounds.Har_Emotes.ouch7'
  6091. + HurtSound(7)=Sound'HPSounds.Har_Emotes.ouch8'
  6092. + HurtSound(8)=Sound'HPSounds.Har_Emotes.ouch9'
  6093. + HurtSound(9)=Sound'HPSounds.Har_Emotes.ouch10'
  6094. + HurtSound(10)=Sound'HPSounds.Har_Emotes.ouch11'
  6095. + HurtSound(11)=Sound'HPSounds.Har_Emotes.ouch12'
  6096. + HurtSound(12)=Sound'HPSounds.Har_Emotes.ouch13'
  6097. + HurtSound(13)=Sound'HPSounds.Har_Emotes.oof1'
  6098. + HurtSound(14)=Sound'HPSounds.Har_Emotes.oof2'
  6099. + GroundSpeed=200
  6100. + AirSpeed=400
  6101. + AccelRate=1024
  6102. + JumpZ=245
  6103. + MaxMountHeight=96.5
  6104. + AirControl=0.25
  6105. + BaseEyeHeight=40.75
  6106. + EyeHeight=40.75
  6107. + MenuName="Harry"
  6108. + DrawType=DT_Mesh
  6109. + Mesh=SkeletalMesh'HarryPotter.skharryMesh'
  6110. + CollisionRadius=15
  6111. + CollisionHeight=42
  6112. + Mass=1
  6113. + Buoyancy=118.8
  6114. + RotationRate=(Pitch=20000,Yaw=70000,Roll=3072) //added the rotation rate in the default props -AdamJD
  6115. +}
  6116. \ No newline at end of file
  6117. diff --git a/Hub2/Classes/BroomDraco.uc b/Hub2/Classes/BroomDraco.uc
  6118. index b27e725..e0148b1 100644
  6119. --- a/Hub2/Classes/BroomDraco.uc
  6120. +++ b/Hub2/Classes/BroomDraco.uc
  6121. @@ -3,6 +3,8 @@
  6122. //=============================================================================
  6123. class BroomDraco extends QuidPlayer;
  6124.  
  6125. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6126. +
  6127. var GameReferee Referee; // Object in charge of the rules of the current mini-game
  6128. var BroomHarry Harry;
  6129.  
  6130. @@ -78,7 +80,7 @@ function Touch( Actor Other)
  6131. {
  6132. // Just stumble (don't damage, like what a QuidPlayer would do) and count bumps
  6133.  
  6134. - if ( !bHit && Other == Harry && Bumps < BumpsToWin-1 )
  6135. + if ( !bHit && Other == Harry && Bumps < BumpsToWin/*-1*/ ) //makes sure Dracos health goes to 0 -AdamJD
  6136. {
  6137. bHit = true;
  6138. PlayAnim( 'Bumped' );
  6139. @@ -86,7 +88,7 @@ function Touch( Actor Other)
  6140. PlaySound( BumpEmoteSounds[ Rand( NUM_BUMP_EMOTES ) ], SLOT_Talk, , , 2000.0 ); // Radius makes sure he can be heard
  6141.  
  6142. ++Bumps;
  6143. - if ( Bumps >= BumpsToWin-1 )
  6144. + if ( Bumps >= BumpsToWin/*-1*/ ) //makes sure Dracos health goes to 0 -AdamJD
  6145. Referee.Trigger( Self, None ); // Tell referee that Draco almost gives up
  6146.  
  6147. Velocity = vect(0,0,1);
  6148. diff --git a/Hub2/Classes/QuidditchReferee.uc b/Hub2/Classes/QuidditchReferee.uc
  6149. index 1e34d72..f6550dc 100644
  6150. --- a/Hub2/Classes/QuidditchReferee.uc
  6151. +++ b/Hub2/Classes/QuidditchReferee.uc
  6152. @@ -3,6 +3,8 @@
  6153. //=============================================================================
  6154. class QuidditchReferee extends GameReferee;
  6155.  
  6156. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6157. +
  6158. var BroomHarry Harry;
  6159. var QuidPlayer Seeker; // Opponent team's seeker
  6160. var Snitch Snitch;
  6161. @@ -797,26 +799,29 @@ state GameCatch
  6162.  
  6163. PlayerHarry.ClientMessage( "Entered GameCatch State" );
  6164. Log( "Entered GameCatch State" );
  6165. -
  6166. - CatchTriesLeft = SnitchMaxCatchTries;
  6167. - SetTimer( 10.0, false ); // Watchdog timer in case Harry never reaches ground
  6168. +
  6169. + //not needed -AdamJD
  6170. + // CatchTriesLeft = SnitchMaxCatchTries;
  6171. + // SetTimer( 10.0, false ); // Watchdog timer in case Harry never reaches ground
  6172.  
  6173. // Make Harry trail the snitch
  6174. - Harry.GotoState( 'Pursue' );
  6175. + // Harry.GotoState( 'Pursue' ); //not needed -AdamJD
  6176. + Harry.GotoState( 'Catching' ); //the pursue state is bugged with the new code so go straight to catching the snitch -AdamJD
  6177.  
  6178. // Make bludgers stop seeking Harry
  6179. foreach AllActors( class'Bludger', Bludger )
  6180. Bludger.SeekTarget( None );
  6181.  
  6182. + //not needed -AdamJD
  6183. // Switch to catch-the-snitch hud element
  6184. - QuidHud( Harry.MyHud ).PlayHUDGame(true);
  6185. - QuidHud( Harry.MyHud ).SetHUDGameType(HUDG_QUIDDITCH);
  6186. -
  6187. - Harry.cam.gotostate('LockAroundHarry');
  6188. - Harry.cam.CameraDistance = 200.000;
  6189. - Harry.cam.TargetRot = rot(5000, 5000, 0);
  6190. + // QuidHud( Harry.MyHud ).PlayHUDGame(true);
  6191. + // QuidHud( Harry.MyHud ).SetHUDGameType(HUDG_QUIDDITCH);
  6192. +
  6193. + // Harry.cam.gotostate('LockAroundHarry');
  6194. + // Harry.cam.CameraDistance = 200.000;
  6195. + // Harry.cam.TargetRot = rot(5000, 5000, 0);
  6196. }
  6197. -
  6198. +
  6199. function Tick( float DeltaTime )
  6200. {
  6201. local TeamAffiliation eTeam;
  6202. @@ -844,7 +849,9 @@ state GameCatch
  6203. fTimeToCheer = Level.TimeSeconds + 8.0 + 3.0*FRand();
  6204. }
  6205. }
  6206. -
  6207. +
  6208. + //not needed -AdamJD
  6209. + /*
  6210. function OnActionKeyPressed()
  6211. {
  6212. // Called when the player's "Action" key/button is pressed.
  6213. @@ -852,7 +859,7 @@ state GameCatch
  6214.  
  6215. // Determine if snitch is caught; if so, goto Won state; otherwise
  6216. // either wait for a few more tries, or return to regular game play
  6217. - if ( QuidHud( Harry.MyHud ).HUDGameGrab() /*Snitch caught*/ )
  6218. + if ( QuidHud( Harry.MyHud ).HUDGameGrab() ) //snitch caught
  6219. {
  6220. // Caught the Snitch! Put snitch in harry's hand
  6221. if ( PlayMechanic == PM_ProximityWithHoops )
  6222. @@ -863,7 +870,7 @@ state GameCatch
  6223.  
  6224. QuidHud(Harry.myHUD).DestroyPopup();
  6225.  
  6226. - // Tell seeker to stop looking for the Snitch
  6227. + Tell seeker to stop looking for the Snitch
  6228. if ( Seeker != None )
  6229. Seeker.SetLookForTarget( None );
  6230.  
  6231. @@ -874,7 +881,7 @@ state GameCatch
  6232. --CatchTriesLeft;
  6233. if ( CatchTriesLeft <= 0 )
  6234. {
  6235. - // Turn off hud progress element
  6236. + Turn off hud progress element
  6237. QuidHud( Harry.MyHud ).PlayHUDGame(false);
  6238. QuidHud(Harry.myHUD).DestroyPopup();
  6239. Harry.cam.gotostate('QuidditchState');
  6240. @@ -883,8 +890,10 @@ state GameCatch
  6241. GotoState( 'GamePlay' );
  6242. }
  6243. }
  6244. - }
  6245. -
  6246. + }*/
  6247. +
  6248. + //not needed -AdamJD
  6249. + /*
  6250. function Timer()
  6251. {
  6252. // Never actioned on the snitch; go back to regular gameplay
  6253. @@ -892,11 +901,11 @@ state GameCatch
  6254. // Turn off hud progress element
  6255. QuidHud( Harry.MyHud ).PlayHUDGame(false);
  6256. QuidHud(Harry.myHUD).DestroyPopup();
  6257. - Harry.cam.gotostate('QuidditchState');
  6258. + Harry.cam.gotostate('QuidditchState'); //not needed -AdamJD
  6259.  
  6260. Harry.GotoState( 'PlayerWalking' );
  6261. GotoState( 'GamePlay' );
  6262. - }
  6263. + }*/
  6264.  
  6265. function EndState()
  6266. {
  6267. @@ -907,6 +916,19 @@ state GameCatch
  6268. Harry.StopFlyingOnPath();
  6269. fProgressPercent = 75.0;
  6270. }
  6271. +
  6272. + //code copied from OnActionKeyPressed function to make Harry catch the snitch -AdamJD
  6273. + Begin:
  6274. + Snitch.HoopTrail.GotoState( 'TrailOff' );
  6275. + Snitch.StopFlyingOnPath();
  6276. + Harry.CatchTarget( Snitch, 'IPHarry_Win' );
  6277. + Snitch.Halo.bHidden = true;
  6278. +
  6279. + // Tell seeker to stop looking for the Snitch
  6280. + if ( Seeker != None )
  6281. + Seeker.SetLookForTarget( None );
  6282. +
  6283. + GotoState( 'GameWon' );
  6284. }
  6285.  
  6286. state GameWon
  6287. @@ -952,10 +974,11 @@ Begin:
  6288. Commentator.SayComment( QC_SigningOff );
  6289. Sleep( Commentator.TimeLeftUntilSafeToSayAComment( true ) );
  6290. }
  6291. - else
  6292. - {
  6293. - Sleep( 12.0 );
  6294. - }
  6295. + //not needed- AdamJD
  6296. + // else
  6297. + // {
  6298. + // Sleep( 12.0 );
  6299. + // }
  6300.  
  6301. if ( bLeagueMode )
  6302. {
  6303. diff --git a/Hub2/Classes/RemembrallReferee.uc b/Hub2/Classes/RemembrallReferee.uc
  6304. index 195905a..66cc04b 100644
  6305. --- a/Hub2/Classes/RemembrallReferee.uc
  6306. +++ b/Hub2/Classes/RemembrallReferee.uc
  6307. @@ -3,6 +3,8 @@
  6308. //=============================================================================
  6309. class RemembrallReferee extends GameReferee;
  6310.  
  6311. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6312. +
  6313. var BroomHarry Harry;
  6314. var BroomDraco Draco;
  6315.  
  6316. @@ -240,7 +242,8 @@ state GamePlay
  6317. // bump away from giving up
  6318. if ( Other == Draco )
  6319. {
  6320. - GotoState( 'GameBump' );
  6321. + // GotoState( 'GameBump' ); //not needed -AdamJD
  6322. + GotoState( 'GameWon' ); // state GameBump is bugged with the new code so go staight to GameWon -AdamJD
  6323. }
  6324. else
  6325. {
  6326. @@ -269,6 +272,8 @@ begin:
  6327.  
  6328. state GameBump
  6329. {
  6330. + //not needed -AdamJD
  6331. + /*
  6332. function BeginState()
  6333. {
  6334. // Start chasing Draco
  6335. @@ -315,14 +320,15 @@ state GameBump
  6336. if ( Other == Draco )
  6337. {
  6338. // Turn off hud bump element and reset camera
  6339. -
  6340. + Draco.OnBroomBump( Harry );
  6341. + QuidHUD(playerHarry.myHUD).DestroyPopup();
  6342. // Make Draco throw Remembrall to Harry
  6343. Harry.SetLookForTarget( None );
  6344. GotoState( 'GameWon' );
  6345. }
  6346. else
  6347. {
  6348. - // Unexpected trigger event
  6349. + Unexpected trigger event
  6350. Super.Trigger( Other, EventInstigator );
  6351. }
  6352. }
  6353. @@ -330,7 +336,7 @@ state GameBump
  6354. function Timer()
  6355. {
  6356. // Never actioned on Draco; go back to regular gameplay
  6357. -
  6358. +
  6359. // Turn off hud bump element and reset camera
  6360. Harry.cam.gotostate('QuidditchState');
  6361. Harry.StandardTarget.TargetOffset = vect(100, 0 ,50);
  6362. @@ -347,14 +353,19 @@ state GameBump
  6363. Log( "Exited GameBump State" );
  6364.  
  6365. SetTimer( 0.0, false );
  6366. - Harry.StopFlyingOnPath();
  6367. - --Draco.Bumps;
  6368. + Harry.StopFlyingOnPath();
  6369. + // --Draco.Bumps;
  6370. }
  6371. + */
  6372. }
  6373.  
  6374. state GameWon
  6375. {
  6376. Begin:
  6377. + Draco.OnBroomBump( Harry ); //Bump Draco -AdamJD
  6378. + Harry.SetLookForTarget( None ); //Harry now looks for no target -AdamJD
  6379. + Draco.GotoState('SpinOut'); //play Dracos spin out anim -AdamJD
  6380. + Sleep(2); //this is needed to make sure Draco appears in the beaten cutscene -AdamJD
  6381. // Go to Win cutscene
  6382. Harry.BossTarget = none;
  6383. TriggerEvent( 'Win', self, None );
  6384. diff --git a/Hub3/Classes/BathroomTroll.uc b/Hub3/Classes/BathroomTroll.uc
  6385. index 19cace8..bc28d0a 100644
  6386. --- a/Hub3/Classes/BathroomTroll.uc
  6387. +++ b/Hub3/Classes/BathroomTroll.uc
  6388. @@ -1,5 +1,7 @@
  6389. class BathroomTroll expands BaseTroll;
  6390.  
  6391. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6392. +
  6393. var float TimeRemaining;
  6394. var BaseToiletObject ThrownObject;
  6395.  
  6396. @@ -27,10 +29,10 @@ auto state Initial
  6397. function beginstate()
  6398. {
  6399.  
  6400. - //foreach AllActors(class'baseharry', playerHarry)
  6401. - //{
  6402. - // break;
  6403. - //}
  6404. + // foreach AllActors(class'baseharry', playerHarry)
  6405. + // {
  6406. + // break;
  6407. + // }
  6408.  
  6409. foreach AllActors(class'BathroomRon', CastingRon)
  6410. {
  6411. @@ -40,7 +42,7 @@ auto state Initial
  6412. //Temp set up for this test
  6413. // basewand(playerHarry.weapon).addspell(class'spellflip');
  6414. playerHarry.bosstarget = self;
  6415. -// playerHarry.cam.gotostate('bossstate');
  6416. + //playerHarry.cam.gotostate('bossstate');
  6417.  
  6418. loopanim('breathe');
  6419. // gotostate('combat');
  6420. @@ -155,10 +157,11 @@ state Combat
  6421.  
  6422. if (animframe > 0.6 && bThrowing)
  6423. {
  6424. - if( FRand() < 0.8 )
  6425. + //casting at objects thrown at Ron is bugged for the new Harry code so I've made all the objects go towards Harry -AdamJD
  6426. + // if( FRand() < 0.8 )
  6427. ThrownObject.ThrowObject(playerHarry);
  6428. - else
  6429. - ThrownObject.ThrowObject(CastingRon);
  6430. + // else
  6431. + // ThrownObject.ThrowObject(CastingRon);
  6432.  
  6433. // PlaySound(sound'HPSounds.Hub1_sfx.peeves_Throws', SLOT_None, [Volume]RandRange(0.8, 1.0), [Radius]100000, [Pitch]RandRange(0.9, 1.1) ); //break;
  6434. switch( Rand(3) )
  6435. diff --git a/Hub4/Classes/BaseSneakActor.uc b/Hub4/Classes/BaseSneakActor.uc
  6436. index c530dcf..e7ae319 100644
  6437. --- a/Hub4/Classes/BaseSneakActor.uc
  6438. +++ b/Hub4/Classes/BaseSneakActor.uc
  6439. @@ -4,6 +4,8 @@
  6440.  
  6441. class BaseSneakActor extends baseChar;
  6442.  
  6443. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6444. +
  6445. // These are so we can keep track of the running speed and animations, since these characters vary between
  6446. // walking and running pretty often...
  6447. var int OldGroundspeed; // The Original Walk Speed
  6448. @@ -233,11 +235,13 @@ function FindHarryTick(float DeltaTime)
  6449. if(playerHarry.Opacity >= 0.8)
  6450. {
  6451. playerHarry.clientMessage("BaseSneakActor went to state RunLocation");
  6452. - gotostate('RunLocation');
  6453. + //gotostate('RunLocation'); //old retail code -AdamJD
  6454. + gotostate('Caught'); //make Harry caught if Filch sees him when visible instead of running towards him -AdamJD
  6455. }
  6456. }
  6457.  
  6458. - if (playerHarry.IsInState('playeraiming')) // Must be casting a spell
  6459. + //if (playerHarry.IsInState('playeraiming')) // Must be casting a spell //old not needed retail PlayerAiming state -AdamJD
  6460. + if (InvisHarry.bPlayerCasting) //is InvisibleHarry casting? -AdamJD
  6461. {
  6462. if(cansee(playerHarry))
  6463. {
  6464. @@ -252,7 +256,7 @@ function FindHarryTick(float DeltaTime)
  6465.  
  6466. foreach allActors(class'InvisibleHarry', InvisHarry)
  6467. {
  6468. - if( InvisHarry.bIsPlayer&& InvisHarry!=Self)
  6469. + if( InvisHarry.bIsPlayer && InvisHarry!=Self)
  6470. {
  6471. // We can only hear him if he's moving
  6472. if(InvisHarry.IsMoving)
  6473. @@ -482,6 +486,7 @@ state RunLocation
  6474. }
  6475.  
  6476. Begin:
  6477. +
  6478. // Make the Run Speed Really Fast
  6479. groundspeed = RunningSpeed;
  6480.  
  6481. diff --git a/Hub4/Classes/InvisibleHarry.uc b/Hub4/Classes/InvisibleHarry.uc
  6482. index 1297375..6ff2c9a 100644
  6483. --- a/Hub4/Classes/InvisibleHarry.uc
  6484. +++ b/Hub4/Classes/InvisibleHarry.uc
  6485. @@ -5,6 +5,8 @@
  6486.  
  6487. class InvisibleHarry extends Harry;
  6488.  
  6489. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6490. +
  6491. // Make this setable in the Editor so we can tweak it...
  6492. var () float InvisibleValue;
  6493. var Texture HitTexture; // This is global to the class here so we can check it from Filch & Norris
  6494. @@ -87,9 +89,12 @@ function MakeVisible(float DeltaTime)
  6495.  
  6496. function OverrideTick(float DeltaTime)
  6497. {
  6498. + local bool isDebugged;
  6499. +
  6500. // This lets us know that, in fact, this function is not called all the time...
  6501. -
  6502. - if(!IsInState('playeraiming'))
  6503. +
  6504. + //if(!IsInState('playeraiming')) //old not needed retail PlayerAiming state -AdamJD
  6505. + if(!bPlayerCasting) //is player not casting? -AdamJD
  6506. {
  6507. if(bHasCloak)
  6508. MakeInvisible(DeltaTime);
  6509. @@ -100,23 +105,40 @@ function OverrideTick(float DeltaTime)
  6510. {
  6511. MakeVisible(DeltaTime);
  6512. }
  6513. -
  6514. +
  6515. + //old retail code -AdamJD
  6516. + /*
  6517. // Now signal for Movement
  6518. if(VSize (LastLocation - location) > FlagMovementRadius)
  6519. {
  6520. - // ***************** Diagnostics
  6521. - //if(!IsMoving)
  6522. - // clientmessage("Harry Started Moving.");
  6523. + //Diagnostics
  6524. + if(!IsMoving)
  6525. + clientmessage("Harry Started Moving.");
  6526. IsMoving = true;
  6527. }
  6528. else
  6529. {
  6530. - // ***************** Diagnostics
  6531. - //if(IsMoving)
  6532. - // clientmessage("Harry Stopped Moving.");
  6533. + //Diagnostics
  6534. + if(IsMoving)
  6535. + clientmessage("Harry Stopped Moving.");
  6536. IsMoving = false;
  6537. }
  6538. -
  6539. + */
  6540. +
  6541. + //Player is not touching a movement key or is in a cutscene -AdamJD
  6542. + if( Acceleration == vect(0,0,0) )
  6543. + {
  6544. + IsMoving = false;
  6545. + //ClientMessage("Harry not moving"); //for testing -AdamJD
  6546. + }
  6547. +
  6548. + //Player has touched a movement key so therefore Harry is now moving -AdamJD
  6549. + else
  6550. + {
  6551. + IsMoving = true;
  6552. + //ClientMessage("Harry is moving"); //for testing -AdamJD
  6553. + }
  6554. +
  6555. LastLocation = location;
  6556. }
  6557.  
  6558. @@ -195,6 +217,18 @@ state harryfrozen
  6559. Super.PlayerTick(DeltaTime);
  6560.  
  6561. OverrideTick(DeltaTime);
  6562. +
  6563. + //stop casting and turn off cursor if caught -AdamJD
  6564. + if(bPlayerCasting == true)
  6565. + {
  6566. + bPlayerCasting = false;
  6567. + StopCasting();
  6568. + baseWand(weapon).bPointing = false;
  6569. + basewand(weapon).bCasting=false;
  6570. + baseWand(Weapon).WandEffect.bHidden = true;
  6571. + rectarget.destroy();
  6572. + StopSoundFX();
  6573. + }
  6574. }
  6575.  
  6576. function ProcessMove(float DeltaTime, vector NewAccel, eDodgeDir DodgeMove, rotator DeltaRot)
  6577. @@ -218,7 +252,7 @@ state harryfrozen
  6578. bPressedJump = false;
  6579. }
  6580.  
  6581. - if ( (Physics == PHYS_Walking) )
  6582. + if ( (Physics == PHYS_Walking) )
  6583. {
  6584. loopanim('caughtbyfilch');
  6585. }
  6586. @@ -299,6 +333,8 @@ state Mounting
  6587. }
  6588. }
  6589.  
  6590. +//old not needed retail PlayerAiming state -AdamJD
  6591. +/*
  6592. state playeraiming
  6593. {
  6594. event PlayerTick(float DeltaTime)
  6595. @@ -308,7 +344,7 @@ state playeraiming
  6596. Super.PlayerTick(DeltaTime);
  6597. }
  6598. }
  6599. -
  6600. +*/
  6601.  
  6602. state PlayerWalking
  6603. {
  6604. @@ -317,6 +353,12 @@ state PlayerWalking
  6605. Super.PlayerTick(DeltaTime);
  6606.  
  6607. OverrideTick(DeltaTime);
  6608. +
  6609. + //if player is casting then make Harry visible -AdamJD
  6610. + if (bPlayerCasting == true)
  6611. + {
  6612. + MakeVisible(DeltaTime);
  6613. + }
  6614. }
  6615. }
  6616.  
  6617. diff --git a/Hub5/Classes/FlyingKeyReferee.uc b/Hub5/Classes/FlyingKeyReferee.uc
  6618. index 43f6949..faecf6c 100644
  6619. --- a/Hub5/Classes/FlyingKeyReferee.uc
  6620. +++ b/Hub5/Classes/FlyingKeyReferee.uc
  6621. @@ -3,6 +3,7 @@
  6622. //=============================================================================
  6623. class FlyingKeyReferee extends QuidditchReferee;
  6624.  
  6625. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6626.  
  6627. //-------------------------------------------------------------------------------------------
  6628. // PostBeginPlay()
  6629. @@ -61,6 +62,10 @@ Begin:
  6630. // Go to Win cutscene
  6631. Sleep( 3.0 );
  6632. TriggerEvent( 'Win', self, None );
  6633. + //makes broomHarry and snitch invisible during the end cutscene -AdamJD
  6634. + Sleep(2);
  6635. + Harry.bHidden = true;
  6636. + Snitch.bHidden = true;
  6637.  
  6638. loop:
  6639. Sleep( 0.1 );
  6640. @@ -94,6 +99,18 @@ state GameCatch
  6641. super.BeginState();
  6642. QuidHud( Harry.MyHud ).SetHUDGameType(HUDG_FLYINGKEYS);
  6643. }
  6644. +
  6645. + //go back to chasing the key if the player didn't get the key in Harrys hand -AdamJD
  6646. + function Timer()
  6647. + {
  6648. + super.Timer();
  6649. + }
  6650. +
  6651. + //go back to chasing the key if the player didn't get the key in Harrys hand -AdamJD
  6652. + function EndState()
  6653. + {
  6654. + super.EndState();
  6655. + }
  6656. }
  6657.  
  6658. defaultproperties
  6659. diff --git a/Tut1/Classes/tut1Peeves.uc b/Tut1/Classes/tut1Peeves.uc
  6660. index 29e084a..097f824 100644
  6661. --- a/Tut1/Classes/tut1Peeves.uc
  6662. +++ b/Tut1/Classes/tut1Peeves.uc
  6663. @@ -1,6 +1,6 @@
  6664. class tut1Peeves expands peeves;
  6665.  
  6666. -
  6667. +//Edited by- AdamJD (edited code will have AdamJD by it)
  6668.  
  6669. var float hitCount;
  6670. var sound peevesVoice;
  6671. @@ -239,7 +239,7 @@ begin:
  6672. findcam();
  6673. Opacity=1;
  6674. hugcamera=true;
  6675. - pcam.gotostate('cutstate');
  6676. + //pcam.gotostate('cutstate'); //the camera locks when hitting Peeves in the new camera code so I've turned this off -AdamJD
  6677. SetPhysics(PHYS_rotating);
  6678. // 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