// // CPT operator / SondeerGame // This source file is (c) by Deltares. // - October 2014 // /* This is the entire interior of the SondeerWagen which can easily be spawned where needed */ class SondeerWagenInterior extends Actor placeable; var OfficeObject osondeerbuis1; var OfficeObject osondeerbuis2; var OfficeObject odeur; var OfficeObject opcknoppen; var OfficeObject opcscherm; var OfficeObject ostaalborstel; var OfficeObject osondeertoren; var OfficeObject okoffiebrief; var OfficeObject oontluchten; var OfficeObject ocable; var OfficeObject oCabine; var OfficeObject oconusintoren; var OfficeObject oopdrachtbon; //var OfficeObject ocomputer; function PostBeginPlay() { SpawnInteriorActors(); } function Stempelen() { local rotator rrot; local vector vpos, vplayer; local GeoPlayerController GeoPC; local PlayerController P; foreach AllActors(class'PlayerController', P) { if(P.IsA('GeoPlayerController')) { GeoPC = GeoPlayerController(P); } } /// Reset object positions: rrot = self.Rotation; rrot.pitch = 0; rrot.roll = 0; self.SetRotation(rrot); vpos = self.Location; vpos.z += 108; self.SetLocation(vpos); vplayer = vpos; vplayer.z += 150; GeoPC.Pawn.SetPhysics(PHYS_NONE); GeoPC.Pawn.SetLocation(vplayer); odeur.SetRotation(rrot); opcknoppen.SetRotation(rrot); opcscherm.SetRotation(rrot); ostaalborstel.SetRotation(rrot); osondeertoren.SetRotation(rrot); okoffiebrief.SetRotation(rrot); osondeerbuis1.SetRotation(rrot); osondeerbuis2.SetRotation(rrot); oontluchten.SetRotation(rrot); ocable.SetRotation(rrot); oopdrachtbon.SetRotation(rrot); /// Update conus in tower as well. if (oconusintoren != None) oconusintoren.SetRotation(rrot); odeur.SetLocation(vpos); opcknoppen.SetLocation(vpos); opcscherm.SetLocation(vpos); ostaalborstel.SetLocation(vpos); osondeertoren.SetLocation(vpos); okoffiebrief.SetLocation(vpos); osondeerbuis1.SetLocation(vpos); osondeerbuis2.SetLocation(vpos); oontluchten.SetLocation(vpos); ocable.SetLocation(vpos); if (oconusintoren != None) oconusintoren.SetLocation(vpos); oopdrachtbon.SetLocation(vpos); oCabine.SetLocation(vpos); oCabine.Setrotation(rrot); } /// Spawn our interior actors /// Tags are used in "MouseItemInteraction.uc", which opens all the dialogs as well. function SpawnInteriorActors() { local GeoPlayerController GeoPC; local PlayerController P; local bool brokenconusleft; // local vector loc; // osondeerbuis1 = Spawn(class'OfficeObject', self,'sondeerstang', Location, Rotation); odeur = Spawn(class'OfficeObject', self, 'sondeerdeur',Location,Rotation); odeur.bMouseEnabled = false; opcknoppen = Spawn(class'OfficeObject', self, 'stempelen',Location,Rotation); opcscherm = Spawn(class'OfficeObject', self, 'sondeercomputer' ,Location,Rotation); ostaalborstel = Spawn(class'OfficeObject', self, 'borstel',Location,Rotation); ostaalborstel.bMouseEnabled = false; // ocomputer = Spawn(class'OfficeObject', self,,',Rotation); osondeertoren = Spawn(class'OfficeObject', self, 'sondeertoren',Location,Rotation); okoffiebrief = Spawn(class'OfficeObject', self, 'koffiebrief',Location,Rotation); oontluchten = Spawn(class'OfficeObject', self, 'ontluchten',Location,Rotation); oopdrachtbon = Spawn(class'OfficeObject', self, 'opdrachtboninterior',Location,Rotation); foreach AllActors(class'PlayerController', P) { if(P.IsA('GeoPlayerController')) { GeoPC = GeoPlayerController(P); } GeoPC.bCableBroken = Rand(2) == 1; } if (GeoPC.bCableBroken) { ocable = Spawn(class'OfficeObject', self, 'cablebroken',Location,Rotation); ocable.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_kabel_gebroken' ); } else { ocable = Spawn(class'OfficeObject', self, 'cable',Location,Rotation); ocable.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_kabel' ); ocable.bMouseEnabled = false; } oopdrachtbon.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_opdrachtbon' ); odeur.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_deur' ); opcknoppen.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_pcknoppen' ); opcscherm.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_pcscherm' ); ostaalborstel.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_staalborstel' ); osondeertoren.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_sondeertoren' ); okoffiebrief.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_koffiebrief' ); /// This should be done with a separate class, but for time saving we'll just use a if... if (GeoPC.GetCompany() == "A.P. van den Berg") { /// For AP only: oontluchten.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_vacuumpomp' ); } else { oontluchten.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_ontluchting' ); } //ocomputer.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_pcs' ); brokenconusleft = (Rand(2) == 1); osondeerbuis1 = Spawn(class'OfficeObject_PickupSondeerConus', self,'pickupconus1', Location, Rotation); OfficeObject_PickupSondeerConus(osondeerbuis1).SetOldConus(true, brokenconusleft); osondeerbuis2 = Spawn(class'OfficeObject_PickupSondeerConus', self,'pickupconus2', Location, Rotation); OfficeObject_PickupSondeerConus(osondeerbuis2).SetOldConus(false, brokenconusleft); /// Spawn cabin: /// In this class we only toggle between Deltares or AP: oCabine = Spawn(class'OfficeObject', self, 'cabine',Location,Rotation); if (GeoPC.GetCompany() == "Deltares") { oCabine.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_cabine_deltares' ); } else { oCabine.SetStaticMesh( StaticMesh'SondeerMeester2.interior.binnenkant_auto_cabine_apvdberg' ); } oCabine.bMouseEnabled = false; } event Destroyed() { Super.Destroyed(); DestroyInteriorActors(); } function DestroyInteriorActors() { osondeerbuis1.destroy(); osondeerbuis2.destroy(); opcknoppen.destroy(); opcscherm.destroy(); ostaalborstel.destroy(); osondeertoren.destroy(); okoffiebrief.destroy(); odeur.destroy(); oontluchten.destroy(); ocable.destroy(); oopdrachtbon.destroy(); oCabine.destroy(); } defaultproperties { StaticMesh=StaticMesh'SondeerMeester2.interior.binnenkant_auto' DrawType=DT_StaticMesh bBlockActors = true; bBlockPlayers = true; bBlockKarma = true; bCollideActors = true; }