// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // class SondeerWagen extends SCar; /// Exhaust: // var() array TrailEffectPositions; // var class TrailEffectClass; // var array TrailEffects; var int BONE_HOED; var int BONE_TRAP; var int BONE_STEMPELS; var int BONE_RUPSL; var int BONE_RUPSR; var bool bSticky; var float fStickyFactor; var float LastCamTime; var rotator LastCamRot; var bool bBackCamera; /// Temporarily skip impact registrations. var bool bSkipImpacts; var float BrakeVehicle; /// jln - 09-12-2008 Respawn after water jump. var bool doRespawn; //============================================================================= // Description: // // Date Id Modification // 2006-04-13 gui Created /* //============================================================================= event Bump(Actor other) { //local KActor kActor; Log("SondeerWagen Bump: " @ Other); if (Controller != None) { } super.Bump(other); } function TakeDamage(int Damage, Pawn InstigatedBy, vector HitLocation, vector Momentum, class DamageType) { Log("SW: Take damage"); } */ function Touch( actor Other ) { //local int i; // Log("Touch Sondeer:" @ Other); /// Only for level 2: if (GeoPlayerController(Controller).GetScenarioNumber() == 2 && FluidSurfaceInfo(Other) != None) { doRespawn = true; SetTimer(2, false); } Super.Touch(other); } event KImpact(actor other, vector pos, vector impactVel, vector impactNorm) { if (bSkipImpacts == false) { Log("SW: Karma impact: " @ impactVel @ Other @ impactNorm); //if (Other != None) //{ SetTimer(2, false); /// Likely stops impacts on the road. if (impactNorm.Z < 0.80) { /// Disable impacts for 2 seconds. bSkipImpacts = true; if (Controller != None) { /// If the player is driving: if (GeoPlayerController(Controller) != None) { if (Other != None) { GeoPlayerController(Controller).RegisterObjectHit(); } else { log("HIT REGISTERED BUT OTHER OBJECT IS NONE"); GeoPlayerController(Controller).RegisterObjectHit(); } } } } //} } Super.KImpact(Other,pos,impactVel,impactNorm); } function Timer() { /// Reset, allow impacts again: bSkipImpacts = false; if (doRespawn == true) { dorespawn = false; GeoPlayerController(Controller).dorespawn(); setTimer(0, false); } } /* function Touch( actor Other ) { //local int i; Log("Touch Sondeer:" @ Other); //local KActor kActor; // Log("Bump: " @ Other); if (Controller != None) { /// If the player is driving: if (GeoPlayerController(Controller) != None) { GeoPlayerController(Controller).RegisterObjectHit(other.name); } } super.Touch(other); // for (i = 0; i < Touching.length; i++) // { // Log("Touch: " @ Touching[i]); // } } function HitWall (vector HitNormal, actor Wall) { super.HitWall(hitNormal, Wall); Log("Sondeer HitWall: " @ Wall); } */ event KDriverEnter(Pawn p) { /// Call super: Super.KDriverenter(P); if (Controller != None) { /// If the player is driving: if (GeoPlayerController(Controller) != None) { if (GeoPlayerController(Controller).RaceMode == true) { Log("Player is driving"); GeoPlayerController(Controller).ClientOpenMenu("GeoInterface.dialogTrafficLight"); } } } } simulated function PostNetBeginPlay() { local int i; Super.PostNetBeginPlay(); for(i = 0;i> Rotation) ); TrailEffects[i].SetBase(self); TrailEffects[i].SetRelativeRotation( rot(0,32768,0) ); } } */ } function UpdateVehicle(float DeltaTime) { OutputBrake = BrakeVehicle; Super.UpdateVehicle(DeltaTime); ///Log("brake:" @ Outputbrake); } function int GetRotDiff(int A, int B) { local int comp; comp = (A - B) & 65535; if(comp > 32768) comp -= 65536; return comp; } simulated function bool SpecialCalcView(out actor ViewActor, out vector CameraLocation, out rotator CameraRotation ) { local vector CamLookAt, HitLocation, HitNormal; local float LerpAmount; local float CurTime; local float CameraSwingRatio; if (bBackCamera == false) { /// Use default camera: return super.SpecialCalcView(ViewActor,CameraLocation,CameraRotation); } CameraSwingRatio = 0.05; ViewActor = self; CurTime = Level.TimeSeconds; LerpAmount = 1.0 - ( CameraSwingRatio ** (CurTime - LastCamTime) ); LastCamTime = CurTime; // if(bRearView) //{ CamLookAt = Location + (vect(-200, 0, -500) >> Rotation); CameraRotation.Yaw = LastCamRot.Yaw + GetRotDiff(Rotation.Yaw, LastCamRot.Yaw) * LerpAmount; CameraRotation.Roll = 0; CameraRotation.Pitch = -2000; //16384; //-1000; // } // else // { // CamLookAt = Location + (vect(-3000, 0, 200) >> Rotation); // CameraRotation.Roll = 0; // CameraRotation.Yaw = LastCamRot.Yaw + // GetRotDiff(Rotation.Yaw + 32768, LastCamRot.Yaw) * LerpAmount; // CameraRotation.Pitch = -1000; // } CameraLocation = CamLookAt + (vect(-1800, 0, 1200) >> CameraRotation); if( Trace( HitLocation, HitNormal, CameraLocation, CamLookAt, false, vect(10, 10, 10) ) != None ) { // CameraLocation = HitLocation; } LastCamRot = CameraRotation; return true; } simulated function Tick(float DeltaTime) { /// jln - 19-09-2008 Are we stuck? if (bSticky) { ModifyKarmaOn(); } // local int i; // local float ThrustAmount; // local GeoPlayercontroller GeoPC; /* if (Owner != None) { GeoPC = GeoPlayerController(Owner); if (GeoPc != None) { ThrustAmount = GeoPC.GetVelocity() / 10; for(i=0; i