diff --git a/.gitignore b/.gitignore index 0bafa9988..36d9b8287 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ Saves/* error_log_* .vscode updates/ +Thumbs.db +*.SI diff --git a/Achievements.bb b/Achievements.bb index d9ba57d7e..7894d924b 100644 --- a/Achievements.bb +++ b/Achievements.bb @@ -3,8 +3,8 @@ Const MAXACHIEVEMENTS=37 Dim Achievements%(MAXACHIEVEMENTS) -Const Achv008%=0, Achv012%=1, Achv035%=2, Achv049%=3, Achv055=4, Achv079%=5, Achv096%=6, Achv106%=7, Achv148%=8, Achv178=9, Achv205=10 -Const Achv294%=11, Achv372%=12, Achv420%=13, Achv500%=14, Achv513%=15, Achv714%=16, Achv789%=17, Achv860%=18, Achv895%=19 +Const Achv008%=0, Achv012%=1, Achv035%=2, Achv049%=3, Achv055=4, Achv079%=5, Achv096%=6, Achv106%=7, Achv148%=8, Achv205=9 +Const Achv294%=10, Achv372%=11, Achv420%=12, Achv427=13, Achv500%=14, Achv513%=15, Achv714%=16, Achv789%=17, Achv860%=18, Achv895%=19 Const Achv914%=20, Achv939%=21, Achv966%=22, Achv970=23, Achv1025%=24, Achv1048=25, Achv1123=26 Const AchvMaynard%=27, AchvHarp%=28, AchvSNAV%=29, AchvOmni%=30, AchvConsole%=31, AchvTesla%=32, AchvPD%=33 diff --git a/Blitz_File_ZipApi.bb b/Blitz_File_ZipApi.bb index e3a194b21..5de64f290 100644 --- a/Blitz_File_ZipApi.bb +++ b/Blitz_File_ZipApi.bb @@ -292,7 +292,7 @@ End Function Function ZipApi_Compress%(bankHandle%, compressionLevel% = ZIPAPI_DEFAULT_COMPRESSION) ; Check bank input - return 0 if invalid - If bankhandle < 1 Then Return False + If bankHandle < 1 Then Return False If BankSize(bankHandle) < 1 Then Return False ; Check compression level and limit appropriately @@ -300,11 +300,11 @@ Function ZipApi_Compress%(bankHandle%, compressionLevel% = ZIPAPI_DEFAULT_COMPRE If compressionLevel > 9 Then compressionLevel = 9 ; Create a bank to place compressed data into - Local destBank = CreateBank(ZlibWapi_CompressBound(BankSize(bankhandle))) + Local destBank = CreateBank(ZlibWapi_CompressBound(BankSize(bankHandle))) ; Create bank to store dest size & populate Local destSize = CreateBank(4) - PokeInt(destSize, 0, BankSize(destbank)) + PokeInt(destSize, 0, BankSize(destBank)) ; Compress Local zipResult = ZlibWapi_Compress2(destBank, destSize, bankHandle, BankSize(bankHandle), compressionLevel) @@ -507,7 +507,7 @@ Function ZipApi_ExtractFileAsBank%(zipHandle, fileName$, password$ = "") If fileName = "" Then Return ZIPAPI_END_OF_LIST_OF_FILE ; Find file & get quick information - Local prevFile.ZipApi_unzFileInfo = ZipApi_GetCurrentFileInfo(zipHandle) + Local prevFile.ZIPAPI_UnzFileInfo = ZipApi_GetCurrentFileInfo(zipHandle) ZipApi_GotoFirstFile(zipHandle) ; Find file @@ -637,9 +637,9 @@ Function ZipApi_GetCurrentFileInfo.ZIPAPI_UnzFileInfo(zipHandle%) ZlibWapi_UnzGetCurrentFileInfo(zipHandle, tBank, fileNameBank, fileInfo\FileNameLength, extraFieldBank, fileInfo\ExtraFieldLength, commentBank, fileInfo\CommentLength) ; Peek our strings - fileInfo\FileName = peekstring(fileNameBank, 0) - fileInfo\ExtraField = peekstring(extraFieldBank, 0) - fileInfo\Comment = peekstring(commentBank, 0) + fileInfo\FileName = PeekString(fileNameBank, 0) + fileInfo\ExtraField = PeekString(extraFieldBank, 0) + fileInfo\Comment = PeekString(commentBank, 0) ; Cleanup & Return FreeBank tBank @@ -669,7 +669,7 @@ Function ZipApi_GetGlobalInfo.ZIPAPI_GlobalInfo(zipHandle) Return Null EndIf - zipInfo = ZipApi_GlobalInfo_FromBank(infoBank) + zipInfo = ZIPAPI_GlobalInfo_FromBank(infoBank) ; Now get the comment Local commentBank = CreateBank(zipInfo\CommentLength + 1) diff --git a/Changelog.txt b/Changelog.txt index 7df3539d2..11e61ed2f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,19 +1,136 @@ -v1.3.9 +v1.3.10 + +- Added SCP-427. +- New rooms (room4info, room2cpit, room2pipes2, room3_3), including improved old rooms (room2nuke, room2testroom2, room049, room2sroom). +- New events in the facility. +- New events in SCP-1499's dimension. +- New ambient sounds. +- New items and documents. +- Added an alarm sound for each gateway room. +- Added 50 cent coins in the game. Those are required to use SCP-294. You can get coins by putting a mastercard into SCP-914 on the "coarse" setting. +- Added a wallet which you can use to store the 50 cent coins. You can find one in the storage room, where the scientist and janitor are killed by SCP-173. +- Added battery power to the night vision goggles that can be found in the facility. +- Added a death message when the player gets killed by the SCP-035 tentacle in the office room. +- Added the missing containment door inside of SCP-372's chamber. +- Added a little message that tells the player to "kneel" in the pocket dimension's throne room. +- Added dead bodies in the nuke room (room2nuke) and elevator shaft room (room2shaft). +- The player can't escape through Gate A and B if SCP-096 had been triggered. +- SCP-1499 instances are now able to "talk" with each other. +- Improved SCP-049's chamber area, making it more complex. +- Improved SCP-049's AI. He is much more active in the game now. +- Improved some documents. +- Improved the SCP-1499 texture. +- Improved SCP-079's Gate B announcement. +- Improved layouts for the Load Game and Load Map tabs in the main menu. +- Improved the badge textures. +- Improved the elevators. +- Improved SCP-914 sounds. +- Slightly improved SCP-682 battle sound at Gate B. +- Cut the amount of bloodloss in the pocket dimension's trench by 75%. +- Changed the mechanics on how the wearing of the hazmat suit, the ballistic vest and SCP-1499 works. +- Decreased SCP-096's speed from 10 to 9. +- SCP-106 now goes straight towards the player if he is not able to find a correct path. +- SCP-106 cannot disappear anymore if the player is too close to him. +- Changed 106's chamber access door to be a level 4 keycard door (instead of a level 3 door). +- Changed the player's spawn point when he leaves the Pocket Dimension and gets teleported to SCP-106's chamber. +- SCP-500 won't heal any injuries and bloodloss anymore, but instead can cure SCP-966's effect. +- Door sounds and ambient sounds are now updating depending on their position. +- The SCP-035 tentacles now play their idle sound. +- The message "You pushed the button but nothing happened." appears when you try to use a locked door that is opened. +- Changed the texture of the checkpoint lockdown screens slightly. +- Changed the label colors for Safe SCPs to green and for Keter SCPs to red. +- Optimized the room light rendering. +- Removed lightmaps from the SCP-1499 dimension buildings, so now the game loads less textures when loading the dimension. +- Optimized the medibay textures. +- The player will die instead of getting teleported to the SCP-008 death cutscene while infected with SCP-008 and when being at one of the exits. +- The MTF units now shoot the player if they are too close to the player in the service tunnels at Gate A. +- Player now vomits before dying by SCP-895's effect when viewing the monitor. +- The red night vision goggles get affected by SCP-895's effect as well. +- The security clearance level now gets displayed when you use a keycard that has a too low level. +- Added a little scene in which Agent Ulgrin gives you SCP-173 document. +- Added a death message when you die by SCP-1048-A. +- Added a tesla caution sign at the floor. +- Reworked the Example and Larry's Revenge maps (by Onemario1234). +- Removed SCP-178. + +- Updated the Map Creator (version 2.1) + - Added an option to enable/disable adjacent door spawning in the 3d viewer. + - Revamped the design for the 2d grid a bit. + - You can now select a room in the 3D view which will automaticly select that room in the 2D grid. + - New map format called ".cbmap2" which includes + - The ability to scale each zone (by adjusting the checkpoint lines for them). + - The ability to write the author's name and description of the map. + - The ability to make custom forest and maintenance tunnel layouts. + - The room amount that gets displayed when hovering over the "Load" button for selecting the map. + - Fixed a bug that caused the event chance to be 0% when you select an event of a room while "Set the event for the rooms by default" is disabled. + - Fixed a little visual glitch in which the selected room stats showed an empty event and the event chance when you moved the slider. + - Swapped the "Open map" and "Save map" texts when opening/saving a map (they were incorrectly named). -- New Map Creator. -- Added a credits screen after the ending screen. -- Added new step sounds for SCP-939 and SCP-966. -- The scientist possessed by SCP-035 can now be encountered after he's released from the containment chamber. -- MTF Units now inform the control if they want to scan the cameras. -- New radio voice lines for the MTF-units. +Bug fixes: + - Fixed the tesla gate electric sprite freezing after death. + - Fixed an exploit that caused the blinking sprite to be rendered invisible after alt-tabbing the game. + - The inventory cannot be opened while the SCP-008 zombie cutscene plays. + - Removed the "room2doors" event from events.ini as the actual event used in the game is called "room2doors173" + - The keycard slot level for the archive rooms will now be saved instead of being generated newly each time. + - The "Battery low" text won't overlap with the "Scanning" text while wearing the blue night vision goggles anymore. + - The event where SCP-173 appears when entering the tunnel room won't pause anymore if you enter it and then leave the room afterwards. + - SCP-173 won't appear in the tunnel room when being contained. + - Gate A won't go any higher anymore if you quick-loaded the game. + - Fixed the player's rotation when the elevator arrives at Gate A. + - The ending screen won't appear anymore when you go to Gate A or B, load the game and die afterwards. + - SCP-106 won't disappear from Gate A anymore if you use SCP-1499. + - The SCP-1499 dimension won't lag anymore if you saved in it and load the save file from the main menu. + - The player cannot fly in the SCP-1499 dimension anymore. + - Fixed SCP-1499's dimension buildings spawning inside the facility. + - The progress bar of the first aid kit won't stay at it's current value if the item has been deselected. + - The inventory and the main menu cannot be opened anymore while using SCP-294. + - The camera won't turn rapidly anymore when leaving SCP-294. + - The maximum amount of achievements displayed at the ending screen is now correct. + - The correct damage sounds will now be played when the player gets attacked by the SCP-035 tentacles. + - The Debug HUD won't be enabled anymore if you start a new game after you have quit a game where it has been activated before. + - SCP-096 cannot spawn anymore if the room2servers event hasn't been triggered. + - Fixed the buttghost event having a chance not to spawn. + - Fixed SCP-008's container door not being saved. + - Fixed a bug when after reloading the save file SCP-173 was able to kill you when he was behind a door. + - Fixed MTF units getting stuck when they wanted to kill SCP-008 instances or SCP-049-2 instances but another MTF killed it. + - Fixed SCP-049-2 zombies damage range. + - Fixed the tunnel106 event. + - Fixed a bug that caused the camera screens not be able to be used for saving on euclid difficulty. + - The femur breaker can't be pressed anymore if the sound transmission is off. + - The navigator now works properly with custom maps. + - The intercom transmission from SCP-106's chamber won't play anymore if the player is in the SCP-1499 dimension, Pocket Dimension or the forest. + - Fixed the monitor in SCP-106's chamber being off after reloading the save file. + - Fixed the MTF gasmask sound. + - Fixed SCP-1048's room3pit event causing a Blitz3D error after loading a save file. + - Fixed the messages for the intro in your cell (all 3 of them are now displayed properly). + - SCP-714's wearing variable will now be saved by the game. + - Fixed a lot of memory leaks occuring at Gate A and B whenever you quickloaded the game after entering those. + - A lot of fixes related to SCP-106 not appearing in Pocket Dimension. + - The remote door control, secondary light and sound transmission won't stay the same when you quit a game to the menu and started a new one. + - Fixed a bug that caused the player to die when getting captured by SCP-106 in room3storage. + - Fixed the timer after which SCP-106 should appear when player leaves the Pocket Dimension. + - Added door collisions for a few doors when they are closing, which prevents the player from being able to go through them while the player shouldn't do it. + - Attempt to fix a bug where the player has the ability to fall through the map after reloading a save file. + - Attempt to fix SCP-096's ability to get stuck while running towards the player. + - Attempt to fix the clerk not dying at the tesla gate. + - Attempt to fix door objects appearing in the center of the rooms. + - The game was patched with the 4GB patch, which should prevent the game from lagging and crashing in most cases. +---------------------------------------------------------------------------------- -- The player can now run slightly longer than before (10 %). -- The stamina will increase faster if the player is not walking and slower if the player walks. -- Made SCP-106 slightly harder to shake off when it's chasing the player. +v1.3.9 -- Moved the buttons for the entrance doors in SCP-012's chamber and in the server room in the entrance zone. +- Revamped Map Creator. +- Added credits after the endings. +- Added new step sounds for SCP-939 and SCP-966. +- The scientist possessed by SCP-035 can now be encountered after he's released from SCP-035's containment chamber. +- MTF Units now inform command that they want to scan the cameras. +- New radio voice lines for the Mobile Task Force units. +- The player can now run slightly longer than before (10%). +- Stamina will increase faster if the player is not walking and slower if the player walks. +- Made SCP-106 slightly harder to escape when chasing the player. +- Moved the buttons for the doors in SCP-012's chamber, and in the Entrance Zone's server room. - Revamped dead Class D texture. -- Some objects in certain areas will not render anymore if the player is outside of their specific rooms. +- Some objects in certain areas will not render anymore if the player is outside of view distance. - Removed the ability to use "<" and ">" characters in the save name as this caused a crash when trying to save the game. - Minor improvements in the Server Room (room2servers) event. - Improvements in SCP-1123 event: @@ -39,10 +156,10 @@ Bug fixes: - Fixed SCP-294 crashing the game if uses a single whitespace as the input. - Fixed SCP-294's drinks not being transparent if their alpha value is set to 0. - Fixed the doors in SCP-1123's event not being rotated correctly after reloading the save file. -- Fixed guard's position in room2restroom. +- Fixed guard's position in room2restroom. - Fixed a map generation bug that occasionally caused rooms to be rotated to an invalid angle. - Fixed a bug that caused the RNG to break when using specific map seeds. -- Fixed SCP-096's scream still playing when the player teleports to the SCP-1499 dimension. +- Fixed SCP-096's scream still playing when the player teleports to the SCP-1499 dimension. ---------------------------------------------------------------------------------- diff --git a/Credits.txt b/Credits.txt index c72fe6e94..ee6394635 100644 --- a/Credits.txt +++ b/Credits.txt @@ -2,95 +2,115 @@ *Programmers Joonas Rikkonen ("Regalis") - MonocleBios - Juanjpro - Ryan Stillings - Luggs123 - ENDSHN - InnocentSam CommanderMark + Jesse Ludtke ("MonocleBios") + Juan Pablo Arce ("Juanjpro") + Luggs123 + Ryan Stillings ("Risingstar64") + Sam Lynch ("InnocentSam") + Shaun Gaylard ("ENDSHN") *3D Modellers - Reilly Grindle ("Mirocaine") - Night - Hakkla - Prosth - Micro - GamerEntitlement + Joonas Rikkonen ("Regalis") + Apocryphos Atomicsneak - James Bear - Kenneth Crooker - Redbull.Ivan and TheKMan Brandon Smith + GamerEntitlement + Hakkla + James Bear ("Moonsaber") + Kenneth Crooker Lionel Ruskin ("Cridone") - Tom Malinowski + Micro + Night + Prosth + Ivan Mikhailov ("Redbull.Ivan") + TheKMan + Reilly Grindle ("Mirocaine") SaitoFox - Apocryphos - InnocentSam + Sam Lynch ("InnocentSam") + Shaun Gaylard ("ENDSHN") + Tom Malinowski + Vladislav Borisevich ("Vane Brain") *Sound Effects and Music - Kevin MacLeod - Slagar - revo794 - Tim Morrison + Joonas Rikkonen ("Regalis") + Caleb Yu ("Omniary") Class401 FireFox - phlip45 - Caleb Yu ("Omniary") gmodfan11 + Kevin MacLeod + phlip45 + revo794 + Shaun Gaylard ("ENDSHN") + Slagar + Tim Morrison + Vladislav Borisevich ("Vane Brain") Walach - Joonas Rikkonen ("Regalis") - ENDSHN - Vane Brain *Voice Actors Aaron Mckee ("TheVolgun") Brendan Sussman ("DukeLovesYou") + CDWinters + Graham Ruruku ("Stealthy Zoroark") + Hunter ItsDuke - Tallfellow Joshofsouls - Hunter + Moonstiee SolidBaker + Tallfellow *Graphics and Sprites - KyoteeWilliams - Brokami + Joonas Rikkonen ("Regalis") Anon4743 - Orgil Pount ("Destructoid") Balzac - Shadowscale48 - Joonas Rikkonen ("Regalis") + Brokami Caleb Yu ("Omniary") - ENDSHN - Vane Brain + KyoteeWilliams + Orgil Pount ("Destructoid") + Shadowscale48 + Shaun Gaylard ("ENDSHN") + Vladislav Borisevich ("Vane Brain") *Writers Joonas Rikkonen ("Regalis") - Dr. Gears - Steelpoint Caleb Yu ("Omniary") + Dr. Gears Irontaco - Vane Brain + Steelpoint + Vladislav Borisevich ("Vane Brain") -*Others +*Testers - Gage Allen ("Lotims") - Turtle Sandwich/Catnipbuddy Christian Rieß + Emil215p + Inclination + LordDeathv11 + Onemario1234 + RadReed + TheHappyJammer + Zadrakos + + +*Others + Agent G - Meow :3 + Gage Allen ("Lotims") Haversine + Max Taylor + Meow :3 + Nikita Sidorov ("Jabka") + Turtle Sandwich/Catnipbuddy /v/ and everyone in the SCP-CB forum @@ -130,9 +150,6 @@ by "Lt Masipag" SCP-173 is based on "SCP-173 - The Sculpture", by "Moto42" - SCP-178 is based on "SCP-178 - "3-D" Specs", -by "Dr Wartheim" - SCP-205 is based on "SCP-205 - Shadow Lamps", by "Sorts" @@ -145,6 +162,9 @@ by "Sylocat" SCP-420-J is based on "SCP-420-J - The Best ____ in the World" by "Quikngruvn" + SCP-427 is based on "SCP-427 - Lovecraftian Locket" +by "Dr Ouros" + SCP-500 is based on "SCP-500 - Panacea" by "far2" @@ -184,9 +204,6 @@ by "Lasergoose" SCP-1048 is based on "SCP-1048 - Builder Bear" by "Researcher Dios" - SCP-1074 is based on "SCP-1074 - Stendhal's Nightmare" -by "Smapti" - SCP-1123 is based on "SCP-1123 - Atrocity Skull" by "sandrewswann" diff --git a/Data/NPCs.ini b/Data/NPCs.ini index 1c82e9795..024251cba 100644 --- a/Data/NPCs.ini +++ b/Data/NPCs.ini @@ -7,7 +7,7 @@ speed = 1.2 scale = 0.25 [SCP-096] -speed = 10.0 +speed = 9.0 scale = 0.6 [SCP-049] diff --git a/Data/SCP-294.ini b/Data/SCP-294.ini index d6e2a6e97..05c09769e 100644 --- a/Data/SCP-294.ini +++ b/Data/SCP-294.ini @@ -86,7 +86,7 @@ alpha = 0.8 message = The drink tastes like a standard pale lager. sound = SFX\SCP\294\ahh.ogg -[Black corrosive liquid|SCP-106|106|Old Man] +[Black corrosive liquid|SCP-106|106|Old Man|Larry|Radical Larry] color = 0, 0, 0 sound = SFX\SCP\106\Decay3.ogg dispensesound = SFX\SCP\294\dispense2.ogg @@ -554,7 +554,7 @@ alpha = 1.0 sound = SFX\SCP\294\ew1.ogg dispensesound = SFX\SCP\294\dispense1.ogg -[Me|Myself|D-9431] +[Me|Myself|D-9431|D-9341] color = 200,0,0 blur = 10 sound = SFX\SCP\294\spit.ogg @@ -683,7 +683,7 @@ color = 73, 23, 102 sound = SFX\SCP\294\slurp.ogg dispensesound = SFX\SCP\294\dispense1.ogg -[Purple Drank|Sizzurp] +[Purple Drank|Sizzurp|Lean|Codeine] color = 163,73,164 alpha = 0.8 refusemessage = The drink tastes like cough syrup. @@ -987,3 +987,13 @@ stamina effect timer = 10 color = 54,177,30 message = MAN DATS SOM GOOD ASS SHIT sound = SFX\Music\420J.ogg + +[Butt ghost|Liquid butt ghost] +color = 0,0,0 +alpha = 1.0 +Sound = SFX\SCP\294\slurp.ogg +dispensesound = SFX\SCP\294\dispense3.ogg +message = Ouch, my ass is being eaten. +blur = 10 +lethal = true +deathmessage = Nine-Tailed Fox discovered the body of D-9341 near the cafeteria at Sector [REDACTED] without some pieces of [REDACTED]. The subject died of anomalous blood loss. diff --git a/Data/achievementstrings.ini b/Data/achievementstrings.ini index f1b8a9914..56034af37 100644 --- a/Data/achievementstrings.ini +++ b/Data/achievementstrings.ini @@ -44,30 +44,30 @@ image=Achv148 AchvDesc=Acquired the "Telekill Alloy". [s9] -string1=Death Perception -image=Achv178 -AchvDesc=Wore a pair of stereoscopic specs. - -[s10] string1=Femme Fatale image=Achv205 AchvDesc=Encountered the Shadow Lamps. -[s11] +[s10] string1=OUT OF RANGE image=Achv294 AchvDesc=Obtained a liquid from the Coffee Machine. -[s12] +[s11] string1=The Corner of Your Eye... image=Achv372 AchvDesc=Encountered the Peripheral Jumper. -[s13] +[s12] string1="Reggae, man." image=Achv420 AchvDesc=Smoked some good ass shit. +[s13] +string1=Light of Life +image=Achv427 +AchvDesc=Found and equipped the "Lovecraftian Locket". + [s14] string1=A Taste of Immortality image=Achv500 diff --git a/Data/events.ini b/Data/events.ini index 018819c21..ac8b308b4 100644 --- a/Data/events.ini +++ b/Data/events.ini @@ -134,10 +134,6 @@ room1=room2ccont descr=An event where a scientist and a janitor get killed by SCP-173. room1=room2closets -[room2doors] -descr=Spawns SCP-173 inside the room. -room1=room2doors - [room2elevator] descr=An event where a guard enters the elevator in the room. room1=room2elevator @@ -285,4 +281,20 @@ room1=room2sl [room2offices035] descr=Spawns the corpse of the possessed scientist inside the room after the player has released him from the containment chamber. -room1=room2offices \ No newline at end of file +room1=room2offices + +[medibay] +descr=Spawns an SCP-008-1 instance inside the room. +room1=medibay + +[room2shaft] +descr=Spawns a dead guard inside the room. +room1=room2shaft + +[room2pit106] +descr=An event in which SCP-106 spawns at the bottom of the catwalk. +room1=room2pit + +[room1archive] +descr=Required for the entrance door to be functional. +room1=room1archive \ No newline at end of file diff --git a/Data/rooms.ini b/Data/rooms.ini index a429f2649..af91b1e06 100644 --- a/Data/rooms.ini +++ b/Data/rooms.ini @@ -1,3 +1,9 @@ +;=== STYLE ABBREVIATIONS === +;LCZ - Light Containment Zone +;HCZ - Heavy Containment Zone +;EZ - Entrance Zone +;=========================== + [room ambience] ambience1 = SFX\Ambient\Room ambience\rumble.ogg ambience2 = SFX\Ambient\Room ambience\lowdrone.ogg @@ -10,8 +16,10 @@ ambience8 = SFX\Ambient\Room ambience\fuelpump.ogg ambience9 = SFX\Ambient\Room ambience\Fan.ogg ambience10 = SFX\Ambient\Room ambience\servers1.ogg +;LIGHT CONTAINMENT ZONE ROOMS +;============================ [lockroom] -descr=Airlock room with timed doors +descr=A timed airlock room, with two doors. mesh path=GFX\map\lockroom_opt.rmesh shape = 2C commonness = 30 @@ -19,28 +27,21 @@ zone1=1 zone2=3 [173] -descr=SCP-173's chamber and the Class D cells in the intro. Placed automatically in every map. +descr=Class-D Cells & SCP-173's chamber in the intro. Placed automatically in all maps. mesh path=GFX\map\173bright_opt.rmesh shape = 1 commonness = 0 disabledecals = true [start] -descr=SCP-173's chamber after the breach. Required in every map. +descr=SCP-173's chamber, after the breach. Placed automatically in all maps. mesh path=GFX\map\173_opt.rmesh shape = 1 commonness = 0 disabledecals = true -[room178] -descr=The containment chamber of SCP-178. -mesh path=GFX\map\room178_opt.rmesh -shape = 1 -commonness = 0 -zone1=1 - [room1123] -descr=The containment chamber of SCP-1123. +descr=SCP-1123's containment chamber. mesh path=GFX\map\1123_opt.rmesh shape = 2 commonness = 0 @@ -48,14 +49,14 @@ zone1=1 disabledecals = true [room1archive] -descr=The archive room where player can get items. +descr=An archive room, where various (random) items spawn on shelves. mesh path=GFX\map\room1archive_opt.rmesh shape = 1 commonness = 80 zone1=1 [room2storage] -descr=Hallway with two small storage rooms (and SCP-970). +descr=SCP-970's storage hallway. mesh path=GFX\map\room2storage_opt.rmesh shape = 2 commonness = 0 @@ -63,7 +64,7 @@ zone1=1 disabledecals = true [room3storage] -descr=The underground room with SCP-939's. +descr=SCP-939's storage area, with various roaming instances of 939. mesh path=GFX\map\room3storage_opt.rmesh shape = 3 commonness = 0 @@ -71,14 +72,14 @@ zone1=1 disableoverlapcheck=true [room2tesla_lcz] -descr=Hallway with a tesla gate, LCZ variant. +descr=Hallway with a tesla gate. LCZ variant. mesh path=GFX\map\room2tesla_lcz_opt.rmesh shape = 2 commonness = 100 zone1=1 [endroom] -descr=Red-lit dead end room with a large gate. +descr=Red-lit dead end room with a large, unopenable gate. mesh path=GFX\map\endroom_opt.rmesh shape = 1 commonness = 100 @@ -86,7 +87,7 @@ zone1=1 zone3=3 [room012] -descr=The containment chamber of SCP-012. +descr=SCP-012's containment chamber. mesh path=GFX\map\room012_opt.rmesh shape = 2 commonness = 0 @@ -94,7 +95,7 @@ zone1=1 disabledecals = true [room205] -descr=The containment chamber of SCP-205. +descr=SCP-205's containment chamber. mesh path=GFX\map\room205_opt.rmesh shape = 1 commonness = 0 @@ -102,42 +103,56 @@ zone1=1 large = true [room2] -descr=Plain two-way hallway. +descr=An empty, two-door hallway. mesh path=GFX\map\room2_opt.rmesh shape = 2 commonness = 45 zone1=1 +[room2_2] +descr=An empty, two-door hallway with a large fan/vent in the wall. +mesh path=GFX\map\room2_2_opt.rmesh +shape = 2 +commonness = 40 +zone1=1 + [room2_3] -descr=Two-way hallway with floor lights. +descr=A larger version of the two-door hallway, with lights in the floor. mesh path=GFX\map\room2_3_opt.rmesh shape = 2 commonness = 35 zone1=1 -[room2_2] -descr=Plain two-way hallway with a large metal fan. -mesh path=GFX\map\room2_2_opt.rmesh -shape = 2 -commonness = 40 +[room2_4] +descr=A two-door hallway, with a unopenable door off to the side. +mesh path=GFX\map\room2_4_opt.rmesh +shape=2 +commonness = 30 +zone1=1 + +[room2_5] +descr=A two-door hallway, with lowered ceilings. +mesh path=GFX\map\room2_5_opt.rmesh +shape=2 +commonness = 35 zone1=1 [room2C] -descr=Plain corner. +descr=An empty, plain corner room. mesh path=GFX\map\room2C_opt.rmesh shape = 2C commonness = 40 zone1=1 [room2c2] -descr=A "corner room" for the light containment zone. +descr=A corner room, with more of a LCZ style. mesh path=GFX\map\room2c2_opt.rmesh shape = 2C commonness = 30 zone1=1 [room2closets] -descr=Storage hallway, with a gas mask and batteries. +descr=A storage hallway, where SCP-173 kills two NPCs. The Gas Mask & Batteries spawn here. mesh path=GFX\map\room2closets_opt.rmesh shape = 2 commonness = 0 @@ -146,62 +161,69 @@ disabledecals = true large = true [room2elevator] -descr=A hallway with an elevator in the middle. +descr=A two-door hallway, with an elevator off to the side. mesh path=GFX\map\room2elevator_opt.rmesh shape = 2 commonness = 20 zone1=1 [room2doors] -descr=Red-lit airlock room in the shape of a T. +descr=Red-lit airlock room, in the shape of a T. mesh path=GFX\map\room2doors_opt.rmesh shape = 2 commonness = 30 zone1=1 [room2scps] -descr=The hallway with SCP-714, SCP-860 and SCP-1025. +descr=SCP-714's, SCP-860's, & SCP-1025's two-door hallway. mesh path=GFX\map\room2scps_opt.rmesh shape = 2 commonness = 0 zone1=1 [room860] -descr=A hallway with SCP-860 door. +descr=SCP-860-1's containment chamber. Can't be traversed without SCP-860. mesh path=GFX\map\room860_opt.rmesh shape = 2 commonness = 0 [room2testroom2] -descr=Hallway with a room where SCP-173 breaks through a window. +descr=Two-door hallway with a small testing room, where SCP-173 shatters the testroom's window. mesh path=GFX\map\room2testroom2_opt.rmesh shape = 2 commonness = 0 zone1=1 [room3] -descr=Plain three-way hallway with a large metal "cage". +descr=Three-door hallway, with a caged off portion in the back wall. mesh path=GFX\map\room3_opt.rmesh shape = 3 commonness = 100 zone1=1 [room3_2] -descr=Another plain three-way hallway. +descr=A three-door hallway, without the caged portion. mesh path=GFX\map\room3_2_opt.rmesh shape = 3 commonness = 100 zone1=1 [room4] -descr=Plain four-way hallway with a bridge. +descr=A four-door hallway, with a metal walkway hanging above. mesh path=GFX\map\room4_opt.rmesh shape = 4 commonness = 100 zone1=1 +[room4_2] +descr=A varient of the four-door hallway, without the metal walkway. +mesh path=GFX\map\room4_2_opt.rmesh +shape=4 +commonness = 80 +zone1=1 + [roompj] -descr=The containment chamber of SCP-372. +descr=SCP-372's containment chamber. mesh path=GFX\map\roompj_opt.rmesh shape = 1 commonness = 0 @@ -209,92 +231,122 @@ disabledecals = true zone1=1 [914] -descr=The containment chamber of SCP-914. +descr=SCP-914's containment chamber. mesh path=GFX\map\machineroom_opt.rmesh shape = 1 commonness = 0 zone1=1 [room2gw] -descr=The 2-sided gateway variant (LCZ). +descr=A two-door contamination airlock. mesh path=GFX\map\room2gw_opt.rmesh shape=2 commonness = 10 zone1=1 [room2gw_b] -descr=Broken variant of the LCZ gateway. +descr=Broken varient of the two-door contamination airlock. mesh path=GFX\map\room2gw_b_opt.rmesh shape=2 commonness = 0 zone1=1 [room1162] -descr=A LCZ corner room with SCP-1162. +descr=SCP-1162's containment chamber, in a corner room. mesh path=GFX\map\room1162_opt.rmesh shape=2c commonness = 0 zone1=1 [room2scps2] -descr=A hallway with SCP-1499 and SCP-500. +descr=SCP-1499 & SCP-500's containment chambers, in a two-door hallway. mesh path=GFX\map\room2scps2_opt.rmesh shape=2 commonness = 0 zone1=1 [room2sl] -descr=The surveillance room for LCZ. +descr=The surveillance room in the LCZ. Required for passing into HCZ, if used. mesh path=GFX\map\room2sl_opt.rmesh shape=2 commonness = 0 zone1=1 large = true -[room2_4] -descr=A LCZ hallway with an intersection where SCP-173 can spawn. -mesh path=GFX\map\room2_4_opt.rmesh -shape=2 -commonness = 30 -zone1=1 - -[room2_5] -descr=Another variant for a LCZ hallway. -mesh path=GFX\map\room2_5_opt.rmesh -shape=2 -commonness = 35 -zone1=1 - [lockroom3] -descr=A closed up airlock room. -mesh path=GFx\map\lockroom3_opt.rmesh +descr=A varient of the timed lockroom, where a seperate path is opened. The airlock itself is broken. +mesh path=GFX\map\lockroom3_opt.rmesh shape=2c commonness = 15 zone1=1 -[room4_2] -descr=Another variant of room4. -mesh path=GFX\map\room4_2_opt.rmesh +[room4info] +descr=A 4-way hallway containing an info center. +mesh path=GFX\map\room4info_opt.rmesh shape=4 -commonness = 80 +commonness = 0 +zone1=1 + +[room3_3] +descr=Another variant of a three-door hallway. +mesh path=GFX\map\room3_3_opt.rmesh +shape=3 +commonness = 20 zone1=1 [checkpoint1] -descr=The checkpoint between light and heavy containment zones. +descr=The keycarded checkpoint between the LCZ and HCZ. mesh path=GFX\map\checkpoint1_opt.rmesh shape = 2 commonness = 0 +;HEAVY CONTAINMENT ZONE ROOMS +;============================ [008] -descr=The containment chamber of SCP-008. +descr=SCP-008's containment chamber. mesh path=GFX\map\008_opt.rmesh shape = 1 commonness = 0 disabledecals = true zone1=2 +[room035] +descr=SCP-035's containment chamber. +mesh path=GFX\map\room035_opt.rmesh +shape = 1 +commonness = 0 +zone1=2 + +[room049] +descr=SCP-049's containment chamber. +mesh path=GFX\map\room049_opt.rmesh +shape = 2 +commonness = 0 +disabledecals = true +walksound=1 +zone1=2 +usevolumelighting = 1 +disableoverlapcheck=true + +[room106] +descr=SCP-106's containment chamber. +mesh path=GFX\map\room106_opt.rmesh +shape = 1 +commonness = 0 +disabledecals = true +zone1=2 +large = true + +[room513] +descr=SCP-513's containment chamber. +mesh path=GFX\map\room513_opt.rmesh +shape = 3 +commonness = 0 +zone1=2 +usevolumelighting = 1 + [coffin] -descr=The containment chamber of SCP-895. +descr=SCP-895's containment chamber. mesh path=GFX\map\coffin_opt.rmesh shape = 1 commonness = 0 @@ -302,15 +354,24 @@ disabledecals = true walksound=1 zone1=2 +[room966] +descr=SCP-966's containment chamber. +mesh path=GFX\map\room966_opt.rmesh +shape = 3 +commonness = 0 +zone1=2 +usevolumelighting = 1 +disableoverlapcheck=true + [endroom2] -descr=A smaller variant of endroom, used in the heavy containment zone. +descr=A small, red-lit, HCZ-styled endroom. mesh path=GFX\map\endroom2_opt.rmesh shape = 1 commonness = 100 zone1=2 [testroom] -descr=Large room with an SCP-682 document. +descr=A large testroom, where SCP-682's document can be found. mesh path=GFX\map\testroom_opt.rmesh shape = 2 commonness = 0 @@ -319,7 +380,7 @@ disabledecals = true zone1=2 [tunnel] -descr=Metal two-way hallway. +descr=A two-door hallway, in the shape of a tunnel. mesh path=GFX\map\tunnel_opt.rmesh shape = 2 commonness = 100 @@ -328,7 +389,7 @@ zone1=2 usevolumelighting = 1 [tunnel2] -descr=Metal two-way hallway with an SCP-173 spawn. +descr=A varient of the tunnel hallway, with a fuse box off to the side where SCP-173 spawns. mesh path=GFX\map\tunnel2_opt.rmesh shape = 2 commonness = 70 @@ -336,35 +397,8 @@ walksound=1 zone1=2 usevolumelighting = 1 -[room035] -descr=The containment chamber of SCP-035. -mesh path=GFX\map\room035_opt.rmesh -shape = 1 -commonness = 0 -zone1=2 - -[room049] -descr=The containment chamber of SCP-049. -mesh path=GFX\map\room049_opt.rmesh -shape = 2 -commonness = 0 -disabledecals = true -walksound=1 -zone1=2 -usevolumelighting = 1 -disableoverlapcheck=true - -[room106] -descr=The containment chamber of SCP-106. -mesh path=GFX\map\room106_opt.rmesh -shape = 1 -commonness = 0 -disabledecals = true -zone1=2 -large = true - [room2Ctunnel] -descr=Metal corner for HCZ. +descr=A HCZ-styled corner room. mesh path=GFX\map\room2Ctunnel_opt.rmesh shape = 2C commonness = 40 @@ -373,7 +407,7 @@ zone1=2 usevolumelighting = 1 [room2nuke] -descr=The elevator that takes you to the nuclear warheads. +descr=A two-door hallway, with a room on the side which leads to the Omega & Alpha warheads. mesh path=GFX\map\room2nuke_opt.rmesh shape = 2 commonness = 0 @@ -381,7 +415,7 @@ zone1=2 large = true [room2pipes] -descr=Metal two-way hallway with cages and pipes on the floor and ceiling. +descr=A two-door hallway, with caged floors and ceiling that contain various pipes. SCP-106 can appear out of the walls. mesh path=GFX\map\room2pipes_opt.rmesh shape = 2 commonness = 50 @@ -390,7 +424,7 @@ walksound=1 zone1=2 [room2pit] -descr=Two-way catwalk with gas and possibly SCP-173. +descr=A two-door catwalk, where the catwalk spews gas. mesh path=GFX\map\room2pit_opt.rmesh shape = 2 commonness = 75 @@ -399,7 +433,7 @@ walksound=1 zone1=2 [room3pit] -descr=Three-way catwalk with a large box near the center. +descr=A three-door walkway, with a large box-like structure in the back wall. mesh path=GFX\map\room3pit_opt.rmesh shape = 3 commonness = 100 @@ -407,8 +441,15 @@ disabledecals = true walksound=1 zone1=2 +[room4pit] +descr=A four-door walkway, with a large cube-like stucture in the middle of the room. +mesh path=GFX\map\room4pit_opt.rmesh +shape=4 +commonness = 100 +zone1=2 + [room2servers] -descr=The server room with SCP-096 and a guard. +descr=SCP-096's spawn area, where 096 kills a guard. mesh path=GFX\map\room2servers_opt.rmesh shape = 2 commonness = 0 @@ -417,14 +458,14 @@ zone1=2 large = true [room2shaft] -descr=HCZ room with an elevator shaft. +descr=A two-door hallway, which has a non-functional elevator and the maintenance shaft. mesh path=GFX\map\room2shaft_opt.rmesh shape = 2 commonness = 0 disabledecals = true [room2tunnel] -descr=The elevators leading to the Maintenance Tunnels. +descr=A closed gate, and elevators leading to the maintenance tunnels. Gate can be opened if SCP-372's chamber is in the map for the code. mesh path=GFX\map\room2tunnel_opt.rmesh shape = 2 commonness = 0 @@ -432,15 +473,8 @@ disabledecals = true walksound=1 zone1=2 -[room2tesla_hcz] -descr=Hallway with a tesla gate, HCZ variant. -mesh path=GFX\map\room2tesla_hcz_opt.rmesh -shape = 2 -commonness = 100 -zone1=2 - [room3tunnel] -descr=Metal three-way hallway. +descr=A three-door hallway, shaped after tunnels. mesh path=GFX\map\room3tunnel_opt.rmesh shape = 3 commonness = 100 @@ -449,7 +483,7 @@ zone1=2 usevolumelighting = 1 [room4tunnels] -descr=Metal four-way hallway. +descr=A four-door hallway, shaped after tunnels. mesh path=GFX\map\4tunnels_opt.rmesh shape = 4 commonness = 100 @@ -457,56 +491,66 @@ walksound=1 zone1=2 usevolumelighting = 1 -[room513] -descr=The containment chamber of SCP-513. -mesh path=GFX\map\room513_opt.rmesh -shape = 3 -commonness = 0 +[room2tesla_hcz] +descr=Hallway with a tesla gate. HCZ variant. +mesh path=GFX\map\room2tesla_hcz_opt.rmesh +shape = 2 +commonness = 100 zone1=2 -usevolumelighting = 1 - -[room966] -descr=The containment chamber of SCP-966. -mesh path=GFX\map\room966_opt.rmesh -shape = 3 -commonness = 0 -zone1=2 -usevolumelighting = 1 -disableoverlapcheck=true [room3z2] -descr=A T-Shaped hallway room in the HCZ. +descr=A T-shaped, three-door hallway. mesh path=GFX\map\room3z2_opt.rmesh shape=3 commonness = 100 zone1=2 -[room4pit] -descr=Similar to room3pit, but having four ways. -mesh path=GFX\map\room4pit_opt.rmesh -shape=4 -commonness = 100 +[room2cpit] +descr=A corner room, with a large cube-like stucture in the middle of the room. +mesh path=GFX\map\room2cpit_opt.rmesh +shape=2c +commonness = 0 +disabledecals = true +zone1=2 + +[room2pipes2] +descr=Another variant of the two-door hallway, with caged floors and ceiling that contain various pipes. +mesh path=GFX\map\room2pipes2_opt.rmesh +shape = 2 +commonness = 70 +disabledecals = true zone1=2 [checkpoint2] -descr=The checkpoint between heavy containment and entrance zone. +descr=The keycarded checkpoint which leads from the HCZ to the EZ. mesh path=GFX\map\checkpoint2_opt.rmesh shape = 2 commonness = 0 -[exit1] -descr=Gate B. -mesh path=GFX\map\exit1_opt.rmesh +;ENTRANCE ZONE ROOMS +;============================ +[room079] +descr=SCP-079's containment chamber. +mesh path=GFX\map\room079_opt.rmesh shape = 1 commonness = 0 +disabledecals = true zone1=3 -disableoverlapcheck=true +large = true -[gatea] -descr=The above ground parts of Gate A. Placed automatically in every map. -mesh path=GFX\map\gatea_opt.rmesh +[lockroom2] +descr=The open-doored lockroom, with SCP-096 sitting in the middle. +mesh path=GFX\map\lockroom2_opt.rmesh +shape = 2C +commonness = 0 +zone1=3 + +[exit1] +descr=The entrance room to Gate B, with an elevator to the surface of Gate B. +mesh path=GFX\map\exit1_opt.rmesh shape = 1 commonness = 0 +zone1=3 disableoverlapcheck=true [gateaentrance] @@ -516,38 +560,29 @@ shape = 1 commonness = 0 zone1=3 +[gatea] +descr=The surface of Gate A. Placed automatically in every map. +mesh path=GFX\map\gatea_opt.rmesh +shape = 1 +commonness = 0 +disableoverlapcheck=true + [medibay] -descr=Medical bay. +descr=A two-door hallway, leading to the medical bay. Contains a zombie. mesh path=GFX\map\medibay_opt.rmesh shape = 2 commonness = 0 zone1=3 -[lockroom2] -descr=The room with SCP-096 sitting in the middle. -mesh path=GFX\map\lockroom2_opt.rmesh -shape = 2C -commonness = 0 -zone1=3 - -[room079] -descr=The containment chamber of SCP-079. -mesh path=GFX\map\room079_opt.rmesh -shape = 1 -commonness = 0 -disabledecals = true -zone1=3 -large = true - [room2z3] -descr=Office-style two-way hallway. +descr=An office-styled two-door hallway. mesh path=GFX\map\room2z3_opt.rmesh shape = 2 commonness = 75 zone1=3 [room2cafeteria] -descr=Cafeteria. +descr=A two-doored walkway, with stairs leading to the cafeteria. mesh path=GFX\map\room2cafeteria_opt.rmesh shape = 2 commonness = 0 @@ -556,14 +591,14 @@ large = true disabledecals = true [room2Cz3] -descr=Office-style corner. +descr=A corner room, with two benches against the walls. mesh path=GFX\map\room2Cz3_opt.rmesh shape = 2C commonness = 100 zone1=3 [room2ccont] -descr=Electrical center. +descr=A corner room, which has the electrical center. Required to finish the game. mesh path=GFX\map\room2ccont_opt.rmesh shape = 2C commonness = 0 @@ -571,14 +606,14 @@ zone1=3 large = true [room2offices] -descr=A small, one story office room. +descr=A small, plain office room with various deks. mesh path=GFX\map\room2offices_opt.rmesh shape = 2 commonness = 30 zone1=3 [room2offices2] -descr=An office room with stairs to a second level. +descr=An office room with stairs that extends downwards. mesh path=GFX\map\room2offices2_opt.rmesh shape = 2 disabledecals=true @@ -586,49 +621,56 @@ commonness = 20 zone1=3 [room2offices3] -descr=A large office with a lower floor and a second floor with two rooms. +descr=A large office with a second floor, and two seperate rooms. mesh path=GFX\map\room2offices3_opt.rmesh shape = 2 commonness = 20 zone1=3 +[room2offices4] +descr=A varient of the offices. +mesh path=GFX\map\room2offices4_opt.rmesh +shape=2 +commonness = 0 +zone1=3 + [room2poffices] -descr=Hallway with three named office rooms (Gears, Maynard, Harp). +descr=A two-door hallway with three labeled offices (Harp, Maynard, & Gears). mesh path=GFX\map\room2poffices_opt.rmesh shape = 2 commonness = 0 zone1=3 [room2poffices2] -descr=Hallway with three named office rooms (including Dr. L's office). +descr=A smaller hallway, with two doors leading to Dr. L's office and the conference rooms. mesh path=GFX\map\room2poffices2_opt.rmesh shape = 2 commonness = 0 zone1=3 [room2sroom] -descr=The office with SCP-420-J. +descr=A two-door hallway with an office containing SCP-420-J mesh path=GFX\map\room2sroom_opt.rmesh shape = 2 commonness = 0 zone1=3 [room2toilets] -descr=Restroom hallway. +descr=Hallway containing SCP-789-J. mesh path=GFX\map\room2toilets_opt.rmesh shape = 2 commonness = 30 zone1=3 [room2tesla] -descr=Hallway with a tesla gate, Entrance Zone variant. +descr=Hallway with a tesla gate. EZ variant. mesh path=GFX\map\room2tesla_opt.rmesh shape = 2 commonness = 100 zone1=3 [room3servers] -descr=Room filled with server computers. +descr=A maze of re-arranced servers, where SCP-173 spawns. mesh path=GFX\map\room3servers_opt.rmesh shape = 3 commonness = 0 @@ -636,7 +678,7 @@ disabledecals = true zone1=3 [room3servers2] -descr=Another variant of the room filled with server computers. +descr=Another variant of the server room, with a longer catwalk. mesh path=GFX\map\room3servers2_opt.rmesh shape = 3 commonness = 0 @@ -644,14 +686,14 @@ disabledecals = true zone1=3 [room3z3] -descr=Office-styled three-way hallway. +descr=A three-door hallway. mesh path=GFX\map\room3z3_opt.rmesh shape = 3 commonness = 100 zone1=3 [room4z3] -descr=Office-styled four-way hallway. +descr=A 4-door hallway. mesh path=GFX\map\room4z3_opt.rmesh shape = 4 commonness = 100 @@ -665,48 +707,41 @@ commonness = 0 zone1=3 [room3gw] -descr=The 3-sided GateWay variant (3rd Zone). +descr=An alternate, EZ-styled, broken contamination airlock. mesh path=GFX\map\room3gw_opt.rmesh shape=3 commonness = 10 zone1=3 [room2servers2] -descr=A S-Com 1.5 server room. +descr=A server room dedicated to keep the Site-COMmunications up and running (no real value). mesh path=GFX\map\room2servers2_opt.rmesh shape=2 commonness = 0 zone1=3 [room3offices] -descr=A office room variant with 3 exits. +descr=A office room with three exits. mesh path=GFX\map\room3offices_opt.rmesh shape=3 commonness = 0 zone1=3 [room2z3_2] -descr=A variant for the room3z2. +descr=A varient of the two-door hallway. mesh path=GFX\map\room2z3_2_opt.rmesh shape=2 commonness = 25 zone1=3 -[room2offices4] -descr=Another variant of the room2offices rooms. -mesh path=GFX\map\room2offices4_opt.rmesh -shape=2 -commonness = 0 -zone1=3 - [pocketdimension] -descr=SCP-106's pocket dimension. Placed automatically in every map. +descr=SCP-106's pocket dimension. Placed automatically in all maps. mesh path=GFX\map\pocketdimension1_opt.rmesh shape = 1 commonness = 0 [dimension1499] -descr=The dimension which is presented by wearing SCP-1499. Placed automatically in every map +descr=SCP-1499's dimension. Placed automatically in all maps. mesh path=GFX\map\dimension1499\1499object0_opt.rmesh shape=1 commonness = 0 diff --git a/Difficulty.bb b/Difficulty.bb index a4c01b8d1..a675cb735 100644 --- a/Difficulty.bb +++ b/Difficulty.bb @@ -36,9 +36,8 @@ difficulties(SAFE)\b = 50 difficulties(EUCLID) = New Difficulty difficulties(EUCLID)\name = "Euclid" -difficulties(EUCLID)\description = "Euclid-class objects are insufficiently understood or inherently unpredictable, " -difficulties(EUCLID)\description = difficulties(EUCLID)\description +"such that reliable containment is not always possible. " -difficulties(EUCLID)\description = difficulties(EUCLID)\description +"In Euclid difficulty, saving only allowed at specific locations marked by lit up computer screens." +difficulties(EUCLID)\description = "In Euclid difficulty, saving is only allowed at specific locations marked by lit up computer screens. " +difficulties(EUCLID)\description = difficulties(EUCLID)\description +"Euclid-class objects are inherently unpredictable, so that reliable containment is not always possible." difficulties(EUCLID)\permaDeath = False difficulties(EUCLID)\aggressiveNPCs = False difficulties(EUCLID)\saveType = SAVEONSCREENS diff --git a/GFX/895pics/Thumbs.db b/GFX/895pics/Thumbs.db deleted file mode 100644 index bb07f0914..000000000 Binary files a/GFX/895pics/Thumbs.db and /dev/null differ diff --git a/GFX/SL_monitors.jpg b/GFX/SL_monitors.jpg new file mode 100644 index 000000000..53153417d Binary files /dev/null and b/GFX/SL_monitors.jpg differ diff --git a/GFX/SL_monitors_checkpoint.jpg b/GFX/SL_monitors_checkpoint.jpg new file mode 100644 index 000000000..4772e0bc5 Binary files /dev/null and b/GFX/SL_monitors_checkpoint.jpg differ diff --git a/GFX/Thumbs.db b/GFX/Thumbs.db deleted file mode 100644 index 1975ce513..000000000 Binary files a/GFX/Thumbs.db and /dev/null differ diff --git a/GFX/decal427.png b/GFX/decal427.png new file mode 100644 index 000000000..98106c2f1 Binary files /dev/null and b/GFX/decal427.png differ diff --git a/GFX/doorhit.b3d b/GFX/doorhit.b3d new file mode 100644 index 000000000..921e3c549 Binary files /dev/null and b/GFX/doorhit.b3d differ diff --git a/GFX/glassesoverlay.jpg b/GFX/glassesoverlay.jpg deleted file mode 100644 index 9fa21e486..000000000 Binary files a/GFX/glassesoverlay.jpg and /dev/null differ diff --git a/GFX/items/1025/Thumbs.db b/GFX/items/1025/Thumbs.db deleted file mode 100644 index 4d34eb5c8..000000000 Binary files a/GFX/items/1025/Thumbs.db and /dev/null differ diff --git a/GFX/items/427.b3d b/GFX/items/427.b3d new file mode 100644 index 000000000..4815a14c1 Binary files /dev/null and b/GFX/items/427.b3d differ diff --git a/GFX/items/427.jpg b/GFX/items/427.jpg new file mode 100644 index 000000000..559b720c7 Binary files /dev/null and b/GFX/items/427.jpg differ diff --git a/GFX/items/INV178.jpg b/GFX/items/INV178.jpg deleted file mode 100644 index ea60d207d..000000000 Binary files a/GFX/items/INV178.jpg and /dev/null differ diff --git a/GFX/items/INVbadge.jpg b/GFX/items/INVbadge.jpg index bbb568b75..a277e5938 100644 Binary files a/GFX/items/INVbadge.jpg and b/GFX/items/INVbadge.jpg differ diff --git a/GFX/items/INVnote2.jpg b/GFX/items/INVnote2.jpg new file mode 100644 index 000000000..347e84837 Binary files /dev/null and b/GFX/items/INVnote2.jpg differ diff --git a/GFX/items/INVoldbadge.jpg b/GFX/items/INVoldbadge.jpg index c96a5e104..bd9cf6c2d 100644 Binary files a/GFX/items/INVoldbadge.jpg and b/GFX/items/INVoldbadge.jpg differ diff --git a/GFX/items/INVpillwhite.jpg b/GFX/items/INVpillwhite.jpg new file mode 100644 index 000000000..50a1df567 Binary files /dev/null and b/GFX/items/INVpillwhite.jpg differ diff --git a/GFX/items/INVscp1499.jpg b/GFX/items/INVscp1499.jpg index d89fc1bae..c36b0a216 100644 Binary files a/GFX/items/INVscp1499.jpg and b/GFX/items/INVscp1499.jpg differ diff --git a/GFX/items/INVscp427.jpg b/GFX/items/INVscp427.jpg new file mode 100644 index 000000000..c59ff1b07 Binary files /dev/null and b/GFX/items/INVscp427.jpg differ diff --git a/GFX/items/INVwallet.jpg b/GFX/items/INVwallet.jpg new file mode 100644 index 000000000..b0ab7be83 Binary files /dev/null and b/GFX/items/INVwallet.jpg differ diff --git a/GFX/items/SCP-1499.3ds b/GFX/items/SCP-1499.3ds deleted file mode 100644 index 9493544f9..000000000 Binary files a/GFX/items/SCP-1499.3ds and /dev/null differ diff --git a/GFX/items/SCP-1499.b3d b/GFX/items/SCP-1499.b3d new file mode 100644 index 000000000..08e89f601 Binary files /dev/null and b/GFX/items/SCP-1499.b3d differ diff --git a/GFX/items/SCP-1499.jpg b/GFX/items/SCP-1499.jpg index 4bf1ee818..32ee64c5c 100644 Binary files a/GFX/items/SCP-1499.jpg and b/GFX/items/SCP-1499.jpg differ diff --git a/GFX/items/Thumbs.db b/GFX/items/Thumbs.db deleted file mode 100644 index 96ca9416d..000000000 Binary files a/GFX/items/Thumbs.db and /dev/null differ diff --git a/GFX/items/badge1.jpg b/GFX/items/badge1.jpg index 66b90fb92..08b483191 100644 Binary files a/GFX/items/badge1.jpg and b/GFX/items/badge1.jpg differ diff --git a/GFX/items/badge1_tex.jpg b/GFX/items/badge1_tex.jpg index 382c5a2e0..d2f7663a0 100644 Binary files a/GFX/items/badge1_tex.jpg and b/GFX/items/badge1_tex.jpg differ diff --git a/GFX/items/badge2.png b/GFX/items/badge2.png index c9eff97e8..e265a3e1b 100644 Binary files a/GFX/items/badge2.png and b/GFX/items/badge2.png differ diff --git a/GFX/items/badge2_tex.png b/GFX/items/badge2_tex.png index 608cd5d82..a775e319a 100644 Binary files a/GFX/items/badge2_tex.png and b/GFX/items/badge2_tex.png differ diff --git a/GFX/items/doc427.jpg b/GFX/items/doc427.jpg new file mode 100644 index 000000000..90d145db9 Binary files /dev/null and b/GFX/items/doc427.jpg differ diff --git a/GFX/items/docRAND2.jpg b/GFX/items/docRAND2.jpg index e00f4fbac..49b752390 100644 Binary files a/GFX/items/docRAND2.jpg and b/GFX/items/docRAND2.jpg differ diff --git a/GFX/items/docdan.jpg b/GFX/items/docdan.jpg index 422e6ab3e..220a2ef25 100644 Binary files a/GFX/items/docdan.jpg and b/GFX/items/docdan.jpg differ diff --git a/GFX/items/docmap.jpg b/GFX/items/docmap.jpg new file mode 100644 index 000000000..fb5d141f6 Binary files /dev/null and b/GFX/items/docmap.jpg differ diff --git a/GFX/items/note.x b/GFX/items/note.x new file mode 100644 index 000000000..dccb73c35 --- /dev/null +++ b/GFX/items/note.x @@ -0,0 +1,127 @@ +xof 0302txt 0064 +// This model was made with 3D World Studio +// http://www.leadwerks.com +Header + { + 1; + 0; + 1; + } +Material material_1 + { + 1.0;1.0;1.0;1.0;; + 11.3137; + 1.0;1.0;1.0;; + 0.0;0.0;0.0;; + TextureFilename + { + "note_tex.jpg"; + } + } +Frame World + { + FrameTransformMatrix + { + 1.0,0.0,0.0,0.0, + 0.0,1.0,0.0,0.0, + 0.0,0.0,1.0,0.0, + 0.0,0.0,0.0,1.0;; + } + Mesh Brush1 + { + 24; + -20.0;0.0;20.0;, + -20.0;0.0;-20.0;, + -20.0;1.0;-20.0;, + -20.0;1.0;20.0;, + 20.0;1.0;20.0;, + 20.0;1.0;-20.0;, + 20.0;0.0;-20.0;, + 20.0;0.0;20.0;, + -20.0;0.0;20.0;, + 20.0;0.0;20.0;, + 20.0;0.0;-20.0;, + -20.0;0.0;-20.0;, + -20.0;1.0;-20.0;, + 20.0;1.0;-20.0;, + 20.0;1.0;20.0;, + -20.0;1.0;20.0;, + -20.0;0.0;20.0;, + -20.0;1.0;20.0;, + 20.0;1.0;20.0;, + 20.0;0.0;20.0;, + 20.0;0.0;-20.0;, + 20.0;1.0;-20.0;, + -20.0;1.0;-20.0;, + -20.0;0.0;-20.0;; + 6; + 4;3,2,1,0;, + 4;7,6,5,4;, + 4;11,10,9,8;, + 4;15,14,13,12;, + 4;19,18,17,16;, + 4;23,22,21,20;; + MeshTextureCoords + { + 24; + 1.0081,1.4869;, + 0.0,1.4869;, + 0.0,1.4617;, + 1.0081,1.4617;, + 1.0081,1.4617;, + 0.0,1.4617;, + 0.0,1.4869;, + 1.0081,1.4869;, + 0.0,0.9829;, + 1.0081,0.9829;, + 1.0081,1.9909;, + 0.0,1.9909;, + 0.0,1.9909;, + 1.0081,1.9909;, + 1.0081,0.9829;, + 0.0,0.9829;, + 0.0,1.4869;, + 0.0,1.4617;, + 1.0081,1.4617;, + 1.0081,1.4869;, + 1.0081,1.4869;, + 1.0081,1.4617;, + 0.0,1.4617;, + 0.0,1.4869;; + } + MeshNormals + { + 6; + -1.0;0.0;0.0;, + 1.0;-0.0;0.0;, + 0.0;0.0;-1.0;, + 0.0;0.0;1.0;, + 0.0;1.0;0.0;, + 0.0;-1.0;0.0;; + 6; + 4;0,0,0,0;, + 4;1,1,1,1;, + 4;2,2,2,2;, + 4;3,3,3,3;, + 4;4,4,4,4;, + 4;5,5,5,5;; + } + MeshMaterialList + { + 6; + 6; + 0, + 1, + 2, + 3, + 4, + 5;; + { material_1 } + { material_1 } + { material_1 } + { material_1 } + { material_1 } + { material_1 } + } + } + } diff --git a/GFX/items/note682.jpg b/GFX/items/note682.jpg new file mode 100644 index 000000000..8fa50eeac Binary files /dev/null and b/GFX/items/note682.jpg differ diff --git a/GFX/items/note_tex.jpg b/GFX/items/note_tex.jpg new file mode 100644 index 000000000..3254eae7f Binary files /dev/null and b/GFX/items/note_tex.jpg differ diff --git a/GFX/items/pill.b3d b/GFX/items/pill.b3d index 4505a54a7..192d112ed 100644 Binary files a/GFX/items/pill.b3d and b/GFX/items/pill.b3d differ diff --git a/GFX/items/scp178.b3d b/GFX/items/scp178.b3d deleted file mode 100644 index 603ff7b55..000000000 Binary files a/GFX/items/scp178.b3d and /dev/null differ diff --git a/GFX/items/scp178.png b/GFX/items/scp178.png deleted file mode 100644 index 3ef61fdbd..000000000 Binary files a/GFX/items/scp178.png and /dev/null differ diff --git a/GFX/items/wallet.b3d b/GFX/items/wallet.b3d new file mode 100644 index 000000000..152285cf4 Binary files /dev/null and b/GFX/items/wallet.b3d differ diff --git a/GFX/items/wallet_tex.jpg b/GFX/items/wallet_tex.jpg new file mode 100644 index 000000000..d3718ffd1 Binary files /dev/null and b/GFX/items/wallet_tex.jpg differ diff --git a/GFX/kneelmortal.pd b/GFX/kneelmortal.pd new file mode 100644 index 000000000..c038f2c6c Binary files /dev/null and b/GFX/kneelmortal.pd differ diff --git a/GFX/map/LAMP.jpg b/GFX/map/LAMP.jpg index 30d968c97..98c33507f 100644 Binary files a/GFX/map/LAMP.jpg and b/GFX/map/LAMP.jpg differ diff --git a/GFX/map/LockdownScreen2.jpg b/GFX/map/LockdownScreen2.jpg index fceffb17f..2f244736c 100644 Binary files a/GFX/map/LockdownScreen2.jpg and b/GFX/map/LockdownScreen2.jpg differ diff --git a/GFX/map/Pipes_NoRust2.jpg b/GFX/map/Pipes_NoRust2.jpg new file mode 100644 index 000000000..7e87bad57 Binary files /dev/null and b/GFX/map/Pipes_NoRust2.jpg differ diff --git a/GFX/map/SLH_miscsigns.jpg b/GFX/map/SLH_miscsigns.jpg index b2fcfaf57..e757c11ea 100644 Binary files a/GFX/map/SLH_miscsigns.jpg and b/GFX/map/SLH_miscsigns.jpg differ diff --git a/GFX/map/Thumbs.db b/GFX/map/Thumbs.db deleted file mode 100644 index 7562f6d31..000000000 Binary files a/GFX/map/Thumbs.db and /dev/null differ diff --git a/GFX/map/bed-table.jpg b/GFX/map/bed-table.jpg index c79262da1..44a96f676 100644 Binary files a/GFX/map/bed-table.jpg and b/GFX/map/bed-table.jpg differ diff --git a/GFX/map/bowl-blood.jpg b/GFX/map/bowl-blood.jpg index a5b2c369c..6a2e66129 100644 Binary files a/GFX/map/bowl-blood.jpg and b/GFX/map/bowl-blood.jpg differ diff --git a/GFX/map/caution_tesla.jpg b/GFX/map/caution_tesla.jpg new file mode 100644 index 000000000..bd7369356 Binary files /dev/null and b/GFX/map/caution_tesla.jpg differ diff --git a/GFX/map/controlpanel2.jpg b/GFX/map/controlpanel2.jpg new file mode 100644 index 000000000..58a0d081e Binary files /dev/null and b/GFX/map/controlpanel2.jpg differ diff --git a/GFX/map/diff_trolley.jpg b/GFX/map/diff_trolley.jpg index 7aac76b4a..068aa17c5 100644 Binary files a/GFX/map/diff_trolley.jpg and b/GFX/map/diff_trolley.jpg differ diff --git a/GFX/map/dimension1499/1499object0_cull.b3d b/GFX/map/dimension1499/1499object0_cull.b3d new file mode 100644 index 000000000..ba742e63c Binary files /dev/null and b/GFX/map/dimension1499/1499object0_cull.b3d differ diff --git a/GFX/map/dimension1499/1499object0_lm1.png b/GFX/map/dimension1499/1499object0_lm1.png index d2433be62..189dea87e 100644 Binary files a/GFX/map/dimension1499/1499object0_lm1.png and b/GFX/map/dimension1499/1499object0_lm1.png differ diff --git a/GFX/map/dimension1499/1499object0_lm2.png b/GFX/map/dimension1499/1499object0_lm2.png new file mode 100644 index 000000000..6c615e789 Binary files /dev/null and b/GFX/map/dimension1499/1499object0_lm2.png differ diff --git a/GFX/map/dimension1499/1499object0_lm3.png b/GFX/map/dimension1499/1499object0_lm3.png new file mode 100644 index 000000000..78d17a267 Binary files /dev/null and b/GFX/map/dimension1499/1499object0_lm3.png differ diff --git a/GFX/map/dimension1499/1499object0_opt.rmesh b/GFX/map/dimension1499/1499object0_opt.rmesh index c950c58f8..9c3ab7c97 100644 Binary files a/GFX/map/dimension1499/1499object0_opt.rmesh and b/GFX/map/dimension1499/1499object0_opt.rmesh differ diff --git a/GFX/map/dimension1499/1499object1.b3d b/GFX/map/dimension1499/1499object1.b3d index 6b4ee3384..7de704508 100644 Binary files a/GFX/map/dimension1499/1499object1.b3d and b/GFX/map/dimension1499/1499object1.b3d differ diff --git a/GFX/map/dimension1499/1499object10.b3d b/GFX/map/dimension1499/1499object10.b3d index e38fe7c2e..726478021 100644 Binary files a/GFX/map/dimension1499/1499object10.b3d and b/GFX/map/dimension1499/1499object10.b3d differ diff --git a/GFX/map/dimension1499/1499object10_lm1.bmp b/GFX/map/dimension1499/1499object10_lm1.bmp deleted file mode 100644 index fe02b6eb1..000000000 Binary files a/GFX/map/dimension1499/1499object10_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object11.b3d b/GFX/map/dimension1499/1499object11.b3d index 8159b1072..129fada1b 100644 Binary files a/GFX/map/dimension1499/1499object11.b3d and b/GFX/map/dimension1499/1499object11.b3d differ diff --git a/GFX/map/dimension1499/1499object11_lm1.bmp b/GFX/map/dimension1499/1499object11_lm1.bmp deleted file mode 100644 index 6f92b5ce9..000000000 Binary files a/GFX/map/dimension1499/1499object11_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object12.b3d b/GFX/map/dimension1499/1499object12.b3d index 97e315b94..0d2f628a7 100644 Binary files a/GFX/map/dimension1499/1499object12.b3d and b/GFX/map/dimension1499/1499object12.b3d differ diff --git a/GFX/map/dimension1499/1499object12_lm1.bmp b/GFX/map/dimension1499/1499object12_lm1.bmp deleted file mode 100644 index f53eed8ba..000000000 Binary files a/GFX/map/dimension1499/1499object12_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object13.b3d b/GFX/map/dimension1499/1499object13.b3d index 43c29b732..7740f7130 100644 Binary files a/GFX/map/dimension1499/1499object13.b3d and b/GFX/map/dimension1499/1499object13.b3d differ diff --git a/GFX/map/dimension1499/1499object13_lm1.bmp b/GFX/map/dimension1499/1499object13_lm1.bmp deleted file mode 100644 index 420a17707..000000000 Binary files a/GFX/map/dimension1499/1499object13_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object14.b3d b/GFX/map/dimension1499/1499object14.b3d index 9f858d9fd..ef2c2a152 100644 Binary files a/GFX/map/dimension1499/1499object14.b3d and b/GFX/map/dimension1499/1499object14.b3d differ diff --git a/GFX/map/dimension1499/1499object14_lm1.bmp b/GFX/map/dimension1499/1499object14_lm1.bmp deleted file mode 100644 index 4108a8b12..000000000 Binary files a/GFX/map/dimension1499/1499object14_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object15.b3d b/GFX/map/dimension1499/1499object15.b3d index b1c4fb18b..9f0fc4da7 100644 Binary files a/GFX/map/dimension1499/1499object15.b3d and b/GFX/map/dimension1499/1499object15.b3d differ diff --git a/GFX/map/dimension1499/1499object15_lm1.bmp b/GFX/map/dimension1499/1499object15_lm1.bmp deleted file mode 100644 index f8a585836..000000000 Binary files a/GFX/map/dimension1499/1499object15_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object1_lm1.bmp b/GFX/map/dimension1499/1499object1_lm1.bmp deleted file mode 100644 index 4c1a39303..000000000 Binary files a/GFX/map/dimension1499/1499object1_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object2.b3d b/GFX/map/dimension1499/1499object2.b3d index 2c79f557d..7c91904e8 100644 Binary files a/GFX/map/dimension1499/1499object2.b3d and b/GFX/map/dimension1499/1499object2.b3d differ diff --git a/GFX/map/dimension1499/1499object2_lm1.bmp b/GFX/map/dimension1499/1499object2_lm1.bmp deleted file mode 100644 index 8c56c63d0..000000000 Binary files a/GFX/map/dimension1499/1499object2_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object3.b3d b/GFX/map/dimension1499/1499object3.b3d index 639f7c57e..1b331055f 100644 Binary files a/GFX/map/dimension1499/1499object3.b3d and b/GFX/map/dimension1499/1499object3.b3d differ diff --git a/GFX/map/dimension1499/1499object3_lm1.bmp b/GFX/map/dimension1499/1499object3_lm1.bmp deleted file mode 100644 index 0667f766f..000000000 Binary files a/GFX/map/dimension1499/1499object3_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object4.b3d b/GFX/map/dimension1499/1499object4.b3d index b0eb73eb0..aa7371de5 100644 Binary files a/GFX/map/dimension1499/1499object4.b3d and b/GFX/map/dimension1499/1499object4.b3d differ diff --git a/GFX/map/dimension1499/1499object4_lm1.bmp b/GFX/map/dimension1499/1499object4_lm1.bmp deleted file mode 100644 index bf410f42d..000000000 Binary files a/GFX/map/dimension1499/1499object4_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object5.b3d b/GFX/map/dimension1499/1499object5.b3d index 43fabbd63..2125ae94a 100644 Binary files a/GFX/map/dimension1499/1499object5.b3d and b/GFX/map/dimension1499/1499object5.b3d differ diff --git a/GFX/map/dimension1499/1499object5_lm1.bmp b/GFX/map/dimension1499/1499object5_lm1.bmp deleted file mode 100644 index 3d7328186..000000000 Binary files a/GFX/map/dimension1499/1499object5_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object5_lm2.bmp b/GFX/map/dimension1499/1499object5_lm2.bmp deleted file mode 100644 index 638961f87..000000000 Binary files a/GFX/map/dimension1499/1499object5_lm2.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object6.b3d b/GFX/map/dimension1499/1499object6.b3d index 3d348eacf..7795d121f 100644 Binary files a/GFX/map/dimension1499/1499object6.b3d and b/GFX/map/dimension1499/1499object6.b3d differ diff --git a/GFX/map/dimension1499/1499object6_lm1.bmp b/GFX/map/dimension1499/1499object6_lm1.bmp deleted file mode 100644 index 9bcac76d2..000000000 Binary files a/GFX/map/dimension1499/1499object6_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object7.b3d b/GFX/map/dimension1499/1499object7.b3d index 2bb66c215..5f3174756 100644 Binary files a/GFX/map/dimension1499/1499object7.b3d and b/GFX/map/dimension1499/1499object7.b3d differ diff --git a/GFX/map/dimension1499/1499object7_lm1.bmp b/GFX/map/dimension1499/1499object7_lm1.bmp deleted file mode 100644 index 0bc25f5f2..000000000 Binary files a/GFX/map/dimension1499/1499object7_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object8.b3d b/GFX/map/dimension1499/1499object8.b3d index 206d6127a..21d2ec0ef 100644 Binary files a/GFX/map/dimension1499/1499object8.b3d and b/GFX/map/dimension1499/1499object8.b3d differ diff --git a/GFX/map/dimension1499/1499object8_lm1.bmp b/GFX/map/dimension1499/1499object8_lm1.bmp deleted file mode 100644 index d9dbf50a0..000000000 Binary files a/GFX/map/dimension1499/1499object8_lm1.bmp and /dev/null differ diff --git a/GFX/map/dimension1499/1499object9.b3d b/GFX/map/dimension1499/1499object9.b3d index 796746f59..dc82ad8a9 100644 Binary files a/GFX/map/dimension1499/1499object9.b3d and b/GFX/map/dimension1499/1499object9.b3d differ diff --git a/GFX/map/dimension1499/1499object9_lm1.bmp b/GFX/map/dimension1499/1499object9_lm1.bmp deleted file mode 100644 index af2495795..000000000 Binary files a/GFX/map/dimension1499/1499object9_lm1.bmp and /dev/null differ diff --git a/GFX/map/elevatordoor.b3d b/GFX/map/elevatordoor.b3d new file mode 100644 index 000000000..06cef94c0 Binary files /dev/null and b/GFX/map/elevatordoor.b3d differ diff --git a/GFX/map/forest/Thumbs.db b/GFX/map/forest/Thumbs.db deleted file mode 100644 index 3a0647cc2..000000000 Binary files a/GFX/map/forest/Thumbs.db and /dev/null differ diff --git a/GFX/map/label035.jpg b/GFX/map/label035.jpg index 8ca70ff6d..a421b9e03 100644 Binary files a/GFX/map/label035.jpg and b/GFX/map/label035.jpg differ diff --git a/GFX/map/label106.jpg b/GFX/map/label106.jpg index 022b69c3f..c0506f673 100644 Binary files a/GFX/map/label106.jpg and b/GFX/map/label106.jpg differ diff --git a/GFX/map/label1123.png b/GFX/map/label1123.png deleted file mode 100644 index 8276c0c74..000000000 Binary files a/GFX/map/label1123.png and /dev/null differ diff --git a/GFX/map/label178.jpg b/GFX/map/label178.jpg deleted file mode 100644 index 18d7581e5..000000000 Binary files a/GFX/map/label178.jpg and /dev/null differ diff --git a/GFX/map/label914.jpg b/GFX/map/label914.jpg index 3bec7fce3..e4023e2ae 100644 Binary files a/GFX/map/label914.jpg and b/GFX/map/label914.jpg differ diff --git a/GFX/map/lamp3.jpg b/GFX/map/lamp3.jpg new file mode 100644 index 000000000..e84d41959 Binary files /dev/null and b/GFX/map/lamp3.jpg differ diff --git a/GFX/map/mat_glass.png b/GFX/map/mat_glass.png new file mode 100644 index 000000000..1b8a47f08 Binary files /dev/null and b/GFX/map/mat_glass.png differ diff --git a/GFX/map/microscope.jpg b/GFX/map/microscope.jpg index d0ecea33d..e1fe13a01 100644 Binary files a/GFX/map/microscope.jpg and b/GFX/map/microscope.jpg differ diff --git a/GFX/map/miscsigns3.jpg b/GFX/map/miscsigns3.jpg index 8f72b46b6..720af17ab 100644 Binary files a/GFX/map/miscsigns3.jpg and b/GFX/map/miscsigns3.jpg differ diff --git a/GFX/map/miscsigns4.jpg b/GFX/map/miscsigns4.jpg index 5c4b72ced..5598700f7 100644 Binary files a/GFX/map/miscsigns4.jpg and b/GFX/map/miscsigns4.jpg differ diff --git a/GFX/map/op-table-light-blood.jpg b/GFX/map/op-table-light-blood.jpg index 5e3addb67..5fc7e65a0 100644 Binary files a/GFX/map/op-table-light-blood.jpg and b/GFX/map/op-table-light-blood.jpg differ diff --git a/GFX/map/ox-cy-tray.jpg b/GFX/map/ox-cy-tray.jpg index 83737a1f3..30fd44408 100644 Binary files a/GFX/map/ox-cy-tray.jpg and b/GFX/map/ox-cy-tray.jpg differ diff --git a/GFX/map/oxygen-cylinder.jpg b/GFX/map/oxygen-cylinder.jpg index 396d2fa17..7d4e667e8 100644 Binary files a/GFX/map/oxygen-cylinder.jpg and b/GFX/map/oxygen-cylinder.jpg differ diff --git a/GFX/map/room049_lm1.png b/GFX/map/room049_lm1.png index 24dc35366..ee0383075 100644 Binary files a/GFX/map/room049_lm1.png and b/GFX/map/room049_lm1.png differ diff --git a/GFX/map/room049_lm2.png b/GFX/map/room049_lm2.png index d73986b82..0ddca52ad 100644 Binary files a/GFX/map/room049_lm2.png and b/GFX/map/room049_lm2.png differ diff --git a/GFX/map/room049_lm3.png b/GFX/map/room049_lm3.png deleted file mode 100644 index f22f49785..000000000 Binary files a/GFX/map/room049_lm3.png and /dev/null differ diff --git a/GFX/map/room049_opt.rmesh b/GFX/map/room049_opt.rmesh index e002fd980..cf87cd9aa 100644 Binary files a/GFX/map/room049_opt.rmesh and b/GFX/map/room049_opt.rmesh differ diff --git a/GFX/map/room178_lm1.png b/GFX/map/room178_lm1.png deleted file mode 100644 index 0ddfd65e7..000000000 Binary files a/GFX/map/room178_lm1.png and /dev/null differ diff --git a/GFX/map/room178_opt.rmesh b/GFX/map/room178_opt.rmesh deleted file mode 100644 index 5cb5844de..000000000 Binary files a/GFX/map/room178_opt.rmesh and /dev/null differ diff --git a/GFX/map/room2cpit_lm1.png b/GFX/map/room2cpit_lm1.png new file mode 100644 index 000000000..05c955a4f Binary files /dev/null and b/GFX/map/room2cpit_lm1.png differ diff --git a/GFX/map/room2cpit_opt.rmesh b/GFX/map/room2cpit_opt.rmesh new file mode 100644 index 000000000..8aea243b6 Binary files /dev/null and b/GFX/map/room2cpit_opt.rmesh differ diff --git a/GFX/map/room2nuke_lm1.png b/GFX/map/room2nuke_lm1.png index 23c5dcf4e..2e476d4bb 100644 Binary files a/GFX/map/room2nuke_lm1.png and b/GFX/map/room2nuke_lm1.png differ diff --git a/GFX/map/room2nuke_opt.rmesh b/GFX/map/room2nuke_opt.rmesh index 4648f8daf..0c56f8d7a 100644 Binary files a/GFX/map/room2nuke_opt.rmesh and b/GFX/map/room2nuke_opt.rmesh differ diff --git a/GFX/map/room2nuke_opt_opt.rmesh b/GFX/map/room2nuke_opt_opt.rmesh deleted file mode 100644 index 4648f8daf..000000000 Binary files a/GFX/map/room2nuke_opt_opt.rmesh and /dev/null differ diff --git a/GFX/map/room2pipes2_lm1.png b/GFX/map/room2pipes2_lm1.png new file mode 100644 index 000000000..5bf57c5f0 Binary files /dev/null and b/GFX/map/room2pipes2_lm1.png differ diff --git a/GFX/map/room2pipes2_opt.rmesh b/GFX/map/room2pipes2_opt.rmesh new file mode 100644 index 000000000..3246065e4 Binary files /dev/null and b/GFX/map/room2pipes2_opt.rmesh differ diff --git a/GFX/map/room2scps_lm1.png b/GFX/map/room2scps_lm1.png index 23acdae53..72168f5b0 100644 Binary files a/GFX/map/room2scps_lm1.png and b/GFX/map/room2scps_lm1.png differ diff --git a/GFX/map/room2scps_opt.rmesh b/GFX/map/room2scps_opt.rmesh index 9e701ca1f..5d0d0a983 100644 Binary files a/GFX/map/room2scps_opt.rmesh and b/GFX/map/room2scps_opt.rmesh differ diff --git a/GFX/map/room2sl_hb.b3d b/GFX/map/room2sl_hb.b3d deleted file mode 100644 index c3306fd83..000000000 Binary files a/GFX/map/room2sl_hb.b3d and /dev/null differ diff --git a/GFX/map/room2sl_hb_lm1.bmp b/GFX/map/room2sl_hb_lm1.bmp deleted file mode 100644 index 88eb97167..000000000 Binary files a/GFX/map/room2sl_hb_lm1.bmp and /dev/null differ diff --git a/GFX/map/room2sl_lm1.png b/GFX/map/room2sl_lm1.png index 4854636c6..a85e9b2c3 100644 Binary files a/GFX/map/room2sl_lm1.png and b/GFX/map/room2sl_lm1.png differ diff --git a/GFX/map/room2sl_lm10.png b/GFX/map/room2sl_lm10.png deleted file mode 100644 index ffcc5e826..000000000 Binary files a/GFX/map/room2sl_lm10.png and /dev/null differ diff --git a/GFX/map/room2sl_lm11.png b/GFX/map/room2sl_lm11.png deleted file mode 100644 index 5554f6082..000000000 Binary files a/GFX/map/room2sl_lm11.png and /dev/null differ diff --git a/GFX/map/room2sl_lm12.png b/GFX/map/room2sl_lm12.png deleted file mode 100644 index 8016e6b67..000000000 Binary files a/GFX/map/room2sl_lm12.png and /dev/null differ diff --git a/GFX/map/room2sl_lm2.png b/GFX/map/room2sl_lm2.png index de866bb1e..31603c753 100644 Binary files a/GFX/map/room2sl_lm2.png and b/GFX/map/room2sl_lm2.png differ diff --git a/GFX/map/room2sl_lm3.png b/GFX/map/room2sl_lm3.png deleted file mode 100644 index dee65d90a..000000000 Binary files a/GFX/map/room2sl_lm3.png and /dev/null differ diff --git a/GFX/map/room2sl_lm4.png b/GFX/map/room2sl_lm4.png deleted file mode 100644 index a013050e3..000000000 Binary files a/GFX/map/room2sl_lm4.png and /dev/null differ diff --git a/GFX/map/room2sl_lm5.png b/GFX/map/room2sl_lm5.png deleted file mode 100644 index 366821af6..000000000 Binary files a/GFX/map/room2sl_lm5.png and /dev/null differ diff --git a/GFX/map/room2sl_lm6.png b/GFX/map/room2sl_lm6.png deleted file mode 100644 index 165af4eb5..000000000 Binary files a/GFX/map/room2sl_lm6.png and /dev/null differ diff --git a/GFX/map/room2sl_lm7.png b/GFX/map/room2sl_lm7.png deleted file mode 100644 index fc0683ea1..000000000 Binary files a/GFX/map/room2sl_lm7.png and /dev/null differ diff --git a/GFX/map/room2sl_lm8.png b/GFX/map/room2sl_lm8.png deleted file mode 100644 index 0f1186a75..000000000 Binary files a/GFX/map/room2sl_lm8.png and /dev/null differ diff --git a/GFX/map/room2sl_lm9.png b/GFX/map/room2sl_lm9.png deleted file mode 100644 index 5989d0267..000000000 Binary files a/GFX/map/room2sl_lm9.png and /dev/null differ diff --git a/GFX/map/room2sl_opt.rmesh b/GFX/map/room2sl_opt.rmesh index a50c24e65..43a093ff4 100644 Binary files a/GFX/map/room2sl_opt.rmesh and b/GFX/map/room2sl_opt.rmesh differ diff --git a/GFX/map/room2sroom_lm1.png b/GFX/map/room2sroom_lm1.png index 49d30aeca..28c570108 100644 Binary files a/GFX/map/room2sroom_lm1.png and b/GFX/map/room2sroom_lm1.png differ diff --git a/GFX/map/room2sroom_opt.rmesh b/GFX/map/room2sroom_opt.rmesh index 34a159e43..f05eae360 100644 Binary files a/GFX/map/room2sroom_opt.rmesh and b/GFX/map/room2sroom_opt.rmesh differ diff --git a/GFX/map/room2tesla_caution.b3d b/GFX/map/room2tesla_caution.b3d new file mode 100644 index 000000000..f17e08e75 Binary files /dev/null and b/GFX/map/room2tesla_caution.b3d differ diff --git a/GFX/map/room2testroom2_lm1.png b/GFX/map/room2testroom2_lm1.png index 01ea5ed79..51ec8e852 100644 Binary files a/GFX/map/room2testroom2_lm1.png and b/GFX/map/room2testroom2_lm1.png differ diff --git a/GFX/map/room2testroom2_opt.rmesh b/GFX/map/room2testroom2_opt.rmesh index fc9659b99..cef71c93e 100644 Binary files a/GFX/map/room2testroom2_opt.rmesh and b/GFX/map/room2testroom2_opt.rmesh differ diff --git a/GFX/map/room3_3_lm1.png b/GFX/map/room3_3_lm1.png new file mode 100644 index 000000000..285179e57 Binary files /dev/null and b/GFX/map/room3_3_lm1.png differ diff --git a/GFX/map/room3_3_opt.rmesh b/GFX/map/room3_3_opt.rmesh new file mode 100644 index 000000000..dfbc235d1 Binary files /dev/null and b/GFX/map/room3_3_opt.rmesh differ diff --git a/GFX/map/room4info_lm1.png b/GFX/map/room4info_lm1.png new file mode 100644 index 000000000..2aa1f4cb4 Binary files /dev/null and b/GFX/map/room4info_lm1.png differ diff --git a/GFX/map/room4info_opt.rmesh b/GFX/map/room4info_opt.rmesh new file mode 100644 index 000000000..b3340685f Binary files /dev/null and b/GFX/map/room4info_opt.rmesh differ diff --git a/GFX/map/sky/Thumbs.db b/GFX/map/sky/Thumbs.db deleted file mode 100644 index d9d541c42..000000000 Binary files a/GFX/map/sky/Thumbs.db and /dev/null differ diff --git a/GFX/map/soft grey.jpg b/GFX/map/soft grey.jpg new file mode 100644 index 000000000..0f5da3a71 Binary files /dev/null and b/GFX/map/soft grey.jpg differ diff --git a/GFX/map/zimmerframe1.jpg b/GFX/map/zimmerframe1.jpg index a5c57cef4..a8ec3a5b8 100644 Binary files a/GFX/map/zimmerframe1.jpg and b/GFX/map/zimmerframe1.jpg differ diff --git a/GFX/menu/Thumbs.db b/GFX/menu/Thumbs.db deleted file mode 100644 index bbd20f703..000000000 Binary files a/GFX/menu/Thumbs.db and /dev/null differ diff --git a/GFX/menu/achievements/Achv178.jpg b/GFX/menu/achievements/Achv178.jpg deleted file mode 100644 index b7357e220..000000000 Binary files a/GFX/menu/achievements/Achv178.jpg and /dev/null differ diff --git a/GFX/menu/achievements/Achv427.jpg b/GFX/menu/achievements/Achv427.jpg new file mode 100644 index 000000000..7727face8 Binary files /dev/null and b/GFX/menu/achievements/Achv427.jpg differ diff --git a/GFX/menu/achievements/AchvMassage.jpg b/GFX/menu/achievements/AchvMassage.jpg deleted file mode 100644 index 73a7e9c93..000000000 Binary files a/GFX/menu/achievements/AchvMassage.jpg and /dev/null differ diff --git a/GFX/menu/achievements/AchvNoHud.jpg b/GFX/menu/achievements/AchvNoHud.jpg deleted file mode 100644 index 29a6a2e1a..000000000 Binary files a/GFX/menu/achievements/AchvNoHud.jpg and /dev/null differ diff --git a/GFX/menu/achievements/Thumbs.db b/GFX/menu/achievements/Thumbs.db deleted file mode 100644 index d4cb42b2a..000000000 Binary files a/GFX/menu/achievements/Thumbs.db and /dev/null differ diff --git a/GFX/npcs/1499-1.b3d b/GFX/npcs/1499-1.b3d index f02fdb7dc..cbc53837b 100644 Binary files a/GFX/npcs/1499-1.b3d and b/GFX/npcs/1499-1.b3d differ diff --git a/GFX/npcs/1499_King.jpg b/GFX/npcs/1499_King.jpg new file mode 100644 index 000000000..0e5a99eee Binary files /dev/null and b/GFX/npcs/1499_King.jpg differ diff --git a/GFX/npcs/shroudling_D.jpg b/GFX/npcs/1499_normal.jpg similarity index 100% rename from GFX/npcs/shroudling_D.jpg rename to GFX/npcs/1499_normal.jpg diff --git a/GFX/npcs/178.jpg b/GFX/npcs/178.jpg deleted file mode 100644 index 8ebb616f9..000000000 Binary files a/GFX/npcs/178.jpg and /dev/null differ diff --git a/GFX/npcs/Thumbs.db b/GFX/npcs/Thumbs.db deleted file mode 100644 index b5470d1a2..000000000 Binary files a/GFX/npcs/Thumbs.db and /dev/null differ diff --git a/GFX/npcs/body2.jpg b/GFX/npcs/body2.jpg new file mode 100644 index 000000000..53e951560 Binary files /dev/null and b/GFX/npcs/body2.jpg differ diff --git a/GFX/npcs/classd.b3d b/GFX/npcs/classd.b3d index ce6a71796..830a76ce1 100644 Binary files a/GFX/npcs/classd.b3d and b/GFX/npcs/classd.b3d differ diff --git a/GFX/npcs/guard.b3d b/GFX/npcs/guard.b3d index 48b5c5a2c..99fb2d480 100644 Binary files a/GFX/npcs/guard.b3d and b/GFX/npcs/guard.b3d differ diff --git a/GFX/npcs/npc178.b3d b/GFX/npcs/npc178.b3d deleted file mode 100644 index 41365b0b2..000000000 Binary files a/GFX/npcs/npc178.b3d and /dev/null differ diff --git a/GFX/npcs/papertexture.jpg b/GFX/npcs/papertexture.jpg new file mode 100644 index 000000000..23c2bf83d Binary files /dev/null and b/GFX/npcs/papertexture.jpg differ diff --git a/GFX/npcs/scp-066.b3d b/GFX/npcs/scp-066.b3d index 139f0a923..e16745f8c 100644 Binary files a/GFX/npcs/scp-066.b3d and b/GFX/npcs/scp-066.b3d differ diff --git a/GFX/screens/Thumbs.db b/GFX/screens/Thumbs.db deleted file mode 100644 index ae751f5c0..000000000 Binary files a/GFX/screens/Thumbs.db and /dev/null differ diff --git a/Items.bb b/Items.bb index d3f735e3e..01d5ac3ce 100644 --- a/Items.bb +++ b/Items.bb @@ -182,7 +182,7 @@ Function InitItemTemplates() it = CreateItemTemplate("Nuclear Device Document", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docNDP.jpg", 0.003) : it\sound = 0 it = CreateItemTemplate("Class D Orientation Leaflet", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docORI.jpg", 0.003) : it\sound = 0 - it = CreateItemTemplate("Note from Daniel", "paper", "GFX\items\paper.x", "GFX\items\INVnote.jpg", "GFX\items\docdan.jpg", 0.0025, "GFX\items\notetexture.jpg") : it\sound = 0 + it = CreateItemTemplate("Note from Daniel", "paper", "GFX\items\note.x", "GFX\items\INVnote2.jpg", "GFX\items\docdan.jpg", 0.0025) : it\sound = 0 it = CreateItemTemplate("Burnt Note", "paper", "GFX\items\paper.x", "GFX\items\INVbn.jpg", "GFX\items\bn.it", 0.003, "GFX\items\BurntNoteTexture.jpg") it\img = BurntNote : it\sound = 0 @@ -193,7 +193,7 @@ Function InitItemTemplates() it = CreateItemTemplate("Security Clearance Levels", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docSC.jpg", 0.003) : it\sound = 0 it = CreateItemTemplate("Object Classes", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docOBJC.jpg", 0.003) : it\sound = 0 it = CreateItemTemplate("Document", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docRAND3.jpg", 0.003) : it\sound = 0 - it = CreateItemTemplate("Note", "paper", "GFX\items\paper.x", "GFX\items\INVnote.jpg", "GFX\items\docRAND2.jpg", 0.003, "GFX\items\notetexture.jpg") : it\sound = 0 + it = CreateItemTemplate("Addendum: 5/14 Test Log", "paper", "GFX\items\paper.x", "GFX\items\INVnote.jpg", "GFX\items\docRAND2.jpg", 0.003, "GFX\items\notetexture.jpg") : it\sound = 0 it = CreateItemTemplate("Notification", "paper", "GFX\items\paper.x", "GFX\items\INVnote.jpg", "GFX\items\docRAND1.jpg", 0.003, "GFX\items\notetexture.jpg") :it\sound = 0 it = CreateItemTemplate("Incident Report SCP-106-0204", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docIR106.jpg", 0.003) : it\sound = 0 @@ -214,7 +214,8 @@ Function InitItemTemplates() it = CreateItemTemplate("Empty Cup", "emptycup", "GFX\items\cup.x", "GFX\items\INVcup.jpg", "", 0.04) : it\sound = 2 - it = CreateItemTemplate("SCP-500-01", "scp500", "GFX\items\pill.b3d", "GFX\items\INVpill.jpg", "", 0.0010) : it\sound = 2 + it = CreateItemTemplate("SCP-500-01", "scp500", "GFX\items\pill.b3d", "GFX\items\INVpill.jpg", "", 0.0001) : it\sound = 2 + EntityColor it\obj,255,0,0 it = CreateItemTemplate("First Aid Kit", "firstaid", "GFX\items\firstaid.x", "GFX\items\INVfirstaid.jpg", "", 0.05) it = CreateItemTemplate("Small First Aid Kit", "finefirstaid", "GFX\items\firstaid.x", "GFX\items\INVfirstaid.jpg", "", 0.03) @@ -274,7 +275,6 @@ Function InitItemTemplates() it = CreateItemTemplate("Clipboard", "clipboard", "GFX\items\clipboard.b3d", "GFX\items\INVclipboard.jpg", "", 0.003, "", "GFX\items\INVclipboard2.jpg", 1) it = CreateItemTemplate("SCP-1123", "1123", "GFX\items\HGIB_Skull1.b3d", "GFX\items\inv1123.jpg", "", 0.015) : it\sound = 2 - it = CreateItemTemplate("SCP-178", "scp178", "GFX\items\scp178.b3d", "GFX\items\INV178.jpg", "", 0.02,"","",1) ;it = CreateItemTemplate("Document SCP-1074", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\doc1074.jpg", 0.003) : it\sound = 0 ;it = CreateItemTemplate("SCP-1074 Containment Notice", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\doc_arce.jpg", 0.003) : it\sound = 0 @@ -290,17 +290,30 @@ Function InitItemTemplates() ;......... ;new Items in SCP:CB 1.3 - ENDSHN - it = CreateItemTemplate("SCP-1499","scp1499","GFX\items\SCP-1499.3ds","GFX\items\INVscp1499.jpg", "", 0.023,"GFX\items\SCP-1499.jpg") : it\sound = 2 - it = CreateItemTemplate("SCP-1499","super1499","GFX\items\SCP-1499.3ds","GFX\items\INVscp1499.jpg", "", 0.023,"GFX\items\SCP-1499.jpg") : it\sound = 2 + it = CreateItemTemplate("SCP-1499","scp1499","GFX\items\SCP-1499.b3d","GFX\items\INVscp1499.jpg", "", 0.023) : it\sound = 2 + it = CreateItemTemplate("SCP-1499","super1499","GFX\items\SCP-1499.b3d","GFX\items\INVscp1499.jpg", "", 0.023) : it\sound = 2 CreateItemTemplate("Emily Ross' Badge", "badge", "GFX\items\badge.x", "GFX\items\INVbadge.jpg", "GFX\items\badge1.jpg", 0.0001, "GFX\items\badge1_tex.jpg") it = CreateItemTemplate("Lost Key", "key", "GFX\items\key.b3d", "GFX\items\INV1162_1.jpg", "", 0.001, "GFX\items\key2.png","",0,1+2+8) : it\sound = 3 it = CreateItemTemplate("Disciplinary Hearing DH-S-4137-17092", "oldpaper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\dh.s", 0.003) : it\sound = 0 - it = CreateItemTemplate("Coin", "coin", "GFX\items\key.b3d", "GFX\items\INVcoin.jpg", "", 0.0005, "GFX\items\coin.png","",0,1+2+8) : it\sound = 3 - it = CreateItemTemplate("Movie Ticket", "ticket", "GFX\items\key.b3d", "GFX\items\INVticket.jpg", "GFX\items\ticket.png", 0.002, "GFX\items\tickettexture.png","",0,1+2+8) : it\sound = 0 - - CreateItemTemplate("Old Badge", "badge", "GFX\items\badge.x", "GFX\items\INVoldbadge.jpg", "GFX\items\badge2.png", 0.0001, "GFX\items\badge2_tex.png","",0,1+2+8) + CreateItemTemplate("Old Badge", "badge", "GFX\items\badge.x", "GFX\items\INVoldbadge.jpg", "GFX\items\badge2.png", 0.0001, "GFX\items\badge2_tex.png","",0,1+2+8) + + it = CreateItemTemplate("50 Cent Coin","50ct", "GFX\items\key.b3d", "GFX\items\INVcoin.jpg", "", 0.0005, "GFX\items\coin.png","",0,1+2+8) : it\sound = 3 + it = CreateItemTemplate("Wallet","wallet", "GFX\items\wallet.b3d", "GFX\items\INVwallet.jpg", "", 0.0005,"","",1) : it\sound = 2 + + CreateItemTemplate("SCP-427","scp427","GFX\items\427.b3d","GFX\items\INVscp427.jpg", "", 0.001) + it = CreateItemTemplate("Upgraded pill", "scp500death", "GFX\items\pill.b3d", "GFX\items\INVpill.jpg", "", 0.0001) : it\sound = 2 + EntityColor it\obj,255,0,0 + it = CreateItemTemplate("Pill", "pill", "GFX\items\pill.b3d", "GFX\items\INVpillwhite.jpg", "", 0.0001) : it\sound = 2 + EntityColor it\obj,255,255,255 + + it = CreateItemTemplate("Sticky Note", "paper", "GFX\items\note.x", "GFX\items\INVnote2.jpg", "GFX\items\note682.jpg", 0.0025) : it\sound = 0 + it = CreateItemTemplate("The Modular Site Project", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docMSP.jpg", 0.003) : it\sound = 0 + + it = CreateItemTemplate("Research Sector-02 Scheme", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\docmap.jpg", 0.003) : it\sound = 0 + + it = CreateItemTemplate("Document SCP-427", "paper", "GFX\items\paper.x", "GFX\items\INVpaper.jpg", "GFX\items\doc427.jpg", 0.003) : it\sound = 0 For it = Each ItemTemplates If (it\tex<>0) Then @@ -406,7 +419,10 @@ Function CreateItem.Items(name$, tempname$, x#, y#, z#, r%=0,g%=0,b%=0,a#=1.0,in If (tempname="clipboard") And (invSlots=0) Then invSlots = 10 SetAnimTime i\model,17.0 - i\invimg = i\itemtemplate\invimg2 + i\invimg = i\itemtemplate\invimg2 + ElseIf (tempname="wallet") And (invSlots=0) Then + invSlots = 10 + SetAnimTime i\model,0.0 EndIf i\invSlots=invSlots @@ -444,7 +460,9 @@ Function RemoveItem(i.Items) Case "scp714" Wearing714 = False Case "scp1499","super1499" - Wearing1499 = False + Wearing1499 = False + Case "scp427" + I_427\Using = False End Select SelectedItem = Null @@ -571,15 +589,22 @@ Function UpdateItems() End Function Function PickItem(item.Items) - Local n% = 0 + Local n% = 0 + Local canpickitem = True + Local fullINV% = True + + For n% = 0 To MaxItemAmount - 1 + If Inventory(n)=Null + fullINV = False + Exit + EndIf + Next CatchErrors("Uncaught (PickItem)") - If ItemAmount < MaxItemAmount Then + If (Not fullINV) Then For n% = 0 To MaxItemAmount - 1 If Inventory(n) = Null Then Select item\itemtemplate\tempname - Case "scp178" - SetAnimTime item\model,19.0 Case "1123" If Not (Wearing714 = 1) Then If PlayerRoom\RoomTemplate\Name <> "room1123" Then @@ -631,25 +656,57 @@ Function PickItem(item.Items) Case "navigator", "nav" If item\itemtemplate\name = "S-NAV Navigator Ultimate" Then GiveAchievement(AchvSNAV) Case "hazmatsuit", "hazmatsuit2", "hazmatsuit3" - Msg = "You put on the hazmat suit." - TakeOffStuff(1+16) - MsgTimer = 70 * 5 - If item\itemtemplate\tempname="hazmatsuit3" Then - WearingHazmat = 3 - ElseIf item\itemtemplate\tempname="hazmatsuit2" - WearingHazmat = 2 - Else - WearingHazmat = 1 + canpickitem = True + For z% = 0 To MaxItemAmount - 1 + If Inventory(z) <> Null Then + If Inventory(z)\itemtemplate\tempname="hazmatsuit" Or Inventory(z)\itemtemplate\tempname="hazmatsuit2" Or Inventory(z)\itemtemplate\tempname="hazmatsuit3" Then + canpickitem% = False + Exit + ElseIf Inventory(z)\itemtemplate\tempname="vest" Or Inventory(z)\itemtemplate\tempname="finevest" Then + canpickitem% = 2 + Exit + EndIf + EndIf + Next + + If canpickitem=False Then + Msg = "You are not able to wear two hazmat suits at the same time." + MsgTimer = 70 * 5 + Return + ElseIf canpickitem=2 Then + Msg = "You are not able to wear a vest and a hazmat suit at the same time." + MsgTimer = 70 * 5 + Return + Else + ;TakeOffStuff(1+16) + SelectedItem = item + EndIf + Case "vest","finevest" + canpickitem = True + For z% = 0 To MaxItemAmount - 1 + If Inventory(z) <> Null Then + If Inventory(z)\itemtemplate\tempname="vest" Or Inventory(z)\itemtemplate\tempname="finevest" Then + canpickitem% = False + Exit + ElseIf Inventory(z)\itemtemplate\tempname="hazmatsuit" Or Inventory(z)\itemtemplate\tempname="hazmatsuit2" Or Inventory(z)\itemtemplate\tempname="hazmatsuit3" Then + canpickitem% = 2 + Exit + EndIf + EndIf + Next + + If canpickitem=False Then + Msg = "You are not able to wear two vests at the same time." + MsgTimer = 70 * 5 + Return + ElseIf canpickitem=2 Then + Msg = "You are not able to wear a vest and a hazmat suit at the same time." + MsgTimer = 70 * 5 + Return + Else + ;TakeOffStuff(2) + SelectedItem = item EndIf - - For z% = 0 To MaxItemAmount - 1 - If Inventory(z) <> Null Then - If Inventory(z)\itemtemplate\tempname="hazmatsuit" Or Inventory(z)\itemtemplate\tempname="hazmatsuit2" Or Inventory(z)\itemtemplate\tempname="hazmatsuit3" Then - DropItem(Inventory(z)) - EndIf - EndIf - Next - End Select If item\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(item\itemtemplate\sound)) @@ -671,9 +728,11 @@ Function PickItem(item.Items) CatchErrors("PickItem") End Function -Function DropItem(item.Items) - CatchErrors("Uncaught (DropItem)") - If item\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(item\itemtemplate\sound)) +Function DropItem(item.Items,playdropsound%=True) + CatchErrors("Uncaught (DropItem)") + If playdropsound Then + If item\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(item\itemtemplate\sound)) + EndIf item\Dropped = 1 @@ -704,10 +763,10 @@ Function DropItem(item.Items) If WearingNightVision = 3 Then CameraFogFar = StoredCameraFogFar : WearingNightVision = False Case "scp714" Wearing714 = False - Case "scp178" - Wearing178 = False Case "scp1499","super1499" - Wearing1499 = False + Wearing1499 = False + Case "scp427" + I_427\Using = False End Select CatchErrors("DropItem") @@ -788,7 +847,9 @@ Function Update294() If VomitTimer < -15 Then FreeSound_Strict(VomitSFX) VomitTimer = 0 - PlaySound_Strict(BreathSFX(0,0)) + If KillTimer >= 0 Then + PlaySound_Strict(BreathSFX(0,0)) + EndIf Injuries = PrevInjuries Bloodloss = PrevBloodloss Vomit = False diff --git a/LoadAllSounds.bb b/LoadAllSounds.bb index 3a9326906..004b39758 100644 --- a/LoadAllSounds.bb +++ b/LoadAllSounds.bb @@ -5,6 +5,8 @@ For i = 0 To 2 CloseDoorSFX(0,i) = LoadSound_Strict("SFX\Door\DoorClose" + (i + 1) + ".ogg") OpenDoorSFX(2,i) = LoadSound_Strict("SFX\Door\Door2Open" + (i + 1) + ".ogg") CloseDoorSFX(2,i) = LoadSound_Strict("SFX\Door\Door2Close" + (i + 1) + ".ogg") + OpenDoorSFX(3,i) = LoadSound_Strict("SFX\Door\ElevatorOpen" + (i + 1) + ".ogg") + CloseDoorSFX(3,i) = LoadSound_Strict("SFX\Door\ElevatorClose" + (i + 1) + ".ogg") Next For i = 0 To 1 OpenDoorSFX(1,i) = LoadSound_Strict("SFX\Door\BigDoorOpen" + (i + 1) + ".ogg") @@ -90,7 +92,7 @@ Next ;CurrAmbientSFX% ;Dim AmbientSFXAmount(6) ;0 = light containment, 1 = heavy containment, 2 = entrance -AmbientSFXAmount(0)=8 : AmbientSFXAmount(1)=11 : AmbientSFXAmount(2)=12 +AmbientSFXAmount(0)=11 : AmbientSFXAmount(1)=11 : AmbientSFXAmount(2)=12 ;3 = general, 4 = pre-breach AmbientSFXAmount(3)=15 : AmbientSFXAmount(4)=5 ;5 = forest @@ -105,6 +107,9 @@ Next OldManSFX(3) = LoadSound_Strict("SFX\SCP\106\Laugh.ogg") OldManSFX(4) = LoadSound_Strict("SFX\SCP\106\Breathing.ogg") OldManSFX(5) = LoadSound_Strict("SFX\Room\PocketDimension\Enter.ogg") +For i = 0 To 2 + OldManSFX(6+i) = LoadSound_Strict("SFX\SCP\106\WallDecay"+(i+1)+".ogg") +Next ;Dim Scp173SFX%(3) For i = 0 To 2 @@ -112,7 +117,7 @@ For i = 0 To 2 Next ;Dim HorrorSFX%(20) -For i = 0 To 10 +For i = 0 To 11 HorrorSFX(i) = LoadSound_Strict("SFX\Horror\Horror" + i + ".ogg") Next For i = 14 To 15 @@ -138,6 +143,10 @@ AlarmSFX(0) = LoadSound_Strict("SFX\Alarm\Alarm.ogg") ;AlarmSFX(1) = LoadSound_Strict("SFX\Alarm\Alarm2.ogg") AlarmSFX(2) = LoadSound_Strict("SFX\Alarm\Alarm3.ogg") +;room_gw alarms +AlarmSFX(3) = LoadSound_Strict("SFX\Alarm\Alarm4.ogg") +AlarmSFX(4) = LoadSound_Strict("SFX\Alarm\Alarm5.ogg") + ;Dim CommotionState%(23) HeartBeatSFX = LoadSound_Strict("SFX\Character\D9341\Heartbeat.ogg") diff --git a/Loadingscreens/178.jpg b/Loadingscreens/178.jpg deleted file mode 100644 index cbd420018..000000000 Binary files a/Loadingscreens/178.jpg and /dev/null differ diff --git a/Loadingscreens/427.jpg b/Loadingscreens/427.jpg new file mode 100644 index 000000000..b49b20921 Binary files /dev/null and b/Loadingscreens/427.jpg differ diff --git a/Loadingscreens/loadingscreens.ini b/Loadingscreens/loadingscreens.ini index 219640c68..e65ddbac2 100644 --- a/Loadingscreens/loadingscreens.ini +++ b/Loadingscreens/loadingscreens.ini @@ -84,15 +84,6 @@ align y = bottom text1 = SCP-173 is constructed from concrete and rebar with traces of Krylon brand spray paint. It is animate and extremely hostile. text2 = The object cannot move while within a direct line of sight. Line of sight must not be broken at any time with SCP-173. Personnel assigned to enter container are instructed to alert one another before blinking. -[SCP-178] -image path = 178.jpg -align x = left -align y = top -disablebackground = true -text1 = SCP-178 is a pair of white stereoscopic ("3-D") glasses with a rectangular white cardboard frame and lenses of transparent blue and red (left and right lenses, respectively) plastic. The item exhibits no unusual physical properties apart from a slight discoloration of the cardboard consistent with age. -text2 = When worn, the wearer begins perceiving large bipedal entities in addition to its ordinary surroundings. Entities reportedly exhibit a docile and occasionally curious behavior, with one exception. -text3 = Any attempt by the wearer or any other personnel to directly interact with the entities results in severe lacerations suddenly appearing on persons involved. - [SCP-205] image path = 205.jpg align x = right @@ -119,6 +110,16 @@ text1 = SCP-372 is a creature of unknown genus, approximately 6.5 ft long from h text2 = SCP-372 has learned to predict the movements of any being around it, and uses this technique to hide behind the head of a person looking for it, or in any of their blind spots. text3 = In the event of a containment breach, all personnel are advised to report any brief flickering movements in the corner of their eyes. +[SCP-427] +image path = 427.jpg +align x = center +align y = bottom +disablebackground = true +text1 = SCP-427 is a small, spherical, ornately carved locket made of a polished silver material. The ornate carvings do not seem to serve any function. +text2 = SCP-427 was created after placing a pill of SCP-500 in the Input booth of SCP-914 and using the Fine setting. It displays no unusual activity when closed. When SCP-427 is opened and exposed to biological tissue, it rapidly regenerates cellular damage and somehow is able to purge invading compounds or infections. +text3 = However, long-term exposure produces a significant health hazard. As the locket heals damage, it optimizes the body's natural systems. Class-D personnel exposed to the device for over an hour total began mutating into a shapeless mass of tissue. +text4 = The "Flesh Beasts" created by SCP-427 are incredibly aggressive, attacking any and all personnel on sight with lethal results. They are highly resistant to most known weaponry. + [SCP-500] image path = 500.jpg align x = right diff --git a/Main.bb b/Main.bb index 518d7b562..363057bce 100644 --- a/Main.bb +++ b/Main.bb @@ -42,8 +42,8 @@ Global UpdaterFont% Global Font1%, Font2%, Font3%, Font4%, Font5% Global ConsoleFont% -Global VersionNumber$ = "1.3.9" -Global CompatibleNumber$ = "1.3.9" ;Only change this if the version given isn't working with the current build version - ENDSHN +Global VersionNumber$ = "1.3.10" +Global CompatibleNumber$ = "1.3.10" ;Only change this if the version given isn't working with the current build version - ENDSHN Global MenuWhite%, MenuBlack% Global ButtonSFX% @@ -290,7 +290,7 @@ Global SCP1025state#[6] Global HeartBeatRate#, HeartBeatTimer#, HeartBeatVolume# -Global WearingGasMask%, WearingHazmat%, WearingVest%, Wearing714%, WearingNightVision%, Wearing178% +Global WearingGasMask%, WearingHazmat%, WearingVest%, Wearing714%, WearingNightVision% Global NVTimer# Global SuperMan%, SuperManTimer# @@ -315,7 +315,7 @@ Global MouseHit1%, MouseDown1%, MouseHit2%, DoubleClick%, LastMouseHit1%, MouseU Global GodMode%, NoClip%, NoClipSpeed# = 2.0 -Global CoffinDistance# +Global CoffinDistance# = 100.0 Global PlayerSoundVolume# @@ -405,11 +405,11 @@ Function UpdateConsole() If ConsoleOpen Then Local cm.ConsoleMsg - + AASetFont ConsoleFont ConsoleR = 255 : ConsoleG = 255 : ConsoleB = 255 - + Local x% = 0, y% = GraphicHeight-300*MenuScale, width% = GraphicWidth, height% = 300*MenuScale-30*MenuScale Local StrTemp$, temp%, i% Local ev.Events, r.Rooms, it.Items @@ -1421,20 +1421,39 @@ Function UpdateConsole() CreateConsoleMsg("Achievement with ID "+Int(StrTemp)+" doesn't exist.",255,150,0) EndIf ;[End Block] - Case Chr($6A)+Chr($6F)+Chr($72)+Chr($67)+Chr($65) + Case "427state" ;[Block] - ConsoleFlush = True - - If ConsoleFlushSnd = 0 Then - ConsoleFlushSnd = LoadSound(Chr(83)+Chr(70)+Chr(88)+Chr(92)+Chr(83)+Chr(67)+Chr(80)+Chr(92)+Chr(57)+Chr(55)+Chr(48)+Chr(92)+Chr(116)+Chr(104)+Chr(117)+Chr(109)+Chr(98)+Chr(115)+Chr(46)+Chr(100)+Chr(98)) - ;FMOD_Pause(MusicCHN) - ;FSOUND_Stream_Stop() - ConsoleMusFlush% = LoadSound(Chr(83)+Chr(70)+Chr(88)+Chr(92)+Chr(77)+Chr(117)+Chr(115)+Chr(105)+Chr(99)+Chr(92)+Chr(116)+Chr(104)+Chr(117)+Chr(109)+Chr(98)+Chr(115)+Chr(46)+Chr(100)+Chr(98)) - ConsoleMusPlay = PlaySound(ConsoleMusFlush) - CreateConsoleMsg(Chr(74)+Chr(79)+Chr(82)+Chr(71)+Chr(69)+Chr(32)+Chr(72)+Chr(65)+Chr(83)+Chr(32)+Chr(66)+Chr(69)+Chr(69)+Chr(78)+Chr(32)+Chr(69)+Chr(88)+Chr(80)+Chr(69)+Chr(67)+Chr(84)+Chr(73)+Chr(78)+Chr(71)+Chr(32)+Chr(89)+Chr(79)+Chr(85)+Chr(46)) - Else - CreateConsoleMsg(Chr(74)+Chr(32)+Chr(79)+Chr(32)+Chr(82)+Chr(32)+Chr(71)+Chr(32)+Chr(69)+Chr(32)+Chr(32)+Chr(67)+Chr(32)+Chr(65)+Chr(32)+Chr(78)+Chr(32)+Chr(78)+Chr(32)+Chr(79)+Chr(32)+Chr(84)+Chr(32)+Chr(32)+Chr(66)+Chr(32)+Chr(69)+Chr(32)+Chr(32)+Chr(67)+Chr(32)+Chr(79)+Chr(32)+Chr(78)+Chr(32)+Chr(84)+Chr(32)+Chr(65)+Chr(32)+Chr(73)+Chr(32)+Chr(78)+Chr(32)+Chr(69)+Chr(32)+Chr(68)+Chr(46)) - EndIf + StrTemp$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " "))) + + I_427\Timer = Float(StrTemp)*70.0 + ;[End Block] + Case "teleport106" + ;[Block] + Curr106\State = 0 + Curr106\Idle = False + ;[End Block] + Case "setblinkeffect" + ;[Block] + args$ = Lower(Right(ConsoleInput, Len(ConsoleInput) - Instr(ConsoleInput, " "))) + BlinkEffect = Float(Left(args, Len(args) - Instr(args, " "))) + BlinkEffectTimer = Float(Right(args, Len(args) - Instr(args, " "))) + CreateConsoleMsg("Set BlinkEffect to: " + BlinkEffect + "and BlinkEffect timer: " + BlinkEffectTimer) + ;[End Block] + Case "jorge" + ;[Block] + CreateConsoleMsg(Chr(74)+Chr(79)+Chr(82)+Chr(71)+Chr(69)+Chr(32)+Chr(72)+Chr(65)+Chr(83)+Chr(32)+Chr(66)+Chr(69)+Chr(69)+Chr(78)+Chr(32)+Chr(69)+Chr(88)+Chr(80)+Chr(69)+Chr(67)+Chr(84)+Chr(73)+Chr(78)+Chr(71)+Chr(32)+Chr(89)+Chr(79)+Chr(85)+Chr(46)) +; Return +; ConsoleFlush = True +; +; If ConsoleFlushSnd = 0 Then +; ConsoleFlushSnd = LoadSound(Chr(83)+Chr(70)+Chr(88)+Chr(92)+Chr(83)+Chr(67)+Chr(80)+Chr(92)+Chr(57)+Chr(55)+Chr(48)+Chr(92)+Chr(116)+Chr(104)+Chr(117)+Chr(109)+Chr(98)+Chr(115)+Chr(46)+Chr(100)+Chr(98)) +; ;FMOD_Pause(MusicCHN) +; ;FSOUND_Stream_Stop() +; ConsoleMusFlush% = LoadSound(Chr(83)+Chr(70)+Chr(88)+Chr(92)+Chr(77)+Chr(117)+Chr(115)+Chr(105)+Chr(99)+Chr(92)+Chr(116)+Chr(104)+Chr(117)+Chr(109)+Chr(98)+Chr(115)+Chr(46)+Chr(100)+Chr(98)) +; ConsoleMusPlay = PlaySound(ConsoleMusFlush) +; Else +; CreateConsoleMsg(Chr(74)+Chr(32)+Chr(79)+Chr(32)+Chr(82)+Chr(32)+Chr(71)+Chr(32)+Chr(69)+Chr(32)+Chr(32)+Chr(67)+Chr(32)+Chr(65)+Chr(32)+Chr(78)+Chr(32)+Chr(78)+Chr(32)+Chr(79)+Chr(32)+Chr(84)+Chr(32)+Chr(32)+Chr(66)+Chr(32)+Chr(69)+Chr(32)+Chr(32)+Chr(67)+Chr(32)+Chr(79)+Chr(32)+Chr(78)+Chr(32)+Chr(84)+Chr(32)+Chr(65)+Chr(32)+Chr(73)+Chr(32)+Chr(78)+Chr(32)+Chr(69)+Chr(32)+Chr(68)+Chr(46)) +; EndIf ;[End Block] Default ;[Block] @@ -1562,6 +1581,7 @@ Music(21) = "..\Ending\MenuBreath" Music(22) = "914" Music(23) = "Ending" Music(24) = "Credits" +Music(25) = "SaveMeFrom" Global MusicVolume# = GetINIFloat(OptionFile, "audio", "music volume") ;Global MusicCHN% = StreamSound_Strict("SFX\Music\"+Music(2)+".ogg", MusicVolume, CurrMusicStream) @@ -1613,6 +1633,7 @@ DrawLoading(20, True) Dim RustleSFX%(3) +Global Use914SFX% Global Death914SFX% Dim DripSFX%(4) @@ -1641,7 +1662,7 @@ AmbientSFXAmount(5)=10 Dim AmbientSFX%(6, 15) -Dim OldManSFX%(6) +Dim OldManSFX%(8) Dim Scp173SFX%(3) @@ -1658,7 +1679,7 @@ Dim IntroSFX%(20) Dim AlarmSFX%(5) -Dim CommotionState%(23) +Dim CommotionState%(25) Global HeartBeatSFX @@ -1833,15 +1854,19 @@ Type Doors Field MTFClose% = True Field NPCCalledElevator% = False + + Field DoorHitOBJ% End Type Dim BigDoorOBJ(2), HeavyDoorObj(2) Dim OBJTunnel(7) -Function CreateDoor.Doors(lvl, x#, y#, z#, angle#, room.Rooms, dopen% = False, big% = False, keycard% = False, code$="") +Function CreateDoor.Doors(lvl, x#, y#, z#, angle#, room.Rooms, dopen% = False, big% = False, keycard% = False, code$="", useCollisionMesh% = False) Local d.Doors, parent, i% If room <> Null Then parent = room\obj + Local d2.Doors + d.Doors = New Doors If big=1 Then d\obj = CopyEntity(BigDoorOBJ(0)) @@ -1853,12 +1878,29 @@ Function CreateDoor.Doors(lvl, x#, y#, z#, angle#, room.Rooms, dopen% = False, ScaleEntity(d\frameobj, RoomScale, RoomScale, RoomScale) EntityType d\frameobj, HIT_MAP EntityAlpha d\frameobj, 0.0 - ElseIf big=2 + ElseIf big=2 Then d\obj = CopyEntity(HeavyDoorObj(0)) ScaleEntity(d\obj, RoomScale, RoomScale, RoomScale) d\obj2 = CopyEntity(HeavyDoorObj(1)) ScaleEntity(d\obj2, RoomScale, RoomScale, RoomScale) + d\frameobj = CopyEntity(DoorFrameOBJ) + ElseIf big=3 Then + For d2 = Each Doors + If d2 <> d And d2\dir = 3 Then + d\obj = CopyEntity(d2\obj) + d\obj2 = CopyEntity(d2\obj2) + ScaleEntity d\obj, RoomScale, RoomScale, RoomScale + ScaleEntity d\obj2, RoomScale, RoomScale, RoomScale + Exit + EndIf + Next + If d\obj=0 Then + d\obj = LoadMesh_Strict("GFX\map\elevatordoor.b3d") + d\obj2 = CopyEntity(d\obj) + ScaleEntity d\obj, RoomScale, RoomScale, RoomScale + ScaleEntity d\obj2, RoomScale, RoomScale, RoomScale + EndIf d\frameobj = CopyEntity(DoorFrameOBJ) Else d\obj = CopyEntity(DoorOBJ) @@ -1954,6 +1996,30 @@ Function CreateDoor.Doors(lvl, x#, y#, z#, angle#, room.Rooms, dopen% = False, d\MTFClose = True + If useCollisionMesh Then + For d2.Doors = Each Doors + If d2 <> d Then + If d2\DoorHitOBJ <> 0 Then + d\DoorHitOBJ = CopyEntity(d2\DoorHitOBJ,d\frameobj) + EntityAlpha d\DoorHitOBJ,0.0 + EntityFX d\DoorHitOBJ,1 + EntityType d\DoorHitOBJ,HIT_MAP + EntityColor d\DoorHitOBJ,255,0,0 + HideEntity d\DoorHitOBJ + Exit + EndIf + EndIf + Next + If d\DoorHitOBJ=0 Then + d\DoorHitOBJ = LoadMesh_Strict("GFX\doorhit.b3d",d\frameobj) + EntityAlpha d\DoorHitOBJ,0.0 + EntityFX d\DoorHitOBJ,1 + EntityType d\DoorHitOBJ,HIT_MAP + EntityColor d\DoorHitOBJ,255,0,0 + HideEntity d\DoorHitOBJ + EndIf + EndIf + Return d End Function @@ -2015,7 +2081,7 @@ Function UpdateDoors() ClosestDoor = Null For d.Doors = Each Doors - If d\dist < HideDistance*2 Then + If d\dist < HideDistance*2 Or d\IsElevatorDoor>0 Then ;Make elevator doors update everytime because if not, this can cause a bug where the elevators suddenly won't work, most noticeable in room2tunnel - ENDSHN If (d\openstate >= 180 Or d\openstate <= 0) And GrabbedEntity = 0 Then For i% = 0 To 1 @@ -2061,7 +2127,14 @@ Function UpdateDoors() Case 2 d\openstate = Min(180, d\openstate + FPSfactor * 2 * (d\fastopen+1)) MoveEntity(d\obj, Sin(d\openstate) * (d\fastopen+1) * FPSfactor / 85.0, 0, 0) - If d\obj2 <> 0 Then MoveEntity(d\obj2, Sin(d\openstate)* (d\fastopen*2+1) * FPSfactor / 120.0, 0, 0) + If d\obj2 <> 0 Then MoveEntity(d\obj2, Sin(d\openstate)* (d\fastopen*2+1) * FPSfactor / 120.0, 0, 0) + Case 3 + d\openstate = Min(180, d\openstate + FPSfactor * 2 * (d\fastopen+1)) + MoveEntity(d\obj, Sin(d\openstate) * (d\fastopen*2+1) * FPSfactor / 162.0, 0, 0) + If d\obj2 <> 0 Then MoveEntity(d\obj2, Sin(d\openstate)* (d\fastopen*2+1) * FPSfactor / 162.0, 0, 0) + Case 4 ;Used for 914 only + d\openstate = Min(180, d\openstate + FPSfactor * 1.4) + MoveEntity(d\obj, Sin(d\openstate) * FPSfactor / 114.0, 0, 0) End Select Else d\fastopen = 0 @@ -2069,19 +2142,19 @@ Function UpdateDoors() If d\obj2 <> 0 Then ResetEntity(d\obj2) If d\timerstate > 0 Then d\timerstate = Max(0, d\timerstate - FPSfactor) - If d\timerstate + FPSfactor > 110 And d\timerstate <= 110 Then PlaySound2(CautionSFX, Camera, d\obj) + If d\timerstate + FPSfactor > 110 And d\timerstate <= 110 Then d\SoundCHN = PlaySound2(CautionSFX, Camera, d\obj) ;If d\timerstate = 0 Then d\open = (Not d\open) : PlaySound2(CloseDoorSFX(Min(d\dir,1),Rand(0, 2)), Camera, d\obj) Local sound% If d\dir = 1 Then sound% = Rand(0, 1) Else sound% = Rand(0, 2) - If d\timerstate = 0 Then d\open = (Not d\open) : PlaySound2(CloseDoorSFX(d\dir,sound%), Camera, d\obj) + If d\timerstate = 0 Then d\open = (Not d\open) : d\SoundCHN = PlaySound2(CloseDoorSFX(d\dir,sound%), Camera, d\obj) EndIf If d\AutoClose And RemoteDoorOn = True Then If EntityDistance(Camera, d\obj) < 2.1 Then If (Not Wearing714) Then PlaySound_Strict HorrorSFX(7) - d\open = False : PlaySound2(CloseDoorSFX(Min(d\dir,1), Rand(0, 2)), Camera, d\obj) : d\AutoClose = False + d\open = False : d\SoundCHN = PlaySound2(CloseDoorSFX(Min(d\dir,1), Rand(0, 2)), Camera, d\obj) : d\AutoClose = False EndIf - End If - End If + EndIf + EndIf Else If d\openstate > 0 Then Select d\dir @@ -2120,6 +2193,13 @@ Function UpdateDoors() d\openstate = Max(0, d\openstate - FPSfactor * 2 * (d\fastopen+1)) MoveEntity(d\obj, Sin(d\openstate) * -FPSfactor * (d\fastopen+1) / 85.0, 0, 0) If d\obj2 <> 0 Then MoveEntity(d\obj2, Sin(d\openstate) * (d\fastopen+1) * -FPSfactor / 120.0, 0, 0) + Case 3 + d\openstate = Max(0, d\openstate - FPSfactor * 2 * (d\fastopen+1)) + MoveEntity(d\obj, Sin(d\openstate) * -FPSfactor * (d\fastopen+1) / 162.0, 0, 0) + If d\obj2 <> 0 Then MoveEntity(d\obj2, Sin(d\openstate) * (d\fastopen+1) * -FPSfactor / 162.0, 0, 0) + Case 4 ;Used for 914 only + d\openstate = Min(180, d\openstate - FPSfactor * 1.4) + MoveEntity(d\obj, Sin(d\openstate) * -FPSfactor / 114.0, 0, 0) End Select If d\angle = 0 Or d\angle=180 Then @@ -2138,6 +2218,9 @@ Function UpdateDoors() EndIf EndIf + If d\DoorHitOBJ <> 0 Then + ShowEntity d\DoorHitOBJ + EndIf Else d\fastopen = 0 PositionEntity(d\obj, EntityX(d\frameobj, True), EntityY(d\frameobj, True), EntityZ(d\frameobj, True)) @@ -2145,22 +2228,35 @@ Function UpdateDoors() If d\obj2 <> 0 And d\dir = 0 Then MoveEntity(d\obj, 0, 0, 8.0 * RoomScale) MoveEntity(d\obj2, 0, 0, 8.0 * RoomScale) - EndIf - End If - End If + EndIf + If d\DoorHitOBJ <> 0 Then + HideEntity d\DoorHitOBJ + EndIf + EndIf + EndIf EndIf + UpdateSoundOrigin(d\SoundCHN,Camera,d\frameobj) + If d\DoorHitOBJ<>0 Then + If DebugHUD Then + EntityAlpha d\DoorHitOBJ,0.5 + Else + EntityAlpha d\DoorHitOBJ,0.0 + EndIf + EndIf Next End Function -Function UseDoor(d.Doors, showmsg%=True) +Function UseDoor(d.Doors, showmsg%=True, playsfx%=True) Local temp% = 0 If d\KeyCard > 0 Then If SelectedItem = Null Then - If showmsg = True Then - Msg = "A keycard is required to operate this door." - MsgTimer = 70 * 5 + If showmsg = True Then + If (Instr(Msg,"The keycard")=0 And Instr(Msg,"A keycard with")=0) Or (MsgTimer<70*3) Then + Msg = "A keycard is required to operate this door." + MsgTimer = 70 * 7 + EndIf EndIf Return Else @@ -2182,9 +2278,11 @@ Function UseDoor(d.Doors, showmsg%=True) End Select If temp =-1 Then - If showmsg = True Then - Msg = "A keycard is required to operate this door." - MsgTimer = 70 * 5 + If showmsg = True Then + If (Instr(Msg,"The keycard")=0 And Instr(Msg,"A keycard with")=0) Or (MsgTimer<70*3) Then + Msg = "A keycard is required to operate this door." + MsgTimer = 70 * 7 + EndIf EndIf Return ElseIf temp >= d\KeyCard @@ -2193,12 +2291,12 @@ Function UseDoor(d.Doors, showmsg%=True) If d\locked Then PlaySound_Strict KeyCardSFX2 Msg = "The keycard was inserted into the slot but nothing happened." - MsgTimer = 70 * 5 + MsgTimer = 70 * 7 Return Else PlaySound_Strict KeyCardSFX1 Msg = "The keycard was inserted into the slot." - MsgTimer = 70 * 5 + MsgTimer = 70 * 7 EndIf EndIf Else @@ -2208,9 +2306,9 @@ Function UseDoor(d.Doors, showmsg%=True) If d\locked Then Msg = "The keycard was inserted into the slot but nothing happened." Else - Msg = "A keycard with a higher security clearance is required to operate this door." + Msg = "A keycard with security clearance "+d\KeyCard+" or higher is required to operate this door." EndIf - MsgTimer = 70 * 5 + MsgTimer = 70 * 7 EndIf Return End If @@ -2223,7 +2321,9 @@ Function UseDoor(d.Doors, showmsg%=True) SelectedItem = Null If temp <> 0 Then PlaySound_Strict ScannerSFX1 - Msg = "You place the palm of the hand onto the scanner. The scanner reads: "+Chr(34)+"DNA verified. Access granted."+Chr(34) + If (Instr(Msg,"You placed your")=0) Or (MsgTimer < 70*3) Then + Msg = "You place the palm of the hand onto the scanner. The scanner reads: "+Chr(34)+"DNA verified. Access granted."+Chr(34) + EndIf MsgTimer = 70 * 10 Else If showmsg = True Then @@ -2239,15 +2339,22 @@ Function UseDoor(d.Doors, showmsg%=True) If Not (d\IsElevatorDoor>0) Then PlaySound_Strict ButtonSFX2 If PlayerRoom\RoomTemplate\Name <> "room2elevator" Then - Msg = "The door appears to be locked." - Else - Msg = "The elevator appears to be broken." - EndIf + If d\open Then + Msg = "You pushed the button but nothing happened." + Else + Msg = "The door appears to be locked." + EndIf + Else + Msg = "The elevator appears to be broken." + EndIf MsgTimer = 70 * 5 Else If d\IsElevatorDoor = 1 Then Msg = "You called the elevator." MsgTimer = 70 * 5 + ElseIf d\IsElevatorDoor = 3 Then + Msg = "The elevator is already on this floor." + MsgTimer = 70 * 5 ElseIf (Msg<>"You called the elevator.") If (Msg="You already called the elevator.") Or (MsgTimer<70*3) Select Rand(10) @@ -2283,14 +2390,21 @@ Function UseDoor(d.Doors, showmsg%=True) ;If d\dir = 1 Then sound = 0 Else sound=Rand(0, 2) If d\dir = 1 Then sound=Rand(0, 1) Else sound=Rand(0, 2) - If d\open Then - If d\LinkedDoor <> Null Then d\LinkedDoor\timerstate = d\LinkedDoor\timer - d\timerstate = d\timer - d\SoundCHN = PlaySound2 (OpenDoorSFX(d\dir, sound), Camera, d\obj) + If playsfx=True Then + If d\open Then + If d\LinkedDoor <> Null Then d\LinkedDoor\timerstate = d\LinkedDoor\timer + d\timerstate = d\timer + d\SoundCHN = PlaySound2 (OpenDoorSFX(d\dir, sound), Camera, d\obj) + Else + d\SoundCHN = PlaySound2 (CloseDoorSFX(d\dir, sound), Camera, d\obj) + EndIf + UpdateSoundOrigin(d\SoundCHN,Camera,d\obj) Else - d\SoundCHN = PlaySound2 (CloseDoorSFX(d\dir, sound), Camera, d\obj) - End If - + If d\open Then + If d\LinkedDoor <> Null Then d\LinkedDoor\timerstate = d\LinkedDoor\timer + d\timerstate = d\timer + EndIf + EndIf End Function @@ -2304,6 +2418,8 @@ Function RemoveDoor(d.Doors) If d\buttons[0] <> 0 Then FreeEntity d\buttons[0] If d\buttons[1] <> 0 Then FreeEntity d\buttons[1] + If d\DoorHitOBJ <> 0 Then FreeEntity d\DoorHitOBJ + Delete d End Function @@ -2413,7 +2529,6 @@ Function InitEvents() CreateEvent("room2fan", "room2_2", 0, 1.0) CreateEvent("room2elevator2", "room2elevator", 0) - ;CreateEvent("room2elevator", "room2elevator", 0, 1) CreateEvent("room2elevator", "room2elevator", Rand(1,2)) CreateEvent("room3storage", "room3storage", 0, 0) @@ -2503,8 +2618,8 @@ Function InitEvents() CreateEvent("914", "914", 0, 0) - CreateEvent("toiletguard", "room2toilets", 1) - CreateEvent("buttghost", "room2toilets", 0, 0.8) + CreateEvent("buttghost", "room2toilets", 0, 0) + CreateEvent("toiletguard", "room2toilets", 1, 0) CreateEvent("room2pipes106", "room2pipes", Rand(0, 3)) @@ -2546,6 +2661,7 @@ Function InitEvents() CreateEvent("room_gw","room3gw",0,1.0) CreateEvent("room2sl","room2sl",0) CreateEvent("medibay","medibay",0) + CreateEvent("room2shaft","room2shaft",0) CreateEvent("room2gw_b","room2gw_b",Rand(0,1)) @@ -2565,6 +2681,8 @@ Function InitEvents() CreateEvent("room2pit106", "room2pit", 0, 0.07 + (0.1*SelectedDifficulty\aggressiveNPCs)) + CreateEvent("room1archive", "room1archive", 0, 1.0) + End Function Include "UpdateEvents.bb" @@ -2600,8 +2718,6 @@ Global InfectTexture%, InfectOverlay% Global DarkTexture%, Dark% Global Collider%, Head% -Global GlassesTexture%, GlassesOverlay% - Global FogNVTexture% Global NVTexture%, NVOverlay% @@ -2668,6 +2784,24 @@ Global CurrTrisAmount% Global Input_ResetTime# = 0 +Type SCP427 + Field Using% + Field Timer# + Field Sound[1] + Field SoundCHN[1] +End Type + +Global I_427.SCP427 = New SCP427 + +Type MapZones + Field Transition%[1] + Field HasCustomForest% + Field HasCustomMT% +End Type + +Global I_Zone.MapZones = New MapZones + + ;---------------------------------------------------------------------------------------------------------------------------------------------------- ;---------------------------------------------- MAIN LOOP --------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------------------------------------------------------- @@ -2791,6 +2925,7 @@ Repeat AmbientSFXCHN = PlaySound2(AmbientSFX(PlayerZone,CurrAmbientSFX), Camera, SoundEmitter) EndIf + UpdateSoundOrigin(AmbientSFXCHN,Camera, SoundEmitter) If Rand(50000) = 3 Then Local RN$ = PlayerRoom\RoomTemplate\Name$ @@ -2810,6 +2945,9 @@ Repeat CameraFogColor(Camera, 0,0,0) CameraFogMode Camera,1 CameraRange(Camera, 0.05, Min(CameraFogFar*LightVolume*1.5,28)) + If PlayerRoom\RoomTemplate\Name<>"pocketdimension" Then + CameraClsColor(Camera, 0,0,0) + EndIf AmbientLight Brightness, Brightness, Brightness PlayerSoundVolume = CurveValue(0.0, PlayerSoundVolume, 5.0) @@ -2850,6 +2988,8 @@ Repeat UpdateNPCs() UpdateItems() UpdateParticles() + Use427() + UpdateMonitorSaving() ;Added a simple code for updating the Particles function depending on the FPSFactor (still WIP, might not be the final version of it) - ENDSHN UpdateParticles_Time# = Min(1,UpdateParticles_Time#+FPSfactor) If UpdateParticles_Time#=1 @@ -2994,17 +3134,25 @@ Repeat ;[End block] - If KeyHit(KEY_INV) And VomitTimer >= 0 - If (Not UnableToMove) And (Not IsZombie) - If InvOpen Then - ResumeSounds() - MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 - Else - PauseSounds() + If KeyHit(KEY_INV) And VomitTimer >= 0 Then + If (Not UnableToMove) And (Not IsZombie) And (Not Using294) Then + Local W$ = "" + Local V# = 0 + If SelectedItem<>Null + W$ = SelectedItem\itemtemplate\tempname + V# = SelectedItem\state + EndIf + If (W<>"vest" And W<>"finevest" And W<>"hazmatsuit" And W<>"hazmatsuit2" And W<>"hazmatsuit3") Or V=0 Or V=100 + If InvOpen Then + ResumeSounds() + MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 + Else + PauseSounds() + EndIf + InvOpen = Not InvOpen + If OtherOpen<>Null Then OtherOpen=Null + SelectedItem = Null EndIf - InvOpen = Not InvOpen - If OtherOpen<>Null Then OtherOpen=Null - SelectedItem = Null EndIf EndIf @@ -3093,6 +3241,22 @@ Repeat UpdateConsole() + If PlayerRoom <> Null Then + If PlayerRoom\RoomTemplate\Name = "173" Then + For e.Events = Each Events + If e\EventName = "173" Then + If e\EventState3 => 40 And e\EventState3 < 50 Then + If InvOpen Then + Msg = "Double click on the document to view it." + MsgTimer=70*7 + e\EventState3 = 50 + EndIf + EndIf + EndIf + Next + EndIf + EndIf + If MsgTimer > 0 Then Local temp% = False If (Not InvOpen%) @@ -3210,170 +3374,6 @@ Function QuickLoadEvents() Case "room2sl" ;[Block] If e\EventState = 0 And e\EventStr <> "" - For r.Rooms = Each Rooms - If ValidRoom2slCamRoom(r) - For sc.SecurityCams = Each SecurityCams - If sc\room = r And (Not sc\SpecialCam) - Local HasCamera% = False - For sc2.SecurityCams = Each SecurityCams - If sc2\room <> sc\room And (Not sc2\SpecialCam) - If sc2\room\RoomTemplate\Name = sc\room\RoomTemplate\Name - If sc2\Screen - HasCamera% = True - DebugLog "HasCamera% = True ("+Chr(34)+sc2\room\RoomTemplate\Name+Chr(34)+")" - Exit - EndIf - EndIf - EndIf - Next - If (Not HasCamera%) Then - If Left(e\EventStr,4) <> "load" - DebugLog "### "+Int(e\EventStr) - If Int(e\EventStr)=sc\ID - sc\Screen = True - sc\AllowSaving = False - - sc\RenderInterval = 12 - - scale# = RoomScale * 4.5 * 0.4 - - sc\ScrObj = CreateSprite() - EntityFX sc\ScrObj, 17 - SpriteViewMode(sc\ScrObj, 2) - sc\ScrTexture = 0 - ;EntityTexture sc\ScrObj, ScreenTexs[sc\ScrTexture] - ScaleSprite(sc\ScrObj, MeshWidth(Monitor) * scale * 0.95* 0.5, MeshHeight(Monitor) * scale * 0.95* 0.5) - - sc\ScrOverlay = CreateSprite(sc\ScrObj) - - ScaleSprite(sc\ScrOverlay, MeshWidth(Monitor) * scale * 0.95 * 0.5, MeshHeight(Monitor) * scale * 0.95 * 0.5) - MoveEntity(sc\ScrOverlay, 0, 0, -0.0005) - EntityTexture(sc\ScrOverlay, MonitorTexture) - SpriteViewMode(sc\ScrOverlay, 2) - EntityBlend(sc\ScrOverlay , 3) - - sc\MonitorObj = CopyEntity(Monitor, sc\ScrObj) - - ScaleEntity(sc\MonitorObj, scale, scale, scale) - - sc\Cam = CreateCamera() - CameraViewport(sc\Cam, 0, 0, 512, 512) - CameraRange sc\Cam, 0.05, 6.0 - CameraZoom(sc\Cam, 0.8) - HideEntity(sc\Cam) - - sc\IsRoom2slCam = True - sc\Room2slTexs%[0] = CreateTexture(128, 128, 1+256) - EntityTexture sc\ScrObj, sc\Room2slTexs%[0] - sc\RenderInterval = 666 - sc\turn = 0 - - pvt% = CreatePivot(e\room\obj) - Select r\RoomTemplate\Name$ - Case "room2closets" ;ID=0 q - PositionEntity pvt%,-207.94,872.0,-60.0686,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 105+e\room\angle, 0) - sc\Room2slID = 0 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room2closets"+Chr(34) - Case "room1archive" ;ID=1 q - PositionEntity pvt%,-231.489,872.0,95.7443,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 90+e\room\angle, 0) - sc\Room2slID = 1 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room1archive"+Chr(34) - Case "room3z3" ;ID=2 q - PositionEntity pvt%,-231.489,872.0,255.744,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 90+e\room\angle, 0) - sc\Room2slID = 2 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room3z3"+Chr(34) - Case "room1lifts" ;ID=3 q - PositionEntity pvt%,-231.489,872.0,415.744,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 90+e\room\angle, 0) - sc\Room2slID = 3 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room1lifts"+Chr(34) - ;ID=4 q (it was room106) - Case "checkpoint1" ;ID=5 q - PositionEntity pvt%,-207.94,760.0,-60.0686,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 105+e\room\angle, 0) - sc\Room2slID = 5 - sc\RenderInterval = 12 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"checkpoint1"+Chr(34) - Case "room2nuke" ;ID=6 q - PositionEntity pvt%,-231.489,760.0,415.744,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 90+e\room\angle, 0) - sc\Room2slID = 6 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room2nuke"+Chr(34) - Case "008" ;ID=7 q - PositionEntity pvt%,-208.138,760.0,571.583,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 75+e\room\angle, 0) - sc\Room2slID = 7 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"008"+Chr(34) - Case "room1162" ;ID=8 q - PositionEntity pvt%,-207.94,648.0,-60.0686,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 105+e\room\angle, 0) - sc\Room2slID = 8 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room1162"+Chr(34) - Case "room966" ;ID=9 q - PositionEntity pvt%,-231.489,648.0,255.744,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 90+e\room\angle, 0) - sc\Room2slID = 9 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room966"+Chr(34) - Case "room2ccont" ;ID=10 q - PositionEntity pvt%,-231.489,648.0,415.744,False - PositionEntity(sc\ScrObj,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True)) - EntityParent(sc\ScrObj, e\room\obj) - TurnEntity(sc\ScrObj, 0, 90+e\room\angle, 0) - sc\Room2slID = 10 - FreeEntity sc\Cam - FindAndDeleteFakeMonitor(e\room,EntityX(pvt%,True),EntityY(pvt%,True),EntityZ(pvt%,True),14) - DebugLog "Created Monitor for "+Chr(34)+"room2ccont"+Chr(34) - End Select - - FreeEntity pvt% - - Exit - EndIf - EndIf - EndIf - EndIf - Next - EndIf - Next If e\EventStr <> "" And Left(e\EventStr,4) <> "load" QuickLoadPercent = QuickLoadPercent + 5 If Int(e\EventStr) > 9 @@ -3801,7 +3801,7 @@ Function DrawEnding() Next AAText x, y, "SCPs encountered: " +scpsEncountered - AAText x, y+20*MenuScale, "Achievements unlocked: " + achievementsUnlocked+"/"+(MAXACHIEVEMENTS-1) + AAText x, y+20*MenuScale, "Achievements unlocked: " + achievementsUnlocked+"/"+(MAXACHIEVEMENTS) AAText x, y+40*MenuScale, "Rooms found: " + roomsfound+"/"+roomamount AAText x, y+60*MenuScale, "Documents discovered: " +docsfound+"/"+docamount AAText x, y+80*MenuScale, "Items refined in SCP-914: " +RefinedItems @@ -4288,10 +4288,12 @@ Function MovePlayer() If Injuries > 1.0 Then temp2 = Bloodloss BlurTimer = Max(Max(Sin(MilliSecs2()/100.0)*Bloodloss*30.0,Bloodloss*2*(2.0-CrouchState)),BlurTimer) - Bloodloss = Min(Bloodloss + (Min(Injuries,3.5)/300.0)*FPSfactor,100) + If (Not I_427\Using And I_427\Timer < 70*360) Then + Bloodloss = Min(Bloodloss + (Min(Injuries,3.5)/300.0)*FPSfactor,100) + EndIf If temp2 <= 60 And Bloodloss > 60 Then - Msg = "You are feeling faint from the amount of blood you loss." + Msg = "You are feeling faint from the amount of blood you have lost." MsgTimer = 70*4 EndIf EndIf @@ -4516,61 +4518,6 @@ Function MouseLook() EntityTexture(Fog, FogTexture) EndIf - If Wearing178>0 Then - ShouldPlay = 14 - ShowEntity(GlassesOverlay) - Else - HideEntity(GlassesOverlay) - EndIf - - canSpawn178%=0 - - If Wearing178<>1 Then - For n.NPCs = Each NPCs - If (n\NPCtype = NPCtype178) Then - If n\State3>0 Then canSpawn178=1 - If (n\State<=0) And (n\State3=0) Then - RemoveNPC(n) - Else If EntityDistance(Collider,n\Collider)>HideDistance*1.5 Then - RemoveNPC(n) - EndIf - EndIf - Next - EndIf - - If (canSpawn178=1) Or (Wearing178=1) Then - tempint%=0 - For n.NPCs = Each NPCs - If (n\NPCtype = NPCtype178) Then - tempint=tempint+1 - If EntityDistance(Collider,n\Collider)>HideDistance*1.5 Then - RemoveNPC(n) - EndIf - ;If n\State<=0 Then RemoveNPC(n) - EndIf - Next - If tempint<10 Then ;create the npcs - For w.WayPoints = Each WayPoints - Local dist# - dist=EntityDistance(Collider,w\obj) - If (dist1.2) And (w\door = Null) And (Rand(0,1)=1) Then - tempint2=True - For n.NPCs = Each NPCs - If n\NPCtype=NPCtype178 Then - If EntityDistance(n\Collider,w\obj)<0.5 - tempint2=False - Exit - EndIf - EndIf - Next - If tempint2 Then - CreateNPC(NPCtype178, EntityX(w\obj,True),EntityY(w\obj,True)+0.15,EntityZ(w\obj,True)) - EndIf - EndIf - Next - EndIf - EndIf - For i = 0 To 5 If SCP1025state[i]>0 Then Select i @@ -4603,7 +4550,9 @@ Function MouseLook() Stamina = Stamina - FPSfactor * 0.1 Case 3 ;appendicitis ;0.035/sec = 2.1/min - SCP1025state[i]=SCP1025state[i]+FPSfactor*0.0005 + If (Not I_427\Using And I_427\Timer < 70*360) Then + SCP1025state[i]=SCP1025state[i]+FPSfactor*0.0005 + EndIf If SCP1025state[i]>20.0 Then If SCP1025state[i]-FPSfactor<=20.0 Then Msg="The pain in your stomach is becoming unbearable." Stamina = Stamina - FPSfactor * 0.3 @@ -4622,7 +4571,9 @@ Function MouseLook() CurrSpeed = CurveValue(0, CurrSpeed, 10+Stamina*15) EndIf Case 5;cardiac arrest - SCP1025state[i]=SCP1025state[i]+FPSfactor*0.35 + If (Not I_427\Using And I_427\Timer < 70*360) Then + SCP1025state[i]=SCP1025state[i]+FPSfactor*0.35 + EndIf ;35/sec If SCP1025state[i]>110 Then HeartBeatRate=0 @@ -4662,21 +4613,54 @@ Function DrawGUI() If PlayerRoom\RoomTemplate\Name = "pocketdimension" Then For e.Events = Each Events - If e\room = PlayerRoom And e\EventState > 600 Then - If BlinkTimer < -3 And BlinkTimer > -11 Then - If e\img = 0 Then - If BlinkTimer > -5 And Rand(30)=1 Then - If Rand(5)<5 Then PlaySound_Strict DripSFX(0) - If e\img = 0 Then e\img = LoadImage_Strict("GFX\npcs\106face.jpg") + If e\room = PlayerRoom Then + If Float(e\EventStr)<1000.0 Then + If e\EventState > 600 Then + If BlinkTimer < -3 And BlinkTimer > -10 Then + If e\img = 0 Then + If BlinkTimer > -5 And Rand(30)=1 Then + PlaySound_Strict DripSFX(0) + If e\img = 0 Then e\img = LoadImage_Strict("GFX\npcs\106face.jpg") + EndIf + Else + DrawImage e\img, GraphicWidth/2-Rand(390,310), GraphicHeight/2-Rand(290,310) + EndIf + Else + If e\img <> 0 Then FreeImage e\img : e\img = 0 EndIf - Else - DrawImage e\img, GraphicWidth/2-Rand(390,310), GraphicHeight/2-Rand(290,310) + + Exit EndIf Else - If e\img <> 0 Then FreeImage e\img : e\img = 0 - EndIf + If BlinkTimer < -3 And BlinkTimer > -10 Then + If e\img = 0 Then + If BlinkTimer > -5 Then + If e\img = 0 Then + e\img = LoadImage_Strict("GFX\kneelmortal.pd") + If (ChannelPlaying(e\SoundCHN)) Then + StopChannel(e\SoundCHN) + EndIf + e\SoundCHN = PlaySound_Strict(e\Sound) + EndIf + EndIf + Else + DrawImage e\img, GraphicWidth/2-Rand(390,310), GraphicHeight/2-Rand(290,310) + EndIf + Else + If e\img <> 0 Then FreeImage e\img : e\img = 0 + If BlinkTimer < -3 Then + If (Not ChannelPlaying(e\SoundCHN)) Then + e\SoundCHN = PlaySound_Strict(e\Sound) + EndIf + Else + If (ChannelPlaying(e\SoundCHN)) Then + StopChannel(e\SoundCHN) + EndIf + EndIf + EndIf - Exit + Exit + EndIf EndIf Next EndIf @@ -4804,38 +4788,39 @@ Function DrawGUI() AAText x - 50, 190, "state: " + ev\EventState AAText x - 50, 210, "state2: " + ev\EventState2 AAText x - 50, 230, "state3: " + ev\EventState3 + AAText x - 50, 250, "str: "+ ev\EventStr Exit EndIf Next - AAText x - 50, 250, "Room coordinates: (" + Floor(EntityX(PlayerRoom\obj) / 8.0 + 0.5) + ", " + Floor(EntityZ(PlayerRoom\obj) / 8.0 + 0.5) + ", angle: "+PlayerRoom\angle + ")" - AAText x - 50, 280, "Stamina: " + f2s(Stamina, 3) - AAText x - 50, 300, "Death timer: " + f2s(KillTimer, 3) - AAText x - 50, 320, "Blink timer: " + f2s(BlinkTimer, 3) - AAText x - 50, 340, "Injuries: " + Injuries - AAText x - 50, 360, "Bloodloss: " + Bloodloss + AAText x - 50, 280, "Room coordinates: (" + Floor(EntityX(PlayerRoom\obj) / 8.0 + 0.5) + ", " + Floor(EntityZ(PlayerRoom\obj) / 8.0 + 0.5) + ", angle: "+PlayerRoom\angle + ")" + AAText x - 50, 300, "Stamina: " + f2s(Stamina, 3) + AAText x - 50, 320, "Death timer: " + f2s(KillTimer, 3) + AAText x - 50, 340, "Blink timer: " + f2s(BlinkTimer, 3) + AAText x - 50, 360, "Injuries: " + Injuries + AAText x - 50, 380, "Bloodloss: " + Bloodloss If Curr173 <> Null - AAText x - 50, 390, "SCP - 173 Position (collider): (" + f2s(EntityX(Curr173\Collider), 3) + ", " + f2s(EntityY(Curr173\Collider), 3) + ", " + f2s(EntityZ(Curr173\Collider), 3) + ")" - AAText x - 50, 410, "SCP - 173 Position (obj): (" + f2s(EntityX(Curr173\obj), 3) + ", " + f2s(EntityY(Curr173\obj), 3) + ", " + f2s(EntityZ(Curr173\obj), 3) + ")" + AAText x - 50, 410, "SCP - 173 Position (collider): (" + f2s(EntityX(Curr173\Collider), 3) + ", " + f2s(EntityY(Curr173\Collider), 3) + ", " + f2s(EntityZ(Curr173\Collider), 3) + ")" + AAText x - 50, 430, "SCP - 173 Position (obj): (" + f2s(EntityX(Curr173\obj), 3) + ", " + f2s(EntityY(Curr173\obj), 3) + ", " + f2s(EntityZ(Curr173\obj), 3) + ")" ;Text x - 50, 410, "SCP - 173 Idle: " + Curr173\Idle - AAText x - 50, 430, "SCP - 173 State: " + Curr173\State + AAText x - 50, 450, "SCP - 173 State: " + Curr173\State EndIf If Curr106 <> Null - AAText x - 50, 450, "SCP - 106 Position: (" + f2s(EntityX(Curr106\obj), 3) + ", " + f2s(EntityY(Curr106\obj), 3) + ", " + f2s(EntityZ(Curr106\obj), 3) + ")" - AAText x - 50, 470, "SCP - 106 Idle: " + Curr106\Idle - AAText x - 50, 490, "SCP - 106 State: " + Curr106\State + AAText x - 50, 470, "SCP - 106 Position: (" + f2s(EntityX(Curr106\obj), 3) + ", " + f2s(EntityY(Curr106\obj), 3) + ", " + f2s(EntityZ(Curr106\obj), 3) + ")" + AAText x - 50, 490, "SCP - 106 Idle: " + Curr106\Idle + AAText x - 50, 510, "SCP - 106 State: " + Curr106\State EndIf offset% = 0 For npc.NPCs = Each NPCs If npc\NPCtype = NPCtype096 Then - AAText x - 50, 510, "SCP - 096 Position: (" + f2s(EntityX(npc\obj), 3) + ", " + f2s(EntityY(npc\obj), 3) + ", " + f2s(EntityZ(npc\obj), 3) + ")" - AAText x - 50, 530, "SCP - 096 Idle: " + npc\Idle - AAText x - 50, 550, "SCP - 096 State: " + npc\State - AAText x - 50, 570, "SCP - 096 Speed: " + f2s(npc\currspeed, 5) + AAText x - 50, 530, "SCP - 096 Position: (" + f2s(EntityX(npc\obj), 3) + ", " + f2s(EntityY(npc\obj), 3) + ", " + f2s(EntityZ(npc\obj), 3) + ")" + AAText x - 50, 550, "SCP - 096 Idle: " + npc\Idle + AAText x - 50, 570, "SCP - 096 State: " + npc\State + AAText x - 50, 590, "SCP - 096 Speed: " + f2s(npc\currspeed, 5) EndIf If npc\NPCtype = NPCtypeMTF Then - AAText x - 50, 600 + 60 * offset, "MTF " + offset + " Position: (" + f2s(EntityX(npc\obj), 3) + ", " + f2s(EntityY(npc\obj), 3) + ", " + f2s(EntityZ(npc\obj), 3) + ")" + AAText x - 50, 620 + 60 * offset, "MTF " + offset + " Position: (" + f2s(EntityX(npc\obj), 3) + ", " + f2s(EntityY(npc\obj), 3) + ", " + f2s(EntityZ(npc\obj), 3) + ")" AAText x - 50, 640 + 60 * offset, "MTF " + offset + " State: " + npc\State - AAText x - 50, 620 + 60 * offset, "MTF " + offset + " LastSeen: " + npc\lastseen + AAText x - 50, 660 + 60 * offset, "MTF " + offset + " LastSeen: " + npc\lastseen offset = offset + 1 EndIf Next @@ -4853,6 +4838,16 @@ Function DrawGUI() AAText x + 350, 90, (m\dwAvailPhys%/1024/1024)+" MB/"+(m\dwTotalPhys%/1024/1024)+" MB ("+(m\dwAvailPhys%/1024)+" KB/"+(m\dwTotalPhys%/1024)+" KB)" AAText x + 350, 110, "Triangles rendered: "+CurrTrisAmount AAText x + 350, 130, "Active textures: "+ActiveTextures() + AAText x + 350, 150, "SCP-427 state (secs): "+Int(I_427\Timer/70.0) + AAText x + 350, 170, "SCP-008 infection: "+Infect + For i = 0 To 5 + AAText x + 350, 190+(20*i), "SCP-1025 State "+i+": "+SCP1025state[i] + Next + If SelectedMonitor <> Null Then + AAText x + 350, 310, "Current monitor: "+SelectedMonitor\ScrObj + Else + AAText x + 350, 310, "Current monitor: NULL" + EndIf AASetFont Font1 EndIf @@ -4979,7 +4974,7 @@ Function DrawGUI() KeypadMSG = "" EndIf - If KeyHit(1) And EndingTimer = 0 Then + If KeyHit(1) And EndingTimer=0 And (Not Using294) Then If MenuOpen Or InvOpen Then ResumeSounds() If OptionsMenu <> 0 Then SaveOptionsINI() @@ -5159,16 +5154,34 @@ Function DrawGUI() Next isEmpty=True - - For z% = 0 To OtherSize - 1 - If OtherOpen\SecondInv[z]<>Null Then isEmpty=False : Exit - Next + If OtherOpen\itemtemplate\tempname = "wallet" Then + If (Not isEmpty) Then + For z% = 0 To OtherSize - 1 + If OtherOpen\SecondInv[z]<>Null + Local name$=OtherOpen\SecondInv[z]\itemtemplate\tempname + If name$<>"50ct" And name$<>"coin" And name$<>"key" And name$<>"scp860" And name$<>"scp714" Then + isEmpty=False + Exit + EndIf + EndIf + Next + EndIf + Else + For z% = 0 To OtherSize - 1 + If OtherOpen\SecondInv[z]<>Null + isEmpty = False + Exit + EndIf + Next + EndIf If isEmpty Then Select OtherOpen\itemtemplate\tempname Case "clipboard" OtherOpen\invimg = OtherOpen\itemtemplate\invimg2 SetAnimTime OtherOpen\model,17.0 + Case "wallet" + SetAnimTime OtherOpen\model,0.0 End Select EndIf @@ -5268,9 +5281,6 @@ Function DrawGUI() ; If Wearing178=1 Then Rect(x - 3, y - 3, width + 6, height + 6) ;Case "glasses" ; If Wearing178=2 Then Rect(x - 3, y - 3, width + 6, height + 6) - - Case "scp178" - If Wearing178=1 Then Rect(x - 3, y - 3, width + 6, height + 6) Case "nvgoggles" If WearingNightVision=1 Then Rect(x - 3, y - 3, width + 6, height + 6) Case "supernv" @@ -5281,6 +5291,8 @@ Function DrawGUI() If Wearing1499=2 Then Rect(x - 3, y - 3, width + 6, height + 6) Case "finenvgoggles" If WearingNightVision=3 Then Rect(x - 3, y - 3, width + 6, height + 6) + Case "scp427" + If I_427\Using=1 Then Rect(x - 3, y - 3, width + 6, height + 6) End Select EndIf @@ -5351,10 +5363,24 @@ Function DrawGUI() EndIf Else If MouseSlot = 66 Then - DropItem(SelectedItem) - - SelectedItem = Null - InvOpen = False + Select SelectedItem\itemtemplate\tempname + Case "vest","finevest","hazmatsuit","hazmatsuit2","hazmatsuit3" + Msg = "Double click on this item to take it off." + MsgTimer = 70*5 + Case "scp1499","super1499" + If Wearing1499>0 Then + Msg = "Double click on this item to take it off." + MsgTimer = 70*5 + Else + DropItem(SelectedItem) + SelectedItem = Null + InvOpen = False + EndIf + Default + DropItem(SelectedItem) + SelectedItem = Null + InvOpen = False + End Select MoveMouse viewport_center_x, viewport_center_y Else @@ -5366,12 +5392,14 @@ Function DrawGUI() SelectedItem = Null ElseIf Inventory(MouseSlot) <> SelectedItem Select SelectedItem\itemtemplate\tempname - Case "paper","key1","key2","key3","key4","key5","key6","misc","oldpaper","badge","ticket" ;BoH stuff + Case "paper","key1","key2","key3","key4","key5","key6","misc","oldpaper","badge","ticket","50ct","coin","key","scp860","scp714" ;[Block] If Inventory(MouseSlot)\itemtemplate\tempname = "clipboard" Then ;Add an item to clipboard Local added.Items = Null - If SelectedItem\itemtemplate\tempname<>"misc" Or (SelectedItem\itemtemplate\name="Playing Card" Or SelectedItem\itemtemplate\name="Mastercard") Then + Local b$ = SelectedItem\itemtemplate\tempname + Local b2$ = SelectedItem\itemtemplate\name + If (b<>"misc" And b<>"50ct" And b<>"coin" And b<>"key" And b<>"scp860" And b<>"scp714") Or (b2="Playing Card" Or b2="Mastercard") Then For c% = 0 To Inventory(MouseSlot)\invSlots-1 If (Inventory(MouseSlot)\SecondInv[c] = Null) If SelectedItem <> Null Then @@ -5408,6 +5436,47 @@ Function DrawGUI() Msg = "You cannot combine these two items." MsgTimer = 70 * 5 EndIf + ElseIf Inventory(MouseSlot)\itemtemplate\tempname = "wallet" Then + ;Add an item to clipboard + added.Items = Null + b$ = SelectedItem\itemtemplate\tempname + b2$ = SelectedItem\itemtemplate\name + If (b<>"misc" And b<>"paper" And b<>"oldpaper") Or (b2="Playing Card" Or b2="Mastercard") Then + For c% = 0 To Inventory(MouseSlot)\invSlots-1 + If (Inventory(MouseSlot)\SecondInv[c] = Null) + If SelectedItem <> Null Then + Inventory(MouseSlot)\SecondInv[c] = SelectedItem + Inventory(MouseSlot)\state = 1.0 + If b<>"50ct" And b<>"coin" And b<>"key" And b<>"scp860" And b<>"scp714" + SetAnimTime Inventory(MouseSlot)\model,3.0 + EndIf + Inventory(MouseSlot)\invimg = Inventory(MouseSlot)\itemtemplate\invimg + + For ri% = 0 To MaxItemAmount - 1 + If Inventory(ri) = SelectedItem Then + Inventory(ri) = Null + PlaySound_Strict(PickSFX(SelectedItem\itemtemplate\sound)) + EndIf + Next + added = SelectedItem + SelectedItem = Null : Exit + EndIf + EndIf + Next + If SelectedItem <> Null Then + Msg = "The wallet is full." + Else + Msg = "You put "+added\itemtemplate\name+" into the wallet." + EndIf + + MsgTimer = 70 * 5 + Else + Msg = "You cannot combine these two items." + MsgTimer = 70 * 5 + EndIf + Else + Msg = "You cannot combine these two items." + MsgTimer = 70 * 5 EndIf SelectedItem = Null @@ -5565,23 +5634,6 @@ Function DrawGUI() WearingNightVision = (Not WearingNightVision) * 3 SelectedItem = Null - ;[End Block] - Case "scp178" - ;[Block] - If Wearing178=1 Then - Msg = "You removed the glasses." - Wearing178 = 0 - Else - GiveAchievement(Achv178) - Msg = "You put on the glasses." - Wearing178 = 1 - ;WearingGasMask = 0 - If WearingNightVision Then CameraFogFar = StoredCameraFogFar - ;WearingNightVision = 0 - TakeOffStuff(1+2+32+64) - EndIf - MsgTimer = 70 * 5 - SelectedItem = Null ;[End Block] Case "ring" ;[Block] @@ -5630,7 +5682,7 @@ Function DrawGUI() ;[Block] ;InvOpen = True ;[End Block] - Case "key1", "key2", "key3", "key4", "key5", "key6", "keyomni", "scp860", "hand", "hand2" + Case "key1", "key2", "key3", "key4", "key5", "key6", "keyomni", "scp860", "hand", "hand2", "50ct" ;[Block] DrawImage(SelectedItem\itemtemplate\invimg, GraphicWidth / 2 - ImageWidth(SelectedItem\itemtemplate\invimg) / 2, GraphicHeight / 2 - ImageHeight(SelectedItem\itemtemplate\invimg) / 2) ;[End Block] @@ -5648,23 +5700,23 @@ Function DrawGUI() If CanUseItem(False, False, True) GiveAchievement(Achv500) - If (Injuries > 0 Or Bloodloss > 0) And Infect > 0 Then - Msg = "You swallowed the pill. Your wounds are healing rapidly and your nausea is fading." - ElseIf Infect > 0 Then + If Infect > 0 Then Msg = "You swallowed the pill. Your nausea is fading." Else - Msg = "You swallowed the pill. Your wounds are healing rapidly." + Msg = "You swallowed the pill." EndIf MsgTimer = 70*7 DeathTimer = 0 - Injuries = 0 - Bloodloss = 0 Infect = 0 Stamina = 100 For i = 0 To 5 SCP1025state[i]=0 Next + If StaminaEffect > 1.0 Then + StaminaEffect = 1.0 + StaminaEffectTimer = 0.0 + EndIf RemoveItem(SelectedItem) SelectedItem = Null @@ -6415,36 +6467,83 @@ Function DrawGUI() ;[End Block] Case "hazmatsuit", "hazmatsuit2", "hazmatsuit3" ;[Block] - Msg = "You removed the hazmat suit." - WearingHazmat = 0 - MsgTimer = 70 * 5 - DropItem(SelectedItem) - SelectedItem = Null - ;[End Block] - Case "vest" - ;[Block] - If WearingVest Then - Msg = "You removed the vest." - WearingVest = False - Else - Msg = "You put on the vest and feel slightly encumbered." - WearingVest = True - TakeOffStuff(2) + CurrSpeed = CurveValue(0, CurrSpeed, 5.0) + + DrawImage(SelectedItem\itemtemplate\invimg, GraphicWidth / 2 - ImageWidth(SelectedItem\itemtemplate\invimg) / 2, GraphicHeight / 2 - ImageHeight(SelectedItem\itemtemplate\invimg) / 2) + + width% = 300 + height% = 20 + x% = GraphicWidth / 2 - width / 2 + y% = GraphicHeight / 2 + 80 + Rect(x, y, width+4, height, False) + For i% = 1 To Int((width - 2) * (SelectedItem\state / 100.0) / 10) + DrawImage(BlinkMeterIMG, x + 3 + 10 * (i - 1), y + 3) + Next + + SelectedItem\state = Min(SelectedItem\state+(FPSfactor/4.0),100) + + If SelectedItem\state=100 Then + If WearingHazmat>0 Then + Msg = "You removed the hazmat suit." + WearingHazmat = False + DropItem(SelectedItem) + Else + If SelectedItem\itemtemplate\tempname="hazmatsuit" Then + ;Msg = "Hazmat1." + WearingHazmat = 1 + ElseIf SelectedItem\itemtemplate\tempname="hazmatsuit2" Then + ;Msg = "Hazmat2." + WearingHazmat = 2 + Else + ;Msg = "Hazmat3." + WearingHazmat = 3 + EndIf + If SelectedItem\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(SelectedItem\itemtemplate\sound)) + Msg = "You put on the hazmat suit." + TakeOffStuff(1+16) + EndIf + SelectedItem\state=0 + MsgTimer = 70 * 5 + SelectedItem = Null EndIf - MsgTimer = 70 * 7 - SelectedItem = Null ;[End Block] - Case "finevest" + Case "vest","finevest" ;[Block] - If WearingVest Then - Msg = "You removed the vest." - WearingVest = False - Else - Msg = "You put on the vest and feel heavily encumbered." - WearingVest = 2 - TakeOffStuff(2) + CurrSpeed = CurveValue(0, CurrSpeed, 5.0) + + DrawImage(SelectedItem\itemtemplate\invimg, GraphicWidth / 2 - ImageWidth(SelectedItem\itemtemplate\invimg) / 2, GraphicHeight / 2 - ImageHeight(SelectedItem\itemtemplate\invimg) / 2) + + width% = 300 + height% = 20 + x% = GraphicWidth / 2 - width / 2 + y% = GraphicHeight / 2 + 80 + Rect(x, y, width+4, height, False) + For i% = 1 To Int((width - 2) * (SelectedItem\state / 100.0) / 10) + DrawImage(BlinkMeterIMG, x + 3 + 10 * (i - 1), y + 3) + Next + + SelectedItem\state = Min(SelectedItem\state+(FPSfactor/(2.0+(0.5*(SelectedItem\itemtemplate\tempname="finevest")))),100) + + If SelectedItem\state=100 Then + If WearingVest>0 Then + Msg = "You removed the vest." + WearingVest = False + DropItem(SelectedItem) + Else + If SelectedItem\itemtemplate\tempname="vest" Then + Msg = "You put on the vest and feel slightly encumbered." + WearingVest = 1 + Else + Msg = "You put on the vest and feel heavily encumbered." + WearingVest = 2 + EndIf + If SelectedItem\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(SelectedItem\itemtemplate\sound)) + TakeOffStuff(2) + EndIf + SelectedItem\state=0 + MsgTimer = 70 * 5 + SelectedItem = Null EndIf - SelectedItem = Null ;[End Block] Case "gasmask", "supergasmask", "gasmask3" ;[Block] @@ -6492,8 +6591,23 @@ Function DrawGUI() AASetFont Font3 - If PlayerRoom\RoomTemplate\Name = "pocketdimension" Then - If (MilliSecs2() Mod 1000) > 300 Then + Local NavWorks% = True + If PlayerRoom\RoomTemplate\Name$ = "pocketdimension" Or PlayerRoom\RoomTemplate\Name$ = "dimension1499" Then + NavWorks% = False + ElseIf PlayerRoom\RoomTemplate\Name$ = "room860" Then + For e.Events = Each Events + If e\EventName = "room860" Then + If e\EventState = 1.0 Then + NavWorks% = False + EndIf + Exit + EndIf + Next + EndIf + + If (Not NavWorks) Then + If (MilliSecs2() Mod 1000) > 300 Then + Color(200, 0, 0) AAText(x, y + height / 2 - 80, "ERROR 06", True) AAText(x, y + height / 2 - 60, "LOCATION UNKNOWN", True) EndIf @@ -6501,42 +6615,49 @@ Function DrawGUI() If SelectedItem\state > 0 And (Rnd(CoffinDistance + 15.0) > 1.0 Or PlayerRoom\RoomTemplate\Name <> "coffin") Then - PlayerX% = Floor(EntityX(PlayerRoom\obj) / 8.0 + 0.5) - PlayerZ% = Floor(EntityZ(PlayerRoom\obj) / 8.0 + 0.5) + PlayerX% = Floor((EntityX(PlayerRoom\obj)+8) / 8.0 + 0.5) + PlayerZ% = Floor((EntityZ(PlayerRoom\obj)+8) / 8.0 + 0.5) SetBuffer ImageBuffer(NavBG) Local xx = x-ImageWidth(SelectedItem\itemtemplate\img)/2 Local yy = y-ImageHeight(SelectedItem\itemtemplate\img)/2+85 DrawImage(SelectedItem\itemtemplate\img, xx, yy) - x = x - 12 + ((EntityX(Collider) - 4.0) Mod 8.0)*3 - y = y + 12 - ((EntityZ(Collider)-4.0) Mod 8.0)*3 - For x2 = Max(1, PlayerX - 6) To Min(MapWidth - 1, PlayerX + 6) - For z2 = Max(1, PlayerZ - 6) To Min(MapHeight - 1, PlayerZ + 6) + x = x - 12 + (((EntityX(Collider)-4.0)+8.0) Mod 8.0)*3 + y = y + 12 - (((EntityZ(Collider)-4.0)+8.0) Mod 8.0)*3 + For x2 = Max(0, PlayerX - 6) To Min(MapWidth, PlayerX + 6) + For z2 = Max(0, PlayerZ - 6) To Min(MapHeight, PlayerZ + 6) If CoffinDistance > 16.0 Or Rnd(16.0) 0 Or SelectedItem\itemtemplate\name = "S-NAV 310 Navigator" Or SelectedItem\itemtemplate\name = "S-NAV Navigator Ultimate") Then - Local drawx% = x + (PlayerX - x2) * 24 , drawy% = y - (PlayerZ - z2) * 24 + If MapTemp(x2, z2)>0 And (MapFound(x2, z2) > 0 Or SelectedItem\itemtemplate\name = "S-NAV 310 Navigator" Or SelectedItem\itemtemplate\name = "S-NAV Navigator Ultimate") Then + Local drawx% = x + (PlayerX - 1 - x2) * 24 , drawy% = y - (PlayerZ - 1 - z2) * 24 - ;Color (30,30,30) - ;If SelectedItem\itemtemplate\name = "S-NAV Navigator" Then Color(100, 0, 0) - ; - ;If MapTemp(x2 + 1, z2) = False Then Line(drawx - 12, drawy - 12, drawx - 12, drawy + 12) - ;If MapTemp(x2 - 1, z2) = False Then Line(drawx + 12, drawy - 12, drawx + 12, drawy + 12) - ; - ;If MapTemp(x2, z2 - 1) = False Then Line(drawx - 12, drawy - 12, drawx + 12, drawy - 12) - ;If MapTemp(x2, z2 + 1)= False Then Line(drawx - 12, drawy + 12, drawx + 12, drawy + 12) - - If MapTemp(x2+1,z2)=False + If x2+1<=MapWidth Then + If MapTemp(x2+1,z2)=False + DrawImage NavImages(3),drawx-12,drawy-12 + EndIf + Else DrawImage NavImages(3),drawx-12,drawy-12 EndIf - If MapTemp(x2-1,z2)=False + If x2-1>=0 Then + If MapTemp(x2-1,z2)=False + DrawImage NavImages(1),drawx-12,drawy-12 + EndIf + Else DrawImage NavImages(1),drawx-12,drawy-12 EndIf - If MapTemp(x2,z2-1)=False + If z2-1>=0 Then + If MapTemp(x2,z2-1)=False + DrawImage NavImages(0),drawx-12,drawy-12 + EndIf + Else DrawImage NavImages(0),drawx-12,drawy-12 EndIf - If MapTemp(x2,z2+1)=False + If z2+1<=MapHeight Then + If MapTemp(x2,z2+1)=False + DrawImage NavImages(2),drawx-12,drawy-12 + EndIf + Else DrawImage NavImages(2),drawx-12,drawy-12 EndIf EndIf @@ -6576,20 +6697,24 @@ Function DrawGUI() Local SCPs_found% = 0 If SelectedItem\itemtemplate\name = "S-NAV Navigator Ultimate" And (MilliSecs2() Mod 600) < 400 Then - Local dist# = EntityDistance(Camera, Curr173\obj) - dist = Ceil(dist / 8.0) * 8.0 - If dist < 8.0 * 4 Then - Color 100, 0, 0 - Oval(x - dist * 3, y - 7 - dist * 3, dist * 3 * 2, dist * 3 * 2, False) - AAText(x - width / 2 + 10, y - height / 2 + 30, "SCP-173") - SCPs_found% = SCPs_found% + 1 + If Curr173<>Null Then + Local dist# = EntityDistance(Camera, Curr173\obj) + dist = Ceil(dist / 8.0) * 8.0 + If dist < 8.0 * 4 Then + Color 100, 0, 0 + Oval(x - dist * 3, y - 7 - dist * 3, dist * 3 * 2, dist * 3 * 2, False) + AAText(x - width / 2 + 10, y - height / 2 + 30, "SCP-173") + SCPs_found% = SCPs_found% + 1 + EndIf EndIf - dist# = EntityDistance(Camera, Curr106\obj) - If dist < 8.0 * 4 Then - Color 100, 0, 0 - Oval(x - dist * 1.5, y - 7 - dist * 1.5, dist * 3, dist * 3, False) - AAText(x - width / 2 + 10, y - height / 2 + 30 + (20*SCPs_found), "SCP-106") - SCPs_found% = SCPs_found% + 1 + If Curr106<>Null Then + dist# = EntityDistance(Camera, Curr106\obj) + If dist < 8.0 * 4 Then + Color 100, 0, 0 + Oval(x - dist * 1.5, y - 7 - dist * 1.5, dist * 3, dist * 3, False) + AAText(x - width / 2 + 10, y - height / 2 + 30 + (20*SCPs_found), "SCP-106") + SCPs_found% = SCPs_found% + 1 + EndIf EndIf If Curr096<>Null Then dist# = EntityDistance(Camera, Curr096\obj) @@ -6604,13 +6729,14 @@ Function DrawGUI() If np\NPCtype = NPCtype049 dist# = EntityDistance(Camera, np\obj) If dist < 8.0 * 4 Then - If (Not np\HideFromNVG) - Color 100, 0, 0 - Oval(x - dist * 1.5, y - 7 - dist * 1.5, dist * 3, dist * 3, False) + If (Not np\HideFromNVG) Then + Color 100, 0, 0 + Oval(x - dist * 1.5, y - 7 - dist * 1.5, dist * 3, dist * 3, False) AAText(x - width / 2 + 10, y - height / 2 + 30 + (20*SCPs_found), "SCP-049") - SCPs_found% = SCPs_found% + 1 + SCPs_found% = SCPs_found% + 1 + EndIf EndIf - EndIf + Exit EndIf Next If PlayerRoom\RoomTemplate\Name = "coffin" Then @@ -6648,7 +6774,7 @@ Function DrawGUI() For i = 1 To Ceil(SelectedItem\state / 10.0) DrawImage NavImages(4),xtemp+i*8-6,ytemp+4 Next - + AASetFont Font3 EndIf EndIf @@ -6658,53 +6784,94 @@ Function DrawGUI() ;new Items in SCP:CB 1.3 Case "scp1499","super1499" ;[Block] - If (Not Wearing1499%) Then - GiveAchievement(Achv1499) - - ;Wearing178 = 0 - ;WearingGasMask = 0 - If WearingNightVision Then CameraFogFar = StoredCameraFogFar - ;WearingNightVision = 0 - TakeOffStuff(1+2+8+32) - For r.Rooms = Each Rooms - If r\RoomTemplate\Name = "dimension1499" Then - BlinkTimer = -1 - NTF_1499PrevRoom = PlayerRoom - NTF_1499PrevX# = EntityX(Collider) - NTF_1499PrevY# = EntityY(Collider) - NTF_1499PrevZ# = EntityZ(Collider) - - If NTF_1499X# = 0.0 And NTF_1499Y# = 0.0 And NTF_1499Z# = 0.0 - PositionEntity (Collider, r\x+676.0*RoomScale, r\y+314.0*RoomScale, r\z-2080.0*RoomScale) - Else - PositionEntity (Collider, NTF_1499X#, NTF_1499Y#+0.05, NTF_1499Z#) - EndIf - ResetEntity(Collider) - UpdateDoors() - UpdateRooms() - For it.Items = Each Items - it\disttimer = 0 - Next - PlayerRoom = r - PlaySound_Strict (LoadTempSound("SFX\SCP\1499\Enter.ogg")) - NTF_1499X# = 0.0 - NTF_1499Y# = 0.0 - NTF_1499Z# = 0.0 - If Curr096<>Null - If Curr096\SoundChn<>0 - SetStreamVolume_Strict(Curr096\SoundChn,0.0) + If WearingHazmat>0 + Msg = "You are not able to wear SCP-1499 and a hazmat suit at the same time." + MsgTimer = 70 * 5 + SelectedItem=Null + Return + EndIf + + CurrSpeed = CurveValue(0, CurrSpeed, 5.0) + + DrawImage(SelectedItem\itemtemplate\invimg, GraphicWidth / 2 - ImageWidth(SelectedItem\itemtemplate\invimg) / 2, GraphicHeight / 2 - ImageHeight(SelectedItem\itemtemplate\invimg) / 2) + + width% = 300 + height% = 20 + x% = GraphicWidth / 2 - width / 2 + y% = GraphicHeight / 2 + 80 + Rect(x, y, width+4, height, False) + For i% = 1 To Int((width - 2) * (SelectedItem\state / 100.0) / 10) + DrawImage(BlinkMeterIMG, x + 3 + 10 * (i - 1), y + 3) + Next + + SelectedItem\state = Min(SelectedItem\state+(FPSfactor),100) + + If SelectedItem\state=100 Then + If Wearing1499>0 Then + ;Msg = "1499remove." + Wearing1499 = False + ;DropItem(SelectedItem) + If SelectedItem\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(SelectedItem\itemtemplate\sound)) + Else + If SelectedItem\itemtemplate\tempname="scp1499" Then + ;Msg = "scp1499." + Wearing1499 = 1 + Else + ;Msg = "super1499." + Wearing1499 = 2 + EndIf + If SelectedItem\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(SelectedItem\itemtemplate\sound)) + GiveAchievement(Achv1499) + If WearingNightVision Then CameraFogFar = StoredCameraFogFar + TakeOffStuff(1+2+8+32) + For r.Rooms = Each Rooms + If r\RoomTemplate\Name = "dimension1499" Then + BlinkTimer = -1 + NTF_1499PrevRoom = PlayerRoom + NTF_1499PrevX# = EntityX(Collider) + NTF_1499PrevY# = EntityY(Collider) + NTF_1499PrevZ# = EntityZ(Collider) + + If NTF_1499X# = 0.0 And NTF_1499Y# = 0.0 And NTF_1499Z# = 0.0 Then + PositionEntity (Collider, r\x+3319.0*RoomScale, r\y+304.0*RoomScale, r\z-2044.0*RoomScale) + RotateEntity Collider,0,0,0,True + Else + PositionEntity (Collider, NTF_1499X#, NTF_1499Y#+0.05, NTF_1499Z#) + EndIf + ResetEntity(Collider) + UpdateDoors() + UpdateRooms() + For it.Items = Each Items + it\disttimer = 0 + Next + PlayerRoom = r + PlaySound_Strict (LoadTempSound("SFX\SCP\1499\Enter.ogg")) + NTF_1499X# = 0.0 + NTF_1499Y# = 0.0 + NTF_1499Z# = 0.0 + If Curr096<>Null Then + If Curr096\SoundChn<>0 Then + SetStreamVolume_Strict(Curr096\SoundChn,0.0) + EndIf EndIf + For e.Events = Each Events + If e\EventName = "dimension1499" Then + If EntityDistance(e\room\obj,Collider)>8300.0*RoomScale Then + If e\EventState2 < 5 Then + e\EventState2 = e\EventState2 + 1 + EndIf + EndIf + Exit + EndIf + Next + Exit EndIf - Exit - EndIf - Next - EndIf - If SelectedItem\itemtemplate\tempname="super1499" - If Wearing1499%=0 Then Wearing1499% = 2 Else Wearing1499%=0 - Else - Wearing1499% = (Not Wearing1499%) + Next + EndIf + SelectedItem\state=0 + ;MsgTimer = 70 * 5 + SelectedItem = Null EndIf - SelectedItem = Null ;[End Block] Case "badge" ;[Block] @@ -6774,6 +6941,43 @@ Function DrawGUI() SelectedItem\state = 1 SelectedItem = Null ;[End Block] + Case "scp427" + ;[Block] + If I_427\Using=1 Then + Msg = "You closed the locket." + I_427\Using = False + Else + GiveAchievement(Achv427) + Msg = "You opened the locket." + I_427\Using = True + EndIf + MsgTimer = 70 * 5 + SelectedItem = Null + ;[End Block] + Case "pill" + ;[Block] + If CanUseItem(False, False, True) + Msg = "You swallowed the pill." + MsgTimer = 70*7 + + RemoveItem(SelectedItem) + SelectedItem = Null + EndIf + ;[End Block] + Case "scp500death" + ;[Block] + If CanUseItem(False, False, True) + Msg = "You swallowed the pill." + MsgTimer = 70*7 + + If I_427\Timer < 70*360 Then + I_427\Timer = 70*360 + EndIf + + RemoveItem(SelectedItem) + SelectedItem = Null + EndIf + ;[End Block] Default ;[Block] ;check if the item is an inventory-type object @@ -6814,10 +7018,26 @@ Function DrawGUI() EntityAlpha Dark, 0.0 IN$ = SelectedItem\itemtemplate\tempname - ;If IN$ = "paper" Or IN$ = "scp1025" Or IN$ = "badge" Or IN$ = "oldpaper" Then If IN$ = "scp1025" Then If SelectedItem\itemtemplate\img<>0 Then FreeImage(SelectedItem\itemtemplate\img) SelectedItem\itemtemplate\img=0 + ElseIf IN$ = "firstaid" Or IN$="finefirstaid" Or IN$="firstaid2" Then + SelectedItem\state = 0 + ElseIf IN$ = "vest" Or IN$="finevest" + SelectedItem\state = 0 + If (Not WearingVest) + DropItem(SelectedItem,False) + EndIf + ElseIf IN$="hazmatsuit" Or IN$="hazmatsuit2" Or IN$="hazmatsuit3" + SelectedItem\state = 0 + If (Not WearingHazmat) + DropItem(SelectedItem,False) + EndIf + ElseIf IN$="scp1499" Or IN$="super1499" + SelectedItem\state = 0 + ;If (Not Wearing1499) + ; DropItem(SelectedItem,False) + ;EndIf EndIf If SelectedItem\itemtemplate\sound <> 66 Then PlaySound_Strict(PickSFX(SelectedItem\itemtemplate\sound)) @@ -6832,7 +7052,16 @@ Function DrawGUI() If ChannelPlaying(RadioCHN(i)) Then PauseChannel(RadioCHN(i)) EndIf Next - EndIf + EndIf + + For it.Items = Each Items + If it<>SelectedItem + Select it\itemtemplate\tempname + Case "firstaid","finefirstaid","firstaid2","vest","finevest","hazmatsuit","hazmatsuit2","hazmatsuit3","scp1499","super1499" + it\state = 0 + End Select + EndIf + Next If PrevInvOpen And (Not InvOpen) Then MoveMouse viewport_center_x, viewport_center_y @@ -6843,7 +7072,13 @@ Function DrawMenu() CatchErrors("Uncaught (DrawMenu)") Local x%, y%, width%, height% - + If api_GetFocus() = 0 Then ;Game is out of focus -> pause the game + If (Not Using294) Then + MenuOpen = True + PauseSounds() + EndIf + Delay 1000 ;Reduce the CPU take while game is not in focus + EndIf If MenuOpen Then ;DebugLog AchievementsMenu+"|"+OptionsMenu+"|"+QuitMSG @@ -7638,21 +7873,11 @@ Function LoadEntities() MoveEntity(NVBlink, 0, 0, 1.0) HideEntity(NVBlink) - GlassesTexture = LoadTexture_Strict("GFX\GlassesOverlay.jpg",1) - GlassesOverlay = CreateSprite(ark_blur_cam) - ScaleSprite(GlassesOverlay, Max(GraphicWidth / 1024.0, 1.0), Max(GraphicHeight / 1024.0 * 0.8, 0.8)) - EntityTexture(GlassesOverlay, GlassesTexture) - EntityBlend (GlassesOverlay, 2) - EntityFX(GlassesOverlay, 1) - EntityOrder GlassesOverlay, -1003 - MoveEntity(GlassesOverlay, 0, 0, 1.0) - HideEntity(GlassesOverlay) - FogNVTexture = LoadTexture_Strict("GFX\fogNV.jpg", 1) DrawLoading(5) - DarkTexture = CreateTexture(1024, 1024, 1 + 2+256) + DarkTexture = CreateTexture(1024, 1024, 1 + 2) SetBuffer TextureBuffer(DarkTexture) Cls SetBuffer BackBuffer() @@ -7854,6 +8079,7 @@ Function LoadEntities() DecalTextures(17) = LoadTexture_Strict("GFX\decal8.png", 1 + 2) DecalTextures(18) = LoadTexture_Strict("GFX\decalpd6.dc", 1 + 2) DecalTextures(19) = LoadTexture_Strict("GFX\decal19.png", 1 + 2) + DecalTextures(20) = LoadTexture_Strict("GFX\decal427.png", 1 + 2) DrawLoading(25) @@ -8125,10 +8351,10 @@ Function InitNewGame() For d.Doors = Each Doors EntityParent(d\obj, 0) - If d\obj2 > 0 Then EntityParent(d\obj2, 0) - If d\frameobj > 0 Then EntityParent(d\frameobj, 0) - If d\buttons[0] > 0 Then EntityParent(d\buttons[0], 0) - If d\buttons[1] > 0 Then EntityParent(d\buttons[1], 0) + If d\obj2 <> 0 Then EntityParent(d\obj2, 0) + If d\frameobj <> 0 Then EntityParent(d\frameobj, 0) + If d\buttons[0] <> 0 Then EntityParent(d\buttons[0], 0) + If d\buttons[1] <> 0 Then EntityParent(d\buttons[1], 0) If d\obj2 <> 0 And d\dir = 0 Then MoveEntity(d\obj, 0, 0, 8.0 * RoomScale) @@ -8178,6 +8404,15 @@ Function InitNewGame() EntityType (it\collider, HIT_ITEM) EntityParent(it\collider, 0) ItemAmount = ItemAmount + 1 + it = CreateItem("Document SCP-173", "paper", 1, 1, 1) + it\Picked = True + it\Dropped = -1 + it\itemtemplate\found=True + Inventory(1) = it + HideEntity(it\collider) + EntityType (it\collider, HIT_ITEM) + EntityParent(it\collider, 0) + ItemAmount = ItemAmount + 1 ElseIf (r\RoomTemplate\Name = "173" And IntroEnabled) Then PositionEntity (Collider, EntityX(r\obj), 1.0, EntityZ(r\obj)) PlayerRoom = r @@ -8259,10 +8494,10 @@ Function InitLoadGame() For d.Doors = Each Doors EntityParent(d\obj, 0) - If d\obj2 > 0 Then EntityParent(d\obj2, 0) - If d\frameobj > 0 Then EntityParent(d\frameobj, 0) - If d\buttons[0] > 0 Then EntityParent(d\buttons[0], 0) - If d\buttons[1] > 0 Then EntityParent(d\buttons[1], 0) + If d\obj2 <> 0 Then EntityParent(d\obj2, 0) + If d\frameobj <> 0 Then EntityParent(d\frameobj, 0) + If d\buttons[0] <> 0 Then EntityParent(d\buttons[0], 0) + If d\buttons[1] <> 0 Then EntityParent(d\buttons[1], 0) Next @@ -8358,6 +8593,8 @@ Function NullGame(playbuttonsfx%=True) ClearTextureCache + DebugHUD = False + UnableToMove% = False QuickLoadPercent = -1 @@ -8378,8 +8615,8 @@ Function NullGame(playbuttonsfx%=True) HideDistance# = 15.0 For lvl = 0 To 0 - For x = 0 To MapWidth - 1 - For y = 0 To MapHeight - 1 + For x = 0 To MapWidth+1 + For y = 0 To MapHeight+1 MapTemp(x, y) = 0 MapFound(x, y) = 0 Next @@ -8427,16 +8664,19 @@ Function NullGame(playbuttonsfx%=True) WearingHazmat = 0 WearingVest = 0 Wearing714 = 0 - Wearing178 = 0 If WearingNightVision Then CameraFogFar = StoredCameraFogFar WearingNightVision = 0 EndIf + I_427\Using = 0 + I_427\Timer = 0.0 ForceMove = 0.0 ForceAngle = 0.0 Playable = True + CoffinDistance = 100 + Contained106 = False If Curr173 <> Null Then Curr173\Idle = False @@ -8470,6 +8710,17 @@ Function NullGame(playbuttonsfx%=True) BlurTimer = 0 SuperMan = False SuperManTimer = 0 + Sanity = 0 + RestoreSanity = True + Crouch = False + CrouchState = 0.0 + LightVolume = 0.0 + Vomit = False + VomitTimer = 0.0 + SecondaryLightOn# = True + PrevSecondaryLightOn# = True + RemoteDoorOn = True + SoundTransmission = False InfiniteStamina% = False @@ -8602,6 +8853,8 @@ Function NullGame(playbuttonsfx%=True) ReloadAAFont() Camera = 0 ark_blur_cam = 0 + Collider = 0 + Sky = 0 InitFastResize() CatchErrors("NullGame") @@ -8635,7 +8888,7 @@ Function LoopSound2%(SoundHandle%, Chn%, cam%, entity%, range# = 10, volume# = 1 If volume>0 Then Local dist# = EntityDistance(cam, entity) / range# - If 1 - dist# > 0 And 1 - dist# < 1 Then + ;If 1 - dist# > 0 And 1 - dist# < 1 Then Local panvalue# = Sin(-DeltaYaw(cam,entity)) @@ -8647,7 +8900,7 @@ Function LoopSound2%(SoundHandle%, Chn%, cam%, entity%, range# = 10, volume# = 1 ChannelVolume(Chn, volume# * (1 - dist#)*SFXVolume#) ChannelPan(Chn, panvalue) - EndIf + ;EndIf Else If Chn <> 0 Then ChannelVolume (Chn, 0) @@ -9164,19 +9417,6 @@ Function Use914(item.Items, setting$, x#, y#, z#) it2 = CreateItem("Bulky Ballistic Vest", "veryfinevest", x, y, z) RemoveItem(item) End Select - Case "3-D Glasses" - Select setting - Case "rough,coarse" - d.Decals = CreateDecal(0, x, 8 * RoomScale + 0.005, z, 90, Rand(360), 0) - d\Size = 0.12 : ScaleSprite(d\obj, d\Size, d\Size) - RemoveItem(item) - For n.NPCs = Each NPCs - If n\NPCtype = NPCtype178 Then RemoveNPC(n) - Next - Case "1:1","fine","very fine" - PositionEntity(item\collider, x, y, z) - ResetEntity(item\collider) - End Select Case "Clipboard" Select setting Case "rough", "coarse" @@ -9466,7 +9706,7 @@ Function Use914(item.Items, setting$, x#, y#, z#) End Select RemoveItem(item) - Case "Playing Card", "Mastercard", "Coin" + Case "Playing Card", "Coin", "50 Cent Coin" Select setting Case "rough", "coarse" d.Decals = CreateDecal(0, x, 8 * RoomScale + 0.005, z, 90, Rand(360), 0) @@ -9477,6 +9717,26 @@ Function Use914(item.Items, setting$, x#, y#, z#) it2 = CreateItem("Level 2 Key Card", "key2", x, y, z) End Select RemoveItem(item) + Case "Mastercard" + Select setting + Case "rough" + d.Decals = CreateDecal(0, x, 8 * RoomScale + 0.005, z, 90, Rand(360), 0) + d\Size = 0.07 : ScaleSprite(d\obj, d\Size, d\Size) + Case "coarse" + it2 = CreateItem("50 Cent Coin", "50ct", x, y, z) + Local it3.Items,it4.Items,it5.Items + it3 = CreateItem("50 Cent Coin", "50ct", x, y, z) + it4 = CreateItem("50 Cent Coin", "50ct", x, y, z) + it5 = CreateItem("50 Cent Coin", "50ct", x, y, z) + EntityType (it3\collider, HIT_ITEM) + EntityType (it4\collider, HIT_ITEM) + EntityType (it5\collider, HIT_ITEM) + Case "1:1" + it2 = CreateItem("Level 1 Key Card", "key1", x, y, z) + Case "fine", "very fine" + it2 = CreateItem("Level 2 Key Card", "key2", x, y, z) + End Select + RemoveItem(item) Case "S-NAV 300 Navigator", "S-NAV 310 Navigator", "S-NAV Navigator", "S-NAV Navigator Ultimate" Select setting Case "rough", "coarse" @@ -9608,7 +9868,7 @@ Function Use914(item.Items, setting$, x#, y#, z#) Case "fine", "very fine" it2 = CreateItem("Syringe", "veryfinesyringe", x, y, z) End Select - + Case "veryfinesyringe" Select setting Case "rough", "coarse", "1:1", "fine" @@ -9621,6 +9881,33 @@ Function Use914(item.Items, setting$, x#, y#, z#) RemoveItem(item) + Case "SCP-500-01", "Upgraded pill", "Pill" + Select setting + Case "rough", "coarse" + d.Decals = CreateDecal(0, x, 8 * RoomScale + 0.010, z, 90, Rand(360), 0) + d\Size = 0.2 : EntityAlpha(d\obj, 0.8) : ScaleSprite(d\obj, d\Size, d\Size) + Case "1:1" + it2 = CreateItem("Pill", "pill", x, y, z) + RemoveItem(item) + Case "fine" + Local no427Spawn% = False + For it3.Items = Each Items + If it3\itemtemplate\tempname = "scp427" Then + no427Spawn = True + Exit + EndIf + Next + If (Not no427Spawn) Then + it2 = CreateItem("SCP-427", "scp427", x, y, z) + Else + it2 = CreateItem("Upgraded pill", "scp500death", x, y, z) + EndIf + RemoveItem(item) + Case "very fine" + it2 = CreateItem("Upgraded pill", "scp500death", x, y, z) + RemoveItem(item) + End Select + Default Select item\itemtemplate\tempname @@ -9854,6 +10141,7 @@ Function Use294() HidePointer() Using294 = False Input294 = "" + MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 EndIf Else ;playing a dispensing sound @@ -9863,6 +10151,14 @@ Function Use294() If Input294 <> "OUT OF RANGE" Then HidePointer() Using294 = False + MouseXSpeed() : MouseYSpeed() : MouseZSpeed() : mouse_x_speed_1#=0.0 : mouse_y_speed_1#=0.0 + Local e.Events + For e.Events = Each Events + If e\room = PlayerRoom + e\EventState2 = 0 + Exit + EndIf + Next EndIf Input294="" PlayerRoom\SoundCHN=0 @@ -9871,6 +10167,99 @@ Function Use294() End Function +Function Use427() + Local i%,pvt%,de.Decals,tempchn% + Local prevI427Timer# = I_427\Timer + + If I_427\Timer < 70*360 + If I_427\Using=True Then + I_427\Timer = I_427\Timer + FPSfactor + If Injuries > 0.0 Then + Injuries = Max(Injuries - 0.0005 * FPSfactor,0.0) + EndIf + If Bloodloss > 0.0 And Injuries <= 1.0 Then + Bloodloss = Max(Bloodloss - 0.001 * FPSfactor,0.0) + EndIf + If Infect > 0.0 Then + Infect = Max(Infect - 0.001 * FPSfactor,0.0) + EndIf + For i = 0 To 5 + If SCP1025state[i]>0.0 Then + SCP1025state[i] = Max(SCP1025state[i] - 0.001 * FPSfactor,0.0) + EndIf + Next + If I_427\Sound[0]=0 Then + I_427\Sound[0] = LoadSound_Strict("SFX\SCP\427\Effect.ogg") + EndIf + If (Not ChannelPlaying(I_427\SoundCHN[0])) Then + I_427\SoundCHN[0] = PlaySound_Strict(I_427\Sound[0]) + EndIf + If I_427\Timer => 70*180 Then + If I_427\Sound[1]=0 Then + I_427\Sound[1] = LoadSound_Strict("SFX\SCP\427\Transform.ogg") + EndIf + If (Not ChannelPlaying(I_427\SoundCHN[1])) Then + I_427\SoundCHN[1] = PlaySound_Strict(I_427\Sound[1]) + EndIf + EndIf + If prevI427Timer < 70*60 And I_427\Timer => 70*60 Then + Msg = "You feel refreshed and energetic." + MsgTimer = 70*5 + ElseIf prevI427Timer < 70*180 And I_427\Timer => 70*180 Then + Msg = "You feel gentle muscle spasms all over your body." + MsgTimer = 70*5 + EndIf + Else + For i = 0 To 1 + If I_427\SoundCHN[i]<>0 Then + If ChannelPlaying(I_427\SoundCHN[i]) Then + StopChannel(I_427\SoundCHN[i]) + EndIf + EndIf + Next + EndIf + Else + If prevI427Timer-FPSfactor < 70*360 And I_427\Timer => 70*360 Then + Msg = "Your muscles are swelling. You feel more powerful than ever." + MsgTimer = 70*5 + ElseIf prevI427Timer-FPSfactor < 70*390 And I_427\Timer => 70*390 Then + Msg = "You can't feel your legs. But you don't need legs anymore." + MsgTimer = 70*5 + EndIf + I_427\Timer = I_427\Timer + FPSfactor + If I_427\Sound[0]=0 Then + I_427\Sound[0] = LoadSound_Strict("SFX\SCP\427\Effect.ogg") + EndIf + If I_427\Sound[1]=0 Then + I_427\Sound[1] = LoadSound_Strict("SFX\SCP\427\Transform.ogg") + EndIf + For i = 0 To 1 + If (Not ChannelPlaying(I_427\SoundCHN[i])) Then + I_427\SoundCHN[i] = PlaySound_Strict(I_427\Sound[i]) + EndIf + Next + If Rnd(200)<2.0 Then + pvt = CreatePivot() + PositionEntity pvt, EntityX(Collider)+Rnd(-0.05,0.05),EntityY(Collider)-0.05,EntityZ(Collider)+Rnd(-0.05,0.05) + TurnEntity pvt, 90, 0, 0 + EntityPick(pvt,0.3) + de.Decals = CreateDecal(20, PickedX(), PickedY()+0.005, PickedZ(), 90, Rand(360), 0) + de\Size = Rnd(0.03,0.08)*2.0 : EntityAlpha(de\obj, 1.0) : ScaleSprite de\obj, de\Size, de\Size + tempchn% = PlaySound_Strict (DripSFX(Rand(0,2))) + ChannelVolume tempchn, Rnd(0.0,0.8)*SFXVolume + ChannelPitch tempchn, Rand(20000,30000) + FreeEntity pvt + BlurTimer = 800 + EndIf + If I_427\Timer >= 70*420 Then + Kill() + DeathMSG = Chr(34)+"Requesting support from MTF Nu-7. We need more firepower to take this thing down."+Chr(34) + ElseIf I_427\Timer >= 70*390 Then + Crouch = True + EndIf + EndIf + +End Function Function UpdateMTF%() @@ -9975,7 +10364,9 @@ Function UpdateInfect() Exit EndIf Next - ElseIf PlayerRoom\RoomTemplate\Name = "dimension1499" Or PlayerRoom\RoomTemplate\Name = "pocketdimension" + ElseIf PlayerRoom\RoomTemplate\Name = "dimension1499" Or PlayerRoom\RoomTemplate\Name = "pocketdimension" Or PlayerRoom\RoomTemplate\Name = "gatea" + teleportForInfect = False + ElseIf PlayerRoom\RoomTemplate\Name = "exit1" And EntityY(Collider)>1040.0*RoomScale teleportForInfect = False EndIf @@ -9984,7 +10375,9 @@ Function UpdateInfect() If Infect < 93.0 Then temp=Infect - Infect = Min(Infect+FPSfactor*0.002,100) + If (Not I_427\Using And I_427\Timer < 70*360) Then + Infect = Min(Infect+FPSfactor*0.002,100) + EndIf BlurTimer = Max(Infect*3*(2.0-CrouchState),BlurTimer) @@ -10013,6 +10406,8 @@ Function UpdateInfect() MsgTimer = 70*6 ElseIf Infect =>91.5 BlinkTimer = Max(Min(-10*(Infect-91.5),BlinkTimer),-10) + IsZombie = True + UnableToMove = True If Infect >= 92.7 And temp < 92.7 Then If teleportForInfect For r.Rooms = Each Rooms @@ -10027,6 +10422,7 @@ Function UpdateInfect() FreeTexture tex r\NPC[0]\State=6 PlayerRoom = r + UnableToMove = False Exit EndIf Next @@ -10047,10 +10443,10 @@ Function UpdateInfect() PointEntity Collider, PlayerRoom\NPC[0]\Collider PointEntity PlayerRoom\NPC[0]\Collider, Collider PointEntity Camera, PlayerRoom\NPC[0]\Collider,EntityRoll(Camera) - ForceMove = 0.7 + ForceMove = 0.75 Injuries = 2.5 Bloodloss = 0 - IsZombie = True + UnableToMove = False Animate2(PlayerRoom\NPC[0]\obj, AnimTime(PlayerRoom\NPC[0]\obj), 357, 381, 0.3) ElseIf Infect < 98.5 @@ -10060,7 +10456,6 @@ Function UpdateInfect() ForceMove = 0.0 UnableToMove = True - IsZombie = False PointEntity Camera, PlayerRoom\NPC[0]\Collider If temp < 94.7 Then @@ -10107,8 +10502,17 @@ Function UpdateInfect() Else Kill() BlinkTimer = Max(Min(-10*(Infect-96),BlinkTimer),-10) - If PlayerRoom\RoomTemplate\Name = "dimension1499" - DeathMSG = "The whereabouts of SCP-1499 are still unknown, but a recon team has been dispatched to investigate repots of a violent attack to a church in the Russian town of [REDACTED]." + If PlayerRoom\RoomTemplate\Name = "dimension1499" Then + DeathMSG = "The whereabouts of SCP-1499 are still unknown, but a recon team has been dispatched to investigate reports of a violent attack to a church in the Russian town of [REDACTED]." + ElseIf PlayerRoom\RoomTemplate\Name = "gatea" Or PlayerRoom\RoomTemplate\Name = "exit1" Then + DeathMSG = "Subject D-9341 found wandering around Gate " + If PlayerRoom\RoomTemplate\Name = "gatea" Then + DeathMSG = DeathMSG + "A" + Else + DeathMSG = DeathMSG + "B" + EndIf + DeathMSG = DeathMSG + ". Subject was immediately terminated by Nine-Tailed Fox and sent for autopsy. " + DeathMSG = DeathMSG + "SCP-008 infection was confirmed, after which the body was incinerated." Else DeathMSG = "" EndIf @@ -10332,10 +10736,7 @@ Function TakeOffStuff(flag%=0) EndIf EndIf If Len(numb_flag%)>3 - If Mid(numb_flag%,Len(numb_flag%)-3,1) = 1 - Wearing178 = False - DebugLog "SCP-178 Off" - EndIf + EndIf If Len(numb_flag%)>4 If Mid(numb_flag%,Len(numb_flag%)-4,1) = 1 @@ -10951,10 +11352,13 @@ Function RenderWorld2() AASetFont Font3 - AAText GraphicWidth/2,20*MenuScale,"REFRESHING DATA IN",True,False + Local plusY% = 0 + If hasBattery=1 Then plusY% = 40 - AAText GraphicWidth/2,60*MenuScale,Max(f2s(NVTimer/60.0,1),0.0),True,False - AAText GraphicWidth/2,100*MenuScale,"SECONDS",True,False + AAText GraphicWidth/2,(20+plusY)*MenuScale,"REFRESHING DATA IN",True,False + + AAText GraphicWidth/2,(60+plusY)*MenuScale,Max(f2s(NVTimer/60.0,1),0.0),True,False + AAText GraphicWidth/2,(100+plusY)*MenuScale,"SECONDS",True,False temp% = CreatePivot() : temp2% = CreatePivot() PositionEntity temp, EntityX(Collider), EntityY(Collider), EntityZ(Collider) @@ -11379,17 +11783,17 @@ End Function Function UpdateStreamSounds() Local e.Events - If FPSfactor > 0 - If IntercomStreamCHN <> 0 + If FPSfactor > 0 Then + If IntercomStreamCHN <> 0 Then SetStreamVolume_Strict(IntercomStreamCHN,SFXVolume) EndIf For e = Each Events - If e\SoundCHN<>0 + If e\SoundCHN<>0 Then If e\SoundCHN_isStream SetStreamVolume_Strict(e\SoundCHN,SFXVolume) EndIf EndIf - If e\SoundCHN2<>0 + If e\SoundCHN2<>0 Then If e\SoundCHN2_isStream SetStreamVolume_Strict(e\SoundCHN2,SFXVolume) EndIf @@ -11397,24 +11801,26 @@ Function UpdateStreamSounds() Next EndIf - If (Not PlayerInReachableRoom()) - If PlayerRoom\RoomTemplate\Name <> "exit1" And PlayerRoom\RoomTemplate\Name <> "gatea" - If IntercomStreamCHN <> 0 + If (Not PlayerInReachableRoom()) Then + If PlayerRoom\RoomTemplate\Name <> "exit1" And PlayerRoom\RoomTemplate\Name <> "gatea" Then + If IntercomStreamCHN <> 0 Then StopStream_Strict(IntercomStreamCHN) IntercomStreamCHN = 0 EndIf - For e = Each Events - If e\SoundCHN<>0 And e\SoundCHN_isStream - StopStream_Strict(e\SoundCHN) - e\SoundCHN = 0 - e\SoundCHN_isStream = 0 - EndIf - If e\SoundCHN2<>0 And e\SoundCHN2_isStream - StopStream_Strict(e\SoundCHN2) - e\SoundCHN = 0 - e\SoundCHN_isStream = 0 - EndIf - Next + If PlayerRoom\RoomTemplate\Name$ <> "dimension1499" Then + For e = Each Events + If e\SoundCHN<>0 And e\SoundCHN_isStream Then + StopStream_Strict(e\SoundCHN) + e\SoundCHN = 0 + e\SoundCHN_isStream = 0 + EndIf + If e\SoundCHN2<>0 And e\SoundCHN2_isStream Then + StopStream_Strict(e\SoundCHN2) + e\SoundCHN = 0 + e\SoundCHN_isStream = 0 + EndIf + Next + EndIf EndIf EndIf @@ -11572,7 +11978,7 @@ Function CanUseItem(canUseWithHazmat%, canUseWithGasMask%, canUseWithEyewear%) Msg = "You can't use that item while wearing a gas mask." MsgTimer = 70*5 Return False - Else If (canUseWithEyewear = False And (WearingNightVision Or Wearing178)) + Else If (canUseWithEyewear = False And (WearingNightVision)) Msg = "You can't use that item while wearing headgear." EndIf @@ -11595,20 +12001,95 @@ Function ResetInput() End Function +Function Update096ElevatorEvent#(e.Events,EventState#,d.Doors,elevatorobj%) + Local prevEventState# = EventState# + + If EventState < 0 Then + EventState = 0 + prevEventState = 0 + EndIf + + If d\openstate = 0 And d\open = False Then + If Abs(EntityX(Collider)-EntityX(elevatorobj%,True))<=280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityZ(Collider)-EntityZ(elevatorobj%,True))<=280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityY(Collider)-EntityY(elevatorobj%,True))<=280.0*RoomScale+(0.015*FPSfactor) Then + d\locked = True + If EventState = 0 Then + TeleportEntity(Curr096\Collider,EntityX(d\frameobj),EntityY(d\frameobj)+1.0,EntityZ(d\frameobj),Curr096\CollRadius) + PointEntity Curr096\Collider,elevatorobj + RotateEntity Curr096\Collider,0,EntityYaw(Curr096\Collider),0 + MoveEntity Curr096\Collider,0,0,-0.5 + ResetEntity Curr096\Collider + Curr096\State = 6 + SetNPCFrame(Curr096,0) + e\Sound = LoadSound_Strict("SFX\SCP\096\ElevatorSlam.ogg") + EventState = EventState + FPSfactor * 1.4 + EndIf + EndIf + EndIf + EndIf + EndIf + + If EventState > 0 Then + If prevEventState = 0 Then + e\SoundCHN = PlaySound_Strict(e\Sound) + EndIf + + If EventState > 70*1.9 And EventState < 70*2+FPSfactor + CameraShake = 7 + ElseIf EventState > 70*4.2 And EventState < 70*4.25+FPSfactor + CameraShake = 1 + ElseIf EventState > 70*5.9 And EventState < 70*5.95+FPSfactor + CameraShake = 1 + ElseIf EventState > 70*7.25 And EventState < 70*7.3+FPSfactor + CameraShake = 1 + d\fastopen = True + d\open = True + Curr096\State = 4 + Curr096\LastSeen = 1 + ElseIf EventState > 70*8.1 And EventState < 70*8.15+FPSfactor + CameraShake = 1 + EndIf + + If EventState <= 70*8.1 Then + d\openstate = Min(d\openstate,20) + EndIf + EventState = EventState + FPSfactor * 1.4 + EndIf + Return EventState + +End Function + +Function RotateEntity90DegreeAngles(entity%) + Local angle = WrapAngle(entity) + + If angle < 45.0 Then + Return 0 + ElseIf angle >= 45.0 And angle < 135 Then + Return 90 + ElseIf angle >= 135 And angle < 225 Then + Return 180 + Else + Return 270 + EndIf + +End Function + ;~IDEal Editor Parameters: -;~F#39#D8#175#17B#18B#2EA#313#327#32C#332#338#33E#344#349#367#37D#392#398#39E#3A5 -;~F#3AC#3B9#3BF#3C5#3CB#3D2#3E1#3EA#3F6#408#421#43D#442#44F#461#47C#483#489#4B3#4BC -;~F#4E2#4F4#50B#517#523#536#53C#542#546#54C#551#570#57F#58E#59D#5F6#6FE#775#796#80E -;~F#81B#8D2#95D#974#982#9B4#A6B#A7A#AB0#BA1#CCD#CDE#DAE#DD6#DE5#E0D#E37#E50#E63#E93 -;~F#EAB#F73#10AB#1338#149D#14CB#14FA#1515#152C#153F#1552#1565#1576#1585#15A1#15A5#15A9#15B2#15CC#15FC -;~F#1656#1661#166D#1679#16A4#16B4#16F3#1700#170D#1722#1853#186F#187F#188F#189C#18A4#18B1#18BD#18D6#198F -;~F#19BC#19D2#19DE#19F5#1A00#1A40#1AB4#1B06#1B41#1B91#1CDB#1CE6#1E54#1E73#1ED3#1F6F#1F9C#1FCB#20D5#20E7 -;~F#2103#210D#211A#2146#2186#21C6#2215#224E#2262#2277#227B#229B#22A3#22CE#2512#25C7#2603#26A5#26AB#26B5 -;~F#26C1#26CC#26D0#270B#2713#271B#2722#2729#2736#273C#2747#2789#2798#27B6#27E4#27EB#27FE#2817#2844#284F -;~F#2854#286E#287A#2895#28E7#28F5#28FD#2905#2930#2939#2962#2967#296C#2971#297B#298C#2A2E#2A3C#2A6B#2AA4 -;~F#2AB6#2AD5#2AE4#2AFB#2B18#2B1C#2B20#2B4E#2B6C#2B77#2BA2#2BC0 -;~B#1232#1474#1B54 +;~F#39#D8#177#17D#18D#241#2EC#2F5#315#329#32E#334#33A#340#346#34B#369#37F#394#39A +;~F#3A0#3A7#3AE#3BB#3C1#3C7#3CD#3D4#3E3#3EC#3F8#40A#423#43F#444#451#463#47E#485#48B +;~F#499#4AC#4B5#4BE#4E4#4F6#50D#519#525#538#53E#544#548#54E#553#572#581#590#596#5A5 +;~F#600#6A3#716#73A#7DC#7E9#8BC#959#972#980#9B2#A70#A7F#AB7#AD1#ADA#BB9#CFB#D0C#D43 +;~F#D6B#D7A#DA2#DCC#DE5#DF8#E28#E40#EF3#EFC#F13#F71#F9E#10E7#11D4#1365#14E9#1542#1571#158C +;~F#15A3#15B6#15C9#15DC#15EB#1607#160B#160F#1618#1633#1666#16C0#16CB#16D7#16E3#170E#171E#175D#176A#1777 +;~F#178C#18D1#18ED#18FD#190D#191A#1944#196A#1983#1A3C#1A96#1AAC#1AB8#1ACF#1ADA#1AE7#1AF1#1AFF#1B58#1BD2 +;~F#1C2C#1C67#1CB7#1E05#1E11#1ED3#1FAF#203D#20D9#2106#2137#224C#225E#227A#2284#2291#22B5#22F5#2335#2385 +;~F#23BE#23D2#23E7#23EB#240B#2413#243E#26A5#2763#27C2#281A#28C6#28D0#28D6#28E0#28EC#28F7#28FB#2936#293E +;~F#2946#294D#2954#2961#2967#2972#29B1#29C0#29DE#2A0C#2A13#2A26#2A3F#2A6C#2A77#2A7C#2A96#2AA2#2ABD#2B0F +;~F#2B1D#2B25#2B2D#2B59#2B62#2B8B#2B90#2B95#2B9A#2BA3#2BB4#2C59#2C67#2CD2#2CE4#2D03#2D12#2D29#2D4C#2D50 +;~F#2D54#2D82#2DA0#2DAB#2DD9#2DF7#2E42#2E5B#2E6A#2E7A#2E8A#2EC5 +;~B#11DC#1454#1BF2 ;~C#Blitz3D \ No newline at end of file diff --git a/Map Creator/arrows.png b/Map Creator/Assets/arrows.png similarity index 100% rename from Map Creator/arrows.png rename to Map Creator/Assets/arrows.png diff --git a/Map Creator/Assets/forest1.png b/Map Creator/Assets/forest1.png new file mode 100644 index 000000000..464dd749c Binary files /dev/null and b/Map Creator/Assets/forest1.png differ diff --git a/Map Creator/Assets/forest2.png b/Map Creator/Assets/forest2.png new file mode 100644 index 000000000..a05f65935 Binary files /dev/null and b/Map Creator/Assets/forest2.png differ diff --git a/Map Creator/Assets/forest2C.png b/Map Creator/Assets/forest2C.png new file mode 100644 index 000000000..0a68093c5 Binary files /dev/null and b/Map Creator/Assets/forest2C.png differ diff --git a/Map Creator/Assets/forest3.png b/Map Creator/Assets/forest3.png new file mode 100644 index 000000000..b6169b548 Binary files /dev/null and b/Map Creator/Assets/forest3.png differ diff --git a/Map Creator/Assets/forest4.png b/Map Creator/Assets/forest4.png new file mode 100644 index 000000000..908ea856d Binary files /dev/null and b/Map Creator/Assets/forest4.png differ diff --git a/Map Creator/Assets/forest_exit.png b/Map Creator/Assets/forest_exit.png new file mode 100644 index 000000000..44276a7ab Binary files /dev/null and b/Map Creator/Assets/forest_exit.png differ diff --git a/Map Creator/Assets/map_logo.jpg b/Map Creator/Assets/map_logo.jpg new file mode 100644 index 000000000..da9c1cc9f Binary files /dev/null and b/Map Creator/Assets/map_logo.jpg differ diff --git a/Map Creator/plus.png b/Map Creator/Assets/plus.png similarity index 100% rename from Map Creator/plus.png rename to Map Creator/Assets/plus.png diff --git a/Map Creator/room1.png b/Map Creator/Assets/room1.png similarity index 100% rename from Map Creator/room1.png rename to Map Creator/Assets/room1.png diff --git a/Map Creator/room2.png b/Map Creator/Assets/room2.png similarity index 100% rename from Map Creator/room2.png rename to Map Creator/Assets/room2.png diff --git a/Map Creator/room2C.png b/Map Creator/Assets/room2C.png similarity index 100% rename from Map Creator/room2C.png rename to Map Creator/Assets/room2C.png diff --git a/Map Creator/Assets/room2elev.png b/Map Creator/Assets/room2elev.png new file mode 100644 index 000000000..bacfad599 Binary files /dev/null and b/Map Creator/Assets/room2elev.png differ diff --git a/Map Creator/room3.png b/Map Creator/Assets/room3.png similarity index 100% rename from Map Creator/room3.png rename to Map Creator/Assets/room3.png diff --git a/Map Creator/room4.png b/Map Creator/Assets/room4.png similarity index 100% rename from Map Creator/room4.png rename to Map Creator/Assets/room4.png diff --git a/Map Creator/Map Creator v2.0.exe b/Map Creator/MapCreator v2.1.exe similarity index 80% rename from Map Creator/Map Creator v2.0.exe rename to Map Creator/MapCreator v2.1.exe index 6998713e6..362aa9cb6 100644 Binary files a/Map Creator/Map Creator v2.0.exe and b/Map Creator/MapCreator v2.1.exe differ diff --git a/Map Creator/Maps/Example.cbmap b/Map Creator/Maps/Example.cbmap deleted file mode 100644 index 6935b1674..000000000 Binary files a/Map Creator/Maps/Example.cbmap and /dev/null differ diff --git a/Map Creator/Maps/Example.cbmap2 b/Map Creator/Maps/Example.cbmap2 new file mode 100644 index 000000000..ccc8195eb Binary files /dev/null and b/Map Creator/Maps/Example.cbmap2 differ diff --git a/Map Creator/Maps/Larry's Revenge.cbmap b/Map Creator/Maps/Larry's Revenge.cbmap deleted file mode 100644 index 7e8f97642..000000000 Binary files a/Map Creator/Maps/Larry's Revenge.cbmap and /dev/null differ diff --git a/Map Creator/Maps/Larrys_Revenge.cbmap2 b/Map Creator/Maps/Larrys_Revenge.cbmap2 new file mode 100644 index 000000000..b3dc534bf Binary files /dev/null and b/Map Creator/Maps/Larrys_Revenge.cbmap2 differ diff --git a/Map Creator/dplayx.dll b/Map Creator/dplayx.dll new file mode 100644 index 000000000..ca26fca71 Binary files /dev/null and b/Map Creator/dplayx.dll differ diff --git a/Map Creator/map_logo.jpg b/Map Creator/map_logo.jpg deleted file mode 100644 index f18380620..000000000 Binary files a/Map Creator/map_logo.jpg and /dev/null differ diff --git a/Map Creator/mapcreator_new.bb b/Map Creator/mapcreator_new.bb index abddaf7af..b1f8efb2d 100644 --- a/Map Creator/mapcreator_new.bb +++ b/Map Creator/mapcreator_new.bb @@ -1,10 +1,10 @@ Global ResWidth% = 910 Global ResHeight% = 660 -Global versionnumber$ = "2.0" +Global versionnumber$ = "2.1" Loadingwindow=CreateWindow("", GraphicsWidth()/2-160,GraphicsHeight()/2-120,320,260,winhandle,8) panelloading = CreatePanel(0,0,320,260,Loadingwindow,0) -SetPanelImage(panelloading,"map_logo.jpg") +SetPanelImage(panelloading,"Assets\map_logo.jpg") ; create a window to put the toolbar in WinHandle=CreateWindow("SCP-CB Map Creator "+versionnumber,GraphicsWidth()/2-ResWidth/2, GraphicsHeight()/2-ResHeight/2,ResWidth,ResHeight,0, 13) @@ -17,13 +17,14 @@ LoadRoomTemplates(FileLocation) Global listbox = CreateListBox(5,60,ResWidth/4,ResHeight/2-20, winhandle) ; ein paar Eintrage hinzufugen For rt.RoomTemplates = Each RoomTemplates - ;If rt\Name <> "start" + If rt\MapGrid = 0 AddGadgetItem listbox, rt\Name - ;EndIf + EndIf Next SetGadgetLayout listbox, 3,3,2,2 InitEvents("..\Data\events.ini") +AddEvents() ;room_desc = CreateLabel("Room description:",5,40+ResHeight/2,ResWidth/4,ResHeight/8.05,WinHandle,3) Global room_desc = CreateLabel("Room description:",5,40+ResHeight/2,ResWidth/4,ResHeight/11.8,WinHandle,3) SetGadgetLayout room_desc , 3,3,2,2 @@ -38,7 +39,7 @@ SetGadgetLayout event_desc , 3,3,2,2 Global event_prob = CreateSlider(6,185+ResHeight/2,ResWidth/4-2,ResHeight/38.0,WinHandle,1) SetGadgetLayout event_prob , 3,3,2,2 -SetSliderRange event_prob,0,101 +SetSliderRange event_prob,0,100 DisableGadget event_prob Global event_prob_label = CreateLabel("",5,170+ResHeight/2,ResWidth/4,ResHeight/38.0,WinHandle,3) @@ -62,14 +63,13 @@ clean_txt=CreateButton("X",210,40,20,20,winhandle) ;create button ;map_2d = CreateLabel("",300,25,550,550,WinHandle,3) ;SetGadgetLayout map_2d , 3,3,2,2 Global ShowGrid% = True -Const MapWidth = 18, MapHeight = 18 map_2d = CreateCanvas(300,25,551,551,WinHandle) Dim MapIcons(5,4) -MapIcons(ROOM1, 0)=LoadImage("room1.png") -MapIcons(ROOM2, 0)=LoadImage("room2.png") -MapIcons(ROOM2C, 0)=LoadImage("room2C.png") -MapIcons(ROOM3, 0)=LoadImage("room3.png") -MapIcons(ROOM4, 0)=LoadImage("room4.png") +MapIcons(ROOM1, 0)=LoadImage("Assets\room1.png") +MapIcons(ROOM2, 0)=LoadImage("Assets\room2.png") +MapIcons(ROOM2C, 0)=LoadImage("Assets\room2C.png") +MapIcons(ROOM3, 0)=LoadImage("Assets\room3.png") +MapIcons(ROOM4, 0)=LoadImage("Assets\room4.png") For i = ROOM1 To ROOM4 MaskImage MapIcons(i,0), 255,255,255 MidHandle(MapIcons(i,0)) @@ -80,6 +80,39 @@ For i = ROOM1 To ROOM4 MidHandle(MapIcons(i,n)) Next Next +Dim ForestIcons(5,4) +ForestIcons(ROOM1, 0)=LoadImage("Assets\forest1.png") +ForestIcons(ROOM2, 0)=LoadImage("Assets\forest2.png") +ForestIcons(ROOM2C, 0)=LoadImage("Assets\forest2C.png") +ForestIcons(ROOM3, 0)=LoadImage("Assets\forest3.png") +ForestIcons(ROOM4, 0)=LoadImage("Assets\forest4.png") +For i = ROOM1 To ROOM4 + MaskImage ForestIcons(i,0), 255,255,255 + MidHandle(ForestIcons(i,0)) + For n = 1 To 3 + ForestIcons(i,n)=CopyImage(ForestIcons(i,0)) + MaskImage ForestIcons(i,n), 255,255,255 + RotateImage(ForestIcons(i,n),90*n) + MidHandle(ForestIcons(i,n)) + Next +Next +Global Grid_SelectedX#=-1.0, Grid_SelectedY#=-1.0 +Global CurrMapGrid% = 0 +Dim SpecialIcons(2,4) +SpecialIcons(1, 0) = LoadImage("Assets\forest_exit.png") +SpecialIcons(2, 0) = LoadImage("Assets\room2elev.png") +For i = 1 To 2 + MaskImage SpecialIcons(i,0), 255,255,255 + MidHandle(SpecialIcons(i,0)) + For n = 1 To 3 + SpecialIcons(i,n)=CopyImage(SpecialIcons(i,0)) + MaskImage SpecialIcons(i,n), 255,255,255 + RotateImage(SpecialIcons(i,n),90*n) + MidHandle(SpecialIcons(i,n)) + Next +Next +;------------------------------------------------------------------------------Facility +Const MapWidth = 18, MapHeight = 18 Dim Map.RoomTemplates(MapWidth, MapHeight) Dim MapAngle%(MapWidth, MapHeight) Dim MapEvent$(MapWidth, MapHeight) @@ -91,9 +124,19 @@ Dim MapEventProb#(MapWidth, MapHeight) ; MapAngle(MapWidth/2,MapHeight)=180 ; EndIf ;Next -Global Grid_SelectedX#=-1.0, Grid_SelectedY#=-1.0 + +;------------------------------------------------------------------------------Forest +Const ForestGridSize = 9 +Dim ForestPlace.RoomTemplates(ForestGridSize, ForestGridSize) +Dim ForestPlaceAngle%(ForestGridSize, ForestGridSize) + +;------------------------------------------------------------------------------Maintenance Tunnels +Const MT_GridSize = 18 +Dim MTRoom.RoomTemplates(MT_GridSize, MT_GridSize) +Dim MTRoomAngle%(MT_GridSize, MT_GridSize) + Dim Arrows(4) -Arrows(0) = LoadImage("arrows.png") +Arrows(0) = LoadImage("Assets\arrows.png") HandleImage Arrows(0),ImageWidth(Arrows(0))/2,ImageHeight(Arrows(0))/2 For i = 1 To 3 Arrows(i)=CopyImage(Arrows(0)) @@ -102,7 +145,7 @@ For i = 1 To 3 Next Global PlusIcon -PlusIcon = LoadImage("plus.png") +PlusIcon = LoadImage("Assets\plus.png") MaskImage plusicon,255,255,255 MidHandle(plusicon) @@ -115,6 +158,12 @@ InsertGadgetItem(tab,0,"2D/Map Creator") InsertGadgetItem(tab,1,"3D/Map Viewer") SetGadgetLayout tab , 3,3,2,2 +tab2=CreateTabber(300,5,ResWidth/4+20,ResHeight-100,winhandle) +InsertGadgetItem(tab2,0,"Facility") +InsertGadgetItem(tab2,1,"Forest") +InsertGadgetItem(tab2,2,"Maintenance Tunnels") +SetGadgetLayout tab2 , 3,3,2,2 + SetStatusText(Loadingwindow, "Starting up") ; Now create a whole bunch of menus and sub-items - first of all the FILE menu file=CreateMenu("File",0,menu) ; main menu @@ -127,11 +176,12 @@ CreateMenu "",1000,file ; Use an empty string to generate separator bars CreateMenu "Quit",10001,file ; another child menu options=CreateMenu("Options",0,menu) -event_default = CreateMenu("Set the Event for the Rooms by Default",15,options) - +event_default = CreateMenu("Set the event for the rooms by default",15,options) +Global adjdoor_place = CreateMenu("Place adjacent doors in 3D view",16,options) +CreateMenu "",1000,options +zone_trans = CreateMenu("Map Settings",18,options) +author_descr = CreateMenu("Edit Author and Description",19,options) CreateMenu "",1000,options -;CreateMenu "Change Paths",1000,options -;CreateMenu "",1000,options CreateMenu "Edit Camera",17,options Local option_event = GetINIInt("options.INI","general","events_default") @@ -140,7 +190,13 @@ If (Not option_event) Else CheckMenu event_default EndIf - +Local option_adjdoors = GetINIInt("options.INI","3d scene","adjdoors_place") +If (Not option_adjdoors) + UncheckMenu adjdoor_place +Else + CheckMenu adjdoor_place +EndIf + ; Now the Edit menu edit=CreateMenu("&Help",0,menu) ; Main menu with Alt Shortcut - Use & to specify the shortcut key CreateMenu "Manual"+Chr$(8)+"F1",6,edit ; Another Child menu with Alt Shortcut @@ -171,32 +227,58 @@ labelcursorR=CreateLabel("R "+GetINIInt("options.INI","3d scene","cursor color R labelcursorG=CreateLabel("G "+GetINIInt("options.INI","3d scene","cursor color G"),225,90,40,15, optionwin) labelcursorB=CreateLabel("B "+GetINIInt("options.INI","3d scene","cursor color B"),225,105,40,15, optionwin) -redfog = GetINIInt("options.INI","3d scene","bg color R") -greenfog = GetINIInt("options.INI","3d scene","bg color G") -bluefog = GetINIInt("options.INI","3d scene","bg color B") +Global redfog = GetINIInt("options.INI","3d scene","bg color R") +Global greenfog = GetINIInt("options.INI","3d scene","bg color G") +Global bluefog = GetINIInt("options.INI","3d scene","bg color B") -redcursor = GetINIInt("options.INI","3d scene","cursor color R") -greencursor = GetINIInt("options.INI","3d scene","cursor color G") -bluecursor = GetINIInt("options.INI","3d scene","cursor color B") +Global redcursor = GetINIInt("options.INI","3d scene","cursor color R") +Global greencursor = GetINIInt("options.INI","3d scene","cursor color G") +Global bluecursor = GetINIInt("options.INI","3d scene","cursor color B") labelrange=CreateLabel("Culling Range",10,170,80,20, optionwin) -camerarange = CreateTextField(25, 150, 40, 20, optionwin) +Global camerarange = CreateTextField(25, 150, 40, 20, optionwin) SetGadgetText camerarange, GetINIInt("options.INI","3d scene","camera range") ;labelrange=CreateLabel("Camera Range",10,140,80,20, optionwin) ;camerarange = CreateTextField(25, 145, 40, 20, optionwin) ;SetGadgetText camerarange, GetINIInt("options.INI","3d scene","camera range") -vsync = CreateButton("Vsync", 123, 145, 50, 30, optionwin, 2) +Global vsync = CreateButton("Vsync", 123, 145, 50, 30, optionwin, 2) SetButtonState vsync, GetINIInt("options.INI","3d scene","vsync") -showfps = CreateButton("Show FPS", 210, 145, 70, 30, optionwin, 2) +Global showfps = CreateButton("Show FPS", 210, 145, 70, 30, optionwin, 2) SetButtonState showfps, GetINIInt("options.INI","3d scene","show fps") cancelopt_button=CreateButton("Cancel",10,210,100,30,optionwin) saveopt_button=CreateButton("Save",185,210,100,30,optionwin) ;create button + +map_settings=CreateWindow("Map Settings", GraphicsWidth()/2-120,GraphicsHeight()/2-80,240,160,winhandle,1) +HideGadget map_settings + +zonetext = CreateLabel("Zone transition settings:",10,10,200,20,map_settings) +labelzonetrans1 = CreateLabel("LCZ to HCZ transition",10,60,120,20,map_settings) +Global zonetrans1 = CreateTextField(20,40,80,20,map_settings) +SetGadgetText zonetrans1,5 +labelzonetrans2 = CreateLabel("HCZ to EZ transition",120,60,120,20,map_settings) +Global zonetrans2 = CreateTextField(130,40,80,20,map_settings) +SetGadgetText zonetrans2,11 + +Global zonetransvalue1 = 13, zonetransvalue2 = 7 + +resetzonetrans = CreateButton("Reset",10,90,100,30,map_settings) +applyzonetrans = CreateButton("Apply",120,90,100,30,map_settings) + +authordescr_settings=CreateWindow("Edit Author and Description", GraphicsWidth()/2-200,GraphicsHeight()/2-80,400,200,winhandle,1) +HideGadget authordescr_settings + +Global MapAuthor$ = "", MapDescription$ = "" +Global map_author_text = CreateTextField(120,30,140,20,authordescr_settings) +map_author_label = CreateLabel("Map author:",140,10,160,20,authordescr_settings) +Global descr_text = CreateTextArea(20,80,350,80,authordescr_settings,1) +descr_label = CreateLabel("Description:",140,60,160,20,authordescr_settings) + SetStatusText(Loadingwindow, "Executing 3D viewer...") -ExecFile("Window3D.exe") +ExecFile("window3d.exe") Repeat vwprt = FindWindow("Blitz Runtime Class" , "MapCreator 3d view");User32.dll @@ -221,42 +303,444 @@ Repeat MouseDown1 = MouseDown(1) MouseDown2 = MouseDown(2) MouseHit3 = MouseHit(3) + + SetGadgetText(map_author_text,(Left(TextFieldText(map_author_text),15))) + SetGadgetText(map_author_label,("Map author ("+(Len(TextFieldText(map_author_text)))+"/15) :")) + + If Len(TextAreaText(descr_text))>200 Then + SetGadgetText(descr_text,(Left(TextAreaText(descr_text),200))) + EndIf + SetGadgetText(descr_label,("Description ("+(Len(TextAreaText(descr_text)))+"/200) :")) + + If FileType("CONFIG_TO2D.SI")=1 + f = ReadFile("CONFIG_TO2D.SI") + + Grid_SelectedX=ReadInt(f) + Grid_SelectedY=ReadInt(f) + + ChangeGridGadget = True + GridGadgetText = "" + SelectGadgetItem listbox,-1 + HideGadget listbox + ShowGadget listbox + ClearGadgetItems combobox + + If CurrMapGrid%=0 + Local hasEvent% = False + Local currEventDescr$ = "" + For rt.RoomTemplates = Each RoomTemplates + If rt = Map(Grid_SelectedX,Grid_SelectedY) + For i = 0 To 5 + If rt\Events[i]<>"" + InsertGadgetItem combobox, 0, "[none]" + hasEvent=True + Exit + EndIf + Next + For i = 0 To 5 + If rt\events[i]<>"" + InsertGadgetItem combobox, i+1, rt\events[i] + EndIf + Next + SetGadgetText room_desc,"Room description:"+Chr(13)+rt\Description + Exit + EndIf + Next + + If (Not hasEvent) + DisableGadget combobox + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°" + Else + EnableGadget combobox + If MapEvent(Grid_SelectedX,Grid_SelectedY)<>"" And MapEvent(Grid_SelectedX,Grid_SelectedY)<>"[none]" + For ev.event = Each event + If ev\name = MapEvent(Grid_SelectedX,Grid_SelectedY) + SetGadgetText event_desc, "Event description:"+Chr(13)+ev\description + Exit + EndIf + Next + Else + SetGadgetText event_desc, "" + EndIf + If MapEvent(Grid_SelectedX,Grid_SelectedY)<>"" And MapEvent(Grid_SelectedX,Grid_SelectedY)<>"[none]" + SetGadgetText event_prob_label, "Event chance: "+Int(MapEventProb(Grid_SelectedX,Grid_SelectedY)*100)+"%" + SetSliderValue event_prob,Int(MapEventProb(Grid_SelectedX,Grid_SelectedY)*100)-1 + EnableGadget event_prob + GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°"+Chr(13)+"Event: "+MapEvent(Grid_SelectedX,Grid_SelectedY)+Chr(13)+"Event Chance: "+Int(MapEventProb(Grid_SelectedX,Grid_SelectedY)*100)+"%" + Else + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°" + EndIf + EndIf + + c = CountGadgetItems( combobox ) + If c >= 0 Then + For e=0 To c-1 + If GadgetItemText(combobox,e)=MapEvent(Grid_SelectedX,Grid_SelectedY) + SelectGadgetItem combobox,e + EndIf + Next + EndIf + ElseIf CurrMapGrid%=1 + For rt.RoomTemplates = Each RoomTemplates + If rt = ForestPlace(Grid_SelectedX,Grid_SelectedY) + SetGadgetText room_desc,"Room description:"+Chr(13)+rt\Description + Exit + EndIf + Next + + DisableGadget combobox + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + GridGadgetText="Name: "+ForestPlace(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY)+"°" + Else + For rt.RoomTemplates = Each RoomTemplates + If rt = MTRoom(Grid_SelectedX,Grid_SelectedY) + SetGadgetText room_desc,"Room description:"+Chr(13)+rt\Description + Exit + EndIf + Next + + DisableGadget combobox + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + GridGadgetText="Name: "+MTRoom(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MTRoomAngle(Grid_SelectedX,Grid_SelectedY)+"°" + EndIf + + CloseFile f + DeleteFile("CONFIG_TO2D.SI") + EndIf + If ShowGrid Cls Local width# = GadgetWidth(map_2d) Local height# = GadgetHeight(map_2d) - For x = 0 To MapWidth - For y = 0 To MapHeight - If GetZone(y)=0 - Color 255,255,255 - ElseIf GetZone(y)=1 - Color 255,200,200 - Else - Color 255,255,200 + ;Facility grid + If CurrMapGrid%=0 + For x = 0 To MapWidth + For y = 0 To MapHeight + ;If GetZone(y)=0 + ; Color 255,255,255 + ;ElseIf GetZone(y)=1 + ; Color 255,125,125 + ;Else + ; Color 255,255,125 + ;EndIf + ; + ;If y=zonetransvalue1 Then Color 255,200,200 + ;If y=zonetransvalue2 Then Color 255,200,125 + + If yzonetransvalue2 And y0 And x0 And y(Float(width)/Float(MapWidth+1)*x+GadgetX(WinHandle)) And (MouseX()-GadgetX(map_2d))<((Float(width)/Float(MapWidth+1)*x)+(Float(width)/Float(MapWidth+1))+GadgetX(WinHandle)) + Local offset% = 45 + If (MouseY()-GadgetY(map_2d))>(Float(height)/Float(MapHeight+1)*y+GadgetY(WinHandle)+offset) And (MouseY()-GadgetY(map_2d))<((Float(height)/Float(MapHeight+1)*y)+(Float(height)/Float(MapHeight+1))+GadgetY(WinHandle)+offset) + Color 200,200,200 + Rect Float(width)/Float(MapWidth+1)*x,Float(height)/Float(MapHeight+1)*y,(Float(width)/Float(MapWidth+1)),(Float(height)/Float(MapHeight+1)),True + If Map(x,y)=Null And SelectedGadgetItem(listbox)>-1 + x2 = Float(width)/Float(MapWidth+1) + y2 = Float(height)/Float(MapHeight+1) + DrawImage PlusIcon,(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 + EndIf + If MouseHit1 + If Grid_SelectedX=x And Grid_SelectedY=y + ;Grid_SelectedX=-1 + ;Grid_SelectedY=-1 + ;ChangeGridGadget = True + ;GridGadgetText = "" + Else + item = SelectedGadgetItem( listbox ) + If Map(x,y)<>Null + Grid_SelectedX=x + Grid_SelectedY=y + ChangeGridGadget = True + GridGadgetText = "" + SelectGadgetItem listbox,-1 + HideGadget listbox + ShowGadget listbox + + ClearGadgetItems combobox + + hasEvent% = False + currEventDescr$ = "" + For rt.RoomTemplates = Each RoomTemplates + If rt = Map(x,y) + For i = 0 To 5 + If rt\Events[i]<>"" + InsertGadgetItem combobox, 0, "[none]" + hasEvent=True + Exit + EndIf + Next + For i = 0 To 5 + If rt\events[i]<>"" + InsertGadgetItem combobox, i+1, rt\events[i] + EndIf + Next + SetGadgetText room_desc,"Room description:"+Chr(13)+rt\Description + Exit + EndIf + Next + + If (Not hasEvent) + DisableGadget combobox + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + Else + EnableGadget combobox + If MapEvent(x,y)<>"" And MapEvent(x,y)<>"[none]" + For ev.event = Each event + If ev\name = MapEvent(x,y) + SetGadgetText event_desc, "Event description:"+Chr(13)+ev\description + Exit + EndIf + Next + Else + SetGadgetText event_desc, "" + EndIf + If MapEvent(x,y)<>"" And MapEvent(x,y)<>"[none]" + SetGadgetText event_prob_label, "Event chance: 100%" + SetSliderValue event_prob,99 + EnableGadget event_prob + Else + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + EndIf + EndIf + + c = CountGadgetItems( combobox ) + If c >= 0 Then + For e=0 To c-1 + If GadgetItemText(combobox,e)=MapEvent(x,y) + SelectGadgetItem combobox,e + EndIf + Next + EndIf + EndIf + If item>=0 + If Map(x,y)=Null + Local room_name$ = GadgetItemText$(listbox, item) + For rt.RoomTemplates = Each RoomTemplates + If rt\Name = room_name + Map(x,y)=rt + Exit + EndIf + Next + If Map(x,y)\Name = "start" Or Map(x,y)\Name = "checkpoint1" Or Map(x,y)\Name = "checkpoint2" + MapAngle(x,y)=180 + EndIf + item2 = SelectedGadgetItem(combobox) + If item2>=0 + Local event_name$ = GadgetItemText$(combobox, item2) + If event_name$<>"" And event_name$<>"[none]" + MapEvent(x,y)=event_name + MapEventProb(x,y)=Float((SliderValue(event_prob)+1)/100.0) + EndIf + EndIf + EndIf + EndIf + EndIf + EndIf + If MouseDown2 + Grid_SelectedX=-1 + Grid_SelectedY=-1 + ChangeGridGadget = True + GridGadgetText = "" + SetSliderValue(event_prob,99) + ;If GadgetText(event_prob_label)<>"" + ; SetGadgetText event_prob_label,"Event chance: "+SliderValue(event_prob)+"%" + ;EndIf + SetGadgetText event_prob_label,"" + DisableGadget event_prob + SetGadgetText event_desc,"" + DisableGadget combobox + ClearGadgetItems combobox + If Map(x,y)<>Null + Map(x,y)=Null + MapAngle(x,y)=0 + MapEvent(x,y)="" + MapEventProb(x,y)=0.0 + EndIf + EndIf + If MouseHit3 + Grid_SelectedX=-1 + Grid_SelectedY=-1 + ChangeGridGadget = True + GridGadgetText = "" + SetSliderValue(event_prob,99) + ;If GadgetText(event_prob_label)<>"" + ; SetGadgetText event_prob_label,"Event chance: "+SliderValue(event_prob)+"%" + ;EndIf + SetGadgetText event_prob_label,"" + DisableGadget event_prob + SetGadgetText event_desc,"" + DisableGadget combobox + ClearGadgetItems combobox + EndIf + EndIf + EndIf + ;EndIf + + ;If (MouseX()-GadgetX(map_2d))>(GadgetX(WinHandle)) And (MouseX()-GadgetX(map_2d))<(Float(width)+GadgetX(WinHandle)) + ; offset% = 45 + ; If (MouseY()-GadgetY(map_2d))>(GadgetY(WinHandle)+offset) And (MouseY()-GadgetY(map_2d))<(Float(height)+GadgetY(WinHandle)+offset) + ; If MouseHit2 + ; Grid_SelectedX=-1 + ; Grid_SelectedY=-1 + ; ChangeGridGadget = True + ; GridGadgetText = "" + ; EndIf + ; EndIf + ;EndIf + + If Grid_SelectedX=x And Grid_SelectedY=y + Color 150,150,150 + Rect Float(width)/Float(MapWidth+1)*x,Float(height)/Float(MapHeight+1)*y,(Float(width)/Float(MapWidth+1)),(Float(height)/Float(MapHeight+1)),True + EndIf + + If Map(x,y) = Null + ;If x=0 Or x=MapWidth Or y=0 Or y=MapHeight + ; Color 170, 170, 170 + ;Else + ; Color 90,90,90 + ;EndIf + Color 90,90,90 + Rect Float(width)/Float(MapWidth+1)*x+1,Float(height)/Float(MapHeight+1)*y+1,(Float(width)/Float(MapWidth+1))-1,(Float(height)/Float(MapHeight+1))-1,False + Else + x2 = Float(width)/Float(MapWidth+1) + y2 = Float(height)/Float(MapHeight+1) + DrawImage MapIcons(Map(x,y)\Shape,Floor(MapAngle(x,y)/90.0)),(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 + + If Grid_SelectedX=x And Grid_SelectedY=y + If PrevSelectedX<>Grid_SelectedX Or PrevSelectedY<>Grid_SelectedY + ChangeGridGadget = True + If MapEvent(x,y)<>"" And MapEvent(x,y)<>"[none]" + GridGadgetText = "Name: "+Map(x,y)\Name+Chr(13)+"Angle: "+MapAngle(x,y)+"°"+Chr(13)+"Event: "+MapEvent(x,y)+Chr(13)+"Event Chance: "+Int(MapEventProb(x,y)*100)+"%" + SetSliderValue(event_prob,Int(MapEventProb(x,y)*100)-1) + Else + GridGadgetText = "Name: "+Map(x,y)\Name+Chr(13)+"Angle: "+MapAngle(x,y)+"°" + ;SetSliderValue(event_prob,99) + EndIf + If GadgetText(event_prob_label)<>"" + SetGadgetText event_prob_label,"Event chance: "+(SliderValue(event_prob)+1)+"%" + EndIf + EndIf + EndIf + EndIf + Next + Next + If MouseDown1 + If Grid_SelectedX>-1 And Grid_SelectedY>-1 + If MouseX()>(GadgetX(map_2d)+GadgetX(WinHandle)) And MouseX()<((width)+GadgetX(map_2d)+GadgetX(WinHandle)) + offset% = 45 + If MouseY()>(GadgetY(map_2d)+GadgetY(WinHandle)+offset) And MouseY()<((height)+GadgetY(map_2d)+GadgetY(WinHandle)+offset) + If Map(Grid_SelectedX,Grid_SelectedY)\Name<>"start" + Local prevAngle = MapAngle(Grid_SelectedX,Grid_SelectedY) + ;Left + If (MouseX()-GadgetX(map_2d))<(Float(width)/Float(MapWidth+1)*Grid_SelectedX+GadgetX(WinHandle)) + MapAngle(Grid_SelectedX,Grid_SelectedY)=90 + EndIf + ;Right + If (MouseX()-GadgetX(map_2d))>((Float(width)/Float(MapWidth+1)*Grid_SelectedX)+(Float(width)/Float(MapWidth+1))+GadgetX(WinHandle)) + MapAngle(Grid_SelectedX,Grid_SelectedY)=270 + EndIf + ;Up + offset% = 45 + If (MouseY()-GadgetY(map_2d))<(Float(height)/Float(MapHeight+1)*Grid_SelectedY+GadgetY(WinHandle)+offset) + MapAngle(Grid_SelectedX,Grid_SelectedY)=180 + EndIf + ;Down + If (MouseY()-GadgetY(map_2d))>((Float(height)/Float(MapHeight+1)*Grid_SelectedY)+(Float(height)/Float(MapHeight+1))+GadgetY(WinHandle)+offset) + MapAngle(Grid_SelectedX,Grid_SelectedY)=0 + EndIf + Local width2 = Float(width)/Float(MapWidth+1)/2.0 + Local height2 = Float(height)/Float(MapHeight+1)/2.0 + DrawImage Arrows(Floor(MapAngle(Grid_SelectedX,Grid_SelectedY)/90)),Float(width)/Float(MapWidth+1)*Grid_SelectedX+width2,Float(height)/Float(MapHeight+1)*Grid_SelectedY+height2 + If prevAngle<>MapAngle(Grid_SelectedX,Grid_SelectedY) + ChangeGridGadget = True + If MapEvent(Grid_SelectedX,Grid_SelectedY)<>"" And MapEvent(Grid_SelectedX,Grid_SelectedY)<>"[none]" + GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°"+Chr(13)+"Event: "+MapEvent(Grid_SelectedX,Grid_SelectedY)+Chr(13)+"Event Chance: "+Int(MapEventProb(Grid_SelectedX,Grid_SelectedY)*100)+"%" + Else + GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°" + EndIf + EndIf + EndIf + EndIf + EndIf EndIf - Rect Float(width)/Float(MapWidth+1)*x,Float(height)/Float(MapHeight+1)*y,(Float(width)/Float(MapWidth+1)),(Float(height)/Float(MapHeight+1)),True - - Local PrevSelectedX=Grid_SelectedX, PrevSelectedY=Grid_SelectedY - ;If x>0 And x0 And y(Float(width)/Float(MapWidth+1)*x+GadgetX(WinHandle)) And (MouseX()-GadgetX(map_2d))<((Float(width)/Float(MapWidth+1)*x)+(Float(width)/Float(MapWidth+1))+GadgetX(WinHandle)) - Local offset% = 45 - If (MouseY()-GadgetY(map_2d))>(Float(height)/Float(MapHeight+1)*y+GadgetY(WinHandle)+offset) And (MouseY()-GadgetY(map_2d))<((Float(height)/Float(MapHeight+1)*y)+(Float(height)/Float(MapHeight+1))+GadgetY(WinHandle)+offset) + EndIf + ;Forest grid + ElseIf CurrMapGrid%=1 + For x = 0 To ForestGridSize + For y = 0 To ForestGridSize + Color 125,255,255 + If x=ForestGridSize Or y=ForestGridSize + Rect Float(width-1)/Float(ForestGridSize+1)*x,Float(height-1)/Float(ForestGridSize+1)*y,(Float(width-1)/Float(ForestGridSize+1))+1,(Float(height-1)/Float(ForestGridSize+1))+1,True + Else + Rect Float(width-1)/Float(ForestGridSize+1)*x,Float(height-1)/Float(ForestGridSize+1)*y,(Float(width-1)/Float(ForestGridSize+1)),(Float(height-1)/Float(ForestGridSize+1)),True + EndIf + + If ForestPlace(x,y) = Null + Color 90,90,90 + Rect Float(width-1)/Float(ForestGridSize+1)*x+1,Float(height-1)/Float(ForestGridSize+1)*y+1,(Float(width-1)/Float(ForestGridSize+1))-1,(Float(height-1)/Float(ForestGridSize+1))-1,False + EndIf + Next + Next + + For x = 0 To ForestGridSize + For y = 0 To ForestGridSize + Color 255,255,255 + If x=ForestGridSize Or y=ForestGridSize + Rect Float(width-1)/Float(ForestGridSize+1)*x,Float(height-1)/Float(ForestGridSize+1)*y,(Float(width-1)/Float(ForestGridSize+1))+1,(Float(height-1)/Float(ForestGridSize+1))+1,True + Else + Rect Float(width-1)/Float(ForestGridSize+1)*x,Float(height-1)/Float(ForestGridSize+1)*y,(Float(width-1)/Float(ForestGridSize+1)),(Float(height-1)/Float(ForestGridSize+1)),True + EndIf + + PrevSelectedX=Grid_SelectedX + PrevSelectedY=Grid_SelectedY + If (MouseX()-GadgetX(map_2d))>(Float(width-1)/Float(ForestGridSize+1)*x+GadgetX(WinHandle)) And (MouseX()-GadgetX(map_2d))<((Float(width-1)/Float(ForestGridSize+1)*x)+(Float(width-1)/Float(ForestGridSize+1))+GadgetX(WinHandle)) + offset% = 45 + If (MouseY()-GadgetY(map_2d))>(Float(height-1)/Float(ForestGridSize+1)*y+GadgetY(WinHandle)+offset) And (MouseY()-GadgetY(map_2d))<((Float(height-1)/Float(ForestGridSize+1)*y)+(Float(height-1)/Float(ForestGridSize+1))+GadgetY(WinHandle)+offset) Color 200,200,200 - Rect Float(width)/Float(MapWidth+1)*x,Float(height)/Float(MapHeight+1)*y,(Float(width)/Float(MapWidth+1)),(Float(height)/Float(MapHeight+1)),True - If Map(x,y)=Null And SelectedGadgetItem(listbox)>-1 - x2 = Float(width)/Float(MapWidth+1) - y2 = Float(height)/Float(MapHeight+1) + Rect Float(width-1)/Float(ForestGridSize+1)*x,Float(height-1)/Float(ForestGridSize+1)*y,(Float(width-1)/Float(ForestGridSizee+1)),(Float(height-1)/Float(ForestGridSize+1)),True + If ForestPlace(x,y)=Null And SelectedGadgetItem(listbox)>-1 + x2 = Float(width)/Float(ForestGridSize+1) + y2 = Float(height)/Float(ForestGridSize+1) DrawImage PlusIcon,(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 EndIf If MouseHit1 If Grid_SelectedX=x And Grid_SelectedY=y - ;Grid_SelectedX=-1 - ;Grid_SelectedY=-1 - ;ChangeGridGadget = True - ;GridGadgetText = "" + Else item = SelectedGadgetItem( listbox ) - If Map(x,y)<>Null ;Or item>=0 + If ForestPlace(x,y)<>Null Grid_SelectedX=x Grid_SelectedY=y ChangeGridGadget = True @@ -267,73 +751,180 @@ Repeat ClearGadgetItems combobox - Local hasEvent% = False - Local currEventDescr$ = "" For rt.RoomTemplates = Each RoomTemplates - If rt = Map(x,y) - For i = 0 To 5 - If rt\events[i]<>"" - InsertGadgetItem combobox, i, rt\events[i] - hasEvent = True - EndIf - Next + If rt = ForestPlace(x,y) SetGadgetText room_desc,"Room description:"+Chr(13)+rt\Description Exit EndIf Next - If (Not hasEvent) - DisableGadget combobox - SetGadgetText event_desc, "" - SetGadgetText event_prob_label, "" - SetSliderValue event_prob,100 - DisableGadget event_prob - Else - EnableGadget combobox - If MapEvent(x,y)<>"" - For ev.event = Each event - If ev\name = MapEvent(x,y) - SetGadgetText event_desc, "Event description:"+Chr(13)+ev\description - Exit - EndIf - Next - Else - SetGadgetText event_desc, "" - EndIf - SetGadgetText event_prob_label, "Event chance: 100%" - SetSliderValue event_prob,100 - EnableGadget event_prob - EndIf - - c = CountGadgetItems( combobox ) - If c > 0 Then - For e=0 To c-1 - If GadgetItemText(combobox,e)=MapEvent(x,y) - SelectGadgetItem combobox,e + DisableGadget combobox + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + EndIf + If item>=0 + If ForestPlace(x,y)=Null + room_name$ = GadgetItemText$(listbox, item) + For rt.RoomTemplates = Each RoomTemplates + If rt\Name = room_name + ForestPlace(x,y)=rt + Exit EndIf Next EndIf EndIf + EndIf + EndIf + If MouseDown2 + Grid_SelectedX=-1 + Grid_SelectedY=-1 + ChangeGridGadget = True + GridGadgetText = "" + SetSliderValue(event_prob,99) + SetGadgetText event_prob_label,"" + DisableGadget event_prob + SetGadgetText event_desc,"" + DisableGadget combobox + ClearGadgetItems combobox + If ForestPlace(x,y)<>Null + ForestPlace(x,y)=Null + ForestPlaceAngle(x,y)=0 + EndIf + EndIf + If MouseHit3 + Grid_SelectedX=-1 + Grid_SelectedY=-1 + ChangeGridGadget = True + GridGadgetText = "" + SetSliderValue(event_prob,99) + SetGadgetText event_prob_label,"" + DisableGadget event_prob + SetGadgetText event_desc,"" + DisableGadget combobox + ClearGadgetItems combobox + EndIf + EndIf + EndIf + + If Grid_SelectedX=x And Grid_SelectedY=y + Color 150,150,150 + Rect Float(width-1)/Float(ForestGridSize+1)*x,Float(height-1)/Float(ForestGridSize+1)*y,(Float(width-1)/Float(ForestGridSize+1)),(Float(height-1)/Float(ForestGridSize+1)),True + EndIf + + If ForestPlace(x,y) = Null + Color 90,90,90 + Rect Float(width-1)/Float(ForestGridSize+1)*x+1,Float(height-1)/Float(ForestGridSize+1)*y+1,(Float(width-1)/Float(ForestGridSize+1))-1,(Float(height-1)/Float(ForestGridSize+1))-1,False + Else + x2 = Float(width-1)/Float(ForestGridSize+1) + y2 = Float(height-1)/Float(ForestGridSize+1) + If ForestPlace(x,y)\Name = "SCP-860-1 door" Then + DrawImage SpecialIcons(1,Floor(ForestPlaceAngle(x,y)/90.0)),(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 + Else + DrawImage ForestIcons(ForestPlace(x,y)\Shape,Floor(ForestPlaceAngle(x,y)/90.0)),(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 + EndIf + + If Grid_SelectedX=x And Grid_SelectedY=y + If PrevSelectedX<>Grid_SelectedX Or PrevSelectedY<>Grid_SelectedY + ChangeGridGadget = True + GridGadgetText = "Name: "+ForestPlace(x,y)\Name+Chr(13)+"Angle: "+ForestPlaceAngle(x,y)+"°" + EndIf + EndIf + EndIf + Next + Next + If MouseDown1 + If Grid_SelectedX>-1 And Grid_SelectedY>-1 + If MouseX()>(GadgetX(map_2d)+GadgetX(WinHandle)) And MouseX()<((width)+GadgetX(map_2d)+GadgetX(WinHandle)) + offset% = 45 + If MouseY()>(GadgetY(map_2d)+GadgetY(WinHandle)+offset) And MouseY()<((height)+GadgetY(map_2d)+GadgetY(WinHandle)+offset) + prevAngle = ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY) + ;Left + If (MouseX()-GadgetX(map_2d))<(Float(width-1)/Float(ForestGridSize+1)*Grid_SelectedX+GadgetX(WinHandle)) + ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY)=90 + EndIf + ;Right + If (MouseX()-GadgetX(map_2d))>((Float(width-1)/Float(ForestGridSize+1)*Grid_SelectedX)+(Float(width-1)/Float(ForestGridSize+1))+GadgetX(WinHandle)) + ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY)=270 + EndIf + ;Up + offset% = 45 + If (MouseY()-GadgetY(map_2d))<(Float(height-1)/Float(ForestGridSize+1)*Grid_SelectedY+GadgetY(WinHandle)+offset) + ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY)=180 + EndIf + ;Down + If (MouseY()-GadgetY(map_2d))>((Float(height-1)/Float(ForestGridSize+1)*Grid_SelectedY)+(Float(height-1)/Float(ForestGridSize+1))+GadgetY(WinHandle)+offset) + ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY)=0 + EndIf + width2 = Float(width-1)/Float(ForestGridSize+1)/2.0 + height2 = Float(height-1)/Float(ForestGridSize+1)/2.0 + DrawImage Arrows(Floor(ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY)/90)),Float(width-1)/Float(ForestGridSize+1)*Grid_SelectedX+width2,Float(height-1)/Float(ForestGridSize+1)*Grid_SelectedY+height2 + If prevAngle<>ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY) + ChangeGridGadget = True + GridGadgetText="Name: "+ForestPlace(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+ForestPlaceAngle(Grid_SelectedX,Grid_SelectedY)+"°" + EndIf + EndIf + EndIf + EndIf + EndIf + ;Maintenance tunnel grid + Else ;20*28 + For x = 0 To MT_GridSize + For y = 0 To MT_GridSize + Color 255,255,255 + Rect Float(width)/Float(MT_GridSize+1)*x,Float(height)/Float(MT_GridSize+1)*y,(Float(width)/Float(MT_GridSize+1)),(Float(height)/Float(MT_GridSize+1)),True + + PrevSelectedX=Grid_SelectedX + PrevSelectedY=Grid_SelectedY + If (MouseX()-GadgetX(map_2d))>(Float(width)/Float(MT_GridSize+1)*x+GadgetX(WinHandle)) And (MouseX()-GadgetX(map_2d))<((Float(width)/Float(MT_GridSize+1)*x)+(Float(width)/Float(MT_GridSize+1))+GadgetX(WinHandle)) + offset% = 45 + If (MouseY()-GadgetY(map_2d))>(Float(height)/Float(MT_GridSize+1)*y+GadgetY(WinHandle)+offset) And (MouseY()-GadgetY(map_2d))<((Float(height)/Float(MT_GridSize+1)*y)+(Float(height)/Float(MT_GridSize+1))+GadgetY(WinHandle)+offset) + Color 200,200,200 + Rect Float(width)/Float(MT_GridSize+1)*x,Float(height)/Float(MT_GridSize+1)*y,(Float(width)/Float(MT_GridSize+1)),(Float(height)/Float(MT_GridSize+1)),True + If MTRoom(x,y)=Null And SelectedGadgetItem(listbox)>-1 + x2 = Float(width)/Float(MT_GridSize+1) + y2 = Float(height)/Float(MT_GridSize+1) + DrawImage PlusIcon,(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 + EndIf + If MouseHit1 + If Grid_SelectedX=x And Grid_SelectedY=y + + Else + item = SelectedGadgetItem( listbox ) + If MTRoom(x,y)<>Null + Grid_SelectedX=x + Grid_SelectedY=y + ChangeGridGadget = True + GridGadgetText = "" + SelectGadgetItem listbox,-1 + HideGadget listbox + ShowGadget listbox + + ClearGadgetItems combobox + + For rt.RoomTemplates = Each RoomTemplates + If rt = MTRoom(x,y) + SetGadgetText room_desc,"Room description:"+Chr(13)+rt\Description + Exit + EndIf + Next + + DisableGadget combobox + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + EndIf If item>=0 - If Map(x,y)=Null - Local room_name$ = GadgetItemText$(listbox, item) + If MTRoom(x,y)=Null + room_name$ = GadgetItemText$(listbox, item) For rt.RoomTemplates = Each RoomTemplates If rt\Name = room_name - Map(x,y)=rt + MTRoom(x,y)=rt Exit EndIf Next - If Map(x,y)\Name = "start" Or Map(x,y)\Name = "checkpoint1" Or Map(x,y)\Name = "checkpoint2" - MapAngle(x,y)=180 - EndIf - item2 = SelectedGadgetItem(combobox) - If item2>=0 - Local event_name$ = GadgetItemText$(combobox, item2) - If event_name$<>"" - MapEvent(x,y)=event_name - MapEventProb(x,y)=Float(SliderValue(event_prob)/100.0) - EndIf - EndIf EndIf EndIf EndIf @@ -343,20 +934,15 @@ Repeat Grid_SelectedY=-1 ChangeGridGadget = True GridGadgetText = "" - SetSliderValue(event_prob,100) - ;If GadgetText(event_prob_label)<>"" - ; SetGadgetText event_prob_label,"Event chance: "+SliderValue(event_prob)+"%" - ;EndIf + SetSliderValue(event_prob,99) SetGadgetText event_prob_label,"" DisableGadget event_prob SetGadgetText event_desc,"" DisableGadget combobox ClearGadgetItems combobox - If Map(x,y)<>Null - Map(x,y)=Null - MapAngle(x,y)=0 - MapEvent(x,y)="" - MapEventProb(x,y)=0.0 + If MTRoom(x,y)<>Null + MTRoom(x,y)=Null + MTRoomAngle(x,y)=0 EndIf EndIf If MouseHit3 @@ -364,10 +950,7 @@ Repeat Grid_SelectedY=-1 ChangeGridGadget = True GridGadgetText = "" - SetSliderValue(event_prob,100) - ;If GadgetText(event_prob_label)<>"" - ; SetGadgetText event_prob_label,"Event chance: "+SliderValue(event_prob)+"%" - ;EndIf + SetSliderValue(event_prob,99) SetGadgetText event_prob_label,"" DisableGadget event_prob SetGadgetText event_desc,"" @@ -376,90 +959,62 @@ Repeat EndIf EndIf EndIf - ;EndIf - - ;If (MouseX()-GadgetX(map_2d))>(GadgetX(WinHandle)) And (MouseX()-GadgetX(map_2d))<(Float(width)+GadgetX(WinHandle)) - ; offset% = 45 - ; If (MouseY()-GadgetY(map_2d))>(GadgetY(WinHandle)+offset) And (MouseY()-GadgetY(map_2d))<(Float(height)+GadgetY(WinHandle)+offset) - ; If MouseHit2 - ; Grid_SelectedX=-1 - ; Grid_SelectedY=-1 - ; ChangeGridGadget = True - ; GridGadgetText = "" - ; EndIf - ; EndIf - ;EndIf - - If Grid_SelectedX=x And Grid_SelectedY=y - Color 150,150,150 - Rect Float(width)/Float(MapWidth+1)*x,Float(height)/Float(MapHeight+1)*y,(Float(width)/Float(MapWidth+1)),(Float(height)/Float(MapHeight+1)),True - EndIf - - If Map(x,y) = Null - ;If x=0 Or x=MapWidth Or y=0 Or y=MapHeight - ; Color 170, 170, 170 - ;Else - ; Color 90,90,90 - ;EndIf - Color 90,90,90 - Rect Float(width)/Float(MapWidth+1)*x+1,Float(height)/Float(MapHeight+1)*y+1,(Float(width)/Float(MapWidth+1))-1,(Float(height)/Float(MapHeight+1))-1,False - Else - x2 = Float(width)/Float(MapWidth+1) - y2 = Float(height)/Float(MapHeight+1) - DrawImage MapIcons(Map(x,y)\Shape,Floor(MapAngle(x,y)/90.0)),(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 If Grid_SelectedX=x And Grid_SelectedY=y - If PrevSelectedX<>Grid_SelectedX Or PrevSelectedY<>Grid_SelectedY - ChangeGridGadget = True - If MapEvent(x,y)<>"" - GridGadgetText = "Name: "+Map(x,y)\Name+Chr(13)+"Angle: "+MapAngle(x,y)+"°"+Chr(13)+"Event: "+MapEvent(x,y)+Chr(13)+"Event Chance: "+Int(MapEventProb(x,y)*100)+"%" - SetSliderValue(event_prob,Int(MapEventProb(x,y)*100)) - Else - GridGadgetText = "Name: "+Map(x,y)\Name+Chr(13)+"Angle: "+MapAngle(x,y)+"°" - ;SetSliderValue(event_prob,100) - EndIf - If GadgetText(event_prob_label)<>"" - SetGadgetText event_prob_label,"Event chance: "+SliderValue(event_prob)+"%" + Color 150,150,150 + Rect Float(width)/Float(MT_GridSize+1)*x,Float(height)/Float(MT_GridSize+1)*y,(Float(width)/Float(MT_GridSize+1)),(Float(height)/Float(MT_GridSize+1)),True + EndIf + + If MTRoom(x,y) = Null + Color 90,90,90 + Rect Float(width)/Float(MT_GridSize+1)*x+1,Float(height)/Float(MT_GridSize+1)*y+1,(Float(width)/Float(MT_GridSize+1))-1,(Float(height)/Float(MT_GridSize+1))-1,False + Else + x2 = Float(width)/Float(MT_GridSize+1) + y2 = Float(height)/Float(MT_GridSize+1) + If MTRoom(x,y)\Name = "Maintenance tunnel elevator" + DrawImage SpecialIcons(2,Floor(MTRoomAngle(x,y)/90.0)),(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 + Else + DrawImage MapIcons(MTRoom(x,y)\Shape,Floor(MTRoomAngle(x,y)/90.0)),(x2*x)+(x2/2.0)+0.5,(y2*y)+(y2/2.0)+0.5 + EndIf + + If Grid_SelectedX=x And Grid_SelectedY=y + If PrevSelectedX<>Grid_SelectedX Or PrevSelectedY<>Grid_SelectedY + ChangeGridGadget = True + GridGadgetText = "Name: "+MTRoom(x,y)\Name+Chr(13)+"Angle: "+MTRoomAngle(x,y)+"°" EndIf EndIf EndIf - EndIf + Next Next - Next - If MouseDown1 - If Grid_SelectedX>-1 And Grid_SelectedY>-1 - If MouseX()>(GadgetX(map_2d)+GadgetX(WinHandle)) And MouseX()<((width)+GadgetX(map_2d)+GadgetX(WinHandle)) - offset% = 45 - If MouseY()>(GadgetY(map_2d)+GadgetY(WinHandle)+offset) And MouseY()<((height)+GadgetY(map_2d)+GadgetY(WinHandle)+offset) - If Map(Grid_SelectedX,Grid_SelectedY)\Name<>"start" - Local prevAngle = MapAngle(Grid_SelectedX,Grid_SelectedY) + If MouseDown1 + If Grid_SelectedX>-1 And Grid_SelectedY>-1 + If MouseX()>(GadgetX(map_2d)+GadgetX(WinHandle)) And MouseX()<((width)+GadgetX(map_2d)+GadgetX(WinHandle)) + offset% = 45 + If MouseY()>(GadgetY(map_2d)+GadgetY(WinHandle)+offset) And MouseY()<((height)+GadgetY(map_2d)+GadgetY(WinHandle)+offset) + prevAngle = MTRoomAngle(Grid_SelectedX,Grid_SelectedY) ;Left - If (MouseX()-GadgetX(map_2d))<(Float(width)/Float(MapWidth+1)*Grid_SelectedX+GadgetX(WinHandle)) - MapAngle(Grid_SelectedX,Grid_SelectedY)=90 + If (MouseX()-GadgetX(map_2d))<(Float(width)/Float(MT_GridSize+1)*Grid_SelectedX+GadgetX(WinHandle)) + MTRoomAngle(Grid_SelectedX,Grid_SelectedY)=90 EndIf ;Right - If (MouseX()-GadgetX(map_2d))>((Float(width)/Float(MapWidth+1)*Grid_SelectedX)+(Float(width)/Float(MapWidth+1))+GadgetX(WinHandle)) - MapAngle(Grid_SelectedX,Grid_SelectedY)=270 + If (MouseX()-GadgetX(map_2d))>((Float(width)/Float(MT_GridSize+1)*Grid_SelectedX)+(Float(width)/Float(MT_GridSize+1))+GadgetX(WinHandle)) + MTRoomAngle(Grid_SelectedX,Grid_SelectedY)=270 EndIf ;Up offset% = 45 - If (MouseY()-GadgetY(map_2d))<(Float(height)/Float(MapHeight+1)*Grid_SelectedY+GadgetY(WinHandle)+offset) - MapAngle(Grid_SelectedX,Grid_SelectedY)=180 + If (MouseY()-GadgetY(map_2d))<(Float(height)/Float(MT_GridSize+1)*Grid_SelectedY+GadgetY(WinHandle)+offset) + MTRoomAngle(Grid_SelectedX,Grid_SelectedY)=180 EndIf ;Down - If (MouseY()-GadgetY(map_2d))>((Float(height)/Float(MapHeight+1)*Grid_SelectedY)+(Float(height)/Float(MapHeight+1))+GadgetY(WinHandle)+offset) - MapAngle(Grid_SelectedX,Grid_SelectedY)=0 + If (MouseY()-GadgetY(map_2d))>((Float(height)/Float(MT_GridSize+1)*Grid_SelectedY)+(Float(height)/Float(MT_GridSize+1))+GadgetY(WinHandle)+offset) + MTRoomAngle(Grid_SelectedX,Grid_SelectedY)=0 EndIf - Local width2 = Float(width)/Float(MapWidth+1)/2.0 - Local height2 = Float(height)/Float(MapHeight+1)/2.0 - DrawImage Arrows(Floor(MapAngle(Grid_SelectedX,Grid_SelectedY)/90)),Float(width)/Float(MapWidth+1)*Grid_SelectedX+width2,Float(height)/Float(MapHeight+1)*Grid_SelectedY+height2 - If prevAngle<>MapAngle(Grid_SelectedX,Grid_SelectedY) + width2 = Float(width)/Float(MT_GridSize+1)/2.0 + height2 = Float(height)/Float(MT_GridSize+1)/2.0 + DrawImage Arrows(Floor(MTRoomAngle(Grid_SelectedX,Grid_SelectedY)/90)),Float(width)/Float(MT_GridSize+1)*Grid_SelectedX+width2,Float(height)/Float(MT_GridSize+1)*Grid_SelectedY+height2 + If prevAngle<>MTRoomAngle(Grid_SelectedX,Grid_SelectedY) ChangeGridGadget = True - If MapEvent(Grid_SelectedX,Grid_SelectedY)<>"" - GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°"+Chr(13)+"Event: "+MapEvent(Grid_SelectedX,Grid_SelectedY)+Chr(13)+"Event Chance: "+Int(MapEventProb(Grid_SelectedX,Grid_SelectedY)*100)+"%" - Else - GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°" - EndIf + GridGadgetText="Name: "+MTRoom(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MTRoomAngle(Grid_SelectedX,Grid_SelectedY)+"°" EndIf EndIf EndIf @@ -474,10 +1029,16 @@ Repeat If item2>=0 event_name$ = GadgetItemText$(combobox, item2) If event_name<>prevEvent ;And prevEvent<>"" - If event_name$<>"" + If event_name$<>"" And event_name$<>"[none]" MapEvent(Grid_SelectedX,Grid_SelectedY)=event_name + MapEventProb(Grid_SelectedX,Grid_SelectedY)=Float((SliderValue(event_prob)+1)/100.0) GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°"+Chr(13)+"Event: "+MapEvent(Grid_SelectedX,Grid_SelectedY)+Chr(13)+"Event Chance: "+Int(MapEventProb(Grid_SelectedX,Grid_SelectedY)*100)+"%" ChangeGridGadget=True + Else + MapEvent(Grid_SelectedX,Grid_SelectedY)=event_name + MapEventProb(Grid_SelectedX,Grid_SelectedY)=0.0 + GridGadgetText="Name: "+Map(Grid_SelectedX,Grid_SelectedY)\Name+Chr(13)+"Angle: "+MapAngle(Grid_SelectedX,Grid_SelectedY)+"°" + ChangeGridGadget=True EndIf EndIf EndIf @@ -489,6 +1050,8 @@ Repeat id=WaitEvent() If ID=$803 And EventSource()= winhandle Then Exit ; Handle the close gadget on the window being hit If ID=$803 And EventSource()= optionwin Then HideGadget optionwin + If ID=$803 And EventSource()= map_settings Then HideGadget map_settings + If ID=$803 And EventSource()= authordescr_settings Then HideGadget authordescr_settings If ID=$1001 Then ; Handle any menu item hit events ; extract the EventData as this will contain our unique id for the menu item EID=EventData() @@ -520,7 +1083,7 @@ Repeat EndIf EndIf If EID=1 Then - filename$ = RequestFile("Save map","cbmap",False,"") + filename$ = RequestFile("Open Map","*cbmap2;*cbmap,*cbmap2,*cbmap",False,"") If filename<>"" LoadMap(filename$) Else @@ -528,19 +1091,35 @@ Repeat EndIf EndIf If EID=2 Then - If FileType(filename) <>1 - filename$ = RequestFile("Save map","cbmap",True,"") + If FileType(filename) <> 1 + filename$ = RequestFile("Save Map","cbmap2,cbmap",True,"") EndIf If filename<>"" - SaveMap(filename$) + If Right(filename,5)="cbmap" Then + value = Confirm("cbmap is an outdated file format. Some data can be lost if you save your map to this file format."+Chr(13)+"Are you sure you want to proceed?",0) + If value=1 Then + SaveMap(filename$,False,1) + EndIf + Else + SaveMap(filename$) + EndIf Else ;Maybe a message or something here, dunno... EndIf EndIf If EID=3 Then - filename$ = RequestFile("Open map","cbmap",True,"") + .back + filename$ = RequestFile("Save Map","cbmap2,cbmap",True,"") If filename<>"" - SaveMap(filename$) + If Right(filename,5)="cbmap" Then + value = Confirm("cbmap is an outdated file format. Some data can be lost if you save your map to this file format."+Chr(13)+"Are you sure you want to proceed?",0) + If value=0 Then + Goto back + EndIf + SaveMap(filename$,False,1) + Else + SaveMap(filename$) + EndIf Else ;Maybe a message or something here, dunno... EndIf @@ -557,6 +1136,20 @@ Repeat UpdateWindowMenu winhandle PutINIValue("options.INI","general","events_default",Not value) EndIf + If EID=16 + value=MenuChecked(adjdoor_place) + If value=0 Then CheckMenu(adjdoor_place) + If value=1 Then UncheckMenu(adjdoor_place) + UpdateWindowMenu winhandle + PutINIValue("options.INI","3d scene","adjdoors_place",Not value) + WriteOptions() + EndIf + If EID=18 + ShowGadget map_settings + EndIf + If EID=19 + ShowGadget authordescr_settings + EndIf If EID=10001 Then End EndIf @@ -564,9 +1157,9 @@ Repeat If ID=$401 Then ; Button action event. EventData contains the toolbar button hit. If EventSource()=tab Then ;in EventData steht das neue Item - ;also in Abhangigkeit des Gadgets zeigen und verst - Select EventData() - Case 0 + ;also in Abhangigkeit des Gadgets zeigen und verstecken + Select EventData() + Case 0 ShowWindow% (vwprt ,0) ShowGadget listbox ShowGadget event_desc @@ -579,9 +1172,10 @@ Repeat ShowGadget event_prob ShowGadget event_prob_label ShowGadget grid_room_info + ShowGadget tab2 SetGadgetShape(tab, 0,5,ResWidth/4+20,ResHeight-60) ShowGrid = True - Case 1 + Case 1 ShowWindow% (vwprt ,1) ;User32.dll HideGadget listbox HideGadget event_desc @@ -594,11 +1188,32 @@ Repeat HideGadget event_prob HideGadget event_prob_label HideGadget grid_room_info + HideGadget tab2 SetGadgetShape(tab, 0,5,ResWidth,ResHeight-60) ShowGrid = False SaveMap("CONFIG_MAPINIT.SI",True) - End Select - EndIf + End Select + EndIf + + If EventSource()=tab2 Then + CurrMapGrid% = EventData() + ClearGadgetItems listbox + For rt.RoomTemplates = Each RoomTemplates + If rt\MapGrid = CurrMapGrid + AddGadgetItem listbox, rt\Name + EndIf + Next + ClearGadgetItems combobox + DisableGadget combobox + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + SetGadgetText room_desc,"Room description:" + Grid_SelectedX=-1 + Grid_SelectedY=-1 + EndIf + If EventSource()=color_button Then If RequestColor(GetINIInt("options.INI","3d scene","bg color R"),GetINIInt("options.INI","3d scene","bg color G"),GetINIInt("options.INI","3d scene","bg color B"))=1 Then redfog=RequestedRed() @@ -643,24 +1258,34 @@ Repeat PutINIValue("options.INI","3d scene","camera range",TextFieldText$(camerarange)) PutINIValue("options.INI","3d scene","vsync",ButtonState(vsync)) PutINIValue("options.INI","3d scene","show fps",ButtonState(showfps)) - f = WriteFile("CONFIG_OPTINIT.SI") - WriteInt f,redfog - WriteInt f,greenfog - WriteInt f,bluefog - WriteInt f,redcursor - WriteInt f,greencursor - WriteInt f,bluecursor - WriteInt f,TextFieldText$(camerarange) - WriteByte f,ButtonState(vsync) - WriteByte f,ButtonState(showfps) - CloseFile f + WriteOptions() + EndIf + If EventSource()=resetzonetrans Then + SetGadgetText zonetrans1,5 + SetGadgetText zonetrans2,11 + zonetransvalue1 = (MapHeight)-Int(TextFieldText$(zonetrans1)) + zonetransvalue2 = (MapHeight)-Int(TextFieldText$(zonetrans2)) + EndIf + If EventSource()=zonetrans1 + SetGadgetText zonetrans1,Int(TextFieldText$(zonetrans1)) + EndIf + If EventSource()=zonetrans2 + SetGadgetText zonetrans2,Int(TextFieldText$(zonetrans2)) + EndIf + If EventSource()=applyzonetrans + SetGadgetText zonetrans2,Int(Min(Max(Int(TextFieldText$(zonetrans2)),Int(TextFieldText$(zonetrans1))+2),MapHeight-1)) + SetGadgetText zonetrans1,Int(Min(Max(Int(TextFieldText$(zonetrans1)),1),Int(TextFieldText$(zonetrans2))-2)) + zonetransvalue1 = (MapHeight)-Int(TextFieldText$(zonetrans1)) + zonetransvalue2 = (MapHeight)-Int(TextFieldText$(zonetrans2)) EndIf If EventSource()=ok Then ; when ok is pressed ;Notify ""+Chr$(13)+TextFieldText$(txtbox); <---TO GET ;text FROM ;textFIELD ClearGadgetItems listbox For rt.RoomTemplates = Each RoomTemplates - If Instr(rt\Name,TextFieldText(txtbox)) - AddGadgetItem listbox, rt\Name + If rt\MapGrid = CurrMapGrid + If Instr(rt\Name,TextFieldText(txtbox)) + AddGadgetItem listbox, rt\Name + EndIf EndIf Next EndIf @@ -668,7 +1293,9 @@ Repeat SetGadgetText txtbox, "" ClearGadgetItems listbox For rt.RoomTemplates = Each RoomTemplates - AddGadgetItem listbox, rt\Name + If rt\MapGrid = CurrMapGrid + AddGadgetItem listbox, rt\Name + EndIf Next EndIf If EventSource() = combobox Then @@ -678,12 +1305,22 @@ Repeat name$ = GadgetItemText$(combobox,item) - For ev.event = Each event - If ev\name = name - SetGadgetText event_desc, "Event description:"+Chr(13)+ev\description - Exit - EndIf - Next + If item > 0 + For ev.event = Each event + If ev\name = name + SetGadgetText event_desc, "Event description:"+Chr(13)+ev\description + Exit + EndIf + Next + SetGadgetText event_prob_label,"Event chance: "+(SliderValue(event_prob)+1)+"%" + EnableGadget event_prob + SetSliderValue event_prob,99 + Else + SetGadgetText event_desc, "" + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + EndIf EndIf EndIf If EventSource() = listbox Then @@ -708,10 +1345,16 @@ Repeat Local currRT.RoomTemplates = Null For rt.RoomTemplates = Each RoomTemplates If rt\Name = name + For i = 0 To 5 + If rt\Events[i]<>"" + InsertGadgetItem combobox, 0, "[none]" + hasEvent=True + Exit + EndIf + Next For i = 0 To 5 If rt\events[i]<>"" - InsertGadgetItem combobox, i, rt\events[i] - hasEvent = True + InsertGadgetItem combobox, i+1, rt\events[i] EndIf Next SetGadgetText room_desc,"Room description:"+Chr(13)+rt\Description @@ -720,43 +1363,53 @@ Repeat EndIf Next + If CountGadgetItems( combobox ) > 0 Then + If MenuChecked(event_default) Then + SelectGadgetItem combobox, 1 + Else + SelectGadgetItem combobox, 0 + EndIf + EndIf + If (Not hasEvent) DisableGadget combobox SetGadgetText event_desc, "" SetGadgetText event_prob_label, "" - SetSliderValue event_prob,100 + SetSliderValue event_prob,99 DisableGadget event_prob Else EnableGadget combobox - For ev.event = Each event - If ev\name = currRT\events[0] - SetGadgetText event_desc, "Event description:"+Chr(13)+ev\description - Exit - EndIf - Next - SetGadgetText event_prob_label, "Event chance: 100%" - SetSliderValue event_prob,100 - EnableGadget event_prob + If SelectedGadgetItem(combobox)<>0 + For ev.event = Each event + If ev\name = currRT\events[0] + SetGadgetText event_desc, "Event description:"+Chr(13)+ev\description + Exit + EndIf + Next + SetGadgetText event_prob_label, "Event chance: 100%" + SetSliderValue event_prob,99 + EnableGadget event_prob + Else + SetGadgetText event_prob_label, "" + SetSliderValue event_prob,99 + DisableGadget event_prob + EndIf EndIf Grid_SelectedX=-1 Grid_SelectedY=-1 ChangeGridGadget = True GridGadgetText = "" - If MenuChecked(event_default) Then - If CountGadgetItems( combobox ) > 0 Then - SelectGadgetItem combobox, 0 - EndIf - EndIf - EndIf EndIf If EventSource()=event_prob - SetGadgetText event_prob_label,"Event chance: "+SliderValue(event_prob)+"%" + SetGadgetText event_prob_label,"Event chance: "+(SliderValue(event_prob)+1)+"%" If Grid_SelectedX<>-1 And Grid_SelectedY<>-1 x=Grid_SelectedX y=Grid_SelectedY - MapEventProb(x,y)=Float(SliderValue(event_prob)/100.0) - GridGadgetText = "Name: "+Map(x,y)\Name+Chr(13)+"Angle: "+MapAngle(x,y)+"°"+Chr(13)+"Event: "+MapEvent(x,y)+Chr(13)+"Event Chance: "+Int(MapEventProb(x,y)*100)+"%" + MapEventProb(x,y)=Float((SliderValue(event_prob)+1)/100.0) + If MapEvent(x,y)<>"" + GridGadgetText = "Name: "+Map(x,y)\Name+Chr(13)+"Angle: "+MapAngle(x,y)+"°"+Chr(13)+"Event: "+MapEvent(x,y)+Chr(13)+"Event Chance: "+Int(MapEventProb(x,y)*100)+"%" + EndIf SetGadgetText grid_room_info, GridGadgetText EndIf EndIf @@ -970,6 +1623,8 @@ Type RoomTemplates Field id Field events$[5] + + Field MapGrid% = 0 End Type Function CreateRoomTemplate.RoomTemplates() @@ -988,6 +1643,7 @@ Function LoadRoomTemplates(file$) Local f = OpenFile(file) + ;Facility rooms While Not Eof(f) TemporaryString = Trim(ReadLine(f)) If Left(TemporaryString,1) = "[" Then @@ -1020,11 +1676,83 @@ Function LoadRoomTemplates(file$) rt\Description = GetINIString(file, TemporaryString, "descr") rt\Large = GetINIInt(file, TemporaryString, "large") + rt\MapGrid = 0 EndIf EndIf Wend + ;Forest pieces + Local fr_prefix$ = "SCP-860-1 " + rt = CreateRoomTemplate() + rt\Name = fr_Prefix$+"door" + rt\Shape = ROOM1 + rt\Description = "FRDOOR" + rt\MapGrid = 1 + rt = CreateRoomTemplate() + rt\Name = fr_Prefix$+"endroom" + rt\Shape = ROOM1 + rt\Description = "FRENDROOM" + rt\MapGrid = 1 + rt = CreateRoomTemplate() + rt\Name = fr_Prefix$+"path" + rt\Shape = ROOM2 + rt\Description = "FRPATH" + rt\MapGrid = 1 + rt = CreateRoomTemplate() + rt\Name = fr_Prefix$+"corner" + rt\Shape = ROOM2C + rt\Description = "FRCORNER" + rt\MapGrid = 1 + rt = CreateRoomTemplate() + rt\Name = fr_Prefix$+"t-shaped path" + rt\Shape = ROOM3 + rt\Description = "FRTSHAPE" + rt\MapGrid = 1 + rt = CreateRoomTemplate() + rt\Name = fr_Prefix$+"4-way path" + rt\Shape = ROOM4 + rt\Description = "FR4WAY" + rt\MapGrid = 1 + + ;Maintenance tunnel rooms + Local mt_prefix$ = "Maintenance tunnel " + rt = CreateRoomTemplate() + rt\Name = mt_prefix$+"endroom" + rt\shape = ROOM1 + rt\Description = "MTENDROOM" + rt\MapGrid = 2 + rt = CreateRoomTemplate() + rt\Name = mt_prefix$+"corridor" + rt\shape = ROOM2 + rt\Description = "MTCORRIDOR" + rt\MapGrid = 2 + rt = CreateRoomTemplate() + rt\Name = mt_prefix$+"corner" + rt\shape = ROOM2C + rt\Description = "MTCORNER" + rt\MapGrid = 2 + rt = CreateRoomTemplate() + rt\Name = mt_prefix$+"t-shaped room" + rt\shape = ROOM3 + rt\Description = "MTTSHAPE" + rt\MapGrid = 2 + rt = CreateRoomTemplate() + rt\Name = mt_prefix$+"4-way room" + rt\shape = ROOM4 + rt\Description = "MT4WAY" + rt\MapGrid = 2 + rt = CreateRoomTemplate() + rt\Name = mt_prefix$+"elevator" + rt\shape = ROOM2 + rt\Description = "MTELEVATOR" + rt\MapGrid = 2 + rt = CreateRoomTemplate() + rt\Name = mt_prefix$+"generator room" + rt\shape = ROOM1 + rt\Description = "MTGENERATOR" + rt\MapGrid = 2 + CloseFile f End Function @@ -1061,6 +1789,13 @@ Function InitEvents(file$) EndIf Wend + CloseFile f + +End Function + +Function AddEvents() + Local rt.RoomTemplates,e.Event + For rt.RoomTemplates = Each RoomTemplates For e = Each Event For i = 1 To MaxEvents @@ -1071,8 +1806,6 @@ Function InitEvents(file$) Next Next - CloseFile f - End Function Function AssignEventToRoomTemplate(rt.RoomTemplates,e.Event) @@ -1116,11 +1849,11 @@ Function EraseMap() DisableGadget combobox SetGadgetText event_desc, "" SetGadgetText event_prob_label, "" - SetSliderValue event_prob,100 + SetSliderValue event_prob,99 DisableGadget event_prob Else - SetSliderValue event_prob,100 - SetGadgetText event_prob_label,"Event chance: "+SliderValue(event_prob)+"%" + SetSliderValue event_prob,99 + SetGadgetText event_prob_label,"Event chance: "+(SliderValue(event_prob)+1)+"%" EndIf For x = 0 To MapWidth @@ -1132,6 +1865,28 @@ Function EraseMap() Next Next + For x = 0 To ForestGridSize + For y = 0 To ForestGridSize + ForestPlace(x,y)=Null + ForestPlaceAngle(x,y)=0 + Next + Next + + For x = 0 To MT_GridSize + For y = 0 To MT_GridSize + MTRoom(x,y)=Null + MTRoomAngle(x,y)=0 + Next + Next + + zonetransvalue1 = 13 + zonetransvalue2 = 7 + SetGadgetText zonetrans1,5 + SetGadgetText zonetrans2,11 + MapAuthor$ = "" + MapDescription$ = "" + SetGadgetText map_author_text,"" + End Function Function LoadMap(file$) @@ -1140,22 +1895,98 @@ Function LoadMap(file$) f% = ReadFile(file) DebugLog file - While Not Eof(f) - x = ReadByte(f) - y = ReadByte(f) - name$ = ReadString(f) - DebugLog x+", "+y+": "+name - For rt.roomtemplates=Each RoomTemplates - If Lower(rt\name) = name Then - DebugLog rt\name - Map(x,y)=rt - Exit + If Right(file$,6)="cbmap2" + MapAuthor$ = ReadLine(f) + MapDescription$ = ReadLine(f) + If MapAuthor$ = "[Unknown]" Then MapAuthor$ = "" + If MapDescription$ = "[No description]" Then MapDescription$ = "" + SetGadgetText map_author_text,MapAuthor$ + SetGadgetText descr_text,MapDescription$ + zonetransvalue1 = ReadByte(f) + zonetransvalue2 = ReadByte(f) + SetGadgetText zonetrans1,(MapHeight)-zonetransvalue1 + SetGadgetText zonetrans2,(MapHeight)-zonetransvalue2 + Local roomamount = ReadInt(f) ;Amount of rooms + Local forestamount = ReadInt(f) ;Amount of forest pieces + Local mtroomamount = ReadInt(f) ;Amount of maintenance tunnel rooms + + ;Facility rooms + For i = 0 To roomamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = ReadString(f) + DebugLog x+", "+y+": "+name + For rt.roomtemplates=Each RoomTemplates + If Lower(rt\name) = name Then + DebugLog rt\name + Map(x,y)=rt + Exit + EndIf + Next + MapAngle(x,y)=ReadByte(f)*90 + MapEvent(x,y) = ReadString(f) + If MapEvent(x,y)="" + MapEvent(x,y)="[none]" + EndIf + MapEventProb(x,y) = ReadFloat(f) + If MapEventProb(x,y)=0.0 + MapEventProb(x,y)=1.0 EndIf Next - MapAngle(x,y)=ReadByte(f)*90 - MapEvent(x,y) = ReadString(f) - MapEventProb(x,y) = ReadFloat(f) - Wend + ;Forest pieces + For i = 0 To forestamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = ReadString(f) + DebugLog x+", "+y+": "+name + For rt.roomtemplates=Each RoomTemplates + If Lower(rt\name) = name Then + DebugLog rt\name + ForestPlace(x,y)=rt + Exit + EndIf + Next + ForestPlaceAngle(x,y)=ReadByte(f)*90 + Next + ;Maintenance tunnel pieces + For i = 0 To mtroomamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = ReadString(f) + DebugLog x+", "+y+": "+name + For rt.roomtemplates=Each RoomTemplates + If Lower(rt\name) = name Then + DebugLog rt\name + MTRoom(x,y)=rt + Exit + EndIf + Next + MTRoomAngle(x,y)=ReadByte(f)*90 + Next + Else + While Not Eof(f) + x = ReadByte(f) + y = ReadByte(f) + name$ = ReadString(f) + DebugLog x+", "+y+": "+name + For rt.roomtemplates=Each RoomTemplates + If Lower(rt\name) = name Then + DebugLog rt\name + Map(x,y)=rt + Exit + EndIf + Next + MapAngle(x,y)=ReadByte(f)*90 + MapEvent(x,y) = ReadString(f) + If MapEvent(x,y)="" + MapEvent(x,y)="[none]" + EndIf + MapEventProb(x,y) = ReadFloat(f) + If MapEventProb(x,y)=0.0 + MapEventProb(x,y)=1.0 + EndIf + Wend + EndIf If ShowGrid=False SaveMap("CONFIG_MAPINIT.SI",True) @@ -1164,9 +1995,60 @@ Function LoadMap(file$) CloseFile f End Function -Function SaveMap(file$,streamtoprgm%=False) +Function SaveMap(file$,streamtoprgm%=False,old%=0) f% = WriteFile(file) + If old%=0 Then + MapAuthor$ = TextFieldText(map_author_text) + If Trim(MapAuthor$)="" + WriteLine f,"[Unknown]" + Else + WriteLine f,MapAuthor$ + EndIf + MapDescription$ = TextAreaText(descr_text) + If Trim(MapDescription$)="" + WriteLine f,"[No description]" + Else + WriteLine f,MapDescription$ + EndIf + WriteByte f,zonetransvalue1 + WriteByte f,zonetransvalue2 + ;Facility room amount + temp=0 + For x=0 To MapWidth + For y=0 To MapHeight + If Map(x,y)<>Null + temp=temp+1 + EndIf + Next + Next + WriteInt f,temp + ;Forest room amount + temp=0 + For x=0 To ForestGridSize + For y=0 To ForestGridSize + If ForestPlace(x,y)<>Null + temp=temp+1 + EndIf + Next + Next + WriteInt f,temp + ;Maintenance tunnel room amount + temp=0 + For x=0 To MT_GridSize + For y=0 To MT_GridSize + If MTRoom(x,y)<>Null + temp=temp+1 + EndIf + Next + Next + WriteInt f,temp + EndIf + + If streamtoprgm + WriteInt f,CurrMapGrid + EndIf + For x = 0 To MapWidth For y = 0 To MapHeight If Map(x,y)<>Null @@ -1174,7 +2056,11 @@ Function SaveMap(file$,streamtoprgm%=False) WriteByte f, y WriteString f, Lower(Map(x,y)\Name) WriteByte f, Floor(MapAngle(x,y)/90.0) - WriteString f, MapEvent(x,y) + If MapEvent(x,y)<>"[none]" + WriteString f, MapEvent(x,y) + Else + WriteString f, "" + EndIf WriteFloat f, MapEventProb(x,y) If streamtoprgm @@ -1188,6 +2074,46 @@ Function SaveMap(file$,streamtoprgm%=False) Next Next + If old%=0 Then + For x = 0 To ForestGridSize + For y = 0 To ForestGridSize + If ForestPlace(x,y)<>Null + WriteByte f, x + WriteByte f, y + WriteString f, Lower(ForestPlace(x,y)\Name) + WriteByte f, Floor(ForestPlaceAngle(x,y)/90.0) + + If streamtoprgm + If Grid_SelectedX=x And Grid_SelectedY=y + WriteByte f,1 + Else + WriteByte f,0 + EndIf + EndIf + EndIf + Next + Next + + For x = 0 To MT_GridSize + For y = 0 To MT_GridSize + If MTRoom(x,y)<>Null + WriteByte f, x + WriteByte f, y + WriteString f, Lower(MTRoom(x,y)\Name) + WriteByte f, Floor(MTRoomAngle(x,y)/90.0) + + If streamtoprgm + If Grid_SelectedX=x And Grid_SelectedY=y + WriteByte f,1 + Else + WriteByte f,0 + EndIf + EndIf + EndIf + Next + Next + EndIf + CloseFile f End Function @@ -1197,3 +2123,19 @@ Function MilliSecs2() Return retVal End Function +Function WriteOptions() + + f = WriteFile("CONFIG_OPTINIT.SI") + WriteInt f,redfog + WriteInt f,greenfog + WriteInt f,bluefog + WriteInt f,redcursor + WriteInt f,greencursor + WriteInt f,bluecursor + WriteInt f,TextFieldText$(camerarange) + WriteByte f,ButtonState(vsync) + WriteByte f,ButtonState(showfps) + WriteByte f,MenuChecked(adjdoor_place) + CloseFile f + +End Function \ No newline at end of file diff --git a/Map Creator/options.ini b/Map Creator/options.ini index 995859084..5e7441841 100644 --- a/Map Creator/options.ini +++ b/Map Creator/options.ini @@ -11,3 +11,4 @@ camera range=50 cursor color R=255 cursor color G=0 cursor color B=0 +adjdoors_place=1 diff --git a/Map Creator/window3d.bb b/Map Creator/window3d.bb index da5828e3a..b4767f10d 100644 --- a/Map Creator/window3d.bb +++ b/Map Creator/window3d.bb @@ -3,7 +3,7 @@ Const C_WS_POPUP = $80000000 Const C_HWND_TOP = 0 Const C_SWP_SHOWWINDOW = $0040 -Global versionnumber$ = "2.0" +Global versionnumber$ = "2.1" Const ClrR = 50, ClrG = 50, ClrB = 50 @@ -46,11 +46,22 @@ TextureBlend AmbientLightRoomTex,5 SetBuffer(TextureBuffer(AmbientLightRoomTex)) ClsColor 0,0,0 Cls - SetBuffer BackBuffer() +;Loading door-relevant meshes (for adjacent doors) +Global Door_LCZ = LoadMesh("..\GFX\map\Door01.x") +HideEntity Door_LCZ +Global Door_HCZ_1 = LoadMesh("..\GFX\map\heavydoor1.x") +HideEntity Door_HCZ_1 +Global Door_HCZ_2 = LoadMesh("..\GFX\map\heavydoor2.x") +HideEntity Door_HCZ_2 +Global Door_Frame = LoadMesh("..\GFX\map\DoorFrame.x") +HideEntity Door_Frame +Global Door_Button = LoadMesh("..\GFX\map\Button.x") +HideEntity Door_Button + Global MenuOpen% = True -Global RandomSeed$ = "testseed" +;Global RandomSeed$ = "testseed" Const ROOM1% = 1, ROOM2% = 2, ROOM2C% = 3, ROOM3% = 4, ROOM4% = 5 @@ -62,9 +73,9 @@ Global FileLocation$ = "..\Data\rooms.ini" LoadRoomTemplates(FileLocation) LoadMaterials("..\Data\materials.ini") -If RandomSeed = "" Then - RandomSeed = Abs(MilliSecs()) -EndIf +;If RandomSeed = "" Then +; RandomSeed = Abs(MilliSecs()) +;EndIf ;Local strtemp$ = "" ;For i = 1 To Len(RandomSeed) ; strtemp = strtemp+Asc(Mid(RandomSeed,i,1)) @@ -81,7 +92,22 @@ Dim MapName$(MapWidth, MapHeight) Dim MapRoomID%(ROOM4 + 1) Dim MapRoom$(ROOM4 + 1, 0) +Global zonetransvalue1% = 13, zonetransvalue2% = 7 + +Global MT_GridSize% = 19 +Dim MTName$(MT_GridSize,MT_GridSize) + +Global ForestGridSize% = 10 +Dim ForestName$(ForestGridSize,ForestGridSize) +Global ForestMeshWidth# + +Global CurrMapGrid% = 0 +;0 = Facility +;1 = Forest (SCP-860-1) +;2 = Maintenance Tunnels + Global PickedRoom.Rooms +Global CurrSelectedRoom.Rooms ChangeDir ".." @@ -97,6 +123,7 @@ ChangeDir "Map Creator" Global ShowFPS% = GetINIInt("options.ini", "3d scene", "show fps") Global CheckFPS%, ElapsedLoops%, FPS% Global VSync% = GetINIInt("options.ini", "3d scene", "vsync") +Global AdjDoorPlace% = GetINIInt("options.ini", "3d scene", "adjdoors_place") Global MXS#=0.0,MYS#=0.0 MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 @@ -132,6 +159,7 @@ Repeat PrevTime = MilliSecs2() Local f% + Local prevAdjDoorPlace = AdjDoorPlace If FileType("CONFIG_OPTINIT.SI")=1 f = ReadFile("CONFIG_OPTINIT.SI") @@ -144,6 +172,7 @@ Repeat CamRange = ReadInt(f) VSync = ReadByte(f) ShowFPS = ReadByte(f) + AdjDoorPlace = ReadByte(f) CamRange = Max(CamRange,20) @@ -154,6 +183,22 @@ Repeat DeleteFile("CONFIG_OPTINIT.SI") EndIf + Local d.Doors + If prevAdjDoorPlace<>AdjDoorPlace + If AdjDoorPlace + PlaceAdjacentDoors() + Else + For d.Doors = Each Doors + FreeEntity d\frameobj + FreeEntity d\buttons[0] + FreeEntity d\buttons[1] + FreeEntity d\obj + FreeEntity d\obj2 + Delete d + Next + EndIf + EndIf + Local x,y Local r.Rooms,rt.RoomTemplates Local name$,angle @@ -165,48 +210,205 @@ Repeat FreeTexture r\overlaytex Delete r Next + For d.Doors = Each Doors + FreeEntity d\frameobj + FreeEntity d\buttons[0] + FreeEntity d\buttons[1] + FreeEntity d\obj + FreeEntity d\obj2 + Delete d + Next + For x = 0 To MapWidth + For y = 0 To MapHeight + MapTemp(x, y) = 0 + Next + Next f = ReadFile("CONFIG_MAPINIT.SI") - While Not Eof(f) - x = ReadByte(f) - y = ReadByte(f) - name$ = Lower(ReadString(f)) - - angle = ReadByte(f)*90.0 - - ename = ReadString(f) - eprob# = ReadFloat(f) - - For rt.RoomTemplates=Each RoomTemplates - If Lower(rt\Name) = name - If angle<>90 And angle<>270 - angle = angle - 180 + ReadLine(f) ;Author + ReadLine(f) ;Description + zonetransvalue1 = ReadByte(f) + zonetransvalue2 = ReadByte(f) + Local roomamount% = ReadInt(f) ;Amount of rooms + Local forestamount% = ReadInt(f) ;Amount of forest grid parts + Local mtroomamount% = ReadInt(f) ;Amount of maintenance tunnel rooms + + CurrMapGrid = ReadInt(f) + + ;While Not Eof(f) + + Select CurrMapGrid + Case 0 + ;Room data + For i = 0 To roomamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = Lower(ReadString(f)) + + angle = ReadByte(f)*90.0 + + ename = ReadString(f) + eprob# = ReadFloat(f) + + For rt.RoomTemplates=Each RoomTemplates + If Lower(rt\Name) = name + ;If angle<>90 And angle<>270 + ; angle = angle - 180 + ;EndIf + + r = PlaceRoom(name,MapWidth-x,y,GetZone(y),rt\Shape,ename,eprob) + r\GridX = x + r\GridZ = y + + r\angle = angle + If r\angle<>90 And r\angle<>270 + r\angle = r\angle + 180 + EndIf + r\angle = WrapAngle(r\angle) + + TurnEntity(r\obj, 0, r\angle, 0) + + MapTemp(MapWidth-x,y)=1 + + Exit + EndIf + Next + + Local isSelRoom% = ReadByte(f) + If isSelRoom% + PositionEntity Camera,(MapWidth-x)*8,1,y*8 + RotateEntity Camera,0,angle,0 + MXS = -angle + MYS = 0 EndIf + Next + Case 1 + ;Skip room data + For i = 0 To roomamount-1 + ReadByte(f) + ReadByte(f) + ReadString(f) + ReadByte(f) + ReadString(f) + ReadFloat(f) + ReadByte(f) + Next + ;Forest data + For i = 0 To forestamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = Lower(ReadString(f)) - PlaceRoom(name,MapWidth-x,y,angle,GetZone(y),rt\Shape,ename,eprob) + angle = ReadByte(f)*90.0 - Exit - EndIf - Next - - Local isSelRoom% = ReadByte(f) - If isSelRoom% - PositionEntity Camera,(MapWidth-x)*8,1,y*8 - RotateEntity Camera,0,angle,0 - MXS = -angle - MYS = 0 - EndIf - - Wend + For rt.RoomTemplates=Each RoomTemplates + If Lower(rt\Name) = name Then + + r = PlaceRoom(name,ForestGridSize-x,y,GetZone(y),rt\Shape,"",0.0,1) + r\GridX = x + r\GridZ = y + + r\angle = angle + If r\angle<>90 And r\angle<>270 + r\angle = r\angle + 180 + EndIf + ;If rt\Shape = ROOM2C Or rt\Shape = ROOM3 Then + ; r\angle = r\angle - 90 + ;EndIf + r\angle = WrapAngle(r\angle) + + TurnEntity(r\obj, 0, r\angle, 0) + + ;MapTemp(MapWidth-x,y)=1 + + Exit + EndIf + Next + + isSelRoom% = ReadByte(f) + If isSelRoom% Then + PositionEntity Camera,(ForestGridSize-x)*12,1,y*12 + RotateEntity Camera,0,angle,0 + MXS = -angle + MYS = 0 + EndIf + Next + Case 2 + ;Skip room data + For i = 0 To roomamount-1 + ReadByte(f) + ReadByte(f) + ReadString(f) + ReadByte(f) + ReadString(f) + ReadFloat(f) + ReadByte(f) + Next + ;Skip forest data + For i = 0 To forestamount-1 + ReadByte(f) + ReadByte(f) + ReadString(f) + ReadByte(f) + ReadByte(f) + Next + ;Maintenance tunnel data + For i = 0 To mtroomamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = Lower(ReadString(f)) + + angle = ReadByte(f)*90.0 + + For rt.RoomTemplates=Each RoomTemplates + If Lower(rt\Name) = name Then + + r = PlaceRoom(name,MT_GridSize-x,y,GetZone(y),rt\Shape,"",0.0,2) + r\GridX = x + r\GridZ = y + + r\angle = angle + If r\angle<>90 And r\angle<>270 + r\angle = r\angle + 180 + EndIf + If rt\Shape = ROOM2C Or rt\Shape = ROOM3 Then + r\angle = r\angle - 90 + EndIf + r\angle = WrapAngle(r\angle) + + TurnEntity(r\obj, 0, r\angle, 0) + + ;MapTemp(MapWidth-x,y)=1 + + Exit + EndIf + Next + + isSelRoom% = ReadByte(f) + If isSelRoom% Then + PositionEntity Camera,(MT_GridSize-x)*2,1,y*2 + RotateEntity Camera,0,angle,0 + MXS = -angle + MYS = 0 + EndIf + Next + End Select FreeTextureCache CloseFile f + + If AdjDoorPlace And CurrMapGrid=0 Then + PlaceAdjacentDoors() + EndIf + DeleteFile("CONFIG_MAPINIT.SI") EndIf While ElapsedTime>0.0 + MouseHit1 = MouseHit(1) + If MouseHit(2) IsRemote = Not IsRemote MoveMouse GraphicsWidth()/2,GraphicsHeight()/2 @@ -215,16 +417,44 @@ Repeat For r = Each Rooms If r\resetoverlaytex And r<>PickedRoom SetBuffer TextureBuffer(r\overlaytex) - ClsColor 0,0,0 + If CurrMapGrid <> 1 Then + ClsColor 0,0,0 + Else + ClsColor 255,255,255 + EndIf Cls SetBuffer BackBuffer() r\resetoverlaytex=False EndIf PickedRoom = Null - If EntityDistance(Camera,r\obj)>(CamRange) Or (Not EntityInView(GetChild(r\obj,2),Camera)) - HideEntity r\obj + If CurrMapGrid <> 1 Then + If EntityDistance(Camera,r\obj)>(CamRange) Or (Not EntityInView(GetChild(r\obj,2),Camera)) + HideEntity r\obj + Else + ShowEntity r\obj + EndIf + Else + If EntityDistance(Camera,r\obj)>(CamRange) Or (Not EntityInView(r\obj,Camera)) + HideEntity r\obj + Else + ShowEntity r\obj + EndIf + EndIf + Next + + For d = Each Doors + If EntityDistance(Camera,d\frameobj)>(CamRange) Or (Not EntityInView(d\frameobj,Camera)) + HideEntity d\frameobj + HideEntity d\obj + HideEntity d\obj2 + HideEntity d\buttons[0] + HideEntity d\buttons[1] Else - ShowEntity r\obj + ShowEntity d\frameobj + ShowEntity d\obj + ShowEntity d\obj2 + ShowEntity d\buttons[0] + ShowEntity d\buttons[1] EndIf Next @@ -238,6 +468,8 @@ Repeat MXS# = MXS# + MouseXSpeed()*0.25 MYS# = MYS# + MouseYSpeed()*0.25 + MYS = Max(Min(MYS,85),-85) + RotateEntity Camera,MYS,-MXS,0 Faster = 0 @@ -250,20 +482,43 @@ Repeat If KeyDown(31) Then MoveEntity Camera,0,0,(-0.05-(0.05*Faster))/(1+Slower) If KeyDown(32) Then MoveEntity Camera,(0.05+(0.05*Faster))/(1+Slower),0,0 - Local picker% = EntityPick(Camera,CamRange/2.5) + Local picker% = EntityPick(Camera,CamRange/(2.5-(CurrMapGrid=1))) If picker<>0 For r = Each Rooms - If PickedEntity()=GetChild(r\obj,2) - SetBuffer TextureBuffer(r\overlaytex) - ClsColor 70,70,20+(Sin(MilliSecs2()/4.0)*20) - Cls - SetBuffer BackBuffer() - PickedRoom = r - r\resetoverlaytex=True - Exit + If CurrMapGrid<>1 Then + If PickedEntity()=GetChild(r\obj,2) + SetBuffer TextureBuffer(r\overlaytex) + ClsColor 70,70,20+(Float(Sin(MilliSecs2()/4.0))*20) + Cls + SetBuffer BackBuffer() + PickedRoom = r + r\resetoverlaytex=True + Exit + EndIf + Else + If PickedEntity()=r\obj + SetBuffer TextureBuffer(r\overlaytex) + ClsColor 60,60,50-(Float(Sin(MilliSecs2()/4.0))*50) + Cls + SetBuffer BackBuffer() + PickedRoom = r + r\resetoverlaytex=True + Exit + EndIf EndIf Next EndIf + If MouseHit1 Then + If PickedRoom <> Null Then + CurrSelectedRoom = PickedRoom + f = WriteFile("CONFIG_TO2D.SI") + WriteInt f,CurrSelectedRoom\GridX + WriteInt f,CurrSelectedRoom\GridZ + CloseFile f + Else + CurrSelectedRoom = Null + EndIf + EndIf Else ShowPointer() EndIf @@ -288,6 +543,7 @@ Repeat Local rname$ = PickedRoom\RoomTemplate\Name Local rX% = Int(PickedRoom\x) Local rZ% = Int(PickedRoom\z) + Local rAngle% = Int(PickedRoom\angle) Color 0,0,0 Rect 2,32,StringWidth("Room name: "+rname),StringHeight("Room name: "+rname) @@ -313,6 +569,16 @@ Repeat EndIf EndIf + If CurrSelectedRoom<>Null Then + rname$ = CurrSelectedRoom\RoomTemplate\Name + + Color 0,0,0 + Rect (ResWidth-2)-StringWidth("Selected room: "+rname),2,StringWidth("Selected room: "+rname),StringHeight("Selected room: "+rname) + + Color 255,255,255 + Text (ResWidth-2)-StringWidth("Selected room: "+rname),2,"Selected room: "+rname + EndIf + Color CursorColorR,CursorColorG,CursorColorB Rect (ResWidth/2)-25,(ResHeight/2)-2.5,20,5,True Rect (ResWidth/2)+5,(ResHeight/2)-2.5,20,5,True @@ -405,12 +671,44 @@ Function LoadRoomTemplates(file$) ; i=i+1 ; Forever + + CloseFile f End Function Function LoadRoomTemplateMeshes() - Local rt.RoomTemplates + Local rt.RoomTemplates,i% + + Local mt_prefix$ = "maintenance tunnel " + rt = New RoomTemplates + rt\objPath = "GFX\map\mt1.rmesh" + rt\Name = mt_prefix+"endroom" + rt\Shape = ROOM1 + rt = New RoomTemplates + rt\objPath = "GFX\map\mt2.rmesh" + rt\Name = mt_prefix+"corridor" + rt\Shape = ROOM2 + rt = New RoomTemplates + rt\objPath = "GFX\map\mt2c.rmesh" + rt\Name = mt_prefix+"corner" + rt\Shape = ROOM2C + rt = New RoomTemplates + rt\objPath = "GFX\map\mt3.rmesh" + rt\Name = mt_prefix+"t-shaped room" + rt\Shape = ROOM3 + rt = New RoomTemplates + rt\objPath = "GFX\map\mt4.rmesh" + rt\Name = mt_prefix+"4-way room" + rt\Shape = ROOM4 + rt = New RoomTemplates + rt\objPath = "GFX\map\mt_elevator.rmesh" + rt\Name = mt_prefix+"elevator" + rt\Shape = ROOM2 + rt = New RoomTemplates + rt\objPath = "GFX\map\mt_generator.rmesh" + rt\Name = mt_prefix+"generator room" + rt\Shape = ROOM1 For rt = Each RoomTemplates If rt\objPath<>"" @@ -418,15 +716,78 @@ Function LoadRoomTemplateMeshes() EndIf Next + Local hmap[ROOM4], mask[ROOM4] + Local GroundTexture = LoadTexture("GFX\map\forest\forestfloor.jpg") + Local PathTexture = LoadTexture("GFX\map\forest\forestpath.jpg") + hmap[ROOM1]=LoadImage("GFX\map\forest\forest1h.png") + mask[ROOM1]=LoadTexture("GFX\map\forest\forest1h_mask.png",1+2) + hmap[ROOM2]=LoadImage("GFX\map\forest\forest2h.png") + mask[ROOM2]=LoadTexture("GFX\map\forest\forest2h_mask.png",1+2) + hmap[ROOM2C]=LoadImage("GFX\map\forest\forest2Ch.png") + mask[ROOM2C]=LoadTexture("GFX\map\forest\forest2Ch_mask.png",1+2) + hmap[ROOM3]=LoadImage("GFX\map\forest\forest3h.png") + mask[ROOM3]=LoadTexture("GFX\map\forest\forest3h_mask.png",1+2) + hmap[ROOM4]=LoadImage("GFX\map\forest\forest4h.png") + mask[ROOM4]=LoadTexture("GFX\map\forest\forest4h_mask.png",1+2) + + Local fr_prefix$ = "scp-860-1 " + rt = New RoomTemplates + rt\obj = load_terrain(hmap[ROOM2],0.03,GroundTexture,PathTexture,mask[ROOM2]) + rt\Name = fr_prefix$+"door" + rt\Shape = ROOM2 + ForestMeshWidth = MeshWidth(rt\obj) + HideEntity rt\obj + rt = New RoomTemplates + rt\obj = load_terrain(hmap[ROOM1],0.03,GroundTexture,PathTexture,mask[ROOM1]) + rt\Name = fr_prefix$+"endroom" + rt\Shape = ROOM1 + HideEntity rt\obj + rt = New RoomTemplates + rt\obj = load_terrain(hmap[ROOM2],0.03,GroundTexture,PathTexture,mask[ROOM2]) + rt\Name = fr_prefix$+"path" + rt\Shape = ROOM2 + HideEntity rt\obj + rt = New RoomTemplates + rt\obj = load_terrain(hmap[ROOM2C],0.03,GroundTexture,PathTexture,mask[ROOM2C]) + rt\Name = fr_prefix$+"corner" + rt\Shape = ROOM2C + HideEntity rt\obj + rt = New RoomTemplates + rt\obj = load_terrain(hmap[ROOM3],0.03,GroundTexture,PathTexture,mask[ROOM3]) + rt\Name = fr_prefix$+"t-shaped path" + rt\Shape = ROOM3 + HideEntity rt\obj + rt = New RoomTemplates + rt\obj = load_terrain(hmap[ROOM4],0.03,GroundTexture,PathTexture,mask[ROOM4]) + rt\Name = fr_prefix$+"4-way path" + rt\Shape = ROOM4 + HideEntity rt\obj + + FreeTexture GroundTexture + FreeTexture PathTexture + For i = ROOM1 To ROOM4 + FreeImage(hmap[i]) + FreeTexture(mask[i]) + Next + End Function -Function PlaceRoom(name$,x%,z%,angle%,zone%,shape%,event$="",eventchance#=1.0) +Function PlaceRoom.Rooms(name$,x%,z%,zone%,shape%,event$="",eventchance#=1.0,mapgrid%=0) Local rt.RoomTemplates,r.Rooms + Local spacing# + Select mapgrid + Case 0 + spacing# = 8.0 + Case 1 + spacing# = 12.0 + Case 2 + spacing# = 2.0 + End Select + For rt = Each RoomTemplates If rt\Name = name$ - r = CreateRoom(zone,shape,x*8.0,0.0,z*8.0,name) - RotateEntity(r\obj,0,angle,0) + r = CreateRoom(zone,shape,x*spacing,0.0,z*spacing,name) Exit EndIf Next @@ -434,6 +795,7 @@ Function PlaceRoom(name$,x%,z%,angle%,zone%,shape%,event$="",eventchance#=1.0) r\event = event If r\event<>"" Then r\eventchance=eventchance + Return r End Function Global Mesh_MinX#,Mesh_MinY#,Mesh_MinZ#,Mesh_MaxX#,Mesh_MaxY#,Mesh_MaxZ#,Mesh_MagX#,Mesh_MagY#,Mesh_MagZ# @@ -551,11 +913,19 @@ Type Rooms Field event$ Field eventchance# + + Field Adjacent.Rooms[4] + Field AdjDoor.Doors[4] + + Field GridX%,GridZ% + + Field forestwallobj% End Type Function CreateRoom.Rooms(zone%, roomshape%, x#, y#, z#, name$ = "") Local r.Rooms = New Rooms Local rt.RoomTemplates + Local tempf1#,tempf2#,tempf3# r\zone = zone @@ -570,18 +940,41 @@ Function CreateRoom.Rooms(zone%, roomshape%, x#, y#, z#, name$ = "") r\RoomTemplate = rt r\obj = CopyEntity(rt\obj) - ScaleEntity(r\obj, RoomScale, RoomScale, RoomScale) - ;EntityPickMode(r\obj, 2) + If CurrMapGrid<>1 Then + ScaleEntity(r\obj, RoomScale, RoomScale, RoomScale) + Else + tempf3=ForestMeshWidth + tempf1=12.0/tempf3 + ScaleEntity r\obj,tempf1,tempf1,tempf1 + EndIf PositionEntity(r\obj, x, y, z) - r\overlaytex = CreateTexture(1,1) - SetBuffer TextureBuffer(r\overlaytex) - ClsColor 0,0,0 - Cls - SetBuffer BackBuffer() + If name = "scp-860-1 door" Then + r\forestwallobj = LoadMesh("..\GFX\map\forest\wall.b3d") + ScaleEntity r\forestwallobj,RoomScale,RoomScale,RoomScale + PositionEntity r\forestwallobj,x,y,z,True + EntityParent r\forestwallobj,r\obj + RotateEntity r\forestwallobj,0,180,0 + MoveEntity r\forestwallobj,0,0,-(14+tempf1) + EndIf - EntityTexture GetChild(r\obj,2),r\overlaytex,0,0 + If CurrMapGrid<>1 Then + r\overlaytex = CreateTexture(1,1) + SetBuffer TextureBuffer(r\overlaytex) + ClsColor 0,0,0 + Cls + SetBuffer BackBuffer() + EntityTexture GetChild(r\obj,2),r\overlaytex,0,0 + Else + r\overlaytex = CreateTexture(1,1) + TextureBlend r\overlaytex,5 + SetBuffer TextureBuffer(r\overlaytex) + ClsColor 255,255,255 + Cls + SetBuffer BackBuffer() + EntityTexture r\obj,r\overlaytex,0,0 + EndIf Return r EndIf @@ -1424,13 +1817,303 @@ Function MilliSecs2() Return retVal End Function +Function WrapAngle#(angle#) + ;If angle = INFINITY Then Return 0.0 + While angle < 0 + angle = angle + 360 + Wend + While angle >= 360 + angle = angle - 360 + Wend + Return angle +End Function + +Type Doors + Field obj%, obj2%, frameobj%, buttons%[2] + Field dir% + Field angle% +End Type + +Function CreateDoor.Doors(x#, y#, z#, angle#, room.Rooms, big% = False) + Local d.Doors, i% + Local parent% + If room <> Null Then parent = room\obj + + d.Doors = New Doors + If big=2 + d\obj = CopyEntity(Door_HCZ_1) + ScaleEntity(d\obj, RoomScale, RoomScale, RoomScale) + d\obj2 = CopyEntity(Door_HCZ_2) + ScaleEntity(d\obj2, RoomScale, RoomScale, RoomScale) + + d\frameobj = CopyEntity(Door_Frame) + Else + d\obj = CopyEntity(Door_LCZ) + ScaleEntity(d\obj, (204.0 * RoomScale) / MeshWidth(d\obj), 312.0 * RoomScale / MeshHeight(d\obj), 16.0 * RoomScale / MeshDepth(d\obj)) + + d\frameobj = CopyEntity(Door_Frame) + d\obj2 = CopyEntity(Door_LCZ) + + ScaleEntity(d\obj2, (204.0 * RoomScale) / MeshWidth(d\obj), 312.0 * RoomScale / MeshHeight(d\obj), 16.0 * RoomScale / MeshDepth(d\obj)) + EndIf + + PositionEntity d\frameobj, x, y, z + ScaleEntity(d\frameobj, (8.0 / 2048.0), (8.0 / 2048.0), (8.0 / 2048.0)) + + For i% = 0 To 1 + d\buttons[i] = CopyEntity(Door_Button) + + ScaleEntity(d\buttons[i], 0.03, 0.03, 0.03) + Next + + PositionEntity d\buttons[0], x + 0.6, y + 0.7, z - 0.1 + PositionEntity d\buttons[1], x - 0.6, y + 0.7, z + 0.1 + RotateEntity d\buttons[1], 0, 180, 0 + EntityParent(d\buttons[0], d\frameobj) + EntityParent(d\buttons[1], d\frameobj) + + PositionEntity d\obj, x, y, z + + RotateEntity d\obj, 0, angle, 0 + RotateEntity d\frameobj, 0, angle, 0 + + If d\obj2 <> 0 Then + PositionEntity d\obj2, x, y, z + RotateEntity(d\obj2, 0, angle + 180, 0) + ;EntityParent(d\obj2, parent) + EndIf + + ;EntityParent(d\frameobj, parent) + ;EntityParent(d\obj, parent) + + d\angle = angle + + d\dir=big + + Return d + +End Function + +Function PlaceAdjacentDoors() + Local temp = 0, zone + Local spacing# = 8.0 + Local shouldSpawnDoor% = False + Local x,y + Local r.Rooms,d.Doors + + For y = MapHeight To 0 Step -1 + + ;If GetZone(y)=0 + ; zone=1 + ;ElseIf GetZone(y)=1 + ; zone=2 + ;Else + ; zone=3 + ;EndIf + + If y=zonetransvalue2 And y 0 Then + If zone = 2 Then temp=2 Else temp=0 + + For r.Rooms = Each Rooms + If Int(r\x/8.0)=x And Int(r\z/8.0)=y Then + shouldSpawnDoor = False + Select r\RoomTemplate\Shape + Case ROOM1 + If r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM2 + If r\angle=90 Or r\angle=270 + shouldSpawnDoor = True + EndIf + Case ROOM2C + If r\angle=0 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM3 + If r\angle=0 Or r\angle=180 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Default + shouldSpawnDoor = True + End Select + If shouldSpawnDoor + If (x+1)<(MapWidth+1) + If MapTemp(x + 1, y) > 0 Then + ;d.Doors = CreateDoor(r\zone, Float(x) * spacing + spacing / 2.0, 0, Float(y) * spacing, 90, r, Max(Rand(-3, 1), 0), temp) + ;r\AdjDoor[0] = d + d.Doors = CreateDoor(Float(x) * spacing + spacing / 2.0, 0, Float(y) * spacing, 90, r, temp) + r\AdjDoor[0] = d + EndIf + EndIf + EndIf + + shouldSpawnDoor = False + Select r\RoomTemplate\Shape + Case ROOM1 + If r\angle=180 + shouldSpawnDoor = True + EndIf + Case ROOM2 + If r\angle=0 Or r\angle=180 + shouldSpawnDoor = True + EndIf + Case ROOM2C + If r\angle=180 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM3 + If r\angle=180 Or r\angle=90 Or r\angle=270 + shouldSpawnDoor = True + EndIf + Default + shouldSpawnDoor = True + End Select + If shouldSpawnDoor + If (y+1)<(MapHeight+1) + If MapTemp(x, y + 1) > 0 Then + ;d.Doors = CreateDoor(r\zone, Float(x) * spacing, 0, Float(y) * spacing + spacing / 2.0, 0, r, Max(Rand(-3, 1), 0), temp) + ;r\AdjDoor[3] = d + d.Doors = CreateDoor(Float(x) * spacing, 0, Float(y) * spacing + spacing / 2.0, 0, r, temp) + r\AdjDoor[3] = d + EndIf + EndIf + EndIf + + Exit + EndIf + Next + + End If + + Next + Next + + For d.Doors = Each Doors + EntityParent(d\obj, 0) + If d\obj2 > 0 Then EntityParent(d\obj2, 0) + If d\frameobj > 0 Then EntityParent(d\frameobj, 0) + If d\buttons[0] > 0 Then EntityParent(d\buttons[0], 0) + If d\buttons[1] > 0 Then EntityParent(d\buttons[1], 0) + + If d\obj2 <> 0 And d\dir = 0 Then + MoveEntity(d\obj, 0, 0, 8.0 * RoomScale) + MoveEntity(d\obj2, 0, 0, 8.0 * RoomScale) + EndIf + Next + +End Function + +Function load_terrain(hmap,yscale#=0.7,t1%,t2%,mask%) + + DebugLog "load_terrain: "+hmap + + ; load the heightmap + If hmap = 0 Then RuntimeError "Heightmap image "+hmap+" does not exist." + + ; store heightmap dimensions + Local x = ImageWidth(hmap)-1, y = ImageHeight(hmap)-1 + Local lx,ly,index + + ; load texture and lightmaps + If t1 = 0 Then RuntimeError "load_terrain error: invalid texture 1" + If t2 = 0 Then RuntimeError "load_terrain error: invalid texture 2" + If mask = 0 Then RuntimeError "load_terrain error: invalid texture mask" + + ; auto scale the textures to the right size + If t1 Then ScaleTexture t1,x/4,y/4 + If t2 Then ScaleTexture t2,x/4,y/4 + If mask Then ScaleTexture mask,x,y + + ; start building the terrain + Local mesh = CreateMesh() + Local surf = CreateSurface(mesh) + + ; create some verts for the terrain + For ly = 0 To y + For lx = 0 To x + AddVertex surf,lx,0,ly,1.0/lx,1.0/ly + Next + Next + RenderWorld + + ; connect the verts with faces + For ly = 0 To y-1 + For lx = 0 To x-1 + AddTriangle surf,lx+((x+1)*ly),lx+((x+1)*ly)+(x+1),(lx+1)+((x+1)*ly) + AddTriangle surf,(lx+1)+((x+1)*ly),lx+((x+1)*ly)+(x+1),(lx+1)+((x+1)*ly)+(x+1) + Next + Next + + ; position the terrain to center 0,0,0 + Local mesh2% = CopyMesh(mesh,mesh) + Local surf2% = GetSurface(mesh2,1) + PositionMesh mesh, -x/2.0,0,-y/2.0 + PositionMesh mesh2, -x/2.0,0.01,-y/2.0 + + ; alter vertice height to match the heightmap red channel + LockBuffer ImageBuffer(hmap) + LockBuffer TextureBuffer(mask) + ;SetBuffer + For lx = 0 To x + For ly = 0 To y + ;using vertex alpha and two meshes instead of FE_ALPHAWHATEVER + ;it doesn't look perfect but it does the job + ;you might get better results by downscaling the mask to the same size as the heightmap + Local maskX# = Min(lx*Float(TextureWidth(mask))/Float(ImageWidth(hmap)),TextureWidth(mask)-1) + Local maskY# = TextureHeight(mask)-Min(ly*Float(TextureHeight(mask))/Float(ImageHeight(hmap)),TextureHeight(mask)-1) + RGB1=ReadPixelFast(Min(lx,x-1),y-Min(ly,y-1),ImageBuffer(hmap)) + r=(RGB1 And $FF0000)Shr 16 ;separate out the red + Local alpha#=(((ReadPixelFast(Max(maskX-5,5),Max(maskY-5,5),TextureBuffer(mask)) And $FF000000) Shr 24)/$FF) + alpha#=alpha+(((ReadPixelFast(Min(maskX+5,TextureWidth(mask)-5),Min(maskY+5,TextureHeight(mask)-5),TextureBuffer(mask)) And $FF000000) Shr 24)/$FF) + alpha#=alpha+(((ReadPixelFast(Max(maskX-5,5),Min(maskY+5,TextureHeight(mask)-5),TextureBuffer(mask)) And $FF000000) Shr 24)/$FF) + alpha#=alpha+(((ReadPixelFast(Min(maskX+5,TextureWidth(mask)-5),Max(maskY-5,5),TextureBuffer(mask)) And $FF000000) Shr 24)/$FF) + alpha#=alpha*0.25 + alpha#=Sqr(alpha) + + index = lx + ((x+1)*ly) + VertexCoords surf, index , VertexX(surf,index), r*yscale,VertexZ(surf,index) + VertexCoords surf2, index , VertexX(surf2,index), r*yscale,VertexZ(surf2,index) + VertexColor surf2, index, 255.0,255.0,255.0,alpha + ; set the terrain texture coordinates + VertexTexCoords surf,index,lx,-ly + VertexTexCoords surf2,index,lx,-ly + Next + Next + UnlockBuffer TextureBuffer(mask) + UnlockBuffer ImageBuffer(hmap) + + UpdateNormals mesh + UpdateNormals mesh2 + + EntityTexture mesh,t1,0,1 + EntityTexture mesh2,t2,0,1 + + EntityFX mesh, 1 + EntityFX mesh2, 1+2+32 + + EntityPickMode mesh,2 + + Return mesh +End Function + + ;~IDEal Editor Parameters: -;~F#14E#159#164#19B#1A6#1B8#1DF#1FE#202#207#215#22B#250#27D#28B#29A#2A2#2CA#2D1#2D8 -;~F#2DF#2F8#300#308#455#465#476#48C#4A1#4AF#4B3#503#511#519#520#524#528#556#56D#580 -;~F#58C +;~F#258#263#26E#2A7#306#322#349#368#36C#371#37F#39C#3D9#406#414#423#42B#453#45A#461 +;~F#468#481#489#491#5DE#5EE#5FF#615#62A#638#63C#68C#69A#6A2#6A9#6AD#6B1#6DF#6F6#709 +;~F#715#71B#726#72C#768#7DF ;~C#Blitz3D \ No newline at end of file diff --git a/Map Creator/window3d.exe b/Map Creator/window3d.exe index 24478d0ea..67a0a07cc 100644 Binary files a/Map Creator/window3d.exe and b/Map Creator/window3d.exe differ diff --git a/MapSystem.bb b/MapSystem.bb index 29aadaff6..cb52f9fb0 100644 --- a/MapSystem.bb +++ b/MapSystem.bb @@ -507,6 +507,7 @@ Function LoadRMesh(file$,rt.RoomTemplates) If isAlpha=1 Then AddMesh childMesh,Alpha + EntityAlpha childMesh,0.0 Else AddMesh childMesh,Opaque EntityParent childMesh,collisionMeshes @@ -1310,6 +1311,232 @@ Function PlaceForest(fr.Forest,x#,y#,z#,r.Rooms) CatchErrors("PlaceForest") End Function +Function PlaceForest_MapCreator(fr.Forest,x#,y#,z#,r.Rooms) + CatchErrors("Uncaught (PlaceForest_MapCreator)") + ;local variables + Local tx%,ty% + Local tile_size#=12.0 + Local tile_type% + Local tile_entity%,detail_entity% + + Local tempf1#,tempf2#,tempf3# + Local i% + + If fr\Forest_Pivot<>0 Then FreeEntity fr\Forest_Pivot : fr\Forest_Pivot=0 + For i%=0 To 3 + If fr\TileMesh[i]<>0 Then FreeEntity fr\TileMesh[i] : fr\TileMesh[i]=0 + Next + For i%=0 To 4 + If fr\DetailMesh[i]<>0 Then FreeEntity fr\DetailMesh[i] : fr\DetailMesh[i]=0 + Next + For i%=0 To 9 + If fr\TileTexture[i]<>0 Then FreeEntity fr\TileTexture[i] : fr\TileTexture[i]=0 + Next + + fr\Forest_Pivot=CreatePivot() + PositionEntity fr\Forest_Pivot,x,y,z,True + + ;load assets + + Local hmap[ROOM4], mask[ROOM4] + Local GroundTexture = LoadTexture_Strict("GFX\map\forest\forestfloor.jpg") + ;TextureBlend GroundTexture, FE_ALPHACURRENT + Local PathTexture = LoadTexture_Strict("GFX\map\forest\forestpath.jpg") + ;TextureBlend PathTexture, FE_ALPHACURRENT + + hmap[ROOM1]=LoadImage_Strict("GFX\map\forest\forest1h.png") + mask[ROOM1]=LoadTexture_Strict("GFX\map\forest\forest1h_mask.png",1+2) + + hmap[ROOM2]=LoadImage_Strict("GFX\map\forest\forest2h.png") + mask[ROOM2]=LoadTexture_Strict("GFX\map\forest\forest2h_mask.png",1+2) + + hmap[ROOM2C]=LoadImage_Strict("GFX\map\forest\forest2Ch.png") + mask[ROOM2C]=LoadTexture_Strict("GFX\map\forest\forest2Ch_mask.png",1+2) + + hmap[ROOM3]=LoadImage_Strict("GFX\map\forest\forest3h.png") + mask[ROOM3]=LoadTexture_Strict("GFX\map\forest\forest3h_mask.png",1+2) + + hmap[ROOM4]=LoadImage_Strict("GFX\map\forest\forest4h.png") + mask[ROOM4]=LoadTexture_Strict("GFX\map\forest\forest4h_mask.png",1+2) + + For i = ROOM1 To ROOM4 + ;TextureBlend mask[i], FE_ALPHAMODULATE + + fr\TileMesh[i]=load_terrain(hmap[i],0.03,GroundTexture,PathTexture,mask[i]) + Next + + ;detail meshes + ;fr\DetailMesh[0]=LoadMesh_strict("GFX\map\forest\detail\860_1_tree1.b3d") + ;fr\DetailMesh[1]=LoadMesh_strict("GFX\map\forest\detail\860_1_tree1_leaves.b3d") + fr\DetailMesh[1]=LoadMesh_Strict("GFX\map\forest\detail\treetest4.b3d");1.b3d) + ;EntityParent fr\DetailMesh[1],fr\DetailMesh[0] + fr\DetailMesh[2]=LoadMesh_Strict("GFX\map\forest\detail\rock.b3d") + fr\DetailMesh[3]=LoadMesh_Strict("GFX\map\forest\detail\rock2.b3d") + fr\DetailMesh[4]=LoadMesh_Strict("GFX\map\forest\detail\treetest5.b3d") + fr\DetailMesh[5]=LoadMesh_Strict("GFX\map\forest\wall.b3d") + + For i%=ROOM1 To ROOM4 + HideEntity fr\TileMesh[i] + Next + For i%=1 To 5 + HideEntity fr\DetailMesh[i] + Next + + tempf3=MeshWidth(fr\TileMesh[ROOM1]) + tempf1=tile_size/tempf3 + + DebugLog "ForestINIT" + + For tx%=0 To gridsize-1 + For ty%=0 To gridsize-1 + If fr\grid[(ty*gridsize)+tx]>0 Then + + tile_type = 0 + Local angle%=0 + + tile_type = Ceil(Float(fr\grid[(ty*gridsize)+tx])/4.0) + If tile_type = 6 Then + tile_type = 2 + EndIf + angle = (fr\grid[(ty*gridsize)+tx] Mod 4)*90 + + tile_entity = CopyEntity(fr\TileMesh[tile_type]) + + DebugLog "Tile: "+tile_type+"| Angle: "+angle + + If tile_type > 0 Then + + Local itemPlaced[4] + ;2, 5, 8 + Local it.Items = Null + If (ty Mod 3)=2 And itemPlaced[Floor(ty/3)]=False Then + itemPlaced[Floor(ty/3)]=True + it.Items = CreateItem("Log #"+Int(Floor(ty/3)+1), "paper", 0,0.5,0) + EntityType(it\collider, HIT_ITEM) + EntityParent(it\collider, tile_entity) + EndIf + + ;place trees and other details + ;only placed on spots where the value of the heightmap is above 100 + SetBuffer ImageBuffer(hmap[tile_type]) + width = ImageWidth(hmap[tile_type]) + tempf4# = (tempf3/Float(width)) + For lx = 3 To width-2 + For ly = 3 To width-2 + GetColor lx,width-ly + + If ColorRed()>Rand(100,260) Then + detail_entity = 0 + Select Rand(0,7) + Case 0,1,2,3,4,5,6 ;create a tree + detail_entity=CopyEntity(fr\DetailMesh[1]) + ;EntityType detail_entity,HIT_MAP + tempf2=Rnd(0.25,0.4) + + For i = 0 To 3 + d=CopyEntity(fr\DetailMesh[4]) + ;ScaleEntity d,tempf2*1.1,tempf2,tempf2*1.1,True + RotateEntity d, 0, 90*i+Rnd(-20,20), 0 + EntityParent(d,detail_entity) + + EntityFX d, 1;+8 + Next + + ScaleEntity detail_entity,tempf2*1.1,tempf2,tempf2*1.1,True + PositionEntity detail_entity,lx*tempf4-(tempf3/2.0),ColorRed()*0.03-Rnd(3.0,3.2),ly*tempf4-(tempf3/2.0),True + + RotateEntity detail_entity,Rnd(-5,5),Rnd(360.0),0.0,True + + ;EntityAutoFade(detail_entity,4.0,6.0) + Case 7 ;add a rock + detail_entity=CopyEntity(fr\DetailMesh[2]) + ;EntityType detail_entity,HIT_MAP + tempf2=Rnd(0.01,0.012) + ;ScaleEntity detail_entity,tempf2,tempf2*Rnd(1.0,2.0),tempf2,True + + PositionEntity detail_entity,lx*tempf4-(tempf3/2.0),ColorRed()*0.03-1.3,ly*tempf4-(tempf3/2.0),True + + EntityFX detail_entity, 1 + + RotateEntity detail_entity,0.0,Rnd(360.0),0.0,True + Case 6 ;add a stump + detail_entity=CopyEntity(fr\DetailMesh[4]) + ;EntityType detail_entity,HIT_MAP + tempf2=Rnd(0.1,0.12) + ScaleEntity detail_entity,tempf2,tempf2,tempf2,True + + PositionEntity detail_entity,lx*tempf4-(tempf3/2.0),ColorRed()*0.03-1.3,ly*tempf4-(tempf3/2.0),True + End Select + + If detail_entity <> 0 Then + EntityFX detail_entity, 1 + ;PositionEntity detail_entity,Rnd(0.0,tempf3)-(tempf3/2.0),ColorRed()*0.03-0.05,Rnd(0.0,tempf3)-(tempf3/2.0),True + EntityParent detail_entity,tile_entity + EndIf + EndIf + Next + Next + SetBuffer BackBuffer() + + TurnEntity tile_entity, 0, angle, 0 + + PositionEntity tile_entity,x+(tx*tile_size),y,z+(ty*tile_size),True + + DebugLog "tile_entity: "+(x+(tx*tile_size))+"|"+(y)+"|"+(z+(ty*tile_size)) + + ScaleEntity tile_entity,tempf1,tempf1,tempf1 + EntityType tile_entity,HIT_MAP + EntityFX tile_entity,1 + EntityParent tile_entity,fr\Forest_Pivot + EntityPickMode tile_entity,2 + + If it<>Null Then EntityParent it\collider,0 + + fr\TileEntities[tx+(ty*gridsize)] = tile_entity + Else + DebugLog "INVALID TILE @ ("+tx+", "+ty+ "): "+tile_type + EndIf + + If Ceil(fr\grid[(ty*gridsize)+tx]/4.0)=6 Then + For i = 0 To 1 + If fr\Door[i]=0 Then + fr\DetailEntities[i]=CopyEntity(fr\DetailMesh[5]) + ScaleEntity fr\DetailEntities[i],RoomScale,RoomScale,RoomScale + + fr\Door[i] = CopyEntity(r\Objects[3]) + PositionEntity fr\Door[i],72*RoomScale,32.0*RoomScale,0,True + RotateEntity fr\Door[i], 0,180,0 + ScaleEntity fr\Door[i],48*RoomScale,45*RoomScale,48*RoomScale,True + EntityParent fr\Door[i],fr\DetailEntities[i] + + Local frame = CopyEntity(r\Objects[2],fr\Door[i]) + PositionEntity frame,0,32.0*RoomScale,0,True + ScaleEntity frame,48*RoomScale,45*RoomScale,48*RoomScale,True + EntityParent frame,fr\DetailEntities[i] + + EntityType fr\DetailEntities[i],HIT_MAP + EntityPickMode fr\DetailEntities[i],2 + + PositionEntity fr\DetailEntities[i],x+(tx*tile_size),y,z+(ty*tile_size),True + RotateEntity fr\DetailEntities[i],0,angle+180,0 + MoveEntity fr\DetailEntities[i],0,0,-6 + + EntityParent fr\DetailEntities[i],fr\Forest_Pivot + Exit + EndIf + Next + EndIf + Else + DebugLog "NO TILE FOUND @ ("+tx+", "+ty+ ")" + EndIf + Next + Next + + DebugLog "ForestINIT END" + + CatchErrors("PlaceForest_MapCreator") +End Function + Function DestroyForest(fr.Forest) CatchErrors("Uncaught (DestroyForest)") Local tx%,ty% @@ -1521,8 +1748,8 @@ LoadRoomTemplates("Data\rooms.ini") Global RoomScale# = 8.0 / 2048.0 Const ZONEAMOUNT = 3 Global MapWidth% = GetINIInt("options.ini", "options", "map size"), MapHeight% = GetINIInt("options.ini", "options", "map size") -Dim MapTemp%(MapWidth, MapHeight) -Dim MapFound%(MapWidth, MapHeight) +Dim MapTemp%(MapWidth+1, MapHeight+1) +Dim MapFound%(MapWidth+1, MapHeight+1) Global RoomAmbience%[20] @@ -1594,7 +1821,7 @@ Type Rooms Field MaxX#, MaxY#, MaxZ# End Type -Const gridsz%=20 +Const gridsz%=19 ;Same size as the main map itself (better for the map creator) Type Grids Field grid%[gridsz*gridsz] Field angles%[gridsz*gridsz] @@ -1624,6 +1851,175 @@ Function UpdateGrid(grid.Grids) Next End Function +Function PlaceGrid_MapCreator(r.Rooms) + Local x,y,i + Local Meshes[6] + Local dr.Doors,it.Items + + For i=0 To 6 + Meshes[i]=CopyEntity(OBJTunnel(i)) + DebugLog i + HideEntity Meshes[i] + Next + + For y = 0 To (gridsz-1) + For x = 0 To (gridsz-1) + If r\grid\grid[x+(y*gridsz)]>0 Then + Local tile_type = 0 + Local angle%=0 + + tile_type = r\grid\grid[x+(y*gridsz)] + angle = r\grid\angles[x+(y*gridsz)]*90.0 + + Local tile_entity = CopyEntity(Meshes[tile_type-1]) + RotateEntity tile_entity,0,angle,0 + ScaleEntity tile_entity,RoomScale,RoomScale,RoomScale,True + PositionEntity tile_entity,r\x+x*2.0,8.0,r\z+y*2.0,True + + Select r\grid\grid[x+(y*gridsz)] + Case ROOM1 + AddLight%(Null, r\x+x*2.0, 8.0+(368.0*RoomScale), r\z+y*2.0, 2, 500.0 * RoomScale, 255, 255, 255) + Case ROOM2,ROOM2C + AddLight%(Null, r\x+x*2.0, 8.0+(368.0*RoomScale), r\z+y*2.0, 2, 500.0 * RoomScale, 255, 255, 255) + Case ROOM2C + AddLight%(Null, r\x+x*2.0, 8.0+(412.0*RoomScale), r\z+y*2.0, 2, 500.0 * RoomScale, 255, 255, 255) + Case ROOM3,ROOM4 + AddLight%(Null,r\x+x*2.0, 8.0+(412.0*RoomScale), r\z+y*2.0, 2, 500.0 * RoomScale, 255, 255, 255) + Case ROOM4+1 + dr=CreateDoor(r\zone,r\x+(x*2.0)+(Cos(EntityYaw(tile_entity,True))*240.0*RoomScale),8.0,r\z+(y*2.0)+(Sin(EntityYaw(tile_entity,True))*240.0*RoomScale),EntityYaw(tile_entity,True)+90.0,Null,False,3,False,"") + PositionEntity dr\buttons[0],EntityX(dr\buttons[0],True)+(Cos(EntityYaw(tile_entity,True))*0.05),EntityY(dr\buttons[0],True)+0.0,EntityZ(dr\buttons[0],True)+(Sin(EntityYaw(tile_entity,True))*0.05),True + + AddLight%(Null, r\x+x*2.0+(Cos(EntityYaw(tile_entity,True))*555.0*RoomScale), 8.0+(469.0*RoomScale), r\z+y*2.0+(Sin(EntityYaw(tile_entity,True))*555.0*RoomScale), 2, 600.0 * RoomScale, 255, 255, 255) + + Local tempInt2=CreatePivot() + RotateEntity tempInt2,0,EntityYaw(tile_entity,True)+180.0,0,True + PositionEntity tempInt2,r\x+(x*2.0)+(Cos(EntityYaw(tile_entity,True))*552.0*RoomScale),8.0+(240.0*RoomScale),r\z+(y*2.0)+(Sin(EntityYaw(tile_entity,True))*552.0*RoomScale) + If r\RoomDoors[1]=Null Then + r\RoomDoors[1]=dr + r\Objects[3]=tempInt2 + PositionEntity r\Objects[0],r\x+x*2.0,8.0,r\z+y*2.0,True + DebugLog "Created door 1 successfully!" + ElseIf r\RoomDoors[1]<>Null And r\RoomDoors[3]=Null Then + r\RoomDoors[3]=dr + r\Objects[5]=tempInt2 + PositionEntity r\Objects[1],r\x+x*2.0,8.0,r\z+y*2.0,True + DebugLog "Created door 2 successfully!" + EndIf + Case ROOM4+2 + AddLight%(Null, r\x+x*2.0-(Sin(EntityYaw(tile_entity,True))*504.0*RoomScale)+(Cos(EntityYaw(tile_entity,True))*16.0*RoomScale), 8.0+(396.0*RoomScale), r\z+y*2.0+(Cos(EntityYaw(tile_entity,True))*504.0*RoomScale)+(Sin(EntityYaw(tile_entity,True))*16.0*RoomScale), 2, 500.0 * RoomScale, 255, 200, 200) + it = CreateItem("SCP-500-01","scp500",r\x+x*2.0+(Cos(EntityYaw(tile_entity,True))*(-208.0)*RoomScale)-(Sin(EntityYaw(tile_entity,True))*1226.0*RoomScale),8.0+(80.0*RoomScale),r\z+y*2.0+(Sin(EntityYaw(tile_entity,True))*(-208.0)*RoomScale)+(Cos(EntityYaw(tile_entity,True))*1226.0*RoomScale)) + EntityType (it\collider, HIT_ITEM) + + it = CreateItem("Night Vision Goggles", "nvgoggles",r\x+x*2.0-(Sin(EntityYaw(tile_entity,True))*504.0*RoomScale)+(Cos(EntityYaw(tile_entity,True))*16.0*RoomScale), 8.0+(80.0*RoomScale), r\z+y*2.0+(Cos(EntityYaw(tile_entity,True))*504.0*RoomScale)+(Sin(EntityYaw(tile_entity,True))*16.0*RoomScale)) + EntityType (it\collider, HIT_ITEM) + End Select + + r\grid\Entities[x+(y*gridsz)]=tile_entity + wayp.WayPoints = CreateWaypoint(r\x+(x*2.0),8.2,r\z+(y*2.0),Null,r) + r\grid\waypoints[x+(y*gridsz)]=wayp + + If yNull Then + dist=EntityDistance(r\grid\waypoints[x+(y*gridsz)]\obj,r\grid\waypoints[x+((y+1)*gridsz)]\obj) + For i=0 To 3 + If r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x+((y+1)*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+(y*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x+((y+1)*gridsz)] + r\grid\waypoints[x+(y*gridsz)]\dist[i]=dist + Exit + EndIf + Next + For i=0 To 3 + If r\grid\waypoints[x+((y+1)*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+((y+1)*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x+((y+1)*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] + r\grid\waypoints[x+((y+1)*gridsz)]\dist[i]=dist + Exit + EndIf + Next + EndIf + EndIf + If y>0 Then + If r\grid\waypoints[x+((y-1)*gridsz)]<>Null Then + dist=EntityDistance(r\grid\waypoints[x+(y*gridsz)]\obj,r\grid\waypoints[x+((y-1)*gridsz)]\obj) + For i=0 To 3 + If r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x+((y-1)*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+(y*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x+((y-1)*gridsz)] + r\grid\waypoints[x+(y*gridsz)]\dist[i]=dist + Exit + EndIf + Next + For i=0 To 3 + If r\grid\waypoints[x+((y-1)*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+(y*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x+((y-1)*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] + r\grid\waypoints[x+((y-1)*gridsz)]\dist[i]=dist + Exit + EndIf + Next + EndIf + EndIf + If x>0 Then + If r\grid\waypoints[x-1+(y*gridsz)]<>Null Then + dist=EntityDistance(r\grid\waypoints[x+(y*gridsz)]\obj,r\grid\waypoints[x-1+(y*gridsz)]\obj) + For i=0 To 3 + If r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x-1+(y*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+(y*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x-1+(y*gridsz)] + r\grid\waypoints[x+(y*gridsz)]\dist[i]=dist + Exit + EndIf + Next + For i=0 To 3 + If r\grid\waypoints[x-1+(y*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+(y*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x-1+(y*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] + r\grid\waypoints[x-1+(y*gridsz)]\dist[i]=dist + Exit + EndIf + Next + EndIf + EndIf + If xNull Then + dist=EntityDistance(r\grid\waypoints[x+(y*gridsz)]\obj,r\grid\waypoints[x+1+(y*gridsz)]\obj) + For i=0 To 3 + If r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x+1+(y*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+(y*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x+(y*gridsz)]\connected[i]=r\grid\waypoints[x+1+(y*gridsz)] + r\grid\waypoints[x+(y*gridsz)]\dist[i]=dist + Exit + EndIf + Next + For i=0 To 3 + If r\grid\waypoints[x+1+(y*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] Then + Exit + ElseIf r\grid\waypoints[x+(y*gridsz)]\connected[i]=Null Then + r\grid\waypoints[x+1+(y*gridsz)]\connected[i]=r\grid\waypoints[x+(y*gridsz)] + r\grid\waypoints[x+1+(y*gridsz)]\dist[i]=dist + Exit + EndIf + Next + EndIf + EndIf + EndIf + Next + Next + + For i=0 To 6 + r\grid\Meshes[i]=Meshes[i] + Next + +End Function + Function CreateRoom.Rooms(zone%, roomshape%, x#, y#, z#, name$ = "") CatchErrors("Uncaught (CreateRoom)") Local r.Rooms = New Rooms @@ -1754,10 +2150,12 @@ Function FillRoom(r.Rooms) d = CreateDoor(r\zone, r\x+416.0*RoomScale,0,r\z + 640.0 * RoomScale,0,r,False,False,1) ;the forest - Local fr.Forest = New Forest - r\fr=fr - GenForestGrid(fr) - PlaceForest(fr,r\x,r\y+30.0,r\z,r) + If I_Zone\HasCustomForest = False Then + Local fr.Forest = New Forest + r\fr=fr + GenForestGrid(fr) + PlaceForest(fr,r\x,r\y+30.0,r\z,r) + EndIf ;EntityParent fr\Forest_Pivot,r\obj ; PositionEntity dp\cam,EntityX(fr\Door[0],True),r\y+31.0,EntityZ(fr\Door[0],True),True @@ -1901,13 +2299,13 @@ Function FillRoom(r.Rooms) ;[End Block] Case "gatea" ;[Block] - r\RoomDoors[2] = CreateDoor(r\zone, r\x - 4064.0 * RoomScale, (-1280.0+12000.0)*RoomScale, r\z + 3952.0 * RoomScale, 0, r, False) + r\RoomDoors[2] = CreateDoor(r\zone, r\x - 4064.0 * RoomScale, r\y-1280.0*RoomScale, r\z + 3952.0 * RoomScale, 0, r, False) r\RoomDoors[2]\AutoClose = False : r\RoomDoors[2]\open = False - d2 = CreateDoor(r\zone, r\x, 12000.0*RoomScale, r\z - 1024.0 * RoomScale, 0, r, False) + d2 = CreateDoor(r\zone, r\x, r\y, r\z - 1024.0 * RoomScale, 0, r, False) d2\AutoClose = False : d2\open = False : d2\locked = True - d2 = CreateDoor(r\zone, r\x-1440*RoomScale, (12000.0-480.0)*RoomScale, r\z + 2328.0 * RoomScale, 0, r, False, False, 2) + d2 = CreateDoor(r\zone, r\x-1440*RoomScale, r\y-480.0*RoomScale, r\z + 2328.0 * RoomScale, 0, r, False, False, 2) If SelectedEnding = "A2" Then d2\AutoClose = False : d2\open = True : d2\locked = True Else @@ -1917,7 +2315,7 @@ Function FillRoom(r.Rooms) PositionEntity d2\buttons[1], r\x-1584*RoomScale, EntityY(d2\buttons[0],True), r\z + 2488.0*RoomScale, True RotateEntity d2\buttons[1], 0, 90, 0, True - d2 = CreateDoor(r\zone, r\x-1440*RoomScale, (12000.0-480.0)*RoomScale, r\z + 4352.0 * RoomScale, 0, r, False, False, 2) + d2 = CreateDoor(r\zone, r\x-1440*RoomScale, r\y-480.0*RoomScale, r\z + 4352.0 * RoomScale, 0, r, False, False, 2) If SelectedEnding = "A2" Then d2\AutoClose = False : d2\open = True : d2\locked = True Else @@ -1934,71 +2332,71 @@ Function FillRoom(r.Rooms) r\Objects[2]=r2\Objects[2] ElseIf r2\RoomTemplate\Name = "gateaentrance" ;ylempi hissi - r\RoomDoors[1] = CreateDoor(0, r\x+1544.0*RoomScale,12000.0*RoomScale, r\z-64.0*RoomScale, 90, r, False) + r\RoomDoors[1] = CreateDoor(0, r\x+1544.0*RoomScale, r\y, r\z-64.0*RoomScale, 90, r, False, 3) r\RoomDoors[1]\AutoClose = False : r\RoomDoors[1]\open = False PositionEntity(r\RoomDoors[1]\buttons[0],r\x+1584*RoomScale, EntityY(r\RoomDoors[1]\buttons[0],True), r\z+80*RoomScale, True) PositionEntity(r\RoomDoors[1]\buttons[1],r\x+1456*RoomScale, EntityY(r\RoomDoors[1]\buttons[1],True), r\z-208*RoomScale, True) r2\Objects[1] = CreatePivot() - PositionEntity(r2\Objects[1], r\x+1848.0*RoomScale, 240.0*RoomScale, r\z-64.0*RoomScale, True) + PositionEntity(r2\Objects[1], r\x+1848.0*RoomScale, r\y+240.0*RoomScale, r\z-64.0*RoomScale, True) EntityParent r2\Objects[1], r\obj EndIf Next ;106:n spawnpoint r\Objects[3]=CreatePivot() - PositionEntity(r\Objects[3], r\x+1216.0*RoomScale, 0, r\z+2112.0*RoomScale, True) + PositionEntity(r\Objects[3], r\x+1216.0*RoomScale, r\y, r\z+2112.0*RoomScale, True) EntityParent r\Objects[3], r\obj ;sillan loppup�� r\Objects[4]=CreatePivot() - PositionEntity(r\Objects[4], r\x, 96.0*RoomScale, r\z+6400.0*RoomScale, True) + PositionEntity(r\Objects[4], r\x, r\y+96.0*RoomScale, r\z+6400.0*RoomScale, True) EntityParent r\Objects[4], r\obj ;vartiotorni 1 r\Objects[5]=CreatePivot() - PositionEntity(r\Objects[5], r\x+1784.0*RoomScale, 2124.0*RoomScale, r\z+4512.0*RoomScale, True) + PositionEntity(r\Objects[5], r\x+1784.0*RoomScale, r\y+2124.0*RoomScale, r\z+4512.0*RoomScale, True) EntityParent r\Objects[5], r\obj ;vartiotorni 2 r\Objects[6]=CreatePivot() - PositionEntity(r\Objects[6], r\x-5048.0*RoomScale, 1912.0*RoomScale, r\z+4656.0*RoomScale, True) + PositionEntity(r\Objects[6], r\x-5048.0*RoomScale, r\y+1912.0*RoomScale, r\z+4656.0*RoomScale, True) EntityParent r\Objects[6], r\obj ;sillan takareuna r\Objects[7]=CreatePivot() - PositionEntity(r\Objects[7], r\x+1824.0*RoomScale, 224.0*RoomScale, r\z+7056.0*RoomScale, True) + PositionEntity(r\Objects[7], r\x+1824.0*RoomScale, r\y+224.0*RoomScale, r\z+7056.0*RoomScale, True) EntityParent r\Objects[7], r\obj ;sillan takareuna2 r\Objects[8]=CreatePivot() - PositionEntity(r\Objects[8], r\x-1824.0*RoomScale, 224.0*RoomScale, r\z+7056.0*RoomScale, True) + PositionEntity(r\Objects[8], r\x-1824.0*RoomScale, r\y+224.0*RoomScale, r\z+7056.0*RoomScale, True) EntityParent r\Objects[8], r\obj ;"valopyssy" r\Objects[9]=CreatePivot() - PositionEntity(r\Objects[9], r\x+2624.0*RoomScale, 992.0*RoomScale, r\z+6157.0*RoomScale, True) + PositionEntity(r\Objects[9], r\x+2624.0*RoomScale, r\y+992.0*RoomScale, r\z+6157.0*RoomScale, True) EntityParent r\Objects[9], r\obj ;objects[10] = valopyssyn yl�osa ;tunnelin loppu r\Objects[11]=CreatePivot() - PositionEntity(r\Objects[11], r\x-4064.0*RoomScale, -1248.0*RoomScale, r\z-1696.0*RoomScale, True) + PositionEntity(r\Objects[11], r\x-4064.0*RoomScale, r\y-1248.0*RoomScale, r\z-1696.0*RoomScale, True) EntityParent r\Objects[11], r\obj r\Objects[13]=LoadMesh_Strict("GFX\map\gateawall1.b3d",r\obj) - PositionEntity(r\Objects[13], r\x-4308.0*RoomScale, -1045.0*RoomScale, r\z+544.0*RoomScale, True) + PositionEntity(r\Objects[13], r\x-4308.0*RoomScale, r\y-1045.0*RoomScale, r\z+544.0*RoomScale, True) EntityColor r\Objects[13], 25,25,25 EntityType r\Objects[13],HIT_MAP ;EntityFX(r\Objects[13],1) r\Objects[14]=LoadMesh_Strict("GFX\map\gateawall2.b3d",r\obj) - PositionEntity(r\Objects[14], r\x-3820.0*RoomScale, -1045.0*RoomScale, r\z+544.0*RoomScale, True) + PositionEntity(r\Objects[14], r\x-3820.0*RoomScale, r\y-1045.0*RoomScale, r\z+544.0*RoomScale, True) EntityColor r\Objects[14], 25,25,25 EntityType r\Objects[14],HIT_MAP ;EntityFX(r\Objects[14],1) r\Objects[15]=CreatePivot(r\obj) - PositionEntity(r\Objects[15], r\x-3568.0*RoomScale, -1089.0*RoomScale, r\z+4944.0*RoomScale, True) + PositionEntity(r\Objects[15], r\x-3568.0*RoomScale, r\y-1089.0*RoomScale, r\z+4944.0*RoomScale, True) r\Objects[16] = LoadMesh_Strict("GFX\map\gatea_hitbox1.b3d",r\obj) EntityPickMode r\Objects[16],2 @@ -2009,7 +2407,7 @@ Function FillRoom(r.Rooms) Case "gateaentrance" ;[Block] ;alempi hissi - r\RoomDoors[0] = CreateDoor(0, r\x+744.0*RoomScale, 0, r\z+512.0*RoomScale, 90, r, True) + r\RoomDoors[0] = CreateDoor(0, r\x+744.0*RoomScale, 0, r\z+512.0*RoomScale, 90, r, True, 3) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = True PositionEntity(r\RoomDoors[0]\buttons[1],r\x+688*RoomScale, EntityY(r\RoomDoors[0]\buttons[1],True), r\z+368*RoomScale, True) PositionEntity(r\RoomDoors[0]\buttons[0],r\x+784*RoomScale, EntityY(r\RoomDoors[0]\buttons[0],True), r\z+656*RoomScale, True) @@ -2058,7 +2456,7 @@ Function FillRoom(r.Rooms) EntityParent r\Objects[7], r\obj ;alempi hissi - r\RoomDoors[0] = CreateDoor(0, r\x+720.0*RoomScale, 0, r\z+1432.0*RoomScale, 0, r, True) + r\RoomDoors[0] = CreateDoor(0, r\x+720.0*RoomScale, 0, r\z+1432.0*RoomScale, 0, r, True, 3) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = True MoveEntity r\RoomDoors[0]\buttons[0],0,0,22.0*RoomScale MoveEntity r\RoomDoors[0]\buttons[1],0,0,22.0*RoomScale @@ -2067,7 +2465,7 @@ Function FillRoom(r.Rooms) EntityParent r\Objects[8], r\obj ;ylempi hissi - r\RoomDoors[1] = CreateDoor(0, r\x-5424.0*RoomScale, 10784.0*RoomScale, r\z-1380.0*RoomScale, 0, r, False) + r\RoomDoors[1] = CreateDoor(0, r\x-5424.0*RoomScale, 10784.0*RoomScale, r\z-1380.0*RoomScale, 0, r, False, 3) r\RoomDoors[1]\AutoClose = False : r\RoomDoors[1]\open = False MoveEntity r\RoomDoors[1]\buttons[0],0,0,22.0*RoomScale MoveEntity r\RoomDoors[1]\buttons[1],0,0,22.0*RoomScale @@ -2140,6 +2538,11 @@ Function FillRoom(r.Rooms) EntityPickMode r\Objects[3],2 EntityType r\Objects[3],HIT_MAP EntityAlpha r\Objects[3],0.0 + + d = CreateDoor(r\zone,r\x,r\y,r\z-368.0*RoomScale,0,r,True,True,2) + d\AutoClose = False + PositionEntity (d\buttons[0], r\x - 496.0 * RoomScale, 0.7, r\z - 272.0 * RoomScale, True) + TurnEntity(d\buttons[0], 0, 90, 0) ;[End Block] Case "room079" ;[Block] @@ -2206,7 +2609,6 @@ Function FillRoom(r.Rooms) sc\angle = 45 sc\turn = 0 TurnEntity(sc\CameraObj, 20, 0, 0) - sc\ID = 5 r\Objects[2] = CopyEntity(Monitor2,r\obj) ScaleEntity(r\Objects[2], 2.0, 2.0, 2.0) @@ -2296,7 +2698,7 @@ Function FillRoom(r.Rooms) EntityParent(r\Objects[0], r\obj) r\Objects[1] = CreatePivot() - PositionEntity(r\Objects[1], r\x - 632.0 * RoomScale, 0.5, r\z - 16.0 * RoomScale) + PositionEntity(r\Objects[1], r\x - 669.0 * RoomScale, 0.5, r\z - 16.0 * RoomScale) ;r\x - 632 EntityParent(r\Objects[1], r\obj) Local Glasstex = LoadTexture_Strict("GFX\map\glass.png",1+2) @@ -2304,27 +2706,25 @@ Function FillRoom(r.Rooms) EntityTexture(r\Objects[2],Glasstex) SpriteViewMode(r\Objects[2],2) ScaleSprite(r\Objects[2],182.0*RoomScale*0.5, 192.0*RoomScale*0.5) - PositionEntity(r\Objects[2], r\x - 595.0 * RoomScale, 224.0*RoomScale, r\z - 208.0 * RoomScale) + PositionEntity(r\Objects[2], r\x - 632.0 * RoomScale, 224.0*RoomScale, r\z - 208.0 * RoomScale) TurnEntity(r\Objects[2],0,180,0) EntityParent(r\Objects[2], r\obj) HideEntity (r\Objects[2]) FreeTexture Glasstex - ;d = CreateDoor(r\zone, r\x - 240.0 * RoomScale, 0.0, r\z + 640.0 * RoomScale, 90, r, False, False, 1) - ;d\AutoClose = False : d\open = False r\RoomDoors[0] = CreateDoor(r\zone, r\x - 240.0 * RoomScale, 0.0, r\z + 640.0 * RoomScale, 90, r, False, False, 1) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = False d = CreateDoor(r\zone, r\x - 512.0 * RoomScale, 0.0, r\z + 384.0 * RoomScale, 0, r, False, False) d\AutoClose = False : d\open = False - d = CreateDoor(r\zone, r\x - 816.0 * RoomScale, 0.0, r\z - 208.0 * RoomScale, 0, r, False, False) - d\AutoClose = False : d\open = False - FreeEntity(d\buttons[0]) : d\buttons[0]=0 - FreeEntity(d\buttons[1]) : d\buttons[1]=0 + ;d = CreateDoor(r\zone, r\x - 816.0 * RoomScale, 0.0, r\z - 208.0 * RoomScale, 0, r, False, False) + ;d\AutoClose = False : d\open = False + ;FreeEntity(d\buttons[0]) : d\buttons[0]=0 + ;FreeEntity(d\buttons[1]) : d\buttons[1]=0 - it = CreateItem("Level 2 Key Card", "key2", r\x - 336.0 * RoomScale, r\y + 165.0 * RoomScale, r\z + 88.0 * RoomScale) + it = CreateItem("Level 2 Key Card", "key2", r\x - 914.0 * RoomScale, r\y + 137.0 * RoomScale, r\z + 61.0 * RoomScale) EntityParent(it\collider, r\obj) it = CreateItem("S-NAV 300 Navigator", "nav", r\x - 312.0 * RoomScale, r\y + 264.0 * RoomScale, r\z + 176.0 * RoomScale) @@ -2411,10 +2811,6 @@ Function FillRoom(r.Rooms) d = CreateDoor(r\zone, r\x + 256.0 * RoomScale, r\y, r\z + 744.0 * RoomScale, 90, r, False, False, 2) d\AutoClose = False : d\open = False - it = CreateItem("Level 2 Key Card", "key2", r\x + 256.0 * RoomScale, r\y, r\z + 744.0 * RoomScale) - RotateEntity(it\collider, 0, 90, 0) - EntityParent(it\collider, r\obj) - it = CreateItem("Level 3 Key Card", "key3", r\x + 1119.0 * RoomScale, r\y + 233.0 * RoomScale, r\z + 494.0 * RoomScale) EntityParent(it\collider, r\obj) @@ -2432,8 +2828,15 @@ Function FillRoom(r.Rooms) ;Player's position after leaving the pocket dimension r\Objects[0] = CreatePivot(r\obj) PositionEntity r\Objects[0],r\x+1560.0*RoomScale,r\y,r\z+250.0*RoomScale,True - ;[End Block] + r\Objects[1] = CreatePivot(r\obj) + PositionEntity r\Objects[1],r\x + 1344.0 * RoomScale, -752.0 * RoomScale,r\z - 384.0 * RoomScale,True + + de.Decals = CreateDecal(3, r\x + 1334.0*RoomScale, -796.0*RoomScale+0.01, r\z-220.0*RoomScale,90,Rnd(360),0) + de\Size = 0.25 + ScaleSprite(de\obj, de\Size,de\Size) + EntityParent de\obj, r\obj + ;[End Block] Case "room2poffices" ;[Block] d = CreateDoor(r\zone, r\x + 240.0 * RoomScale, 0.0, r\z + 448.0 * RoomScale, 90, r, False, False, 0, Str(AccessCode)) @@ -2491,6 +2894,9 @@ Function FillRoom(r.Rooms) it = CreateItem("Dr L's Burnt Note", "paper", r\x - 808.0 * RoomScale, 1.0, r\z - 72.0 * RoomScale) EntityParent(it\collider, r\obj) + + it = CreateItem("The Modular Site Project", "paper", r\x + 622.0*RoomScale, r\y + 125.0*RoomScale, r\z - 73.0*RoomScale) + EntityParent(it\collider, r\obj) ;[End Block] Case "room2elevator" ;[Block] @@ -2500,7 +2906,7 @@ Function FillRoom(r.Rooms) r\Objects[1] = CreatePivot(r\obj) PositionEntity(r\Objects[1], r\x+1024.0*RoomScale-0.01, 120.0*RoomScale, r\z, True) - r\RoomDoors[0] = CreateDoor(r\zone, r\x + 448.0 * RoomScale, 0.0, r\z, 90, r) + r\RoomDoors[0] = CreateDoor(r\zone, r\x + 448.0 * RoomScale, 0.0, r\z, 90, r, False, 3) PositionEntity(r\RoomDoors[0]\buttons[1], r\x + 416.0 * RoomScale, EntityY(r\RoomDoors[0]\buttons[1],True), r\z - 208.0 * RoomScale,True) PositionEntity(r\RoomDoors[0]\buttons[0], r\x + 480.0 * RoomScale, EntityY(r\RoomDoors[0]\buttons[0],True), r\z + 184.0 * RoomScale,True) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = True : r\RoomDoors[0]\locked = True @@ -2526,10 +2932,11 @@ Function FillRoom(r.Rooms) Case "room2nuke" ;[Block] ;"tuulikaapin" ovi - d = CreateDoor(r\zone, r\x + 576.0 * RoomScale, 0.0, r\z - 152.0 * RoomScale, 90, r, False, False, 5) + d = CreateDoor(r\zone, r\x + 576.0 * RoomScale, 0.0, r\z + 152.0 * RoomScale, 90, r, False, False, 5) d\AutoClose = False : d\open = False - PositionEntity(d\buttons[0], r\x + 608.0 * RoomScale, EntityY(d\buttons[0],True), r\z - 284.0 * RoomScale,True) - PositionEntity(d\buttons[1], r\x + 544.0 * RoomScale, EntityY(d\buttons[1],True), r\z - 284.0 * RoomScale,True) + PositionEntity(d\buttons[0], r\x + 602.0 * RoomScale, EntityY(d\buttons[0],True), r\z + 20.0 * RoomScale,True) + PositionEntity(d\buttons[1], r\x + 550.0 * RoomScale, EntityY(d\buttons[1],True), r\z + 20.0 * RoomScale,True) + FreeEntity d\obj2 : d\obj2 = 0 d = CreateDoor(r\zone, r\x - 544.0 * RoomScale, 1504.0*RoomScale, r\z + 738.0 * RoomScale, 90, r, False, False, 5) d\AutoClose = False : d\open = False @@ -2537,14 +2944,14 @@ Function FillRoom(r.Rooms) PositionEntity(d\buttons[1], EntityX(d\buttons[1],True), EntityY(d\buttons[1],True), r\z + 608.0 * RoomScale,True) ;yl�kerran hissin ovi - r\RoomDoors[0] = CreateDoor(r\zone, r\x + 1192.0 * RoomScale, 0.0, r\z, 90, r, True) + r\RoomDoors[0] = CreateDoor(r\zone, r\x + 1192.0 * RoomScale, 0.0, r\z, 90, r, True, 3) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = True ;yl�kerran hissi r\Objects[4] = CreatePivot() PositionEntity(r\Objects[4], r\x + 1496.0 * RoomScale, 240.0 * RoomScale, r\z) EntityParent(r\Objects[4], r\obj) ;alakerran hissin ovi - r\RoomDoors[1] = CreateDoor(r\zone, r\x + 680.0 * RoomScale, 1504.0 * RoomScale, r\z, 90, r, False) + r\RoomDoors[1] = CreateDoor(r\zone, r\x + 680.0 * RoomScale, 1504.0 * RoomScale, r\z, 90, r, False, 3) r\RoomDoors[1]\AutoClose = False : r\RoomDoors[1]\open = False ;alakerran hissi r\Objects[5] = CreatePivot() @@ -2577,14 +2984,14 @@ Function FillRoom(r.Rooms) it = CreateItem("Ballistic Vest", "vest", r\x - 944.0 * RoomScale, r\y + 1652.0 * RoomScale, r\z - 656.0 * RoomScale) EntityParent(it\collider, r\obj) : RotateEntity(it\collider, 0, -90, 0) - it = CreateItem("Dr L's Note", "paper", r\x + 800.0 * RoomScale, 88.0 * RoomScale, r\z + 256.0 * RoomScale) - EntityParent(it\collider, r\obj) - sc.SecurityCams = CreateSecurityCam(r\x+624.0*RoomScale, r\y+1888.0*RoomScale, r\z-312.0*RoomScale, r) sc\angle = 90 sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) - sc\ID = 6 + + r\Objects[6] = CreatePivot() + PositionEntity r\Objects[6],r\x+1110.0*RoomScale,r\y+36.0*RoomScale,r\z-208.0*RoomScale + EntityParent r\Objects[6],r\obj ;[End Block] Case "room2tunnel" ;[Block] @@ -2605,12 +3012,12 @@ Function FillRoom(r.Rooms) PositionEntity(r\Objects[4], r\x - 552.0 * RoomScale, 240.0 * RoomScale, r\z - 656.0 * RoomScale) EntityParent(r\Objects[4], r\obj) ; - r\RoomDoors[0] = CreateDoor(r\zone, r\x + 264.0 * RoomScale, 0.0, r\z + 656.0 * RoomScale, 90, r, True) + r\RoomDoors[0] = CreateDoor(r\zone, r\x + 264.0 * RoomScale, 0.0, r\z + 656.0 * RoomScale, 90, r, True, 3) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = True PositionEntity(r\RoomDoors[0]\buttons[1], r\x + 224.0 * RoomScale, 0.7, r\z + 480.0 * RoomScale, True) PositionEntity(r\RoomDoors[0]\buttons[0], r\x + 304.0 * RoomScale, 0.7, r\z + 832.0 * RoomScale, True) - r\RoomDoors[2] = CreateDoor(r\zone, r\x - 264.0 * RoomScale, 0.0, r\z - 656.0 * RoomScale, 90, r, True) + r\RoomDoors[2] = CreateDoor(r\zone, r\x - 264.0 * RoomScale, 0.0, r\z - 656.0 * RoomScale, 90, r, True, 3) r\RoomDoors[2]\AutoClose = False : r\RoomDoors[2]\open = True PositionEntity(r\RoomDoors[2]\buttons[0], r\x - 224.0 * RoomScale, 0.7, r\z - 480.0 * RoomScale, True) PositionEntity(r\RoomDoors[2]\buttons[1], r\x - 304.0 * RoomScale, 0.7, r\z - 832.0 * RoomScale, True) @@ -2642,6 +3049,8 @@ Function FillRoom(r.Rooms) RotateEntity(r\Objects[1],89,0,0,True) + r\Levers[0] = r\Objects[1] + Glasstex = LoadTexture_Strict("GFX\map\glass.png",1+2) r\Objects[2] = CreateSprite() EntityTexture(r\Objects[2],Glasstex) @@ -2708,7 +3117,6 @@ Function FillRoom(r.Rooms) sc\angle = 135 sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) - sc\ID = 7 ;[End Block] Case "room035" ;[Block] @@ -2812,7 +3220,7 @@ Function FillRoom(r.Rooms) it = CreateItem("Blood-stained Note", "paper", r\x + 736.0 * RoomScale,1.0, r\z + 48.0 * RoomScale) EntityParent(it\collider, r\obj) - it = CreateItem("Document SCP-1048", "paper", r\x - 480.0 * RoomScale, 104.0*RoomScale, r\z - 176.0 * RoomScale) + it = CreateItem("Document SCP-513", "paper", r\x - 480.0 * RoomScale, 104.0*RoomScale, r\z - 176.0 * RoomScale) EntityParent(it\collider, r\obj) ;[End Block] Case "room966" @@ -2828,7 +3236,6 @@ Function FillRoom(r.Rooms) sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) ;sc\FollowPlayer = True - sc\ID = 9 r\Objects[0] = CreatePivot(r\obj) PositionEntity(r\Objects[0], r\x, 0.5, r\z + 512.0 * RoomScale, True) @@ -2844,6 +3251,7 @@ Function FillRoom(r.Rooms) it = CreateItem("Night Vision Goggles", "nvgoggles", r\x + 320.0 * RoomScale, 0.5, r\z + 704.0 * RoomScale) EntityParent(it\collider, r\obj) + it\state = 300 ;[End Block] Case "room3storage" @@ -2909,17 +3317,17 @@ Function FillRoom(r.Rooms) EntityAlpha r\Objects[20],0.0 ;Doors - r\RoomDoors[0] = CreateDoor(r\zone, r\x, 0.0, r\z + 448.0 * RoomScale, 0, r, True) + r\RoomDoors[0] = CreateDoor(r\zone, r\x, 0.0, r\z + 448.0 * RoomScale, 0, r, True, 3) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = True PositionEntity(r\RoomDoors[0]\buttons[1], r\x - 160.0 * RoomScale, 0.7, r\z + 480.0 * RoomScale, True) PositionEntity(r\RoomDoors[0]\buttons[0], r\x + 160.0 * RoomScale, 0.7, r\z + 416.0 * RoomScale, True) - r\RoomDoors[1] = CreateDoor(r\zone, r\x + 5840.0 * RoomScale, -5632.0 * RoomScale, r\z + 1048.0 * RoomScale, 0, r, False) + r\RoomDoors[1] = CreateDoor(r\zone, r\x + 5840.0 * RoomScale, -5632.0 * RoomScale, r\z + 1048.0 * RoomScale, 0, r, False, 3) r\RoomDoors[1]\AutoClose = False : r\RoomDoors[1]\open = False PositionEntity(r\RoomDoors[1]\buttons[0], r\x + 6000.0 * RoomScale, EntityY(r\RoomDoors[1]\buttons[0],True), r\z + 1008.0 * RoomScale, True) PositionEntity(r\RoomDoors[1]\buttons[1], r\x + 5680.0 * RoomScale, EntityY(r\RoomDoors[1]\buttons[1],True), r\z + 1088.0 * RoomScale, True) - r\RoomDoors[2] = CreateDoor(r\zone, r\x + 608.0 * RoomScale, 0.0, r\z - 312.0 * RoomScale, 0, r, True) + r\RoomDoors[2] = CreateDoor(r\zone, r\x + 608.0 * RoomScale, 0.0, r\z - 312.0 * RoomScale, 0, r, True, 3) r\RoomDoors[2]\AutoClose = False : r\RoomDoors[2]\open = True PositionEntity(r\RoomDoors[2]\buttons[1], r\x + 448.0 * RoomScale, 0.7, r\z - 272.0 * RoomScale, True) PositionEntity(r\RoomDoors[2]\buttons[0], r\x + 768.0 * RoomScale, 0.7, r\z - 352.0 * RoomScale, True) @@ -2927,7 +3335,7 @@ Function FillRoom(r.Rooms) ;r\RoomDoors[3] = CreateDoor(r\zone, r\x + 720.0 * RoomScale, -5632.0 * RoomScale, r\z + 1064.0 * RoomScale, 0, r, False) ;PositionEntity(r\RoomDoors[3]\buttons[0], r\x + 896.0 * RoomScale, EntityY(r\RoomDoors[3]\buttons[0],True), r\z + 1024.0 * RoomScale, True) ;PositionEntity(r\RoomDoors[3]\buttons[1], r\x + 544.0 * RoomScale, EntityY(r\RoomDoors[3]\buttons[1],True), r\z + 1104.0 * RoomScale, True) - r\RoomDoors[3] = CreateDoor(r\zone, r\x - 456.0 * RoomScale, -5632.0 * RoomScale, r\z - 824.0 * RoomScale, 0, r, False) + r\RoomDoors[3] = CreateDoor(r\zone, r\x - 456.0 * RoomScale, -5632.0 * RoomScale, r\z - 824.0 * RoomScale, 0, r, False, 3) r\RoomDoors[3]\AutoClose = False : r\RoomDoors[3]\open = False ;X=+176 | Z=-40 PositionEntity r\RoomDoors[3]\buttons[0], r\x - 280.0*RoomScale, EntityY(r\RoomDoors[3]\buttons[0],True), r\z - 864.0 * RoomScale, True @@ -2958,6 +3366,7 @@ Function FillRoom(r.Rooms) it = CreateItem("Night Vision Goggles", "nvgoggles", r\x + 1936.0 * RoomScale, r\y - 5496.0 * RoomScale, r\z - 944.0 * RoomScale) EntityParent(it\collider, r\obj) + it\state = 450 de.Decals = CreateDecal(3, r\x + x*RoomScale, -5632.0*RoomScale+0.01, r\z+z*RoomScale,90,Rnd(360),0) de\Size = 0.5 @@ -3020,19 +3429,15 @@ Function FillRoom(r.Rooms) PositionEntity(r\Objects[0], r\x + 640.0 * RoomScale, 240.0 * RoomScale, r\z + 656.0 * RoomScale, True) r\Objects[1] = CreatePivot(r\obj) - PositionEntity(r\Objects[1], r\x - 2032.0 * RoomScale, -3280.0 * RoomScale, r\z - 656.0 * RoomScale, True) + PositionEntity(r\Objects[1], r\x + 3211.0 * RoomScale, -3280.0 * RoomScale, r\z + 1824.0 * RoomScale, True) r\Objects[2] = CreatePivot(r\obj) - PositionEntity(r\Objects[2], r\x - 640.0 * RoomScale, 240.0 * RoomScale, r\z - 656.0 * RoomScale, True) + PositionEntity(r\Objects[2], r\x - 672.0 * RoomScale, 240.0 * RoomScale, r\z - 93.0 * RoomScale, True) r\Objects[3] = CreatePivot(r\obj) - PositionEntity(r\Objects[3], r\x + 2040.0 * RoomScale, -3280.0 * RoomScale, r\z + 656.0 * RoomScale, True) - - ;storage room (the spawn point of scp-049) - ;r\Objects[5] = CreatePivot(r\obj) - ;PositionEntity(r\Objects[5], r\x + 584.0 * RoomScale, -3440.0 * RoomScale, r\z + 104.0 * RoomScale, True) + PositionEntity(r\Objects[3], r\x - 2766.0 * RoomScale, -3280.0 * RoomScale, r\z - 1277.0 * RoomScale, True) - ;zombie 1 and 049 + ;zombie 1 r\Objects[4] = CreatePivot(r\obj) PositionEntity(r\Objects[4], r\x + 528.0 * RoomScale, -3440.0 * RoomScale, r\z + 96.0 * RoomScale, True) ;zombie 2 @@ -3050,55 +3455,59 @@ Function FillRoom(r.Rooms) Select n Case 0 ;power feed - PositionEntity (r\Objects[n * 2 + 6 + i], r\x - 328.0 * RoomScale, r\y - 3374.0 * RoomScale, r\z + 916 * RoomScale, True) + PositionEntity (r\Objects[n * 2 + 6 + i], r\x + 852.0 * RoomScale, r\y - 3374.0 * RoomScale, r\z - 854.0 * RoomScale, True) Case 1 ;generator - PositionEntity (r\Objects[n * 2 + 6 + i], r\x - 370.0 * RoomScale, r\y - 3400.0 * RoomScale, r\z - 799 * RoomScale, True) + PositionEntity (r\Objects[n * 2 + 6 + i], r\x - 834.0 * RoomScale, r\y - 3400.0 * RoomScale, r\z + 1093.0 * RoomScale, True) End Select EntityParent(r\Objects[n * 2 + 6 + i], r\obj) Next - RotateEntity(r\Objects[n*2+6], 0, -180*n, 0) - RotateEntity(r\Objects[n*2+7], 81-92*n, -180*(Not n), 0) + RotateEntity(r\Objects[n*2+6], 0, 180+90*(Not n), 0) + RotateEntity(r\Objects[n*2+7], 81-92*n, 90*(Not n), 0) EntityPickMode r\Objects[n * 2 + 7], 1, False EntityRadius r\Objects[n * 2 + 7], 0.1 Next - r\RoomDoors[0] = CreateDoor(r\zone, r\x + 328.0 * RoomScale, 0.0, r\z + 656.0 * RoomScale, 90, r, True) + r\RoomDoors[0] = CreateDoor(r\zone, r\x + 330.0 * RoomScale, 0.0, r\z + 656.0 * RoomScale, 90, r, True, 3) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = True PositionEntity(r\RoomDoors[0]\buttons[1], r\x + 288.0 * RoomScale, 0.7, r\z + 512.0 * RoomScale, True) - PositionEntity(r\RoomDoors[0]\buttons[0], r\x + 368.0 * RoomScale, 0.7, r\z + 840.0 * RoomScale, True) + PositionEntity(r\RoomDoors[0]\buttons[0], r\x + 368.0 * RoomScale, 0.7, r\z + 840.0 * RoomScale, True) - r\RoomDoors[1] = CreateDoor(r\zone, r\x - 2328.0 * RoomScale, -3520.0 * RoomScale, r\z - 656.0 * RoomScale, 90, r, False) + r\RoomDoors[1] = CreateDoor(r\zone, r\x + 2898.0 * RoomScale, -3520.0 * RoomScale, r\z + 1824.0 * RoomScale, 90, r, False, 3) r\RoomDoors[1]\AutoClose = False : r\RoomDoors[1]\open = False - PositionEntity(r\RoomDoors[1]\buttons[1], r\x - 2432.0 * RoomScale, EntityY(r\RoomDoors[1]\buttons[1],True), r\z - 816.0 * RoomScale, True) - PositionEntity(r\RoomDoors[1]\buttons[0], r\x - 2304.0 * RoomScale, EntityY(r\RoomDoors[1]\buttons[0],True), r\z - 472.0 * RoomScale, True) + PositionEntity(r\RoomDoors[1]\buttons[1], r\x + 2881.0 * RoomScale, EntityY(r\RoomDoors[1]\buttons[1],True), r\z + 1663.0 * RoomScale, True) + PositionEntity(r\RoomDoors[1]\buttons[0], r\x + 2936.0 * RoomScale, EntityY(r\RoomDoors[1]\buttons[0],True), r\z + 2009.0 * RoomScale, True) - r\RoomDoors[2] = CreateDoor(r\zone, r\x - 328.0 * RoomScale, 0.0, r\z - 656.0 * RoomScale, 90, r, True) + r\RoomDoors[2] = CreateDoor(r\zone, r\x - 672.0 * RoomScale, 0.0, r\z - 408.0 * RoomScale, 0, r, True, 3) r\RoomDoors[2]\AutoClose = False : r\RoomDoors[2]\open = True - PositionEntity(r\RoomDoors[2]\buttons[0], r\x - 288.0 * RoomScale, 0.7, r\z - 512.0 * RoomScale, True) - PositionEntity(r\RoomDoors[2]\buttons[1], r\x - 368.0 * RoomScale, 0.7, r\z - 840.0 * RoomScale, True) + PositionEntity(r\RoomDoors[2]\buttons[0], r\x - 487.0 * RoomScale, 0.7, r\z - 447.0 * RoomScale, True) + PositionEntity(r\RoomDoors[2]\buttons[1], r\x - 857.0 * RoomScale, 0.7, r\z - 369.0 * RoomScale, True) - r\RoomDoors[3] = CreateDoor(r\zone, r\x + 2360.0 * RoomScale, -3520.0 * RoomScale, r\z + 656.0 * RoomScale, 90, r, False) + r\RoomDoors[3] = CreateDoor(r\zone, r\x - 2766.0 * RoomScale, -3520.0 * RoomScale, r\z - 1592.0 * RoomScale, 0, r, False, 3) r\RoomDoors[3]\AutoClose = False : r\RoomDoors[3]\open = False - PositionEntity(r\RoomDoors[3]\buttons[0], r\x + 2432.0 * RoomScale, EntityY(r\RoomDoors[3]\buttons[0],True), r\z + 816.0 * RoomScale, True) - PositionEntity(r\RoomDoors[3]\buttons[1], r\x + 2312.0 * RoomScale, EntityY(r\RoomDoors[3]\buttons[1],True), r\z + 472.0 * RoomScale, True) - - For i = 0 To 3 - If (i Mod 2) = 1 - AssignElevatorObj(r\Objects[i],r\RoomDoors[i],2) - Else - AssignElevatorObj(r\Objects[i],r\RoomDoors[i],True) - EndIf - Next + PositionEntity(r\RoomDoors[3]\buttons[0], r\x - 2581.0 * RoomScale, EntityY(r\RoomDoors[3]\buttons[0],True), r\z - 1631.0 * RoomScale, True) + PositionEntity(r\RoomDoors[3]\buttons[1], r\x - 2951.0 * RoomScale, EntityY(r\RoomDoors[3]\buttons[1],True), r\z - 1553.0 * RoomScale, True) + + ;For i = 0 To 3 + ; If (i Mod 2) = 1 + ; AssignElevatorObj(r\Objects[i],r\RoomDoors[i],2) + ; Else + ; AssignElevatorObj(r\Objects[i],r\RoomDoors[i],True) + ; EndIf + ;Next - ;storage room door + ;storage room doors r\RoomDoors[4] = CreateDoor(r\zone, r\x + 272.0 * RoomScale, -3552.0 * RoomScale, r\z + 104.0 * RoomScale, 90, r, False) - r\RoomDoors[4]\AutoClose = False : r\RoomDoors[4]\open = False : r\RoomDoors[4]\locked = True + r\RoomDoors[4]\AutoClose = False : r\RoomDoors[4]\open = True : r\RoomDoors[4]\locked = True + r\RoomDoors[5] = CreateDoor(r\zone, r\x + 264.0 * RoomScale, -3520.0 * RoomScale, r\z - 1824.0 * RoomScale, 90, r, False) + r\RoomDoors[5]\AutoClose = False : r\RoomDoors[5]\open = True : r\RoomDoors[5]\locked = True + r\RoomDoors[6] = CreateDoor(r\zone, r\x - 264.0 * RoomScale, -3520.0 * RoomScale, r\z + 1824.0 * RoomScale, 90, r, False) + r\RoomDoors[6]\AutoClose = False : r\RoomDoors[6]\open = True : r\RoomDoors[6]\locked = True d.Doors = CreateDoor(0, r\x,0,r\z, 0, r, False, 2, -2) @@ -3111,10 +3520,25 @@ Function FillRoom(r.Rooms) it = CreateItem("First Aid Kit", "firstaid", r\x +385.0 * RoomScale, r\y - 3412.0 * RoomScale, r\z + 271.0 * RoomScale) EntityParent(it\collider, r\obj) - r\Objects[10] = LoadMesh_Strict("GFX\map\room049_hb.b3d",r\obj) - EntityPickMode r\Objects[10],2 - EntityType r\Objects[10],HIT_MAP - EntityAlpha r\Objects[10],0.0 + d = CreateDoor(r\zone,r\x-272.0*RoomScale,r\y-3552.0*RoomScale,r\z+98.0*RoomScale,90,r,True,True) + d\AutoClose = False : d\open = True : d\MTFClose = False : d\locked = True + For i = 0 To 1 + FreeEntity(d\buttons[i]) : d\buttons[i]=0 + Next + + d = CreateDoor(r\zone,r\x-2990.0*RoomScale,r\y-3520.0*RoomScale,r\z-1824.0*RoomScale,90,r,False,2) + d\locked = True : d\DisableWaypoint = True + d = CreateDoor(r\zone,r\x-896.0*RoomScale,r\y,r\z-640*RoomScale,90,r,False,2) + d\locked = True : d\DisableWaypoint = True + + r\Objects[10] = CreatePivot(r\obj) + PositionEntity r\Objects[10],r\x-832.0*RoomScale,r\y-3484.0*RoomScale,r\z+1572.0*RoomScale,True + + ;Spawnpoint for the map layout document + r\Objects[11] = CreatePivot(r\obj) + PositionEntity r\Objects[11],r\x+2642.0*RoomScale,r\y-3516.0*RoomScale,r\z+1822.0*RoomScale,True + r\Objects[12] = CreatePivot(r\obj) + PositionEntity r\Objects[12],r\x-2666.0*RoomScale,r\y-3516.0*RoomScale,r\z-1792.0*RoomScale,True ;[End Block] Case "room2_2" ;[Block] @@ -3126,7 +3550,7 @@ Function FillRoom(r.Rooms) EndIf EndIf Next - If r\Objects[0]=0 Then r\Objects[0] = LoadMesh("GFX\map\fan.b3d") + If r\Objects[0]=0 Then r\Objects[0] = LoadMesh_Strict("GFX\map\fan.b3d") ScaleEntity r\Objects[0], RoomScale, RoomScale, RoomScale PositionEntity(r\Objects[0], r\x - 248 * RoomScale, 528 * RoomScale, r\z, 0) EntityParent(r\Objects[0], r\obj) @@ -3239,9 +3663,9 @@ Function FillRoom(r.Rooms) d.Doors = CreateDoor(0, r\x,0,r\z, 0, r, False, 2, False) d\locked = True - r\RoomDoors[0] = CreateDoor(r\zone, r\x - 208.0 * RoomScale, 0.0, r\z - 736.0 * RoomScale, 90, r, True, False) + r\RoomDoors[0] = CreateDoor(r\zone, r\x - 208.0 * RoomScale, 0.0, r\z - 736.0 * RoomScale, 90, r, True, False, False, "", True) r\RoomDoors[0]\AutoClose=False - r\RoomDoors[1] = CreateDoor(r\zone, r\x - 208.0 * RoomScale, 0.0, r\z + 736.0 * RoomScale, 90, r, True, False) + r\RoomDoors[1] = CreateDoor(r\zone, r\x - 208.0 * RoomScale, 0.0, r\z + 736.0 * RoomScale, 90, r, True, False, False, "", True) r\RoomDoors[1]\AutoClose=False r\RoomDoors[2] = CreateDoor(r\zone, r\x - 672.0 * RoomScale, 0.0, r\z - 1024.0 * RoomScale, 0, r, False, False, False, "GEAR") @@ -3369,7 +3793,7 @@ Function FillRoom(r.Rooms) ;[End Block] Case "room2closets" ;[Block] - it = CreateItem("Document SCP-173", "paper", r\x + 736.0 * RoomScale, r\y + 176.0 * RoomScale, r\z + 736.0 * RoomScale) + it = CreateItem("Document SCP-1048", "paper", r\x + 736.0 * RoomScale, r\y + 176.0 * RoomScale, r\z + 736.0 * RoomScale) EntityParent(it\collider, r\obj) it = CreateItem("Gas Mask", "gasmask", r\x + 736.0 * RoomScale, r\y + 176.0 * RoomScale, r\z + 544.0 * RoomScale) @@ -3410,7 +3834,6 @@ Function FillRoom(r.Rooms) sc\angle = 180 sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) - sc\ID = 0 ;sc\FollowPlayer = True ;[End Block] Case "room2offices" @@ -3598,12 +4021,12 @@ Function FillRoom(r.Rooms) PositionEntity(d\buttons[0], r\x + 320.0 * RoomScale, EntityY(d\buttons[0],True), EntityZ(d\buttons[0],True), True) PositionEntity(d\buttons[1], r\x + 224.0 * RoomScale, EntityY(d\buttons[1],True), EntityZ(d\buttons[1],True), True) - d.Doors = CreateDoor(r\zone, r\x - 264.0 * RoomScale, 0, r\z+32*RoomScale, 270, r, True, False, 3) + d.Doors = CreateDoor(r\zone, r\x - 264.0 * RoomScale, 0, r\z, 270, r, True, False, 3) d\AutoClose = False : d\open = False PositionEntity(d\buttons[0], r\x - 320.0 * RoomScale, EntityY(d\buttons[0],True), EntityZ(d\buttons[0],True), True) PositionEntity(d\buttons[1], r\x - 224.0 * RoomScale, EntityY(d\buttons[1],True), EntityZ(d\buttons[1],True), True) - r\RoomDoors[1] = CreateDoor(r\zone, r\x-560.0 * RoomScale, 0, r\z - 240.0 * RoomScale, 0, r, True, False, 3) + r\RoomDoors[1] = CreateDoor(r\zone, r\x-560.0 * RoomScale, 0, r\z - 272.0 * RoomScale, 0, r, True, False, 3) r\RoomDoors[1]\AutoClose = False : r\RoomDoors[1]\open = False r\RoomDoors[2] = CreateDoor(r\zone, r\x + 560.0 * RoomScale, 0, r\z - 272.0 * RoomScale, 180, r, True, False, 3) @@ -3612,7 +4035,10 @@ Function FillRoom(r.Rooms) r\RoomDoors[3] = CreateDoor(r\zone, r\x + 560.0 * RoomScale, 0, r\z + 272.0 * RoomScale, 180, r, True, False, 3) r\RoomDoors[3]\AutoClose = False : r\RoomDoors[3]\open = False - it = CreateItem("SCP-714", "scp714", r\x - 552.0 * RoomScale, r\y + 220.0 * RoomScale, r\z - 728.0 * RoomScale) + r\RoomDoors[4] = CreateDoor(r\zone, r\x-560.0 * RoomScale, 0, r\z + 272.0 * RoomScale, 0, r, True, False, 3) + r\RoomDoors[4]\AutoClose = False : r\RoomDoors[4]\open = False + + it = CreateItem("SCP-714", "scp714", r\x - 552.0 * RoomScale, r\y + 220.0 * RoomScale, r\z - 760.0 * RoomScale) EntityParent(it\collider, r\obj) it = CreateItem("SCP-1025", "scp1025", r\x + 552.0 * RoomScale, r\y + 224.0 * RoomScale, r\z - 758.0 * RoomScale) @@ -3631,10 +4057,81 @@ Function FillRoom(r.Rooms) TurnEntity(sc\CameraObj, 30, 0, 0) EntityParent(sc\obj, r\obj) - it = CreateItem("Document SCP-714", "paper", r\x - 728.0 * RoomScale, r\y + 288.0 * RoomScale, r\z - 328.0 * RoomScale) - EntityParent(it\collider, r\obj) - ;[End Block] + sc.SecurityCams = CreateSecurityCam(r\x + 560.0 * RoomScale, r\y + 386 * RoomScale, r\z + 480.0 * RoomScale, r) + sc\angle = 0 : sc\turn = 30 + TurnEntity(sc\CameraObj, 30, 0, 0) + EntityParent(sc\obj, r\obj) + + sc.SecurityCams = CreateSecurityCam(r\x - 560.0 * RoomScale, r\y + 386 * RoomScale, r\z + 480.0 * RoomScale, r) + sc\angle = 0 : sc\turn = 30 + TurnEntity(sc\CameraObj, 30, 0, 0) + EntityParent(sc\obj, r\obj) + + it = CreateItem("Document SCP-714", "paper", r\x - 728.0 * RoomScale, r\y + 288.0 * RoomScale, r\z - 360.0 * RoomScale) + EntityParent(it\collider, r\obj) + it = CreateItem("Document SCP-427", "paper", r\x - 608.0 * RoomScale, r\y + 66.0 * RoomScale, r\z + 636.0 * RoomScale) + EntityParent(it\collider, r\obj) + + Local dx#,dy# + For i = 0 To 14 + Select i + Case 0 + dx# = -64.0 + dz# = -516.0 + Case 1 + dx# = -96.0 + dz# = -388.0 + Case 2 + dx# = -128.0 + dz# = -292.0 + Case 3 + dx# = -128.0 + dz# = -132.0 + Case 4 + dx# = -160.0 + dz# = -36.0 + Case 5 + dx# = -192.0 + dz# = 28.0 + Case 6 + dx# = -384.0 + dz# = 28.0 + Case 7 + dx# = -448.0 + dz# = 92.0 + Case 8 + dx# = -480.0 + dz# = 124.0 + Case 9 + dx# = -512.0 + dz# = 156.0 + Case 10 + dx# = -544.0 + dz# = 220.0 + Case 11 + dx# = -544.0 + dz# = 380.0 + Case 12 + dx# = -544.0 + dz# = 476.0 + Case 13 + dx# = -544.0 + dz# = 572.0 + Case 14 + dx# = -544.0 + dz# = 636.0 + End Select + de.Decals = CreateDecal(Rand(15,16),r\x+dx#*RoomScale,0.005,r\z+dz#*RoomScale,90,Rand(360),0) + If i > 10 Then + de\Size = Rnd(0.2,0.25) + Else + de\Size = Rnd(0.1,0.17) + EndIf + EntityAlpha(de\obj, 1.0) : ScaleSprite(de\obj,de\Size,de\Size) + EntityParent de\obj, r\obj + Next + ;[End Block] Case "room205" ;[Block] ;d.Doors = CreateDoor(r\zone, r\x + 128.0 * RoomScale, 0, r\z + 640.0 *RoomScale, 90, r, True, False, 3) @@ -3644,7 +4141,7 @@ Function FillRoom(r.Rooms) ;PositionEntity(d\buttons[0], r\x + 320.0 * RoomScale, EntityY(d\buttons[0],True), EntityZ(d\buttons[0],True), True) ;PositionEntity(d\buttons[1], r\x + 224.0 * RoomScale, EntityY(d\buttons[1],True), EntityZ(d\buttons[1],True), True) - r\RoomDoors[0] = CreateDoor(r\zone, r\x - 1392.0 * RoomScale, -128.0 * RoomScale, r\z - 384*RoomScale, 0, r, True, False, 3) + r\RoomDoors[0] = CreateDoor(r\zone, r\x - 1392.0 * RoomScale, -128.0 * RoomScale, r\z - 384*RoomScale, 0, r, True, False, 3, "", True) r\RoomDoors[0]\AutoClose = False : r\RoomDoors[0]\open = False FreeEntity(r\RoomDoors[0]\buttons[0]) : r\RoomDoors[0]\buttons[0]=0 FreeEntity(r\RoomDoors[0]\buttons[1]) : r\RoomDoors[0]\buttons[1]=0 @@ -3736,6 +4233,7 @@ Function FillRoom(r.Rooms) it = CreateItem("Night Vision Goggles", "nvgoggles", r\x + 280.0 * RoomScale, r\y -1456.0 * RoomScale, r\z + 2164.0 * RoomScale) EntityParent(it\collider, r\obj) + it\state = 400 r\Objects[1] = CreatePivot(r\obj) PositionEntity(r\Objects[1], r\x + 96.0*RoomScale, -1532.0 * RoomScale, r\z + 2016.0 * RoomScale,True) @@ -3789,6 +4287,16 @@ Function FillRoom(r.Rooms) r\Objects[6] = CreatePivot() PositionEntity(r\Objects[6],r\x,0,r\z+800*RoomScale) EntityParent(r\Objects[6],r\obj) + + For r2.Rooms = Each Rooms + If r2<>r Then + If r2\RoomTemplate\Name = "room2tesla" Or r2\RoomTemplate\Name = "room2tesla_lcz" Or r2\RoomTemplate\Name = "room2tesla_hcz" Then + r\Objects[7] = CopyEntity(r2\Objects[7],r\obj) ;don't load the mesh again + Exit + EndIf + EndIf + Next + If r\Objects[7]=0 Then r\Objects[7] = LoadMesh_Strict("GFX\map\room2tesla_caution.b3d",r\obj) ;[End Block] Case "room2doors" ;[Block] @@ -3839,12 +4347,14 @@ Function FillRoom(r.Rooms) FreeEntity (d\obj2) : d\obj2 = 0 FreeEntity (d\buttons[0]) : d\buttons[0] = 0 FreeEntity (d\buttons[1]) : d\buttons[1] = 0 + d\dir = 4 r\RoomDoors[0] = d: d\AutoClose = False d = CreateDoor(r\zone, r\x + 816.0 * RoomScale, 0.0, r\z + 528.0 * RoomScale, 180, r, True) FreeEntity (d\obj2) : d\obj2 = 0 FreeEntity (d\buttons[0]) : d\buttons[0] = 0 FreeEntity (d\buttons[1]) : d\buttons[1] = 0 + d\dir = 4 r\RoomDoors[1] = d : d\AutoClose = False r\Objects[2] = CreatePivot() @@ -3854,7 +4364,7 @@ Function FillRoom(r.Rooms) EntityParent(r\Objects[2], r\obj) EntityParent(r\Objects[3], r\obj) - it = CreateItem("Note", "paper", r\x +954.0 * RoomScale, r\y +228.0 * RoomScale, r\z + 127.0 * RoomScale) + it = CreateItem("Addendum: 5/14 Test Log", "paper", r\x +954.0 * RoomScale, r\y +228.0 * RoomScale, r\z + 127.0 * RoomScale) EntityParent(it\collider, r\obj) it = CreateItem("First Aid Kit", "firstaid", r\x + 960.0 * RoomScale, r\y + 112.0 * RoomScale, r\z - 40.0 * RoomScale) @@ -3907,7 +4417,7 @@ Function FillRoom(r.Rooms) ;AddLight(r, r\x-224.0*RoomScale, r\y+640.0*RoomScale, r\z+128.0*RoomScale,2,2,200,200,200) ;AddLight(r, r\x-1056.0*RoomScale, r\y+608.0*RoomScale, r\z+416.0*RoomScale,2,2,200,200,200) - r\RoomDoors[2] = CreateDoor(r\zone, r\x - 1008.0 * RoomScale, 0, r\z - 688.0 * RoomScale, 90, r, True) + r\RoomDoors[2] = CreateDoor(r\zone, r\x - 1008.0 * RoomScale, 0, r\z - 688.0 * RoomScale, 90, r, True, False, False, "", True) r\RoomDoors[2]\AutoClose = False : r\RoomDoors[2]\open = False : r\RoomDoors[2]\locked = True FreeEntity(r\RoomDoors[2]\buttons[0]) : r\RoomDoors[2]\buttons[0] = 0 FreeEntity(r\RoomDoors[2]\buttons[1]) : r\RoomDoors[2]\buttons[1] = 0 @@ -4022,7 +4532,6 @@ Function FillRoom(r.Rooms) sc\angle = 45 sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) - sc\ID = 10 ;[End Block] Case "room106" ;[Block] @@ -4038,7 +4547,7 @@ Function FillRoom(r.Rooms) d = CreateDoor(r\zone, r\x - 968.0 * RoomScale, -764.0 * RoomScale, r\z + 1392.0 * RoomScale, 0, r, False, False, 4) d\AutoClose = False : d\open = False - d = CreateDoor(r\zone, r\x, 0, r\z - 464.0 * RoomScale, 0, r, False, False, 3) + d = CreateDoor(r\zone, r\x, 0, r\z - 464.0 * RoomScale, 0, r, False, False, 4) d\AutoClose = False : d\open = False d = CreateDoor(r\zone, r\x - 624.0 * RoomScale, -1280.0 * RoomScale, r\z, 90, r, False, False, 4) @@ -4132,11 +4641,12 @@ Function FillRoom(r.Rooms) r\Objects[9] = CreatePivot(r\obj) PositionEntity (r\Objects[9], r\x - 272 * RoomScale, r\y - 672.0 * RoomScale, r\z + 2736.0 * RoomScale, True) + + r\Objects[10] = CreatePivot(r\obj) + PositionEntity (r\Objects[10], r\x, r\y, r\z - 720.0 * RoomScale, True) ;[End Block] Case "room1archive" ;[Block] - temp% = Rand(1,3) - For xtemp = 0 To 1 For ytemp = 0 To 2 For ztemp = 0 To 2 @@ -4200,20 +4710,19 @@ Function FillRoom(r.Rooms) x# = (-672.0 + 864.0 * xtemp)* RoomScale y# = (96.0 + 96.0 * ytemp) * RoomScale z# = (480.0 - 352.0*ztemp + Rnd(-96.0,96.0)) * RoomScale - + it = CreateItem(tempstr,tempstr2,r\x+x,y,r\z+z) EntityParent it\collider,r\obj Next Next Next - - r\RoomDoors[0] = CreateDoor(r\zone,r\x,r\y,r\z - 528.0 * RoomScale,0,r,False,False,temp) + + r\RoomDoors[0] = CreateDoor(r\zone,r\x,r\y,r\z - 528.0 * RoomScale,0,r,False,False,6) sc.SecurityCams = CreateSecurityCam(r\x-256.0*RoomScale, r\y+384.0*RoomScale, r\z+640.0*RoomScale, r) sc\angle = 180 sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) - sc\ID = 1 ;[End Block] Case "room2test1074" ;[Block] @@ -4342,15 +4851,6 @@ Function FillRoom(r.Rooms) EntityType r\Objects[14],HIT_MAP EntityAlpha r\Objects[14],0.0 ;[End Block] - Case "room178" - ;[Block] - r\RoomDoors[0] = CreateDoor(r\zone,r\x,r\y,r\z - 672.0*RoomScale,0,r,False,False,3) - - it = CreateItem("SCP-178","scp178",r\x,200.0 * RoomScale,r\z - 80.0 * RoomScale) - RotateEntity it\collider,0,0,0 - EntityParent it\collider,r\obj - SetAnimTime it\model,0.0 - ;[End Block] Case "pocketdimension" ;[Block] Local hallway = LoadMesh_Strict("GFX\map\pocketdimension2.b3d") ;the tunnels in the first room @@ -4513,7 +5013,6 @@ Function FillRoom(r.Rooms) sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) ;sc\FollowPlayer = True - sc\ID = 2 ;[End Block] Case "room2_3" ;[Block] @@ -4533,7 +5032,6 @@ Function FillRoom(r.Rooms) sc\room = r TurnEntity(sc\CameraObj, 20, 0, 0) EntityParent(sc\obj, r\obj) - sc\ID = 3 ;[End Block] Case "room2servers2" ;[Block] @@ -4546,7 +5044,7 @@ Function FillRoom(r.Rooms) d.Doors\locked = True d.Doors\DisableWaypoint = True it = CreateItem("Night Vision Goggles", "nvgoggles", r\x + 56.0154 * RoomScale, r\y - 648.0 * RoomScale, r\z + 749.638 * RoomScale) - it\state = 20 + it\state = 200 RotateEntity it\collider, 0, r\angle+Rand(245), 0 EntityParent(it\collider, r\obj) ;[End Block] @@ -4560,6 +5058,12 @@ Function FillRoom(r.Rooms) de\Size = 0.5 ScaleSprite(de\obj, de\Size,de\Size) EntityParent de\obj, r\obj + + ;260 300 -350 + ;WIP + r\Objects[0] = CreatePivot() + PositionEntity r\Objects[0],r\x+280.0*RoomScale,r\y+345.0*RoomScale,r\z-340.0*RoomScale,True + EntityParent r\Objects[0],r\obj EndIf r\RoomDoors[0] = CreateDoor(r\zone, r\x + 336.0 * RoomScale, 0.0, r\z - 382.0 * RoomScale, 0, r, False, False) @@ -4665,7 +5169,6 @@ Function FillRoom(r.Rooms) sc\angle = 225 sc\turn = 45 TurnEntity(sc\CameraObj, 20, 0, 0) - sc\ID = 8 ;[End Block] Case "room2scps2" ;[Block] @@ -4689,6 +5192,16 @@ Function FillRoom(r.Rooms) it = CreateItem("Emily Ross' Badge", "badge", r\x + 364.0 * RoomScale, r\y + 5.0 * RoomScale, r\z + 716.0 * RoomScale) EntityParent(it\collider, r\obj) + + sc.SecurityCams = CreateSecurityCam(r\x + 850.0 * RoomScale, r\y + 350.0 * RoomScale, r\z + 876.0 * RoomScale, r) + sc\angle = 220 : sc\turn = 30 + TurnEntity(sc\CameraObj, 30, 0, 0) + EntityParent(sc\obj, r\obj) + + sc.SecurityCams = CreateSecurityCam(r\x + 600.0 * RoomScale, r\y + 514.0 * RoomScale, r\z + 150.0 * RoomScale, r) + sc\angle = 180 : sc\turn = 30 + TurnEntity(sc\CameraObj, 30, 0, 0) + EntityParent(sc\obj, r\obj) ;[End Block] Case "room3offices" ;[Block] @@ -4705,17 +5218,65 @@ Function FillRoom(r.Rooms) Case "room2offices4" ;[Block] d.Doors = CreateDoor(0, r\x - 240.0 * RoomScale, 0.0, r\z, 90, r, False) - d\open = False : d\AutoClose = False + PositionEntity(d\buttons[0], r\x - 230.0 * RoomScale, EntityY(d\buttons[0],True), EntityZ(d\buttons[0],True), True) + PositionEntity(d\buttons[1], r\x - 250.0 * RoomScale, EntityY(d\buttons[1],True), EntityZ(d\buttons[1],True), True) + d\open = False : d\AutoClose = False + + it = CreateItem("Sticky Note", "paper", r\x - 991.0*RoomScale, r\y - 242.0*RoomScale, r\z + 904.0*RoomScale) + EntityParent(it\collider, r\obj) ;[End Block] Case "room2sl" ;[Block] Local scale# = RoomScale * 4.5 * 0.4 + Local screen% + + r\Textures[0] = LoadAnimTexture("GFX\SL_monitors_checkpoint.jpg",1,512,512,0,4) + r\Textures[1] = LoadAnimTexture("GFX\Sl_monitors.jpg",1,256,256,0,8) ;Monitor Objects For i = 0 To 14 - If i <> 7 + If i <> 7 Then r\Objects[i] = CopyEntity(Monitor) ScaleEntity(r\Objects[i], scale, scale, scale) + If i <> 4 And i <> 13 Then + screen = CreateSprite() + EntityFX screen,17 + SpriteViewMode screen,2 + ScaleSprite(screen, MeshWidth(Monitor) * scale * 0.95 * 0.5, MeshHeight(Monitor) * scale * 0.95 * 0.5) + Select i + Case 0 + EntityTexture screen,r\Textures[1],0 + Case 2 + EntityTexture screen,r\Textures[1],2 + Case 3 + EntityTexture screen,r\Textures[1],1 + Case 8 + EntityTexture screen,r\Textures[1],4 + Case 9 + EntityTexture screen,r\Textures[1],5 + Case 10 + EntityTexture screen,r\Textures[1],3 + Case 11 + EntityTexture screen,r\Textures[1],7 + Default + EntityTexture screen,r\Textures[0],3 + End Select + EntityParent screen,r\Objects[i] + ElseIf i = 4 Then + r\Objects[20] = CreateSprite() + EntityFX r\Objects[20],17 + SpriteViewMode r\Objects[20],2 + ScaleSprite(r\Objects[20], MeshWidth(Monitor) * scale * 0.95 * 0.5, MeshHeight(Monitor) * scale * 0.95 * 0.5) + EntityTexture r\Objects[20],r\Textures[0],2 + EntityParent r\Objects[20],r\Objects[i] + Else + r\Objects[21] = CreateSprite() + EntityFX r\Objects[21],17 + SpriteViewMode r\Objects[21],2 + ScaleSprite(r\Objects[21], MeshWidth(Monitor) * scale * 0.95 * 0.5, MeshHeight(Monitor) * scale * 0.95 * 0.5) + EntityTexture r\Objects[21],r\Textures[1],6 + EntityParent r\Objects[21],r\Objects[i] + EndIf EndIf Next For i = 0 To 2 @@ -4770,8 +5331,11 @@ Function FillRoom(r.Rooms) PositionEntity r\Objects[15],r\x+700.0*RoomScale,r\y+700.0*RoomScale,r\z+256.0*RoomScale,True EntityParent r\Objects[15],r\obj r\Objects[16] = CreatePivot() - PositionEntity r\Objects[16],r\x-100.0*RoomScale,r\y+700.0*RoomScale,r\z+256.0*RoomScale,True + PositionEntity r\Objects[16],r\x-60.0*RoomScale,r\y+700.0*RoomScale,r\z+200.0*RoomScale,True EntityParent r\Objects[16],r\obj + r\Objects[17] = CreatePivot() + PositionEntity r\Objects[17],r\x-48.0*RoomScale,r\y+540.0*RoomScale,r\z+656.0*RoomScale,True + EntityParent r\Objects[17],r\obj ;Faked room409 ;r\Objects[17] = LoadMesh_Strict("GFX\map\room2sl_2.b3d",r\obj) @@ -4812,39 +5376,18 @@ Function FillRoom(r.Rooms) TurnEntity(sc\ScrObj, 0, 90, 0) EntityParent(sc\ScrObj, r\obj) - r\Objects[20] = CopyEntity(LeverBaseOBJ) - r\Objects[21] = CopyEntity(LeverOBJ) - - For i% = 0 To 1 - ScaleEntity(r\Objects[20 + i], 0.04, 0.04, 0.04) - PositionEntity r\Objects[20],r\x+82.0*RoomScale, r\y+689.0*RoomScale, r\z+912.0*RoomScale,True - PositionEntity r\Objects[21],r\x+90.9775*RoomScale, r\y+604.347*RoomScale, r\z+890.584*RoomScale,True - - EntityParent(r\Objects[20 + i], r\obj) - Next - - RotateEntity r\Objects[21],8.6,-150.0,-5.0 - - ;For tw.TempWayPoints = Each TempWayPoints - ; If tw\roomtemplate = r\RoomTemplate - ; If tw\y > 480.0*RoomScale - ; tw\y = 540.0*RoomScale - ; EndIf - ; EndIf - ;Next - - ;w.waypoints = CreateWaypoint(r\x, r\y + 64.0 * RoomScale, r\z - 640.0 * RoomScale, Null, r) - ;w2.waypoints = CreateWaypoint(r\x + 1024.0*RoomScale, r\y + 320.0 * RoomScale, r\z - 640.0 * RoomScale, Null, r) - ;w3.waypoints = CreateWaypoint(r\x + 1552.0*RoomScale, r\y + 540.0 * RoomScale, r\z - 636.0*RoomScale, Null, r) - ;w3\connected[0] = w2 : w3\dist[0] = EntityDistance(w3\obj, w2\obj) - ;w2\connected[1] = w3 : w2\dist[1] = w3\dist[0] - - ;r\MaxWayPointY# = 400.0*RoomScale - - r\Objects[22] = LoadMesh_Strict("GFX\map\room2sl_hb.b3d",r\obj) - EntityPickMode r\Objects[22],2 - EntityType r\Objects[22],HIT_MAP - EntityAlpha r\Objects[22],0.0 +; r\Objects[20] = CopyEntity(LeverBaseOBJ) +; r\Objects[21] = CopyEntity(LeverOBJ) +; +; For i% = 0 To 1 +; ScaleEntity(r\Objects[20 + i], 0.04, 0.04, 0.04) +; PositionEntity r\Objects[20],r\x+82.0*RoomScale, r\y+689.0*RoomScale, r\z+912.0*RoomScale,True +; PositionEntity r\Objects[21],r\x+90.9775*RoomScale, r\y+604.347*RoomScale, r\z+890.584*RoomScale,True +; +; EntityParent(r\Objects[20 + i], r\obj) +; Next +; +; RotateEntity r\Objects[21],8.6,-150.0,-5.0 ;[End Block] Case "room2_4" ;[Block] @@ -4923,6 +5466,33 @@ Function FillRoom(r.Rooms) ;PositionEntity r\Objects[3],r\x-926.891*RoomScale,r\y,r\z-318.399*RoomScale,True PositionEntity r\Objects[3],r\x-820.0*RoomScale,r\y,r\z-318.399*RoomScale,True ;[End Block] + Case "room2cpit" + ;[Block] + em.Emitters = CreateEmitter(r\x + 512.0 * RoomScale, -76 * RoomScale, r\z - 688 * RoomScale, 0) + TurnEntity(em\Obj, -90, 0, 0) + EntityParent(em\Obj, r\obj) + em\RandAngle = 55 + em\Speed = 0.0005 + em\Achange = -0.015 + em\SizeChange = 0.007 + + d = CreateDoor(r\zone,r\x-256.0*RoomScale, 0.0, r\z-752.0*RoomScale,90,r,False,2,3) + d\locked = True : d\open = False : d\AutoClose = False : d\MTFClose = False : d\DisableWaypoint = True + PositionEntity d\buttons[0],r\x-240.0*RoomScale,EntityY(d\buttons[0],True),EntityZ(d\buttons[0],True),True + + it = CreateItem("Dr L's Note", "paper", r\x - 160.0 * RoomScale, 32.0 * RoomScale, r\z - 353.0 * RoomScale) + EntityParent(it\collider, r\obj) + ;[End Block] + Case "dimension1499" + ;[Block] + r\Levers[1] = LoadMesh_Strict("GFX\map\dimension1499\1499object0_cull.b3d",r\obj) + EntityType r\Levers[1],HIT_MAP + EntityAlpha r\Levers[1],0 + + r\Levers[0] = CreatePivot() + PositionEntity r\Levers[0],r\x+205.0*RoomScale,r\y+200.0*RoomScale,r\z+2287.0*RoomScale + EntityParent r\Levers[0],r\obj + ;[End Block] End Select For lt.lighttemplates = Each LightTemplates @@ -4979,7 +5549,17 @@ Function UpdateRooms() Local x#,z#,hide%=True - PlayerZone=Min(Max(GetZone(EntityZ(Collider)/8.0),0),ZONEAMOUNT-1) + ;The reason why it is like this: + ; When the map gets spawned by a seed, it starts from LCZ to HCZ to EZ (bottom to top) + ; A map loaded by the map creator starts from EZ to HCZ to LCZ (top to bottom) and that's why this little code thing with the (SelectedMap="") needs to be there + ; - ENDSHN + If (EntityZ(Collider)/8.0)=I_Zone\Transition[1]-(SelectedMap="") And (EntityZ(Collider)/8.0)0 - HideEntity sc\Cam - EndIf + If sc\room\dist < 6.0 Or PlayerRoom=sc\room Then + close = True + ElseIf sc\Cam<>0 + HideEntity sc\Cam EndIf - If sc\IsRoom2slCam Then sc\CoffinEffect = 0 If sc\room <> Null If sc\room\RoomTemplate\Name$ = "room2sl" Then sc\CoffinEffect = 0 EndIf - If sc\SpecialCam Then sc\CoffinEffect = 0 - If close Or sc=CoffinCam Or sc\IsRoom2slCam Then + If close Or sc=CoffinCam Then If sc\FollowPlayer Then If sc<>CoffinCam If EntityVisible(sc\CameraObj,Camera) @@ -5845,18 +6413,10 @@ Function UpdateSecurityCams() PositionEntity(sc\CameraObj, EntityX(sc\obj, True), EntityY(sc\obj, True) - 0.083, EntityZ(sc\obj, True)) RotateEntity(sc\CameraObj, EntityPitch(sc\CameraObj), EntityYaw(sc\obj), 0) - If (Not sc\IsRoom2slCam) - If sc\Cam<>0 Then - PositionEntity(sc\Cam, EntityX(sc\CameraObj, True), EntityY(sc\CameraObj, True), EntityZ(sc\CameraObj, True)) - RotateEntity(sc\Cam, EntityPitch(sc\CameraObj), EntityYaw(sc\CameraObj), 0) - MoveEntity(sc\Cam, 0, 0, 0.1) - EndIf - Else - ;If sc\Room2slID = CurrRoom2slRenderCam - PositionEntity(Room2slCam, EntityX(sc\CameraObj, True), EntityY(sc\CameraObj, True), EntityZ(sc\CameraObj, True)) - RotateEntity(Room2slCam, EntityPitch(sc\CameraObj), EntityYaw(sc\CameraObj), 0) - MoveEntity(Room2slCam, 0, 0, 0.1) - ;EndIf + If sc\Cam<>0 Then + PositionEntity(sc\Cam, EntityX(sc\CameraObj, True), EntityY(sc\CameraObj, True), EntityZ(sc\CameraObj, True)) + RotateEntity(sc\Cam, EntityPitch(sc\CameraObj), EntityYaw(sc\CameraObj), 0) + MoveEntity(sc\Cam, 0, 0, 0.1) EndIf If sc<>CoffinCam @@ -5871,22 +6431,9 @@ Function UpdateSecurityCams() EndIf EndIf - If close = True Or sc\IsRoom2slCam Or sc\SpecialCam Then + If close = True Then If sc\Screen Then - If sc\RenderInterval<>666 - sc\State = sc\State+FPSfactor - EndIf - - If sc\InSight And sc\AllowSaving Then - If SelectedDifficulty\saveType = SAVEONSCREENS And EntityDistance(Camera, sc\ScrObj)<1.0 Then - DrawHandIcon = True - If MouseHit1 Then SelectedMonitor = sc - Else If SelectedMonitor = sc - SelectedMonitor = Null - EndIf - Else - SelectedMonitor = Null - EndIf + sc\State = sc\State+FPSfactor If BlinkTimer > - 5 And EntityInView(sc\ScrObj, Camera) Then If EntityVisible(Camera,sc\ScrObj) Then @@ -5896,138 +6443,83 @@ Function UpdateSecurityCams() DebugLog Sanity RestoreSanity = False EndIf - - If Sanity < (-1000) Then - DeathMSG = Chr(34)+"What we know is that he died of cardiac arrest. My guess is that it was caused by SCP-895, although it has never been observed affecting video equipment from this far before. " - DeathMSG = DeathMSG + "Further testing is needed to determine whether SCP-895's "+Chr(34)+"Red Zone"+Chr(34)+" is increasing."+Chr(34) - - Kill() - EndIf EndIf EndIf EndIf - ;If ((sc\State >= sc\RenderInterval And ((Not sc\IsRoom2slCam) Or sc\Room2slID=CurrRoom2slRenderCam))) Or sc\RenderInterval=666 Then - If (sc\State >= sc\RenderInterval) Or sc\RenderInterval=666 + If Sanity < (-1000) Then + DeathMSG = Chr(34)+"What we know is that he died of cardiac arrest. My guess is that it was caused by SCP-895, although it has never been observed affecting video equipment from this far before. " + DeathMSG = DeathMSG + "Further testing is needed to determine whether SCP-895's "+Chr(34)+"Red Zone"+Chr(34)+" is increasing."+Chr(34) + + If VomitTimer < -10 Then + Kill() + EndIf + EndIf + + If VomitTimer < 0 And Sanity < -800 Then + RestoreSanity = False + Sanity = -1010 + EndIf + + If BlinkTimer > - 5 And EntityInView(sc\ScrObj, Camera) And EntityVisible(Camera,sc\ScrObj) Then + sc\InSight = True + Else sc\InSight = False - If BlinkTimer > - 5 And EntityInView(sc\ScrObj, Camera) And sc\RenderInterval<>667 Then - If (Not sc\IsRoom2slCam) - If EntityVisible(Camera,sc\ScrObj) Then - sc\InSight = True - -; If (sc\CoffinEffect=1 Or sc\CoffinEffect=3) And (Not Wearing714) Then -; If BlinkTimer > - 5 -; Sanity=Sanity-(FPSfactor * 16) -; DebugLog Sanity -; RestoreSanity = False -; EndIf -; -; If Sanity < (-1000) Then -; DeathMSG = Chr(34)+"What we know is that he died of cardiac arrest. My guess is that it was caused by SCP-895, although it has never been observed affecting video equipment from this far before. " -; DeathMSG = DeathMSG + "Further testing is needed to determine whether SCP-895's "+Chr(34)+"Red Zone"+Chr(34)+" is increasing."+Chr(34) -; -; Kill() -; EndIf -; EndIf - If (Not sc\SpecialCam) - If CoffinCam = Null Or Rand(5)=5 Or sc\CoffinEffect <> 3 Then - HideEntity(Camera) - ShowEntity(sc\Cam) - Cls - - UpdateRoomLights(sc\Cam) - - SetBuffer BackBuffer() - RenderWorld - CopyRect 0,0,512,512,0,0,BackBuffer(),TextureBuffer(ScreenTexs[sc\ScrTexture]) - - HideEntity(sc\Cam) - ShowEntity(Camera) - Else - HideEntity(Camera) - ShowEntity (CoffinCam\room\obj) - EntityAlpha(GetChild(CoffinCam\room\obj,2),1) - ShowEntity(CoffinCam\Cam) - Cls - - UpdateRoomLights(CoffinCam\Cam) - - SetBuffer BackBuffer() - RenderWorld - CopyRect 0,0,512,512,0,0,BackBuffer(),TextureBuffer(ScreenTexs[sc\ScrTexture]) - - HideEntity (CoffinCam\room\obj) - HideEntity(CoffinCam\Cam) - ShowEntity(Camera) - EndIf - Else - HideEntity(Camera) - ShowEntity(sc\Cam) - Cls - - UpdateRoomLights(sc\Cam) - - RenderWorld - - HideEntity(sc\Cam) - ShowEntity(Camera) - - CopyRect(0,0,512,512,0,0,BackBuffer(),TextureBuffer(sc\Room2slTexs[sc\ScrTexture])) - EndIf + EndIf + + If (sc\State >= sc\RenderInterval) + ;sc\InSight = False + If BlinkTimer > - 5 And EntityInView(sc\ScrObj, Camera)Then + If EntityVisible(Camera,sc\ScrObj) Then + ;sc\InSight = True + If CoffinCam = Null Or Rand(5)=5 Or sc\CoffinEffect <> 3 Then + HideEntity(Camera) + ShowEntity(sc\Cam) + Cls + + UpdateRoomLights(sc\Cam) + + SetBuffer BackBuffer() + RenderWorld + CopyRect 0,0,512,512,0,0,BackBuffer(),TextureBuffer(ScreenTexs[sc\ScrTexture]) + + HideEntity(sc\Cam) + ShowEntity(Camera) + Else + HideEntity(Camera) + ShowEntity (CoffinCam\room\obj) + EntityAlpha(GetChild(CoffinCam\room\obj,2),1) + ShowEntity(CoffinCam\Cam) + Cls + + UpdateRoomLights(CoffinCam\Cam) + + SetBuffer BackBuffer() + RenderWorld + CopyRect 0,0,512,512,0,0,BackBuffer(),TextureBuffer(ScreenTexs[sc\ScrTexture]) + + HideEntity (CoffinCam\room\obj) + HideEntity(CoffinCam\Cam) + ShowEntity(Camera) EndIf - Else - sc\InSight = True - - PositionEntity(Room2slCam, EntityX(sc\CameraObj, True), EntityY(sc\CameraObj, True), EntityZ(sc\CameraObj, True)) - RotateEntity(Room2slCam, EntityPitch(sc\CameraObj), EntityYaw(sc\CameraObj), 0) - MoveEntity(Room2slCam, 0, 0, 0.1) - - HideEntity(Camera) - ShowEntity (sc\room\obj) - EntityAlpha(GetChild(sc\room\obj,2),1) - ShowEntity(Room2slCam) - Cls - - UpdateRoomLights(Room2slCam) - - RenderWorld - - HideEntity (sc\room\obj) - HideEntity(Room2slCam) - ShowEntity(Camera) - - CopyRect(0,0,128,128,0,0,BackBuffer(),TextureBuffer(sc\Room2slTexs[sc\ScrTexture])) - - If sc\RenderInterval=666 Then sc\RenderInterval=667 EndIf EndIf sc\State = 0 - ;If CurrRoom2slRenderCam >= 10 - ; CurrRoom2slRenderCam = 0 - ;Else - ; CurrRoom2slRenderCam = CurrRoom2slRenderCam + 1 - ;EndIf EndIf - If SelectedMonitor = sc Or ((sc\CoffinEffect=1 Or sc\CoffinEffect=3) And (Not Wearing714)) Then + If ((sc\CoffinEffect=1 Or sc\CoffinEffect=3) And (Not Wearing714)) Then If sc\InSight Then - ;If (Not NoClip) Then Local pvt% = CreatePivot() PositionEntity pvt, EntityX(Camera), EntityY(Camera), EntityZ(Camera) PointEntity(pvt, sc\ScrObj) - ;DebugLog("curvea: "+CurveAngle(EntityYaw(pvt), EntityYaw(Collider), Min(Max(15000.0 / (-Sanity), 20.0), 200.0))) RotateEntity(Collider, EntityPitch(Collider), CurveAngle(EntityYaw(pvt), EntityYaw(Collider), Min(Max(15000.0 / (-Sanity), 20.0), 200.0)), 0) TurnEntity(pvt, 90, 0, 0) user_camera_pitch = CurveAngle(EntityPitch(pvt), user_camera_pitch + 90.0, Min(Max(15000.0 / (-Sanity), 20.0), 200.0)) - user_camera_pitch=user_camera_pitch-90 - - ;DebugLog("pvt: "+EntityYaw(pvt)+" - coll: "+EntityYaw(Collider)) - + user_camera_pitch=user_camera_pitch-90 FreeEntity pvt - ;EndIf If (sc\CoffinEffect=1 Or sc\CoffinEffect=3) And (Not Wearing714) Then If Sanity < - 800 Then If Rand(3) = 1 Then EntityTexture(sc\ScrOverlay, MonitorTexture) @@ -6043,6 +6535,9 @@ Function UpdateSecurityCams() If sc\CoffinEffect=3 And Rand(200)=1 Then sc\CoffinEffect=2 : sc\PlayerState = Rand(10000, 20000) End If BlurTimer = 1000 + If VomitTimer = 0 Then + VomitTimer = 1 + EndIf ElseIf Sanity < - 500 If Rand(7) = 1 Then EntityTexture(sc\ScrOverlay, MonitorTexture) If Rand(50) = 1 Then @@ -6059,7 +6554,7 @@ Function UpdateSecurityCams() EntityTexture(sc\ScrOverlay, MonitorTexture) EndIf EndIf - EndIf + EndIf If sc\InSight And sc\CoffinEffect=0 Or sc\CoffinEffect=2 Then If sc\PlayerState = 0 Then @@ -6089,7 +6584,7 @@ Function UpdateSecurityCams() If (Not sc\InSight) Then sc\soundCHN = LoopSound2(CameraSFX, sc\soundCHN, Camera, sc\CameraObj, 4.0) Else - If SelectedMonitor=sc Then SelectedMonitor=Null + ;If SelectedMonitor=sc Then SelectedMonitor=Null EndIf If sc<>Null Then @@ -6109,6 +6604,50 @@ Function UpdateSecurityCams() End Function +Function UpdateMonitorSaving() + Local sc.SecurityCams + Local close% = False + + If SelectedDifficulty\saveType <> SAVEONSCREENS Then Return + + For sc = Each SecurityCams + If sc\AllowSaving And sc\Screen Then + close = False + If sc\room\dist < 6.0 Or PlayerRoom=sc\room Then + close = True + EndIf + + If close And GrabbedEntity = 0 And ClosestButton = 0 Then + If EntityInView(sc\ScrObj,Camera) And EntityDistance(sc\ScrObj,Camera)<1.0 Then + If EntityVisible(sc\ScrObj,Camera) Then + DrawHandIcon = True + If MouseHit1 Then SelectedMonitor = sc + Else + If SelectedMonitor = sc Then SelectedMonitor = Null + EndIf + Else + If SelectedMonitor = sc Then SelectedMonitor = Null + EndIf + + If SelectedMonitor = sc Then + If sc\InSight Then + Local pvt% = CreatePivot() + PositionEntity pvt, EntityX(Camera), EntityY(Camera), EntityZ(Camera) + PointEntity(pvt, sc\ScrObj) + RotateEntity(Collider, EntityPitch(Collider), CurveAngle(EntityYaw(pvt), EntityYaw(Collider), Min(Max(15000.0 / (-Sanity), 20.0), 200.0)), 0) + TurnEntity(pvt, 90, 0, 0) + user_camera_pitch = CurveAngle(EntityPitch(pvt), user_camera_pitch + 90.0, Min(Max(15000.0 / (-Sanity), 20.0), 200.0)) + user_camera_pitch=user_camera_pitch-90 + FreeEntity pvt + EndIf + EndIf + Else + If SelectedMonitor = sc Then SelectedMonitor = Null + EndIf + EndIf + Next + +End Function Function UpdateLever(obj, locked=False) @@ -6188,336 +6727,124 @@ Function UpdateButton(obj) End Function -Function UpdateElevators#(State#, door1.Doors, door2.Doors, room1, room2, event.Events) - Local x#, z#, n.NPCs, NPC_inside.NPCs, it.Items +Function UpdateElevators#(State#, door1.Doors, door2.Doors, room1, room2, event.Events, ignorerotation% = True) + Local x#, z#, sound% + Local dist#, dir#, n.NPCs, it.Items door1\IsElevatorDoor = 1 door2\IsElevatorDoor = 1 - If door1\open = True And door2\open = False Then + If door1\open = True And door2\open = False And door1\openstate = 180 Then State = -1 + door1\locked = False If (ClosestButton = door2\buttons[0] Or ClosestButton = door2\buttons[1]) And MouseHit1 Then UseDoor(door1,False) EndIf - If door2\NPCCalledElevator = True - UseDoor(door1,False) - door2\NPCCalledElevator = 2 - EndIf - ElseIf door2\open = True And door1\open = False + ElseIf door2\open = True And door1\open = False And door2\openstate = 180 Then State = 1 + door2\locked = False If (ClosestButton = door1\buttons[0] Or ClosestButton = door1\buttons[1]) And MouseHit1 Then UseDoor(door2,False) EndIf - If door1\NPCCalledElevator = True - UseDoor(door2,False) - door1\NPCCalledElevator = 2 - EndIf ElseIf Abs(door1\openstate-door2\openstate)<0.2 Then door1\IsElevatorDoor = 2 door2\IsElevatorDoor = 2 EndIf - Local inside = False - NPC_inside = Null - - ;molemmat ovet kiinni = hissi liikkuu - If door1\open = False And door2\open = False Then - door1\locked = True - door2\locked = True - door1\NPCCalledElevator = 2 - door2\NPCCalledElevator = 2 - If State < 0 Then ;ylh��lt� alas - State = State - FPSfactor - ;pelaaja hissin sis�ll� - If Abs(EntityX(Collider)-EntityX(room1,True))<=280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(Collider)-EntityZ(room1,True))<=280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(Collider)-EntityY(room1,True))<=280.0*RoomScale+(0.015*FPSfactor) Then - inside = True - - If event\SoundCHN = 0 Then - event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) - Else - If (Not ChannelPlaying(event\SoundCHN)) Then event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) - EndIf - - CameraShake = Sin(Abs(State)/3.0)*0.3 - EndIf - EndIf - EndIf - - For n.NPCs = Each NPCs - If n\CanUseElevator - If Abs(EntityX(n\Collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) - If Abs(EntityZ(n\Collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(n\Collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - NPC_inside = n - EndIf - EndIf - EndIf - EndIf - Next - - If NPC_inside <> Null And (Not inside) - NPC_inside\Idle = True - ElseIf NPC_inside <> Null And inside - NPC_inside\Idle = False - EndIf - - If State < -400 Then - door1\locked = False - door2\locked = False - door1\NPCCalledElevator = False - door2\NPCCalledElevator = False - State = 0 - - If inside Then - ;x# = Max(Min((EntityX(Collider)-EntityX(room1,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - ;z# = Max(Min((EntityZ(Collider)-EntityZ(room1,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - x# = Max(Min((EntityX(Collider)-EntityX(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(Collider)-EntityZ(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(Collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(Collider)-EntityY(room1,True)),EntityZ(room2,True)+z,0.3,True) - For n.NPCs = Each NPCs - If Abs(EntityX(n\Collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(n\Collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(n\Collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - x# = Max(Min((EntityX(n\Collider)-EntityX(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(n\Collider)-EntityZ(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(n\Collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(n\Collider)-EntityY(room1,True)),EntityZ(room2,True)+z,n\CollRadius,True) - If n = Curr173 - Curr173\IdleTimer = 10 - EndIf - EndIf - EndIf - EndIf - Next - For it.Items = Each Items - If Abs(EntityX(it\collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(it\collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(it\collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - x# = Max(Min((EntityX(it\collider)-EntityX(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(it\collider)-EntityZ(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(it\collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(it\collider)-EntityY(room1,True)),EntityZ(room2,True)+z,0.01,True) - EndIf - EndIf - EndIf - Next - UpdateDoorsTimer = 0 - DropSpeed = 0 - UpdateDoors() - UpdateRooms() - EndIf - - If NPC_inside <> Null - x# = Max(Min((EntityX(NPC_inside\Collider)-EntityX(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(NPC_inside\Collider)-EntityZ(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(NPC_inside\Collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(NPC_inside\Collider)-EntityY(room1,True)),EntityZ(room2,True)+z,NPC_inside\CollRadius,True) - UpdateDoorsTimer = 0 - NPC_inside\DropSpeed = 0 - If NPC_inside\Idle - TurnEntity NPC_inside\obj,0,180,0 - TurnEntity NPC_inside\Collider,0,180,0 - NPC_inside\Idle = False - EndIf - NPC_inside\CurrElevator = Null - EndIf - - UseDoor(door2,False) - - PlaySound2(ElevatorBeepSFX, Camera, room1, 4.0) - EndIf - Else ;alhaalta yl�s - State = State + FPSfactor - ;pelaaja hissin sis�ll� - If Abs(EntityX(Collider)-EntityX(room2,True))<=280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(Collider)-EntityZ(room2,True))<=280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(Collider)-EntityY(room2,True))<=280.0*RoomScale+(0.015*FPSfactor) Then - inside = True - - If event\SoundCHN = 0 Then - event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) - Else - If (Not ChannelPlaying(event\SoundCHN)) Then event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) - EndIf - - CameraShake = Sin(Abs(State)/3.0)*0.3 - EndIf - EndIf - EndIf - - For n.NPCs = Each NPCs - If n\CanUseElevator - If Abs(EntityX(n\Collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) - If Abs(EntityZ(n\Collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(n\Collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - NPC_inside = n - EndIf - EndIf - EndIf + door1\locked = True + door2\locked = True + If door1\open Then + door1\IsElevatorDoor = 3 + If Abs(EntityX(Collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityZ(Collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityY(Collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then + door1\locked = False + door1\IsElevatorDoor = 1 EndIf - Next - - If NPC_inside <> Null And (Not inside) - NPC_inside\Idle = True - ElseIf NPC_inside <> Null And inside - NPC_inside\Idle = False EndIf - - If State > 400 Then - door1\locked = False - door2\locked = False - door1\NPCCalledElevator = False - door2\NPCCalledElevator = False - State = 0 - - ;pelaaja hissin sis�ll�, siirret��n - If inside Then - ;x# = Max(Min((EntityX(Collider)-EntityX(room2,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - ;z# = Max(Min((EntityZ(Collider)-EntityZ(room2,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - x# = Max(Min((EntityX(Collider)-EntityX(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(Collider)-EntityZ(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(Collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(Collider)-EntityY(room2,True)),EntityZ(room1,True)+z,0.3,True) - For n.NPCs = Each NPCs - If Abs(EntityX(n\Collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(n\Collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(n\Collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - x# = Max(Min((EntityX(n\Collider)-EntityX(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(n\Collider)-EntityZ(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(n\Collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(n\Collider)-EntityY(room2,True)),EntityZ(room1,True)+z,n\CollRadius,True) - If n = Curr173 - Curr173\IdleTimer = 10 - EndIf - EndIf - EndIf - EndIf - Next - For it.Items = Each Items - If Abs(EntityX(it\collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(it\collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(it\collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - x# = Max(Min((EntityX(it\collider)-EntityX(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(it\collider)-EntityZ(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(it\collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(it\collider)-EntityY(room2,True)),EntityZ(room1,True)+z,0.01,True) - EndIf - EndIf - EndIf - Next - UpdateDoorsTimer = 0 - DropSpeed = 0 - UpdateDoors() - UpdateRooms() - EndIf - - If NPC_inside <> Null - x# = Max(Min((EntityX(NPC_inside\Collider)-EntityX(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min((EntityZ(NPC_inside\Collider)-EntityZ(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) - TeleportEntity(NPC_inside\Collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(NPC_inside\Collider)-EntityY(room2,True)),EntityZ(room1,True)+z,NPC_inside\CollRadius,True) - UpdateDoorsTimer = 0 - NPC_inside\DropSpeed = 0 - If NPC_inside\Idle - TurnEntity NPC_inside\obj,0,180,0 - TurnEntity NPC_inside\Collider,0,180,0 - NPC_inside\Idle = False - EndIf - NPC_inside\CurrElevator = Null - EndIf - - UseDoor(door1,False) - - PlaySound2(ElevatorBeepSFX, Camera, room2, 4.0) - EndIf - EndIf EndIf - - Return State - -End Function - -Function UpdateElevators2#(State#, door1.Doors, door2.Doors, room1, room2, event.Events) - Local x#, z# - - door1\IsElevatorDoor = 1 - door2\IsElevatorDoor = 1 - If door1\open = True And door2\open = False Then - State = -1 - door2\IsElevatorDoor = 2 - If (ClosestButton = door2\buttons[0] Or ClosestButton = door2\buttons[1]) And MouseHit1 Then - UseDoor(door1,False) - EndIf - ElseIf door2\open = True And door1\open = False - State = 1 - door1\IsElevatorDoor = 2 - If (ClosestButton = door1\buttons[0] Or ClosestButton = door1\buttons[1]) And MouseHit1 Then - UseDoor(door2,False) - EndIf - ElseIf Abs(door1\openstate-door2\openstate)<0.2 Then - door1\IsElevatorDoor = 2 - door2\IsElevatorDoor = 2 + If door2\open Then + door2\IsElevatorDoor = 3 + If Abs(EntityX(Collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityZ(Collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityY(Collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then + door2\locked = False + door2\IsElevatorDoor = 1 + EndIf + EndIf + EndIf EndIf Local inside = False - ;molemmat ovet kiinni = hissi liikkuu If door1\open = False And door2\open = False Then - door1\locked = True - door2\locked = True - If State < 0 Then ;ylh��lt?alas - State = State - FPSfactor - ;pelaaja hissin sis�ll? - If Abs(EntityX(Collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(Collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(Collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - inside = True - - If event\SoundCHN = 0 Then - event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) - Else - If (Not ChannelPlaying(event\SoundCHN)) Then event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) + door1\locked = True + door2\locked = True + If door1\openstate = 0 And door2\openstate = 0 Then + If State < 0 Then + State = State - FPSfactor + If Abs(EntityX(Collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityZ(Collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityY(Collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then + inside = True + + If event\SoundCHN = 0 Then + event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) + Else + If (Not ChannelPlaying(event\SoundCHN)) Then event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) + EndIf + + CameraShake = Sin(Abs(State)/3.0)*0.3 EndIf - - CameraShake = Sin(Abs(State)/3.0)*0.3 EndIf EndIf - EndIf - - If State < -400 Then - door1\locked = False - door2\locked = False - State = 0 - - UseDoor(door2,True) - If inside Then - - dist# = Distance(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room1,True),EntityZ(room1,True)) - - dir# = point_direction(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room1,True),EntityZ(room1,True)) - dir=dir+EntityYaw(room2,True)-EntityYaw(room1,True);EntityYaw(room2,True)+angleDist(dir,EntityYaw(room1,True)) - ;dir=dir-90.0 - -; dir# = EntityYaw(Collider)-EntityYaw(room1,True)+EntityYaw(room2,True) - - dir=WrapAngle(dir) - - x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + If State < -500 Then + door1\locked = True + door2\locked = False + State = 0 - ;x# = Max(Min((EntityX(Collider)-EntityX(room1,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - ;z# = Max(Min((EntityZ(Collider)-EntityZ(room1,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - - RotateEntity Collider,EntityPitch(Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(Collider,True),EntityYaw(room1,True)),EntityRoll(Collider,True),True ;dir + If inside Then + If (Not ignorerotation) Then + dist# = Distance(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room1,True),EntityZ(room1,True)) + dir# = point_direction(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room1,True),EntityZ(room1,True)) + dir=dir+EntityYaw(room2,True)-EntityYaw(room1,True) + dir=WrapAngle(dir) + x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + RotateEntity Collider,EntityPitch(Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(Collider,True),EntityYaw(room1,True)),EntityRoll(Collider,True),True + Else + x# = Max(Min((EntityX(Collider)-EntityX(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min((EntityZ(Collider)-EntityZ(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + EndIf + + TeleportEntity(Collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(Collider)-EntityY(room1,True)),EntityZ(room2,True)+z,0.3,True) + UpdateDoorsTimer = 0 + DropSpeed = 0 + UpdateDoors() + UpdateRooms() + + sound=Rand(0, 2) + door2\SoundCHN = PlaySound_Strict(OpenDoorSFX(3, sound)) + EndIf - TeleportEntity(Collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(Collider)-EntityY(room1,True)),EntityZ(room2,True)+z,0.3,True) For n.NPCs = Each NPCs If Abs(EntityX(n\Collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityZ(n\Collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityY(n\Collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - dist# = Distance(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room1,True),EntityZ(room1,True)) - dir# = point_direction(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room1,True),EntityZ(room1,True)) - dir=dir+EntityYaw(room2,True)-EntityYaw(room1,True) - dir=WrapAngle(dir) - x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - RotateEntity n\Collider,EntityPitch(n\Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(n\Collider,True),EntityYaw(room1,True)),EntityRoll(n\Collider,True),True + If (Not ignorerotation) Then + dist# = Distance(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room1,True),EntityZ(room1,True)) + dir# = point_direction(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room1,True),EntityZ(room1,True)) + dir=dir+EntityYaw(room2,True)-EntityYaw(room1,True) + dir=WrapAngle(dir) + x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + RotateEntity n\Collider,EntityPitch(n\Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(n\Collider,True),EntityYaw(room1,True)),EntityRoll(n\Collider,True),True + Else + x# = Max(Min((EntityX(n\Collider)-EntityX(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min((EntityZ(n\Collider)-EntityZ(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + EndIf + TeleportEntity(n\Collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(n\Collider)-EntityY(room1,True)),EntityZ(room2,True)+z,n\CollRadius,True) If n = Curr173 Curr173\IdleTimer = 10 @@ -6530,83 +6857,92 @@ Function UpdateElevators2#(State#, door1.Doors, door2.Doors, room1, room2, event If Abs(EntityX(it\collider)-EntityX(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityZ(it\collider)-EntityZ(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityY(it\collider)-EntityY(room1,True))<280.0*RoomScale+(0.015*FPSfactor) Then - dist# = Distance(EntityX(it\Collider,True),EntityZ(it\Collider,True),EntityX(room1,True),EntityZ(room1,True)) - dir# = point_direction(EntityX(it\Collider,True),EntityZ(it\Collider,True),EntityX(room1,True),EntityZ(room1,True)) - dir=dir+EntityYaw(room2,True)-EntityYaw(room1,True) - dir=WrapAngle(dir) - x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - RotateEntity it\Collider,EntityPitch(it\Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(it\Collider,True),EntityYaw(room1,True)),EntityRoll(it\Collider,True),True - TeleportEntity(it\Collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(it\Collider)-EntityY(room1,True)),EntityZ(room2,True)+z,0.01,True) + If (Not ignorerotation) Then + dist# = Distance(EntityX(it\collider,True),EntityZ(it\collider,True),EntityX(room1,True),EntityZ(room1,True)) + dir# = point_direction(EntityX(it\collider,True),EntityZ(it\collider,True),EntityX(room1,True),EntityZ(room1,True)) + dir=dir+EntityYaw(room2,True)-EntityYaw(room1,True) + dir=WrapAngle(dir) + x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + RotateEntity it\collider,EntityPitch(it\collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(it\collider,True),EntityYaw(room1,True)),EntityRoll(it\collider,True),True + Else + x# = Max(Min((EntityX(it\collider)-EntityX(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min((EntityZ(it\collider)-EntityZ(room1,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + EndIf + + TeleportEntity(it\collider, EntityX(room2,True)+x,(0.1*FPSfactor)+EntityY(room2,True)+(EntityY(it\collider)-EntityY(room1,True)),EntityZ(room2,True)+z,0.01,True) EndIf EndIf EndIf Next - UpdateDoors() - UpdateRooms() + + UseDoor(door2,False,Not inside) + door1\open = False + + PlaySound2(ElevatorBeepSFX, Camera, room1, 4.0) EndIf + Else + State = State + FPSfactor + If Abs(EntityX(Collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityZ(Collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then + If Abs(EntityY(Collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then + inside = True + + If event\SoundCHN = 0 Then + event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) + Else + If (Not ChannelPlaying(event\SoundCHN)) Then event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) + EndIf + + CameraShake = Sin(Abs(State)/3.0)*0.3 + EndIf + EndIf + EndIf - PlaySound2(ElevatorBeepSFX, Camera, room1, 4.0) - ;PlaySound_Strict(ElevatorBeepSFX) - EndIf - Else ;alhaalta yl�s - State = State + FPSfactor - ;pelaaja hissin sis�ll? - If Abs(EntityX(Collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityZ(Collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - If Abs(EntityY(Collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - inside = True - - If event\SoundCHN = 0 Then - event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) + If State > 500 Then + door1\locked = False + door2\locked = True + State = 0 + + If inside Then + If (Not ignorerotation) Then + dist# = Distance(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room2,True),EntityZ(room2,True)) + dir# = point_direction(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room2,True),EntityZ(room2,True)) + dir=dir+EntityYaw(room1,True)-EntityYaw(room2,True) + x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + RotateEntity Collider,EntityPitch(Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(Collider,True),EntityYaw(room1,True)),EntityRoll(Collider,True),True Else - If (Not ChannelPlaying(event\SoundCHN)) Then event\SoundCHN = PlaySound_Strict(ElevatorMoveSFX) + x# = Max(Min((EntityX(Collider)-EntityX(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min((EntityZ(Collider)-EntityZ(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) EndIf - CameraShake = Sin(Abs(State)/3.0)*0.3 + TeleportEntity(Collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(Collider)-EntityY(room2,True)),EntityZ(room1,True)+z,0.3,True) + UpdateDoorsTimer = 0 + DropSpeed = 0 + UpdateDoors() + UpdateRooms() + + sound=Rand(0, 2) + door1\SoundCHN = PlaySound_Strict(OpenDoorSFX(3, sound)) EndIf - EndIf - EndIf - - If State > 400 Then - door1\locked = False - door2\locked = False - State = 0 - - UseDoor(door1,True) - - ;pelaaja hissin sis�ll? siirret��n - If inside Then - - dist# = Distance(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room2,True),EntityZ(room2,True)) - - dir# = point_direction(EntityX(Collider,True),EntityZ(Collider,True),EntityX(room2,True),EntityZ(room2,True)) - dir=dir+EntityYaw(room1,True)-EntityYaw(room2,True) ;EntityYaw(room1,True)+angleDist(dir,EntityYaw(room2,True)) - ;dir=dir-90.0 - -; dir# = EntityYaw(Collider)-EntityYaw(room2,True)+EntityYaw(room1,True) - - ;dir=WrapAngle(dir) - - x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - - ;x# = Max(Min((EntityX(Collider)-EntityX(room2,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - ;z# = Max(Min((EntityZ(Collider)-EntityZ(room2,True)),280*RoomScale-0.17),-280*RoomScale+0.17) - - RotateEntity Collider,EntityPitch(Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(Collider,True),EntityYaw(room1,True)),EntityRoll(Collider,True),True ;dir - TeleportEntity(Collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(Collider)-EntityY(room2,True)),EntityZ(room1,True)+z,0.3,True) For n.NPCs = Each NPCs If Abs(EntityX(n\Collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityZ(n\Collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityY(n\Collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - dist# = Distance(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room2,True),EntityZ(room2,True)) - dir# = point_direction(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room2,True),EntityZ(room2,True)) - dir=dir+EntityYaw(room1,True)-EntityYaw(room2,True) - x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - RotateEntity n\Collider,EntityPitch(n\Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(n\Collider,True),EntityYaw(room1,True)),EntityRoll(n\Collider,True),True + If (Not ignorerotation) Then + dist# = Distance(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room2,True),EntityZ(room2,True)) + dir# = point_direction(EntityX(n\Collider,True),EntityZ(n\Collider,True),EntityX(room2,True),EntityZ(room2,True)) + dir=dir+EntityYaw(room1,True)-EntityYaw(room2,True) + x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + RotateEntity n\Collider,EntityPitch(n\Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(n\Collider,True),EntityYaw(room1,True)),EntityRoll(n\Collider,True),True + Else + x# = Max(Min((EntityX(n\Collider)-EntityX(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min((EntityZ(n\Collider)-EntityZ(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + EndIf + TeleportEntity(n\Collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(n\Collider)-EntityY(room2,True)),EntityZ(room1,True)+z,n\CollRadius,True) If n = Curr173 Curr173\IdleTimer = 10 @@ -6619,24 +6955,31 @@ Function UpdateElevators2#(State#, door1.Doors, door2.Doors, room1, room2, event If Abs(EntityX(it\collider)-EntityX(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityZ(it\collider)-EntityZ(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then If Abs(EntityY(it\collider)-EntityY(room2,True))<280.0*RoomScale+(0.015*FPSfactor) Then - dist# = Distance(EntityX(it\Collider,True),EntityZ(it\Collider,True),EntityX(room2,True),EntityZ(room2,True)) - dir# = point_direction(EntityX(it\Collider,True),EntityZ(it\Collider,True),EntityX(room2,True),EntityZ(room2,True)) - dir=dir+EntityYaw(room1,True)-EntityYaw(room2,True) - x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) - RotateEntity it\Collider,EntityPitch(it\Collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(it\Collider,True),EntityYaw(room1,True)),EntityRoll(it\Collider,True),True - TeleportEntity(it\Collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(it\Collider)-EntityY(room2,True)),EntityZ(room1,True)+z,0.01,True) + If (Not ignorerotation) Then + dist# = Distance(EntityX(it\collider,True),EntityZ(it\collider,True),EntityX(room2,True),EntityZ(room2,True)) + dir# = point_direction(EntityX(it\collider,True),EntityZ(it\collider,True),EntityX(room2,True),EntityZ(room2,True)) + dir=dir+EntityYaw(room1,True)-EntityYaw(room2,True) + x# = Max(Min(Cos(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min(Sin(dir)*dist,280*RoomScale-0.22),-280*RoomScale+0.22) + RotateEntity it\collider,EntityPitch(it\collider,True),EntityYaw(room2,True)+angleDist(EntityYaw(it\collider,True),EntityYaw(room1,True)),EntityRoll(it\collider,True),True + Else + x# = Max(Min((EntityX(it\collider)-EntityX(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + z# = Max(Min((EntityZ(it\collider)-EntityZ(room2,True)),280*RoomScale-0.22),-280*RoomScale+0.22) + EndIf + + TeleportEntity(it\collider, EntityX(room1,True)+x,(0.1*FPSfactor)+EntityY(room1,True)+(EntityY(it\collider)-EntityY(room2,True)),EntityZ(room1,True)+z,0.01,True) EndIf EndIf EndIf Next - UpdateDoors() - UpdateRooms() - EndIf + + UseDoor(door1,False,Not inside) + door2\open = False + + PlaySound2(ElevatorBeepSFX, Camera, room2, 4.0) + EndIf - PlaySound2(ElevatorBeepSFX, Camera, room2, 4.0) - EndIf - + EndIf EndIf EndIf @@ -6669,6 +7012,10 @@ End Function Function CreateMap() DebugLog ("Generating a map using the seed "+RandomSeed) + I_Zone\Transition[0] = 13 + I_Zone\Transition[1] = 7 + I_Zone\HasCustomForest = False + I_Zone\HasCustomMT = False Local x%, y%, temp% Local i%, x2%, y2% @@ -7015,7 +7362,6 @@ Function CreateMap() SetRoom("914", ROOM1, Floor(0.3*Float(Room1Amount[0])),min_pos,max_pos) SetRoom("room1archive",ROOM1,Floor(0.5*Float(Room1Amount[0])),min_pos,max_pos) SetRoom("room205", ROOM1, Floor(0.6*Float(Room1Amount[0])),min_pos,max_pos) - SetRoom("room178",ROOM1,Floor(0.7*Float(Room1Amount[0])),min_pos,max_pos) MapRoom(ROOM2C, 0) = "lockroom" @@ -7038,17 +7384,18 @@ Function CreateMap() MapRoom(ROOM2C, Floor(0.5*Float(Room2CAmount[0]))) = "room1162" + MapRoom(ROOM4, Floor(0.3*Float(Room4Amount[0]))) = "room4info" + ;zone 2 -------------------------------------------------------------------------------------------------- min_pos = Room1Amount[0] - max_pos = Room1Amount[0]+Room1Amount[1]-1 + max_pos = Room1Amount[0]+Room1Amount[1]-1 - ;MapRoom(ROOM1, Room1Amount[0]+Floor(0.1*Float(Room1Amount[1]))) = "room079" SetRoom("room079", ROOM1, Room1Amount[0]+Floor(0.15*Float(Room1Amount[1])),min_pos,max_pos) - SetRoom("coffin", ROOM1, Room1Amount[0]+Floor(0.3*Float(Room1Amount[1])),min_pos,max_pos) - SetRoom("room035", ROOM1, Room1Amount[0]+Floor(0.5*Float(Room1Amount[1])),min_pos,max_pos) - SetRoom("room106", ROOM1, Room1Amount[0]+Floor(0.7*Float(Room1Amount[1])),min_pos,max_pos) - SetRoom("008", ROOM1, Room1Amount[0]+Floor(0.9*Float(Room1Amount[1])),min_pos,max_pos) + SetRoom("room106", ROOM1, Room1Amount[0]+Floor(0.3*Float(Room1Amount[1])),min_pos,max_pos) + SetRoom("008", ROOM1, Room1Amount[0]+Floor(0.4*Float(Room1Amount[1])),min_pos,max_pos) + SetRoom("room035", ROOM1, Room1Amount[0]+Floor(0.5*Float(Room1Amount[1])),min_pos,max_pos) + SetRoom("coffin", ROOM1, Room1Amount[0]+Floor(0.7*Float(Room1Amount[1])),min_pos,max_pos) min_pos = Room2Amount[0] max_pos = Room2Amount[0]+Room2Amount[1]-1 @@ -7063,6 +7410,8 @@ Function CreateMap() MapRoom(ROOM3, Room3Amount[0]+Floor(0.3*Float(Room3Amount[1]))) = "room513" MapRoom(ROOM3, Room3Amount[0]+Floor(0.6*Float(Room3Amount[1]))) = "room966" + MapRoom(ROOM2C, Room2CAmount[0]+Floor(0.5*Float(Room2CAmount[1]))) = "room2cpit" + ;zone 3 -------------------------------------------------------------------------------------------------- @@ -7209,7 +7558,7 @@ Function CreateMap() Next Next - r = CreateRoom(0, ROOM1, 0, 0, 8, "gatea") + r = CreateRoom(0, ROOM1, (MapWidth-1) * 8, 500, 8, "gatea") MapRoomID(ROOM1)=MapRoomID(ROOM1)+1 r = CreateRoom(0, ROOM1, (MapWidth-1) * 8, 0, (MapHeight-1) * 8, "pocketdimension") @@ -7285,35 +7634,92 @@ Function CreateMap() Next Next - For r.Rooms = Each Rooms - x = Int(r\x/8.0) - y = Int(r\z/8.0) - spacing = 8.0 - If MapTemp(x, y)>0 Then - If (Floor((x + y) / 2.0) = Ceil((x + y) / 2.0)) Then - If r\zone = 2 Then temp = 2 Else temp=0 - - If MapTemp(x + 1, y) Then - d.Doors = CreateDoor(r\zone, Float(x) * spacing + spacing / 2.0, 0, Float(y) * spacing, 90, r, Max(Rand(-3, 1), 0), temp) - r\AdjDoor[0] = d - EndIf - - If MapTemp(x - 1, y) Then - d.Doors = CreateDoor(r\zone, Float(x) * spacing - spacing / 2.0, 0, Float(y) * spacing, 90, r, Max(Rand(-3, 1), 0), temp) - r\AdjDoor[2] = d - EndIf - - If MapTemp(x, y + 1) Then - d.Doors = CreateDoor(r\zone, Float(x) * spacing, 0, Float(y) * spacing + spacing / 2.0, 0, r, Max(Rand(-3, 1), 0), temp) - r\AdjDoor[3] = d - EndIf - - If MapTemp(x, y - 1) Then - d.Doors = CreateDoor(r\zone, Float(x) * spacing, 0, Float(y) * spacing - spacing / 2.0, 0, r, Max(Rand(-3, 1), 0), temp) - r\AdjDoor[1] = d - EndIf - EndIf + Local d.Doors + Local shouldSpawnDoor% + For y = MapHeight To 0 Step -1 + + If y=I_Zone\Transition[1]-1 And y 0 Then + If zone = 2 Then temp=2 Else temp=0 + + For r.Rooms = Each Rooms + r\angle = WrapAngle(r\angle) + If Int(r\x/8.0)=x And Int(r\z/8.0)=y Then + shouldSpawnDoor = False + Select r\RoomTemplate\Shape + Case ROOM1 + If r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM2 + If r\angle=90 Or r\angle=270 + shouldSpawnDoor = True + EndIf + Case ROOM2C + If r\angle=0 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM3 + If r\angle=0 Or r\angle=180 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Default + shouldSpawnDoor = True + End Select + If shouldSpawnDoor + If (x+1)<(MapWidth+1) + If MapTemp(x + 1, y) > 0 Then + d.Doors = CreateDoor(r\zone, Float(x) * spacing + spacing / 2.0, 0, Float(y) * spacing, 90, r, Max(Rand(-3, 1), 0), temp) + r\AdjDoor[0] = d + EndIf + EndIf + EndIf + + shouldSpawnDoor = False + Select r\RoomTemplate\Shape + Case ROOM1 + If r\angle=180 + shouldSpawnDoor = True + EndIf + Case ROOM2 + If r\angle=0 Or r\angle=180 + shouldSpawnDoor = True + EndIf + Case ROOM2C + If r\angle=180 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM3 + If r\angle=180 Or r\angle=90 Or r\angle=270 + shouldSpawnDoor = True + EndIf + Default + shouldSpawnDoor = True + End Select + If shouldSpawnDoor + If (y+1)<(MapHeight+1) + If MapTemp(x, y + 1) > 0 Then + d.Doors = CreateDoor(r\zone, Float(x) * spacing, 0, Float(y) * spacing + spacing / 2.0, 0, r, Max(Rand(-3, 1), 0), temp) + r\AdjDoor[3] = d + EndIf + EndIf + EndIf + + Exit + EndIf + Next + + End If + + Next Next For r.Rooms = Each Rooms @@ -7484,123 +7890,167 @@ End Function Include "Skybox.bb" +Global UpdateRoomLightsTimer# = 0.0 Function UpdateRoomLights(cam%) Local r.Rooms, i, random#, alpha#, dist# For r.Rooms = Each Rooms - If r\dist < HideDistance*0.7 Or r = PlayerRoom + If r\dist < HideDistance*0.7 Or r = PlayerRoom Then For i = 0 To r\MaxLights% - If r\Lights%[i]<>0 - If EnableRoomLights% And (SecondaryLightOn>0.5) - ShowEntity r\LightSprites[i] - - If EntityDistance(cam%,r\Lights%[i])<8.5 - If r\LightHidden[i] - ShowEntity r\Lights%[i] - r\LightHidden[i] = False - EndIf - Else - If (Not r\LightHidden[i]) - HideEntity r\Lights%[i] - r\LightHidden[i] = True - EndIf - EndIf - - If r\LightCone[i]<>0 Then ShowEntity r\LightCone[i] - ;[TODO] - If r\LightConeSpark[i]<>0 - If r\LightConeSparkTimer[i]>0 And r\LightConeSparkTimer[i]<10 ;Needs testing - ShowEntity r\LightConeSpark[i] - r\LightConeSparkTimer[i]=r\LightConeSparkTimer[i]+FPSfactor + If r\Lights%[i]<>0 Then + If EnableRoomLights% And (SecondaryLightOn>0.5) And cam%=Camera Then + EntityOrder r\LightSprites2[i],-1 + If UpdateRoomLightsTimer=0.0 Then + ShowEntity r\LightSprites[i] + + If EntityDistance(cam%,r\Lights%[i])<8.5 Then + If r\LightHidden[i] Then + ShowEntity r\Lights%[i] + r\LightHidden[i] = False + EndIf Else - HideEntity r\LightConeSpark[i] - r\LightConeSparkTimer[i]=0 - EndIf - EndIf - - If (EntityDistance(cam%,r\LightSprites2[i])<8.5 Or r\RoomTemplate\UseLightCones) - If EntityVisible(cam%,r\LightSpritesPivot[i]) Or r\RoomTemplate\UseLightCones - If r\LightSpriteHidden%[i] - ShowEntity r\LightSprites2%[i] - r\LightSpriteHidden%[i] = False + If (Not r\LightHidden[i]) Then + HideEntity r\Lights%[i] + r\LightHidden[i] = True EndIf - If PlayerRoom\RoomTemplate\Name$ = "173" - random# = Rnd(0.38,0.42) - Else - If r\LightFlicker%[i]<5 + EndIf + + If (EntityDistance(cam%,r\LightSprites2[i])<8.5 Or r\RoomTemplate\UseLightCones) Then + If EntityVisible(cam%,r\LightSpritesPivot[i]) Or r\RoomTemplate\UseLightCones Then + If r\LightSpriteHidden%[i] Then + ShowEntity r\LightSprites2%[i] + r\LightSpriteHidden%[i] = False + EndIf + If PlayerRoom\RoomTemplate\Name$ = "173" Then random# = Rnd(0.38,0.42) - ElseIf r\LightFlicker%[i]>4 And r\LightFlicker%[i]<10 - random# = Rnd(0.35,0.45) Else - random# = Rnd(0.3,0.5) + If r\LightFlicker%[i]<5 Then + random# = Rnd(0.38,0.42) + ElseIf r\LightFlicker%[i]>4 And r\LightFlicker%[i]<10 Then + random# = Rnd(0.35,0.45) + Else + random# = Rnd(0.3,0.5) + EndIf EndIf - EndIf - ScaleSprite r\LightSprites2[i],random#,random# - If r\LightCone[i]<>0 - ;ScaleEntity r\LightCone[i],0.01+((-0.4+random#)*0.025),0.01+((-0.4+random#)*0.025),0.01+((-0.4+random#)*0.025) - ScaleEntity r\LightCone[i],0.005+((-0.4+random#)*0.025),0.005+((-0.4+random#)*0.025),0.005+((-0.4+random#)*0.025) - If r\LightFlicker%[i]>4 - If Rand(400)=1 - SetEmitter(r\LightSpritesPivot[i],ParticleEffect[0]) - PlaySound2(IntroSFX(Rand(10,12)),cam,r\LightSpritesPivot[i]) - ShowEntity r\LightConeSpark[i] - r\LightConeSparkTimer[i] = FPSfactor + ScaleSprite r\LightSprites2[i],random#,random# + + dist# = (EntityDistance(cam%,r\LightSpritesPivot[i])+0.5)/7.5 + dist# = Max(Min(dist#,1.0),0.0) + alpha# = Float(Inverse(dist#)) + + If alpha# > 0.0 Then + EntityAlpha r\LightSprites2[i],Max(3*(Brightness/255)*(r\LightIntensity[i]/2),1)*alpha# + Else + ;Instead of rendering the sprite invisible, just hiding it if the player is far away from it + If (Not r\LightSpriteHidden%[i]) Then + HideEntity r\LightSprites2[i] + r\LightSpriteHidden%[i]=True EndIf EndIf - EndIf - dist# = (EntityDistance(cam%,r\LightSpritesPivot[i])+0.5)/7.5 - dist# = Max(Min(dist#,1.0),0.0) - alpha# = Float(Inverse(dist#)) - - If alpha# > 0.0 - EntityAlpha r\LightSprites2[i],Max(3*(Brightness/255)*(r\LightIntensity[i]/2),1)*alpha# - Else - ;Instead of rendering the sprite invisible, just hiding it if the player is far away from it - If (Not r\LightSpriteHidden%[i]) - HideEntity r\LightSprites2[i] - r\LightSpriteHidden%[i]=True + + If r\RoomTemplate\UseLightCones Then + If EntityDistance(cam%,r\LightSprites2[i])>=8.5 Or (Not EntityVisible(cam%,r\LightSpritesPivot[i])) Then + HideEntity r\LightSprites2%[i] + r\LightSpriteHidden%[i] = True + EndIf EndIf - EndIf - - If r\RoomTemplate\UseLightCones - If EntityDistance(cam%,r\LightSprites2[i])>=8.5 Or (Not EntityVisible(cam%,r\LightSpritesPivot[i])) + Else + If (Not r\LightSpriteHidden%[i]) Then HideEntity r\LightSprites2%[i] r\LightSpriteHidden%[i] = True EndIf EndIf Else - If (Not r\LightSpriteHidden%[i]) + If (Not r\LightSpriteHidden%[i]) Then HideEntity r\LightSprites2%[i] r\LightSpriteHidden%[i] = True + If r\LightCone[i]<>0 Then HideEntity r\LightCone[i] + If r\LightConeSpark[i]<>0 HideEntity r\LightConeSpark[i] + EndIf + EndIf + + If r\LightCone[i]<>0 Then ShowEntity r\LightCone[i] + + If r\LightConeSpark[i]<>0 Then + If r\LightConeSparkTimer[i]>0 And r\LightConeSparkTimer[i]<10 + ShowEntity r\LightConeSpark[i] + r\LightConeSparkTimer[i]=r\LightConeSparkTimer[i]+FPSfactor + Else + HideEntity r\LightConeSpark[i] + r\LightConeSparkTimer[i]=0 + EndIf + EndIf + + If r\LightCone[i]<>0 Then + ScaleEntity r\LightCone[i],0.005+Max(((-0.4+random#)*0.025),0),0.005+Max(((-0.4+random#)*0.025),0),0.005+Max(((-0.4+random#)*0.025),0) + If r\LightFlicker%[i]>4 Then + If Rand(400)=1 Then + SetEmitter(r\LightSpritesPivot[i],ParticleEffect[0]) + PlaySound2(IntroSFX(Rand(10,12)),cam,r\LightSpritesPivot[i]) + ShowEntity r\LightConeSpark[i] + r\LightConeSparkTimer[i] = FPSfactor + EndIf EndIf EndIf Else - If (Not r\LightSpriteHidden%[i]) - HideEntity r\LightSprites2%[i] - r\LightSpriteHidden%[i] = True - If r\LightCone[i]<>0 Then HideEntity r\LightCone[i] - If r\LightConeSpark[i]<>0 HideEntity r\LightConeSpark[i] + If (EntityDistance(cam%,r\LightSprites2[i])<8.5 Or r\RoomTemplate\UseLightCones) Then + If PlayerRoom\RoomTemplate\Name$ = "173" Then + random# = Rnd(0.38,0.42) + Else + If r\LightFlicker%[i]<5 Then + random# = Rnd(0.38,0.42) + ElseIf r\LightFlicker%[i]>4 And r\LightFlicker%[i]<10 Then + random# = Rnd(0.35,0.45) + Else + random# = Rnd(0.3,0.5) + EndIf + EndIf + + If (Not r\LightSpriteHidden[i]) Then + ScaleSprite r\LightSprites2[i],random#,random# + EndIf + EndIf + + If r\LightCone[i]<>0 Then + ScaleEntity r\LightCone[i],0.005+Max(((-0.4+random#)*0.025),0),0.005+Max(((-0.4+random#)*0.025),0),0.005+Max(((-0.4+random#)*0.025),0) + EndIf + + If r\LightConeSpark[i]<>0 Then + If r\LightConeSparkTimer[i]>0 And r\LightConeSparkTimer[i]<10 Then + ShowEntity r\LightConeSpark[i] + r\LightConeSparkTimer[i]=r\LightConeSparkTimer[i]+FPSfactor + Else + HideEntity r\LightConeSpark[i] + r\LightConeSparkTimer[i]=0 + EndIf EndIf EndIf - Else - If SecondaryLightOn<=0.5 + UpdateRoomLightsTimer = UpdateRoomLightsTimer + FPSfactor + If UpdateRoomLightsTimer >= 8 Then + UpdateRoomLightsTimer = 0.0 + EndIf + ElseIf cam%=Camera Then + If SecondaryLightOn<=0.5 Then HideEntity r\LightSprites[i] Else ShowEntity r\LightSprites[i] EndIf - If (Not r\LightHidden[i]) + If (Not r\LightHidden[i]) Then HideEntity r\Lights%[i] r\LightHidden[i] = True EndIf - If (Not r\LightSpriteHidden[i]) + If (Not r\LightSpriteHidden[i]) Then HideEntity r\LightSprites2[i] r\LightSpriteHidden[i]=True EndIf If r\LightCone[i]<>0 Then HideEntity r\LightCone[i] - If r\LightConeSpark[i]<>0 HideEntity r\LightConeSpark[i] + If r\LightConeSpark[i]<>0 Then HideEntity r\LightConeSpark[i] + Else + ;This will make the lightsprites not glitch through the wall when they are rendered by the cameras + EntityOrder r\LightSprites2[i],0 EndIf EndIf Next @@ -7782,6 +8232,7 @@ Function CreateChunkParts(r.Rooms) ScaleEntity chp\obj[j],RoomScale,RoomScale,RoomScale EntityType chp\obj[j],HIT_MAP EntityPickMode chp\obj[j],2 + HideEntity chp\obj[j] ;EntityParent chp\obj[j],r\obj Next chp2 = Before(chp) @@ -7803,8 +8254,8 @@ Type Chunk Field Amount% Field IsSpawnChunk% Field ChunkPivot% - Field ChunkPivotDebug% - Field ChunkDebugObj% + ;Field ChunkPivotDebug% + ;Field ChunkDebugObj% Field PlatForm% End Type @@ -7820,15 +8271,15 @@ Function CreateChunk.Chunk(obj%,x#,y#,z#,isSpawnChunk%=False) ch\IsSpawnChunk = isSpawnChunk - ch\ChunkPivotDebug% = CreateSphere(8,ch\ChunkPivot) - EntityColor ch\ChunkPivotDebug,255*(Not isSpawnChunk),255*(isSpawnChunk),0 - EntityFX ch\ChunkPivotDebug,1 + ;ch\ChunkPivotDebug% = CreateSphere(8,ch\ChunkPivot) + ;EntityColor ch\ChunkPivotDebug,255*(Not isSpawnChunk),255*(isSpawnChunk),0 + ;EntityFX ch\ChunkPivotDebug,1 - ch\ChunkDebugObj = CreateCube(ch\ChunkPivotDebug) - ScaleEntity ch\ChunkDebugObj,20,0.1,20 - EntityColor ch\ChunkDebugObj,Rand(255),Rand(255),Rand(255) - EntityFX ch\ChunkDebugObj,1 - EntityAlpha ch\ChunkDebugObj,0.2 + ;ch\ChunkDebugObj = CreateCube(ch\ChunkPivotDebug) + ;ScaleEntity ch\ChunkDebugObj,20,0.1,20 + ;EntityColor ch\ChunkDebugObj,Rand(255),Rand(255),Rand(255) + ;EntityFX ch\ChunkDebugObj,1 + ;EntityAlpha ch\ChunkDebugObj,0.2 If obj% > -1 ch\Amount% = GetINIInt("Data\1499chunks.INI","chunk"+obj,"count") @@ -7885,11 +8336,11 @@ Function UpdateChunks(r.Rooms,ChunkPartAmount%,spawnNPCs%=True) Until z# > (ChunkMaxDistance#+(ChunkZ*40)) For ch = Each Chunk - If DebugHUD - ShowEntity ch\ChunkPivotDebug - Else - HideEntity ch\ChunkPivotDebug - EndIf +; If DebugHUD +; ShowEntity ch\ChunkPivotDebug +; Else +; HideEntity ch\ChunkPivotDebug +; EndIf If (Not ch\IsSpawnChunk) If Distance(EntityX(Collider),EntityZ(Collider),EntityX(ch\ChunkPivot),EntityZ(ch\ChunkPivot))>ChunkMaxDistance FreeEntity ch\ChunkPivot @@ -7906,6 +8357,15 @@ Function UpdateChunks(r.Rooms,ChunkPartAmount%,spawnNPCs%=True) Next Local MaxNPCs% = 64 ;<---- the maximum amount of NPCs in dimension1499 + Local e.Events + For e.Events = Each Events + If e\room = PlayerRoom Then + If e\room\NPC[0]<>Null Then + MaxNPCs = 16 + Exit + EndIf + EndIf + Next If currNPCNumb < MaxNPCs Select Rand(1,8) @@ -7930,10 +8390,12 @@ Function UpdateChunks(r.Rooms,ChunkPartAmount%,spawnNPCs%=True) n\Angle = Rnd(360) Else For n = Each NPCs - If n\NPCtype = NPCtype1499 - If EntityDistance(n\Collider,Collider)>ChunkMaxDistance Or EntityY(n\Collider)ChunkMaxDistance Or EntityY(n\Collider)15 Then + AAText(x+150*MenuScale + 100*MenuScale, y+55*MenuScale + 15*MenuScale, Left(SelectedMap,14)+"...", True, True) + Else + AAText(x+150*MenuScale + 100*MenuScale, y+55*MenuScale + 15*MenuScale, SelectedMap, True, True) + EndIf If DrawButton(x+370*MenuScale, y+55*MenuScale, 120*MenuScale, 30*MenuScale, "Deselect", False) Then SelectedMap="" @@ -395,7 +408,8 @@ Function UpdateMainMenu() y = y + height + 20 * MenuScale width = 580 * MenuScale - height = 300 * MenuScale + ;height = 300 * MenuScale + height = 510 * MenuScale DrawFrame(x, y, width, height) @@ -414,48 +428,99 @@ Function UpdateMainMenu() width = 580 * MenuScale height = 296 * MenuScale - AASetFont Font1 + ;AASetFont Font1 + + AASetFont Font2 + + If CurrLoadGamePage < Ceil(Float(SaveGameAmount)/6.0)-1 And SaveMSG = "" Then + If DrawButton(x+530*MenuScale, y + 510*MenuScale, 50*MenuScale, 55*MenuScale, ">") Then + CurrLoadGamePage = CurrLoadGamePage+1 + EndIf + Else + DrawFrame(x+530*MenuScale, y + 510*MenuScale, 50*MenuScale, 55*MenuScale) + Color(100, 100, 100) + AAText(x+555*MenuScale, y + 537.5*MenuScale, ">", True, True) + EndIf + If CurrLoadGamePage > 0 And SaveMSG = "" Then + If DrawButton(x, y + 510*MenuScale, 50*MenuScale, 55*MenuScale, "<") Then + CurrLoadGamePage = CurrLoadGamePage-1 + EndIf + Else + DrawFrame(x, y + 510*MenuScale, 50*MenuScale, 55*MenuScale) + Color(100, 100, 100) + AAText(x+25*MenuScale, y + 537.5*MenuScale, "<", True, True) + EndIf + + DrawFrame(x+50*MenuScale,y+510*MenuScale,width-100*MenuScale,55*MenuScale) + + AAText(x+(width/2.0),y+536*MenuScale,"Page "+Int(Max((CurrLoadGamePage+1),1))+"/"+Int(Max((Int(Ceil(Float(SaveGameAmount)/6.0))),1)),True,True) + + AASetFont Font1 + + If CurrLoadGamePage > Ceil(Float(SaveGameAmount)/6.0)-1 Then + CurrLoadGamePage = CurrLoadGamePage - 1 + EndIf If SaveGameAmount = 0 Then AAText (x + 20 * MenuScale, y + 20 * MenuScale, "No saved games.") Else x = x + 20 * MenuScale y = y + 20 * MenuScale - For i% = 1 To SaveGameAmount - DrawFrame(x,y,540* MenuScale, 70* MenuScale) - - AAText(x + 20 * MenuScale, y + 10 * MenuScale, SaveGames(i - 1)) - AAText(x + 20 * MenuScale, y + (10+23) * MenuScale, SaveGameTime(i - 1)) - AAText(x + 120 * MenuScale, y + (10+23) * MenuScale, SaveGameDate(i - 1)) - - If SaveMSG = "" Then - If DrawButton(x + 280 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale, "Load", False) Then - LoadEntities() - LoadAllSounds() - LoadGame(SavePath + SaveGames(i - 1) + "\") - CurrSave = SaveGames(i - 1) - InitLoadGame() - MainMenuOpen = False + + For i% = (1+(6*CurrLoadGamePage)) To 6+(6*CurrLoadGamePage) + If i <= SaveGameAmount Then + DrawFrame(x,y,540* MenuScale, 70* MenuScale) + + If SaveGameVersion(i - 1) <> CompatibleNumber Then + Color 255,0,0 + Else + Color 255,255,255 EndIf - If DrawButton(x + 400 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale, "Delete", False) Then - SaveMSG = SaveGames(i - 1) - DebugLog SaveMSG - Exit + AAText(x + 20 * MenuScale, y + 10 * MenuScale, SaveGames(i - 1)) + AAText(x + 20 * MenuScale, y + (10+18) * MenuScale, SaveGameTime(i - 1)) ;y + (10+23) * MenuScale + AAText(x + 120 * MenuScale, y + (10+18) * MenuScale, SaveGameDate(i - 1)) + AAText(x + 20 * MenuScale, y + (10+36) * MenuScale, SaveGameVersion(i - 1)) + + If SaveMSG = "" Then + If SaveGameVersion(i - 1) <> CompatibleNumber Then + DrawFrame(x + 280 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale) + Color(255, 0, 0) + AAText(x + 330 * MenuScale, y + 34 * MenuScale, "Load", True, True) + Else + If DrawButton(x + 280 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale, "Load", False) Then + LoadEntities() + LoadAllSounds() + LoadGame(SavePath + SaveGames(i - 1) + "\") + CurrSave = SaveGames(i - 1) + InitLoadGame() + MainMenuOpen = False + EndIf + EndIf + + If DrawButton(x + 400 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale, "Delete", False) Then + SaveMSG = SaveGames(i - 1) + DebugLog SaveMSG + Exit + EndIf + Else + DrawFrame(x + 280 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale) + If SaveGameVersion(i - 1) <> CompatibleNumber Then + Color(255, 0, 0) + Else + Color(100, 100, 100) + EndIf + AAText(x + 330 * MenuScale, y + 34 * MenuScale, "Load", True, True) + + DrawFrame(x + 400 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale) + Color(100, 100, 100) + AAText(x + 450 * MenuScale, y + 34 * MenuScale, "Delete", True, True) EndIf + y = y + 80 * MenuScale Else - DrawFrame(x + 280 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale) - Color(100, 100, 100) - AAText(x + 330 * MenuScale, y + 34 * MenuScale, "Load", True, True) - - DrawFrame(x + 400 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale) - Color(100, 100, 100) - AAText(x + 450 * MenuScale, y + 34 * MenuScale, "Delete", True, True) + Exit EndIf - - y = y + 80 * MenuScale - Next If SaveMSG <> "" @@ -949,7 +1014,7 @@ Function UpdateMainMenu() ;[Block] y = y + height + 20 * MenuScale width = 580 * MenuScale - height = 350 * MenuScale + height = 510 * MenuScale DrawFrame(x, y, width, height) @@ -962,13 +1027,48 @@ Function UpdateMainMenu() Color(255, 255, 255) AASetFont Font2 AAText(x + width / 2, y + height / 2, "LOAD MAP", True, True) - AASetFont Font1 x = 160 * MenuScale y = y + height + 20 * MenuScale width = 580 * MenuScale height = 350 * MenuScale + AASetFont Font2 + + tx# = x+width + ty# = y + tw# = 400*MenuScale + th# = 150*MenuScale + + If CurrLoadGamePage < Ceil(Float(SavedMapsAmount)/6.0)-1 Then + If DrawButton(x+530*MenuScale, y + 510*MenuScale, 50*MenuScale, 55*MenuScale, ">") Then + CurrLoadGamePage = CurrLoadGamePage+1 + EndIf + Else + DrawFrame(x+530*MenuScale, y + 510*MenuScale, 50*MenuScale, 55*MenuScale) + Color(100, 100, 100) + AAText(x+555*MenuScale, y + 537.5*MenuScale, ">", True, True) + EndIf + If CurrLoadGamePage > 0 Then + If DrawButton(x, y + 510*MenuScale, 50*MenuScale, 55*MenuScale, "<") Then + CurrLoadGamePage = CurrLoadGamePage-1 + EndIf + Else + DrawFrame(x, y + 510*MenuScale, 50*MenuScale, 55*MenuScale) + Color(100, 100, 100) + AAText(x+25*MenuScale, y + 537.5*MenuScale, "<", True, True) + EndIf + + DrawFrame(x+50*MenuScale,y+510*MenuScale,width-100*MenuScale,55*MenuScale) + + AAText(x+(width/2.0),y+536*MenuScale,"Page "+Int(Max((CurrLoadGamePage+1),1))+"/"+Int(Max((Int(Ceil(Float(SavedMapsAmount)/6.0))),1)),True,True) + + AASetFont Font1 + + If CurrLoadGamePage > Ceil(Float(SavedMapsAmount)/6.0)-1 Then + CurrLoadGamePage = CurrLoadGamePage - 1 + EndIf + AASetFont Font1 If SavedMaps(0)="" Then @@ -976,26 +1076,27 @@ Function UpdateMainMenu() Else x = x + 20 * MenuScale y = y + 20 * MenuScale - For i = 0 To MAXSAVEDMAPS-1 - If SavedMaps(i)<>"" Then + For i = (1+(6*CurrLoadGamePage)) To 6+(6*CurrLoadGamePage) + If i <= SavedMapsAmount Then + DrawFrame(x,y,540* MenuScale, 70* MenuScale) - If DrawButton(x + 20 * MenuScale, y + 20 * MenuScale, 170, 25, SavedMaps(i), False) Then - SelectedMap=SavedMaps(i) + AAText(x + 20 * MenuScale, y + 10 * MenuScale, SavedMaps(i - 1)) + AAText(x + 20 * MenuScale, y + (10+27) * MenuScale, SavedMapsAuthor(i - 1)) + + If DrawButton(x + 400 * MenuScale, y + 20 * MenuScale, 100 * MenuScale, 30 * MenuScale, "Load", False) Then + SelectedMap=SavedMaps(i - 1) MainMenuTab = 1 EndIf - - y=y+30*MenuScale - If y > (286+230) * MenuScale Then - y = 286*MenuScale + 2*MenuScale - x = x+175*MenuScale + If MouseOn(x + 400 * MenuScale, y + 20 * MenuScale, 100*MenuScale,30*MenuScale) + DrawMapCreatorTooltip(tx,ty,tw,th,SavedMaps(i-1)) EndIf + + y = y + 80 * MenuScale Else Exit EndIf Next EndIf - - ;[End Block] End Select @@ -2043,6 +2144,77 @@ Function DrawOptionsTooltip(x%,y%,width%,height%,option$,value#=0,ingame%=False) End Function +Function DrawMapCreatorTooltip(x%,y%,width%,height%,mapname$) + Local fx# = x+6*MenuScale + Local fy# = y+6*MenuScale + Local fw# = width-12*MenuScale + Local fh# = height-12*MenuScale + Local lines% = 0 + + AASetFont Font1 + Color 255,255,255 + + Local txt$[5] + If Right(mapname,6)="cbmap2" Then + txt[0] = Left(mapname$,Len(mapname$)-7) + Local f% = OpenFile("Map Creator\Maps\"+mapname$) + + Local author$ = ReadLine(f) + Local descr$ = ReadLine(f) + ReadByte(f) + ReadByte(f) + Local ramount% = ReadInt(f) + If ReadInt(f) > 0 Then + Local hasForest% = True + Else + hasForest% = False + EndIf + If ReadInt(f) > 0 Then + Local hasMT% = True + Else + hasMT% = False + EndIf + + CloseFile f% + Else + txt[0] = Left(mapname$,Len(mapname$)-6) + author$ = "[Unknown]" + descr$ = "[No description]" + ramount% = 0 + hasForest% = False + hasMT% = False + EndIf + txt[1] = "Made by: "+author$ + txt[2] = "Description: "+descr$ + If ramount > 0 Then + txt[3] = "Room amount: "+ramount + Else + txt[3] = "Room amount: [Unknown]" + EndIf + If hasForest Then + txt[4] = "Has custom forest: Yes" + Else + txt[4] = "Has custom forest: No" + EndIf + If hasMT Then + txt[5] = "Has custom maintenance tunnel: Yes" + Else + txt[5] = "Has custom maintenance tunnel: No" + EndIf + + lines% = GetLineAmount(txt[2],fw,fh) + DrawFrame(x,y,width,(AAStringHeight(txt[0])*6)+AAStringHeight(txt[2])*lines+5*MenuScale) + + Color 255,255,255 + AAText(fx,fy,txt[0]) + AAText(fx,fy+AAStringHeight(txt[0]),txt[1]) + RowText(txt[2],fx,fy+(AAStringHeight(txt[0])*2),fw,fh) + AAText(fx,fy+((AAStringHeight(txt[0])*2)+AAStringHeight(txt[2])*lines+5*MenuScale),txt[3]) + AAText(fx,fy+((AAStringHeight(txt[0])*3)+AAStringHeight(txt[2])*lines+5*MenuScale),txt[4]) + AAText(fx,fy+((AAStringHeight(txt[0])*4)+AAStringHeight(txt[2])*lines+5*MenuScale),txt[5]) + +End Function + Function ChangeMenu_TestIMG(change$) If Menu_TestIMG <> 0 Then FreeImage Menu_TestIMG diff --git a/NPCs.bb b/NPCs.bb index eaa9d6dd3..43c6354f4 100644 --- a/NPCs.bb +++ b/NPCs.bb @@ -3,8 +3,8 @@ Global Curr173.NPCs, Curr106.NPCs, Curr096.NPCs, Curr5131.NPCs Const NPCtype173% = 1, NPCtypeOldMan% = 2, NPCtypeGuard% = 3, NPCtypeD% = 4 Const NPCtype372% = 6, NPCtypeApache% = 7, NPCtypeMTF% = 8, NPCtype096 = 9 Const NPCtype049% = 10, NPCtypeZombie% = 11, NPCtype5131% = 12, NPCtypeTentacle% = 13 -Const NPCtype860% = 14, NPCtype939% = 15, NPCtype066% = 16, NPCtype178% = 17, NPCtypePdPlane% = 18 -Const NPCtype966% = 19, NPCtype1048a = 20, NPCtype1499% = 21, NPCtype008% = 22, NPCtypeClerk% = 23 +Const NPCtype860% = 14, NPCtype939% = 15, NPCtype066% = 16, NPCtypePdPlane% = 17 +Const NPCtype966% = 18, NPCtype1048a = 19, NPCtype1499% = 20, NPCtype008% = 21, NPCtypeClerk% = 22 ;[End Block] Type NPCs @@ -245,7 +245,7 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#) ;[Block] n\NVName = "SCP-096" n\Collider = CreatePivot() - EntityRadius n\Collider, 0.3 + EntityRadius n\Collider, 0.26 EntityType n\Collider, HIT_PLAYER n\obj = LoadAnimMesh_Strict("GFX\npcs\scp096.b3d") @@ -256,7 +256,7 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#) MeshCullBox (n\obj, -MeshWidth(n\obj)*2, -MeshHeight(n\obj)*2, -MeshDepth(n\obj)*2, MeshWidth(n\obj)*2, MeshHeight(n\obj)*4, MeshDepth(n\obj)*4) - n\CollRadius = 0.3 + n\CollRadius = 0.26 ;[End Block] Case NPCtype049 ;[Block] @@ -493,39 +493,6 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#) n\Speed = (GetINIFloat("DATA\NPCs.ini", "SCP-066", "speed") / 100.0) ;[End Block] - Case NPCtype178 - ;[Block] - n\NVName = "Unidentified" - - n\Collider = CreatePivot() - EntityRadius n\Collider,0.2 - - For n2.NPCs = Each NPCs - If (n\NPCtype = n2\NPCtype) And (n<>n2) Then - n\obj = CopyEntity (n2\obj) - Exit - EndIf - Next - - If n\obj = 0 Then - n\obj = LoadAnimMesh_Strict("GFX\npcs\npc178.b3d") - EndIf - - temp# = Rnd(0.09,0.125) - - EntityFX n\obj,1 - - temp# = Rnd(0.6,0.8) / MeshWidth(n\obj) - ScaleEntity n\obj, temp, temp, temp - - ;EntityColor n\obj,Rnd(0,50),0,Rnd(50,100) - - SetAnimTime n\obj,15.0 - - EntityType n\Collider,HIT_178 - - n\Speed = 0.02 - ;[End Block] Case NPCtype966 ;[Block] i = 1 @@ -594,6 +561,8 @@ Function CreateNPC.NPCs(NPCtype%, x#, y#, z#) ScaleEntity n\obj, temp, temp, temp EntityFX n\obj,1 + + EntityAutoFade n\obj,HideDistance*2.5,HideDistance*2.95 ;[End Block] Case NPCtype008 ;[Block] @@ -975,6 +944,7 @@ Function UpdateNPCs() dist = EntityDistance(n\Collider, Collider) Local spawn106% = True + ;checking if 106 is allowed to spawn If PlayerRoom\RoomTemplate\Name$ = "dimension1499" Then spawn106% = False For e.Events = Each Events If e\EventName = "room860" @@ -984,7 +954,28 @@ Function UpdateNPCs() Exit EndIf Next - If (Not spawn106%) And n\State <= 0 Then n\State = Rand(22000, 27000) + If PlayerRoom\RoomTemplate\Name$ = "room049" And EntityY(Collider) <= -2848*RoomScale Then + spawn106% = False + EndIf + ;GateA event has been triggered - don't make 106 disapper! + ;The reason why this is a seperate For loop is because we need to make sure that room860 would not be able to overwrite the "spawn106%" variable + For e.events = Each Events + If e\EventName = "gatea" + If e\EventState <> 0 + spawn106% = True + If PlayerRoom\RoomTemplate\Name$ = "dimension1499" Then + n\Idle = True + Else + n\Idle = False + EndIf + EndIf + Exit + EndIf + Next + If (Not spawn106%) And n\State <= 0 Then + n\State = Rand(22000, 27000) + PositionEntity n\Collider,0,500,0 + EndIf If (Not n\Idle) And spawn106% If n\State <= 0 Then ;attacking @@ -1050,7 +1041,7 @@ Function UpdateNPCs() End If If dist > 0.8 Then - If (dist > 25.0 Or PlayerRoom\RoomTemplate\Name = "pocketdimension" Or Visible Or n\PathStatus = 2) And PlayerRoom\RoomTemplate\Name <> "gatea" Then + If (dist > 25.0 Or PlayerRoom\RoomTemplate\Name = "pocketdimension" Or Visible Or n\PathStatus <> 1) And PlayerRoom\RoomTemplate\Name <> "gatea" Then If (dist > 40 Or PlayerRoom\RoomTemplate\Name = "pocketdimension") Then TranslateEntity n\Collider, 0, ((EntityY(Collider) - 0.14) - EntityY(n\Collider)) / 50.0, 0 @@ -1076,9 +1067,11 @@ Function UpdateNPCs() EndIf n\PathTimer = Max(n\PathTimer-FPSfactor,0) - If n\PathTimer =< 0 Then n\PathStatus = 0 + If n\PathTimer =< 0 Then + n\PathStatus = FindPath (n, EntityX(Collider,True), EntityY(Collider,True), EntityZ(Collider,True)) + n\PathTimer = 70*10 + EndIf Else - If n\PathTimer <= 0 Then n\PathStatus = FindPath (n, EntityX(Collider,True), EntityY(Collider,True), EntityZ(Collider,True)) n\PathTimer = 70*10 @@ -1089,13 +1082,16 @@ Function UpdateNPCs() If n\PathStatus = 2 Then n\CurrSpeed = 0 ElseIf n\PathStatus = 1 - If n\Path[n\PathLocation]=Null Then + While n\Path[n\PathLocation]=Null If n\PathLocation > 19 Then n\PathLocation = 0 : n\PathStatus = 0 + Exit Else n\PathLocation = n\PathLocation + 1 EndIf - Else + Wend + + If n\Path[n\PathLocation]<>Null Then TranslateEntity n\Collider, 0, ((EntityY(n\Path[n\PathLocation]\obj,True) - 0.11) - EntityY(n\Collider)) / 50.0, 0 PointEntity n\obj, n\Path[n\PathLocation]\obj @@ -1163,7 +1159,10 @@ Function UpdateNPCs() MoveEntity n\Collider, 0, 0, n\CurrSpeed * FPSfactor If n\State <= Rand(-3500, -3000) Then - If Not EntityInView(n\obj,Camera) Then n\State = Rand(22000, 27000) + If Not EntityInView(n\obj,Camera) And dist > 5 Then + n\State = Rand(22000, 27000) + PositionEntity n\Collider,0,500,0 + EndIf EndIf If FallTimer < -250.0 Then @@ -1183,9 +1182,10 @@ Function UpdateNPCs() RotateEntity(n\Collider,0,EntityYaw(n\Collider),0) MoveEntity(n\Collider,0,0,-2) PlaySound2(OldManSFX(3),Camera,n\Collider) + n\SoundChn2 = PlaySound2(OldManSFX(6+Rand(0,2)),Camera,n\Collider) n\PathTimer = 0 n\Reload = (70*10.0)/(SelectedDifficulty\otherFactors+1) - DebugLog "COBY!" + DebugLog "Teleported 106 (Distance: "+EntityDistance(n\Collider,Collider)+")" EndIf EndIf EndIf @@ -1193,6 +1193,7 @@ Function UpdateNPCs() n\Reload = Max(0, n\Reload - FPSfactor) DebugLog "106 in... "+n\Reload + UpdateSoundOrigin(n\SoundChn2,Camera,n\Collider) Else ;idling outside the map n\CurrSpeed = 0 MoveEntity n\Collider, 0, ((EntityY(Collider) - 30) - EntityY(n\Collider)) / 200.0, 0 @@ -1454,7 +1455,7 @@ Function UpdateNPCs() EndIf dist2# = EntityDistance(n\Collider,n\Path[n\PathLocation]\obj) - If dist2 < 0.4 Then + If dist2 < 0.8 Then ;0.4 If n\Path[n\PathLocation]\door <> Null Then If n\Path[n\PathLocation]\door\open = False Then n\Path[n\PathLocation]\door\open = True @@ -1462,7 +1463,7 @@ Function UpdateNPCs() PlaySound2(OpenDoorFastSFX, Camera, n\Path[n\PathLocation]\door\obj) EndIf EndIf - If dist2 < 0.2 Then n\PathLocation = n\PathLocation + 1 + If dist2 < 0.7 Then n\PathLocation = n\PathLocation + 1 ;0.2 EndIf EndIf @@ -1653,7 +1654,7 @@ Function UpdateNPCs() End Select ;ResetEntity(n\Collider) - PositionEntity(n\obj, EntityX(n\Collider), EntityY(n\Collider)-0.07, EntityZ(n\Collider)) + PositionEntity(n\obj, EntityX(n\Collider), EntityY(n\Collider)-0.03, EntityZ(n\Collider)) ;-0.07 RotateEntity n\obj, EntityPitch(n\Collider), EntityYaw(n\Collider), 0 ;[End Block] @@ -1678,9 +1679,11 @@ Function UpdateNPCs() If ChannelPlaying(n\SoundChn2) Then StopChannel(n\SoundChn2) Else If n\Idle = 0.1 - TeleportCloser(n) - n\Idle = 0.0 - DebugLog "SCP-049 not idle" + If PlayerInReachableRoom() Then + TeleportCloser(n) + n\Idle = 0.0 + DebugLog "SCP-049 not idle" + EndIf EndIf Select n\State @@ -1703,10 +1706,10 @@ Function UpdateNPCs() ;[End Block] Case 2 ;being active ;[Block] - If (dist < HideDistance*2 Or n\InFacility<>1) And (Not n\Idle) ;Checking if the player is in range/if 049 is in facility/if 049 is not idle + If (dist < HideDistance*2) And (Not n\Idle) And PlayerInReachableRoom() Then n\SoundChn = LoopSound2(n\Sound, n\SoundChn, Camera, n\Collider) PlayerSeeAble% = MeNPCSeesPlayer(n) - If PlayerSeeAble%=True Or n\State2>0 ;Player is visible for 049's sight - attacking + If PlayerSeeAble%=True Or n\State2>0 Then ;Player is visible for 049's sight - attacking GiveAchievement(Achv049) ;Playing a sound after detecting the player @@ -1720,8 +1723,10 @@ Function UpdateNPCs() n\PathTimer# = 0.0 n\PathLocation = 0 If PlayerSeeAble%=True Then n\State2 = 70*2 + PointEntity n\obj,Collider RotateEntity n\Collider,0,CurveAngle(EntityYaw(n\obj),EntityYaw(n\Collider),10.0),0 + If dist < 0.5 Then If Wearing714 Then BlurTimer = BlurTimer+FPSfactor*2.5 @@ -1768,248 +1773,186 @@ Function UpdateNPCs() EndIf EndIf Else ;Finding a path to the player - If PlayerSeeAble% = 2 Then n\LastSeen = 70*15 - - If n\LastSeen > 0 - If n\PathStatus = 1 ;Path to player found - If n\Path[n\PathLocation]=Null Then - If n\PathLocation > 19 Then - n\PathLocation = 0 : n\PathStatus = 0 - Else - n\PathLocation = n\PathLocation + 1 - EndIf + If n\PathStatus = 1 ;Path to player found + While n\Path[n\PathLocation]=Null + If n\PathLocation > 19 + n\PathLocation = 0 : n\PathStatus = 0 : Exit Else - ;closes doors behind him - If n\PathLocation>0 Then - If n\Path[n\PathLocation-1] <> Null - If n\Path[n\PathLocation-1]\door <> Null Then - If (Not n\Path[n\PathLocation-1]\door\IsElevatorDoor) - If EntityDistance(n\Path[n\PathLocation-1]\obj,n\Collider)>0.3 - If n\Path[n\PathLocation-1]\door\open Then UseDoor(n\Path[n\PathLocation-1]\door, False) + n\PathLocation = n\PathLocation + 1 + EndIf + Wend + If n\Path[n\PathLocation]<>Null Then + ;closes doors behind him + If n\PathLocation>0 Then + If n\Path[n\PathLocation-1] <> Null Then + If n\Path[n\PathLocation-1]\door <> Null Then + If (Not n\Path[n\PathLocation-1]\door\IsElevatorDoor) Then + If EntityDistance(n\Path[n\PathLocation-1]\obj,n\Collider)>0.3 Then + If (n\Path[n\PathLocation-1]\door\MTFClose) And (n\Path[n\PathLocation-1]\door\open) And (n\Path[n\PathLocation-1]\door\buttons[0]<>0 Or n\Path[n\PathLocation-1]\door\buttons[1]<>0) Then + UseDoor(n\Path[n\PathLocation-1]\door, False) EndIf EndIf EndIf EndIf EndIf - - n\CurrSpeed = CurveValue(n\Speed, n\CurrSpeed, 20.0) - PointEntity n\obj,n\Path[n\PathLocation]\obj - RotateEntity n\Collider,0,CurveAngle(EntityYaw(n\obj),EntityYaw(n\Collider),10.0),0 - MoveEntity n\Collider,0,0,n\CurrSpeed*FPSfactor - - ;opens doors in front of him - dist2# = EntityDistance(n\Collider,n\Path[n\PathLocation]\obj) - If dist2 < 0.6 Then - temp = True - If n\Path[n\PathLocation]\door <> Null Then - If (Not n\Path[n\PathLocation]\door\IsElevatorDoor) - If n\Path[n\PathLocation]\door\locked Or n\Path[n\PathLocation]\door\KeyCard>0 Or n\Path[n\PathLocation]\door\Code<>"" Then - temp = False - ;n\CurrSpeed = 0 - Else - If n\Path[n\PathLocation]\door\open = False Then UseDoor(n\Path[n\PathLocation]\door, False) + EndIf + + n\CurrSpeed = CurveValue(n\Speed, n\CurrSpeed, 20.0) + PointEntity n\obj,n\Path[n\PathLocation]\obj + RotateEntity n\Collider,0,CurveAngle(EntityYaw(n\obj),EntityYaw(n\Collider),10.0),0 + MoveEntity n\Collider,0,0,n\CurrSpeed*FPSfactor + + ;opens doors in front of him + dist2# = EntityDistance(n\Collider,n\Path[n\PathLocation]\obj) + If dist2 < 0.6 Then + temp = True + If n\Path[n\PathLocation]\door <> Null Then + If (Not n\Path[n\PathLocation]\door\IsElevatorDoor) + If (n\Path[n\PathLocation]\door\locked Or n\Path[n\PathLocation]\door\KeyCard<>0 Or n\Path[n\PathLocation]\door\Code<>"") And (Not n\Path[n\PathLocation]\door\open) Then + temp = False + Else + If n\Path[n\PathLocation]\door\open = False And (n\Path[n\PathLocation]\door\buttons[0]<>0 Or n\Path[n\PathLocation]\door\buttons[1]<>0) Then + UseDoor(n\Path[n\PathLocation]\door, False) EndIf EndIf EndIf - If dist2#<0.2 And temp - n\PathLocation = n\PathLocation + 1 - ElseIf dist2#<0.5 And (Not temp) - ;Breaking up the path because the door cannot be operated by SCP-049 - n\PathStatus = 0 - n\PathTimer# = 0.0 - EndIf - EndIf - - AnimateNPC(n, Max(Min(AnimTime(n\obj),358.0),346), 393.0, n\CurrSpeed*38) - - ;Playing a sound if he hears the player - If n\PrevState = 0 And ChannelPlaying(n\SoundChn2)=False - If n\Sound2 <> 0 Then FreeSound_Strict(n\Sound2) - If Rand(8)=3 - n\Sound2 = LoadSound_Strict("SFX\SCP\049\Detected4.ogg") - Else - n\Sound2 = LoadSound_Strict("SFX\SCP\049\Detected"+Rand(1,3)+".ogg") - EndIf - n\SoundChn2 = LoopSound2(n\Sound2,n\SoundChn2,Camera,n\obj) - n\PrevState = 1 - EndIf - - ;Resetting the "PrevState" value randomly, to make 049 talking randomly - If Rand(300)=1 And ChannelPlaying(n\SoundChn2)=False Then n\PrevState = 0 - - n\State3 = n\State3 + FPSfactor - - If n\PrevState > 1 Then n\PrevState = 1 - - If n\State3 > 70*7 ;Upadting the path every 7 seconds - If n\InFacility = InFacility - n\PathStatus = FindPath(n, EntityX(Collider),EntityY(Collider)+0.2,EntityZ(Collider)) - EndIf - n\State3 = 0.0 EndIf - EndIf - - If n\CurrElevator <> Null - dist2# = EntityDistance(n\Collider,n\CurrElevator\door\frameobj) - If dist2# < 0.7 + If dist2#<0.2 And temp + n\PathLocation = n\PathLocation + 1 + ElseIf dist2#<0.5 And (Not temp) + ;Breaking up the path when the door in front of 049 cannot be operated by himself n\PathStatus = 0 - n\PathLocation = 0 n\PathTimer# = 0.0 EndIf EndIf - Else ;No Path to the player found - stands still and tries to find a path - If n\CurrElevator = Null - If n\PathStatus = 2 ;Updating path faster - n\PathTimer# = n\PathTimer# + 2*FPSfactor - Else - n\PathTimer# = n\PathTimer# + FPSfactor - EndIf - If n\PathTimer# > 70*5-(2*SelectedDifficulty\aggressiveNPCs) - If n\InFacility = InFacility - n\PathStatus = FindPath(n, EntityX(Collider),EntityY(Collider)+0.2,EntityZ(Collider)) - Else - FindNextElevator(n) - EndIf - n\PathTimer# = 0.0 - EndIf - AnimateNPC(n, 269, 345, 0.2) - ;n\PrevState = 0 - Else - ;n\CurrSpeed = CurveValue(n\Speed, n\CurrSpeed, 20.0) - n\CurrSpeed = n\Speed - GoToElevator(n) - - If n\CurrSpeed > 0.0 - MoveEntity n\Collider,0,0,n\CurrSpeed*FPSfactor - AnimateNPC(n, Max(Min(AnimTime(n\obj),358.0),346), 393.0, n\CurrSpeed*38) + + AnimateNPC(n, Max(Min(AnimTime(n\obj),358.0),346), 393.0, n\CurrSpeed*38) + + ;Playing a sound if he hears the player + If n\PrevState = 0 And ChannelPlaying(n\SoundChn2)=False + If n\Sound2 <> 0 Then FreeSound_Strict(n\Sound2) + If Rand(20)=1 + n\Sound2 = LoadSound_Strict("SFX\SCP\049\Detected4.ogg") Else - AnimateNPC(n, 269, 345, 0.2) + n\Sound2 = LoadSound_Strict("SFX\SCP\049\Detected"+Rand(1,3)+".ogg") EndIf + n\SoundChn2 = LoopSound2(n\Sound2,n\SoundChn2,Camera,n\obj) + n\PrevState = 1 EndIf + + ;Resetting the "PrevState" value randomly, to make 049 talking randomly + If Rand(600)=1 And ChannelPlaying(n\SoundChn2)=False Then n\PrevState = 0 + + If n\PrevState > 1 Then n\PrevState = 1 EndIf - Else ;Player hasn't been detected, just being idle - If n\PathStatus = 1 - If n\Path[n\PathLocation]=Null Then - If n\PathLocation > 19 Then - n\PathLocation = 0 : n\PathStatus = 0 - Else - n\PathLocation = n\PathLocation + 1 - EndIf - Else - ;closes doors behind him - If n\PathLocation>0 Then - If n\Path[n\PathLocation-1] <> Null - If n\Path[n\PathLocation-1]\door <> Null Then - If (Not n\Path[n\PathLocation-1]\door\IsElevatorDoor) - If EntityDistance(n\Path[n\PathLocation-1]\obj,n\Collider)>0.3 - If n\Path[n\PathLocation-1]\door\open Then UseDoor(n\Path[n\PathLocation-1]\door, False) - EndIf - EndIf + Else ;No Path to the player found - stands still and tries to find a path + ;[Block] + n\PathTimer# = n\PathTimer# + FPSfactor + If n\PathTimer# > 70*(5-(2*SelectedDifficulty\aggressiveNPCs)) Then + n\PathStatus = FindPath(n, EntityX(Collider),EntityY(Collider),EntityZ(Collider)) + n\PathTimer# = 0.0 + n\State3 = 0 + + ;Attempt to find a room (the Playerroom or one of it's adjacent rooms) for 049 to go to but select the one closest to him + If n\PathStatus <> 1 Then + Local closestdist# = EntityDistance(PlayerRoom\obj,n\Collider) + Local closestRoom.Rooms = PlayerRoom + Local currdist# = 0.0 + For i = 0 To 3 + If PlayerRoom\Adjacent[i]<>Null Then + currdist = EntityDistance(PlayerRoom\Adjacent[i]\obj,n\Collider) + If currdist < closestdist Then + closestdist = currdist + closestRoom = PlayerRoom\Adjacent[i] EndIf EndIf - EndIf - - n\CurrSpeed = CurveValue(n\Speed, n\CurrSpeed, 20.0) - PointEntity n\obj,n\Path[n\PathLocation]\obj - RotateEntity n\Collider,0,CurveAngle(EntityYaw(n\obj),EntityYaw(n\Collider),10.0),0 - MoveEntity n\Collider,0,0,n\CurrSpeed*FPSfactor - - ;opens doors in front of him - dist2# = EntityDistance(n\Collider,n\Path[n\PathLocation]\obj) - If dist2 < 0.6 Then - temp = True - If n\Path[n\PathLocation]\door <> Null Then - If (Not n\Path[n\PathLocation]\door\IsElevatorDoor) - If n\Path[n\PathLocation]\door\locked Or n\Path[n\PathLocation]\door\KeyCard>0 Or n\Path[n\PathLocation]\door\Code<>"" Then - temp = False - ;n\CurrSpeed = 0 - Else - If n\Path[n\PathLocation]\door\open = False Then UseDoor(n\Path[n\PathLocation]\door, False) - EndIf + Next + n\PathStatus = FindPath(n,EntityX(closestRoom\obj),0.5,EntityZ(closestRoom\obj)) + DebugLog "Find path for 049 in another room (pathstatus: "+n\PathStatus+")" + EndIf + + ;Making 3 attempts at finding a path + While Int(n\State3) < 3 + ;Breaking up the path if no "real" path has been found (only 1 waypoint and it is too close) + If n\PathStatus = 1 Then + If n\Path[1]<>Null Then + If n\Path[2]=Null And EntityDistance(n\Path[1]\obj,n\Collider)<0.4 Then + n\PathLocation = 0 + n\PathStatus = 0 + DebugLog "Breaking up path for 049 because no waypoint number 2 has been found and waypoint number 1 is too close." EndIf EndIf - If dist2#<0.2 And temp - n\PathLocation = n\PathLocation + 1 - ElseIf dist2#<0.5 And (Not temp) - ;Breaking up the path because the door cannot be operated by SCP-049 + If n\Path[0]<>Null And n\Path[1]=Null Then + n\PathLocation = 0 n\PathStatus = 0 - n\PathTimer# = 0.0 + DebugLog "Breaking up path for 049 because no waypoint number 1 has been found." EndIf EndIf - If n\PrevState = 0 And ChannelPlaying(n\SoundChn2)=False - If Rand(8)=3 - If n\Sound2 <> 0 Then FreeSound_Strict(n\Sound2) - n\Sound2 = LoadSound_Strict("SFX\SCP\049\Detected4.ogg") - n\SoundChn2 = LoopSound2(n\Sound2,n\SoundChn2,Camera,n\obj) - EndIf - n\PrevState = 1 + ;No path could still be found, just make 049 go to a room (further away than the very first attempt) + If n\PathStatus <> 1 Then + closestdist# = 100.0 ;Prevent the PlayerRoom to be considered the closest, so 049 wouldn't try to find a path there + closestRoom.Rooms = PlayerRoom + currdist# = 0.0 + For i = 0 To 3 + If PlayerRoom\Adjacent[i]<>Null Then + currdist = EntityDistance(PlayerRoom\Adjacent[i]\obj,n\Collider) + If currdist < closestdist Then + closestdist = currdist + For j = 0 To 3 + If PlayerRoom\Adjacent[i]\Adjacent[j]<>Null Then + If PlayerRoom\Adjacent[i]\Adjacent[j]<>PlayerRoom Then + closestRoom = PlayerRoom\Adjacent[i]\Adjacent[j] + Exit + EndIf + EndIf + Next + EndIf + EndIf + Next + n\PathStatus = FindPath(n,EntityX(closestRoom\obj),0.5,EntityZ(closestRoom\obj)) + DebugLog "Find path for 049 in another further away room (pathstatus: "+n\PathStatus+")" EndIf - AnimateNPC(n, Max(Min(AnimTime(n\obj),358.0),346), 393.0, n\CurrSpeed*38) - - n\PrevState = 0 - n\State3 = n\State3 + FPSfactor - - If n\InFacility = True - If n\State3 > 70*14 ;Breaking the path after 14 seconds - n\PathStatus = 0 - n\PathLocation = 0 - n\PathTimer# = 0.0 - n\State3 = 0.0 - EndIf - EndIf - EndIf - - If n\CurrElevator <> Null - dist2# = EntityDistance(n\Collider,n\CurrElevator\door\frameobj) - If dist2# < 0.7 - n\PathStatus = 0 - n\PathLocation = 0 - n\PathTimer# = 0.0 - EndIf - EndIf - Else - If n\CurrElevator = Null - n\CurrSpeed = 0 - AnimateNPC(n, 269, 345, 0.2) - If n\PathTimer# < 300+Rand(100,300) - n\PathTimer# = n\PathTimer# + FPSfactor - Else - If n\InFacility = True - If Rand(2)=1 - For r.Rooms = Each Rooms - If EntityDistance(r\obj,n\Collider)<12.0 And EntityDistance(r\obj,n\Collider)>4.0 - n\PathStatus = FindPath(n,EntityX(r\obj),EntityY(r\obj),EntityZ(r\obj)) - Exit - EndIf - Next + ;Making 049 skip waypoints for doors he can't interact with, but only if the actual path is behind him + If n\PathStatus = 1 Then + If n\Path[1]<>Null Then + If n\Path[1]\door<>Null Then + If (n\Path[1]\door\locked Or n\Path[1]\door\KeyCard<>0 Or n\Path[1]\door\Code<>"") And (Not n\Path[1]\door\open) Then + Repeat + If n\PathLocation > 19 + n\PathLocation = 0 : n\PathStatus = 0 : Exit + Else + n\PathLocation = n\PathLocation + 1 + EndIf + If n\Path[n\PathLocation]<>Null Then + If Abs(DeltaYaw(n\Collider,n\Path[n\PathLocation]\obj))>(45.0-Abs(DeltaYaw(n\Collider,n\Path[1]\obj))) Then + DebugLog "Skip until waypoint number "+n\PathLocation + n\State3 = 3 + Exit + EndIf + EndIf + Forever + Else + n\State3 = 3 + EndIf + Else + n\State3 = 3 EndIf - Else - FindNextElevator(n) EndIf - n\PathTimer# = 0.0 - EndIf - Else - ;n\CurrSpeed = CurveValue(n\Speed, n\CurrSpeed, 20.0) - n\CurrSpeed = n\Speed - GoToElevator(n) - - If n\CurrSpeed > 0.0 - MoveEntity n\Collider,0,0,n\CurrSpeed*FPSfactor - AnimateNPC(n, Max(Min(AnimTime(n\obj),358.0),346), 393.0, n\CurrSpeed*38) - Else - AnimateNPC(n, 269, 345, 0.2) EndIf - EndIf + n\State3 = n\State3 + 1 + Wend EndIf + AnimateNPC(n, 269, 345, 0.2) + ;[End Block] EndIf EndIf If n\CurrSpeed > 0.005 Then If (prevFrame < 361 And n\Frame=>361) Or (prevFrame < 377 And n\Frame=>377) Then PlaySound2(StepSFX(3,0,Rand(0,2)),Camera, n\Collider, 8.0, Rnd(0.8,1.0)) - ElseIf (prevFrame < 431 And n\Frame=>431) Or (prevFrame < 447 And n\Frame=>447) + ElseIf (prevFrame < 431 And n\Frame=>431) Or (prevFrame < 447 And n\Frame=>447) Then PlaySound2(StepSFX(3,0,Rand(0,2)),Camera, n\Collider, 8.0, Rnd(0.8,1.0)) EndIf EndIf @@ -2018,32 +1961,11 @@ Function UpdateNPCs() UpdateSoundOrigin(n\SoundChn2,Camera,n\obj) EndIf ElseIf (Not n\Idle) - If ChannelPlaying(n\SoundChn) Then StopChannel(n\SoundChn) - If PlayerInReachableRoom() ;Player is in a room where SCP-049 can teleport to - ;If Rand(100-(30*SelectedDifficulty\aggressiveNPCs))=1 Then TeleportCloser(n) - If Rand(50-(20*SelectedDifficulty\aggressiveNPCs))=1 - For w.waypoints = Each WayPoints - If w\door=Null And w\room\dist < HideDistance And Rand(3)=1 Then - If EntityDistance(w\room\obj,n\Collider) 4.0 Then - z = Abs(EntityZ(n\Collider)-EntityZ(w\obj,True)) - If z < 12 And z > 4.0 Then - If w\room\dist > 4 - DebugLog "MOVING 049 TO "+w\room\roomtemplate\name - PositionEntity n\Collider, EntityX(w\obj,True), EntityY(w\obj,True)+0.25,EntityZ(w\obj,True) - ResetEntity n\Collider - n\PathStatus = 0 - n\PathTimer# = 0.0 - n\PathLocation = 0 - Exit - EndIf - EndIf - EndIf - EndIf - EndIf - Next - EndIf + If ChannelPlaying(n\SoundChn) Then + StopChannel(n\SoundChn) + EndIf + If PlayerInReachableRoom() Then ;Player is in a room where SCP-049 can teleport to + TeleportCloser(n) EndIf EndIf ;[End Block] @@ -2063,9 +1985,17 @@ Function UpdateNPCs() ;Animate2(n\obj, AnimTime(n\obj), 18, 19, 0.05) PointEntity n\obj, Collider RotateEntity n\Collider, 0, CurveAngle(EntityYaw(n\obj), EntityYaw(n\Collider), 45.0), 0 - ElseIf dist > HideDistance*0.8 + + n\State3 = 1 + ElseIf dist > HideDistance*0.8 And n\State3 > 0 Then n\State = 2 - TeleportCloser(n) + n\State3 = 0 + For r.Rooms = Each Rooms + If EntityDistance(r\obj,n\Collider)<4.0 Then + TeleportEntity(n\Collider,EntityX(r\obj),0.1,EntityZ(r\obj),n\CollRadius,True) + Exit + EndIf + Next EndIf ;[End Block] Case 5 ;used for "room2sl" @@ -2084,7 +2014,7 @@ Function UpdateNPCs() ElseIf PlayerSeeAble% = 2 And n\State3 > 0.0 n\PathStatus = FindPath(n,EntityX(Collider),EntityY(Collider),EntityZ(Collider)) Else - If n\State3 = 5.0 + If n\State3 = 6.0 If EntityDistance(n\Collider,Collider)>HideDistance n\State = 2 n\PathStatus = 0 @@ -2149,8 +2079,9 @@ Function UpdateNPCs() EndIf EndIf - If Music(20) = 0 Then Music(20) = LoadSound_Strict("SFX\Music\049Chase.ogg") - ShouldPlay = 20 + If PlayerRoom\RoomTemplate\Name = "room2sl" Then + ShouldPlay = 20 + EndIf If n\CurrSpeed > 0.005 Then If (prevFrame < 361 And n\Frame=>361) Or (prevFrame < 377 And n\Frame=>377) Then @@ -2186,23 +2117,19 @@ Function UpdateNPCs() If (Not n\IsDead) Select n\State Case 0 + ;[Block] AnimateNPC(n, 719, 777, 0.2, False) - ;Animate2(n\obj, AnimTime(n\obj), 719, 777, 0.2, False) If n\Frame=777 Then - If Rand(700)=1 Then + If Rand(700)=1 Then If EntityDistance(Collider, n\Collider)<5.0 Then n\Frame = 719 - ;SetAnimTime (n\obj, 719) - If Rand(3)=1 Then - n\State=1 - n\Frame = 155 - ;SetAnimTime n\obj, 155 - EndIf EndIf EndIf EndIf + ;[End Block] Case 1 ;stands up + ;[Block] If n\Frame=>682 Then AnimateNPC(n, 926, 935, 0.3, False) If n\Frame = 935 Then n\State = 2 @@ -2213,7 +2140,9 @@ Function UpdateNPCs() AnimateNPC(n, 155, 682, 1.5, False) ;Animate2(n\obj, AnimTime(n\obj), 155, 682, 1.5, False) EndIf + ;[End Block] Case 2 ;following the player + ;[Block] If n\State3 < 0 Then ;check if the player is visible every three seconds If EntityDistance(Collider, n\Collider)<5.0 Then If EntityVisible(Collider, n\Collider) Then n\State2 = 70*5 @@ -2294,32 +2223,42 @@ Function UpdateNPCs() ;PlaySound2(StepSFX(0,0,Rand(0,2)),Camera, n\Collider, 8.0, Rnd(0.3,0.5)) PlaySound2(StepSFX(2,0,Rand(0,2)),Camera, n\Collider, 8.0, Rnd(0.3,0.5)) EndIf - EndIf + EndIf + ;[End Block] Case 3 + ;[Block] If NoTarget Then n\State = 2 If n\Frame < 66 Then AnimateNPC(n, 2, 65, 0.7, False) ;Animate2(n\obj, AnimTime(n\obj), 2, 65, 0.7, False) - If prevFrame < 23 And n\Frame=>23 Then - PlaySound_Strict DamageSFX(Rand(5,8)) - Injuries = Injuries+Rnd(0.4,1.0) - DeathMSG = "Subject D-9341. Cause of death: multiple lacerations and severe blunt force trauma caused by an instance of SCP-049-2." + If prevFrame < 23 And n\Frame=>23 Then + If EntityDistance(n\Collider,Collider)<1.1 + If (Abs(DeltaYaw(n\Collider,Collider))<=60.0) + PlaySound_Strict DamageSFX(Rand(5,8)) + Injuries = Injuries+Rnd(0.4,1.0) + DeathMSG = "Subject D-9341. Cause of death: multiple lacerations and severe blunt force trauma caused by an instance of SCP-049-2." + EndIf + EndIf ElseIf n\Frame=65 Then n\State = 2 EndIf Else AnimateNPC(n, 66, 132, 0.7, False) ;Animate2(n\obj, AnimTime(n\obj), 66, 132, 0.7, False) - If prevFrame < 90 And n\Frame=>90 Then - PlaySound_Strict DamageSFX(Rand(5,8)) - Injuries = Injuries+Rnd(0.4,1.0) - DeathMSG = "Subject D-9341. Cause of death: multiple lacerations and severe blunt force trauma caused by an instance of SCP-049-2." + If prevFrame < 90 And n\Frame=>90 Then + If EntityDistance(n\Collider,Collider)<1.1 + If (Abs(DeltaYaw(n\Collider,Collider))<=60.0) + PlaySound_Strict DamageSFX(Rand(5,8)) + Injuries = Injuries+Rnd(0.4,1.0) + DeathMSG = "Subject D-9341. Cause of death: multiple lacerations and severe blunt force trauma caused by an instance of SCP-049-2." + EndIf + EndIf ElseIf n\Frame=132 Then n\State = 2 EndIf EndIf - + ;[End Block] End Select Else AnimateNPC(n, 133, 157, 0.5, False) @@ -2828,7 +2767,7 @@ Function UpdateNPCs() RotateEntity n\obj, EntityPitch(n\Collider), EntityYaw(n\Collider)-180.0, 0 ;[End Block] Case NPCtype5131 - ;[Block} + ;[Block] ;If KeyHit(48) Then n\Idle = True : n\State2 = 0 If PlayerRoom\RoomTemplate\Name <> "pocketdimension" Then @@ -3195,10 +3134,11 @@ Function UpdateNPCs() PositionEntity(n\Collider, EntityX(n\obj), EntityY(n\obj), EntityZ(n\obj)) If EntityDistance(n\obj, target) <0.3 Then - If TempSound2 <> 0 Then FreeSound_Strict TempSound2 : TempSound2 = 0 - TempSound2 = LoadSound_Strict("SFX\Character\Apache\Crash"+Rand(1,2)+".ogg") + ;If TempSound2 <> 0 Then FreeSound_Strict TempSound2 : TempSound2 = 0 + ;TempSound2 = LoadSound_Strict("SFX\Character\Apache\Crash"+Rand(1,2)+".ogg") CameraShake = Max(CameraShake, 3.0) - PlaySound_Strict TempSound2 + ;PlaySound_Strict TempSound2 + PlaySound_Strict LoadTempSound("SFX\Character\Apache\Crash"+Rand(1,2)+".ogg") n\State = 5 EndIf @@ -3228,7 +3168,10 @@ Function UpdateNPCs() AnimateNPC(n, 283, 389, 0.3, False) ;Animate2(n\obj, AnimTime(n\obj), 283, 389, 0.3, False) - If n\Frame>388 Then n\State = 1 + If n\Frame>388 Then + n\State = 1 + FreeSound_Strict n\Sound2 : n\Sound2 = 0 + EndIf Else If dist < 2.5 Then SetNPCFrame(n, 284) @@ -3240,12 +3183,17 @@ Function UpdateNPCs() ;attack 2, 32 ;idle 33, 174 Case 1 ;idle + If n\Sound2=0 Then + FreeSound_Strict n\Sound2 : n\Sound2=0 + n\Sound2 = LoadSound_Strict("SFX\Room\035Chamber\TentacleIdle.ogg") + EndIf + n\SoundChn2 = LoopSound2(n\Sound2,n\SoundChn2,Camera,n\Collider) + If dist < 1.8 Then If Abs(DeltaYaw(n\Collider, Collider))<20 Then n\State = 2 If n\Sound<>0 Then FreeSound_Strict n\Sound : n\Sound = 0 - If n\Sound2<>0 Then FreeSound_Strict n\Sound2 : n\Sound2 = 0 - + ;If n\Sound2<>0 Then FreeSound_Strict n\Sound2 : n\Sound2 = 0 EndIf EndIf @@ -3266,6 +3214,7 @@ Function UpdateNPCs() If n\Frame>33 Then ;SetAnimTime(n\obj,2) + If n\Sound2<>0 Then FreeSound_Strict n\Sound2 : n\Sound2 = 0 n\Frame = 2 n\Sound = LoadSound_Strict("SFX\Room\035Chamber\TentacleAttack"+Rand(1,2)+".ogg") PlaySound_Strict(n\Sound) @@ -3282,14 +3231,21 @@ Function UpdateNPCs() Else BlurTimer = 100 Injuries = Injuries+Rnd(1.0,1.5) - PlaySound_Strict DamageSFX(Rand(3,4)) + PlaySound_Strict DamageSFX(Rand(2,3)) - If Injuries > 3.0 Then - DeathMSG = Chr(34)+"We will need more than the regular cleaning team to care of this. " - DeathMSG = DeathMSG + "Two large and highly active tentacle-like appendages seem " - DeathMSG = DeathMSG + "to have formed inside the chamber. Their level of aggression is " - DeathMSG = DeathMSG + "unlike anything we've seen before - it looks like they have " - DeathMSG = DeathMSG + "beaten some unfortunate Class D to death at some point during the breach."+Chr(34) + If Injuries > 3.0 Then + If PlayerRoom\RoomTemplate\Name = "room2offices" Then + DeathMSG = Chr(34)+"One large and highly active tentacle-like appendage seems " + DeathMSG = DeathMSG + "to have grown outside the dead body of a scientist within office area [REDACTED]. Its level of aggression is " + DeathMSG = DeathMSG + "unlike anything we've seen before - it looks like it has " + DeathMSG = DeathMSG + "beaten some unfortunate Class D to death at some point during the breach."+Chr(34) + Else + DeathMSG = Chr(34)+"We will need more than the regular cleaning team to take care of this. " + DeathMSG = DeathMSG + "Two large and highly active tentacle-like appendages seem " + DeathMSG = DeathMSG + "to have formed inside the chamber. Their level of aggression is " + DeathMSG = DeathMSG + "unlike anything we've seen before - it looks like they have " + DeathMSG = DeathMSG + "beaten some unfortunate Class D to death at some point during the breach."+Chr(34) + EndIf Kill() EndIf EndIf @@ -4046,185 +4002,6 @@ Function UpdateNPCs() PositionEntity(n\obj, EntityX(n\Collider), EntityY(n\Collider) - 0.2, EntityZ(n\Collider)) RotateEntity n\obj, EntityPitch(n\Collider)-90, EntityYaw(n\Collider), 0 - ;[End Block] - Case NPCtype178 - ;[Block] - dist = EntityDistance(n\Collider,Collider) - - If n\Sound > 0 Then - temp = 0.5 - ;the ambient sound gets louder when the npcs are attacking - If n\State > 0 Then temp = 1.0 - - n\SoundChn = LoopSound2(n\Sound, n\SoundChn, Camera, Camera, 10.0,temp) - EndIf - - temp = Rnd(-1.0,1.0) - PositionEntity n\obj,EntityX(n\Collider,True)+n\PrevX*temp,EntityY(n\Collider,True)-0.2,EntityZ(n\Collider,True)+n\PrevZ*temp - RotateEntity n\obj,0.0,EntityYaw(n\Collider)-180,0.0 - - ;use the prev-values to do a "twitching" effect - n\PrevX = CurveValue(0.0, n\PrevX, 10.0) - n\PrevZ = CurveValue(0.0, n\PrevZ, 10.0) - - If Rand(200)=1 Then - If Rand(5)=1 Then - n\PrevX = (EntityX(Collider)-EntityX(n\Collider))*0.9 - n\PrevZ = (EntityZ(Collider)-EntityZ(n\Collider))*0.9 - Else - n\PrevX = Rnd(0.1,0.5) - n\PrevZ = Rnd(0.1,0.5) - EndIf - - EndIf - - If (Wearing178<>1) And (n\State3=0.0) Then - If n\State<=0 Then - ;nothing happens here... - Else - EntityAlpha n\obj,0.0 - n\State=Max(n\State-FPSfactor,0.0) - EndIf - Else - If n\State3=0.0 Then - EntityAlpha n\obj,0.5+(Float(Rand(0,1))/2.0) - Else - EntityAlpha n\obj,0.5+(Sin(n\Frame*6.0)/2.0) - EndIf - EndIf - - If n\State = 0 Then - If n\Reload = 0 Then - AnimateNPC(n, 206, 240, 0.1) - If n\Frame>=240 Then n\Reload = 1 - - ;Animate2(n\obj, AnimTime(n\obj), 206, 240, 0.1) - ;If AnimTime(n\obj)>=240 Then n\Reload = 1 - Else - AnimateNPC(n, 206, 240, -0.1) - If n\Frame<=206 Then n\Reload = 0 - - ;Animate2(n\obj, AnimTime(n\obj), 206, 240, -0.1) - ;If AnimTime(n\obj)<=206 Then n\Reload = 0 - EndIf - - ;If Rand(1,15)=1 Then EntityColor n\obj,Rand(0,50),0,Rand(50,100) - angle = VectorYaw(EntityX(Collider)-EntityX(n\Collider),0,EntityZ(Collider)-EntityZ(n\Collider)) - RotateEntity n\Collider,0.0,CurveAngle(angle,EntityYaw(n\Collider),20.0),0.0 - - For n2.NPCs = Each NPCs - If (n2\NPCtype=n\NPCtype) And (n<>n2) Then - If n2\State>0.0 Then n\State=1.0 - If n2\State3>0.0 Then n\State3=1.0 - ;if one of the npcs is hostile, make all of them hostile - EndIf - If n\State<>0 Then Exit - Next - If dist<1.0 And EntityInView(n\obj,Camera) Then - n\State2=n\State2+FPSfactor - ElseIf EntityCollided(n\Collider,HIT_PLAYER)=Collider Then - n\State2=50.0 - Else - n\State2=Max(n\State2-FPSfactor,0.0) - EndIf - If n\State2>=50.0 Then - n\State=1.0 - EndIf - EndIf - If n\State>0 Then - If n\State3=0 Then - For n2.NPCs = Each NPCs - If (n2\NPCtype=n\NPCtype) And (n<>n2) Then - If n2\State3>0.0 Then n\State3=1.0 - EndIf - If n\State3<>0 Then Exit - Next - EndIf - - ;If Rand(1,15)=1 Then EntityColor n\obj,Rand(50,100),0,Rand(0,50) - If (Wearing178=1) Or (n\State3>0) Then - n\State=Min(n\State+FPSfactor,300.0) - Else - n\State=Max(n\State-FPSfactor,0.0) - EndIf - If n\PathTimer <= 0 Then - n\PathStatus = FindPath (n, EntityX(Collider,True), EntityY(Collider,True), EntityZ(Collider,True)) - n\PathTimer = 40*10 - n\CurrSpeed = 0 - EndIf - n\PathTimer = Max(n\PathTimer-FPSfactor,0) - - If (Not EntityVisible(n\Collider,Collider)) Then - If n\PathStatus = 2 Then - n\CurrSpeed = 0 - n\Frame = 15 - ;SetAnimTime n\obj,15 - ElseIf n\PathStatus = 1 - If n\Path[n\PathLocation]=Null Then - If n\PathLocation > 19 Then - n\PathLocation = 0 : n\PathStatus = 0 - Else - n\PathLocation = n\PathLocation + 1 - EndIf - Else - angle = VectorYaw(EntityX(n\Path[n\PathLocation]\obj,True)-EntityX(n\Collider),0,EntityZ(n\Path[n\PathLocation]\obj,True)-EntityZ(n\Collider)) - RotateEntity n\Collider,0.0,CurveAngle(angle,EntityYaw(n\Collider),10.0),0.0 - - n\CurrSpeed = CurveValue(n\Speed,n\CurrSpeed,10.0) - - If EntityDistance(n\Collider,n\Path[n\PathLocation]\obj) < 0.2 Then - n\PathLocation = n\PathLocation + 1 - EndIf - EndIf - ElseIf n\PathStatus = 0 - ;SetAnimTime(n\obj,64) - n\CurrSpeed = CurveValue(0,n\CurrSpeed,10.0) - EndIf - Else - angle = VectorYaw(EntityX(Collider)-EntityX(n\Collider),0,EntityZ(Collider)-EntityZ(n\Collider)) - RotateEntity n\Collider,0.0,CurveAngle(angle,EntityYaw(n\Collider),10.0),0.0 - - n\CurrSpeed = CurveValue(n\Speed,n\CurrSpeed,10.0) - EndIf - - If dist>0.3 Then - MoveEntity n\Collider, 0, 0, n\CurrSpeed * FPSfactor - AnimateNPC(n, 64, 91, n\CurrSpeed*10.0) - ;Animate2(n\obj, AnimTime(n\obj), 64, 91, n\CurrSpeed*10.0) - - For d.Doors = Each Doors - If (EntityDistance(n\Collider,d\obj)<1.25) And (d\Code<>"GEAR") And (EntityCollided(n\Collider,HIT_178)=0) Then - n\DropSpeed=0 - ResetEntity n\Collider - EndIf - Next - EndIf - If dist<0.4 Then - ;Animate2(n\obj, AnimTime(n\obj), 122, 172, 0.2, False) - If (n\State2>=65.0) And (KillTimer>=0) Then - Injuries=Injuries+Rnd(0.4,0.8) - If Injuries>=4.0 Then - If n\State3=0.0 Then - DeathMSG = "A Class D subject wearing SCP-178 was found dead in [REDACTED]. " - DeathMSG = DeathMSG + "Presumed to be killed by the " - DeathMSG = DeathMSG + "effects of SCP-178." - Else - DeathMSG = "Several bipedal entities of unknown origin were found in Site-[REDACTED]. " - DeathMSG = DeathMSG + "Testing reveals that these entities behave similarly to those " - DeathMSG = DeathMSG + "seen when using SCP-178. It is unknown at the current time " - DeathMSG = DeathMSG + "whether SCP-178 and these entities are related." - EndIf - Kill() - EndIf - PlaySound_Strict DamageSFX(Rand(2,3)) - n\State2=0.0 - Else - n\State2=n\State2+FPSfactor - EndIf - EndIf - - EndIf - ;[End Block] Case NPCtype966 ;[Block] @@ -4566,109 +4343,265 @@ Function UpdateNPCs() ;[Block] ;n\State: Current State of the NPC ;n\State2: A second state variable (dependend on the current NPC's n\State) + ;n\State3: Determines if the NPC will always be aggressive against the player + ;n\PrevState: Determines the type/behaviour of the NPC + ; 0 = Normal / Citizen + ; 1 = Stair guard / Guard next to king + ; 2 = King + ; 3 = Front guard prevFrame# = n\Frame - If (Not n\Idle) And EntityDistance(n\Collider,Collider) n - If n2\State <> 0 And n2\State <> 2 - n\State = 1 - n\State2 = 0 - Exit + If (Not n\Idle) And EntityDistance(n\Collider,Collider) n Then + If n2\State <> 0 And n2\State <> 2 Then + If n2\PrevState = 0 Then + n\State = 1 + n\State2 = 0 + Exit + EndIf + EndIf EndIf - EndIf - Next + Next + EndIf EndIf Select n\State Case 0 - If n\CurrSpeed = 0.0 - If n\State2 < 500.0*Rnd(1,3) - n\CurrSpeed = 0.0 - n\State2 = n\State2 + FPSfactor + ;[Block] + If n\PrevState=0 Then + If n\CurrSpeed = 0.0 Then + If n\Reload=0 Then + If n\State2 < 500.0*Rnd(1,3) Then + n\CurrSpeed = 0.0 + n\State2 = n\State2 + FPSfactor + Else + If n\CurrSpeed = 0.0 Then n\CurrSpeed = n\CurrSpeed + 0.0001 + EndIf + Else + If n\State2 < 1500 Then + n\CurrSpeed = 0.0 + n\State2 = n\State2 + FPSfactor + Else + If n\Target <> Null Then + If n\Target\Target <> Null Then + n\Target\Target = Null + EndIf + n\Target\Reload = 0 + n\Target\Angle = n\Target\Angle+Rnd(-45,45) + n\Target = Null + n\Reload = 0 + n\Angle = n\Angle+Rnd(-45,45) + EndIf + If n\CurrSpeed = 0.0 Then n\CurrSpeed = n\CurrSpeed + 0.0001 + EndIf + EndIf Else - If n\CurrSpeed = 0.0 Then n\CurrSpeed = n\CurrSpeed + 0.0001 + If n\Target<>Null Then + n\State2 = 0.0 + EndIf + + If n\State2 < 10000.0*Rnd(1,3) + n\CurrSpeed = CurveValue(n\Speed,n\CurrSpeed,10.0) + n\State2 = n\State2 + FPSfactor + Else + n\CurrSpeed = CurveValue(0.0,n\CurrSpeed,50.0) + EndIf + + RotateEntity n\Collider,0,CurveAngle(n\Angle,EntityYaw(n\Collider),10.0),0 + + If n\Target=Null Then + If Rand(200) = 1 Then n\Angle = n\Angle + Rnd(-45,45) + + HideEntity n\Collider + EntityPick(n\Collider, 1.5) + If PickedEntity() <> 0 Then + n\Angle = EntityYaw(n\Collider)+Rnd(80,110) + EndIf + ShowEntity n\Collider + Else + n\Angle = EntityYaw(n\Collider) + DeltaYaw(n\Collider,n\Target\Collider) + If EntityDistance(n\Collider,n\Target\Collider)<1.5 Then + n\CurrSpeed = 0.0 + n\Target\CurrSpeed = 0.0 + n\Reload = 1 + n\Target\Reload = 1 + temp = Rand(0,2) + If temp=0 Then + SetNPCFrame(n,296) + ElseIf temp=1 Then + SetNPCFrame(n,856) + Else + SetNPCFrame(n,905) + EndIf + temp = Rand(0,2) + If temp=0 Then + SetNPCFrame(n\Target,296) + ElseIf temp=1 Then + SetNPCFrame(n\Target,856) + Else + SetNPCFrame(n\Target,905) + EndIf + EndIf + EndIf EndIf Else - If n\State2 < 10000.0*Rnd(1,3) - n\CurrSpeed = CurveValue(n\Speed,n\CurrSpeed,10.0) - n\State2 = n\State2 + FPSfactor - Else - n\CurrSpeed = CurveValue(0.0,n\CurrSpeed,50.0) - EndIf - RotateEntity n\Collider,0,CurveAngle(n\Angle,EntityYaw(n\Collider),10.0),0 - - If Rand(200) = 1 Then n\Angle = n\Angle + Rnd(-45,45) - - HideEntity n\Collider - EntityPick(n\Collider, 1.5) - If PickedEntity() <> 0 Then - n\Angle = EntityYaw(n\Collider)+Rnd(80,110) - EndIf - ShowEntity n\Collider EndIf If n\CurrSpeed = 0.0 - AnimateNPC(n,296,317,0.2) + If n\Reload = 0 And n\PrevState<>2 Then + AnimateNPC(n,296,320,0.2) + ElseIf n\Reload = 0 And n\PrevState=2 Then + ;509-533 + ;534-601 + If n\Frame <= 532.5 Then + AnimateNPC(n,509,533,0.2,False) + ElseIf n\Frame > 533.5 And n\Frame <= 600.5 Then + AnimateNPC(n,534,601,0.2,False) + Else + temp = Rand(0,1) + If temp=0 Then + SetNPCFrame(n,509) + Else + SetNPCFrame(n,534) + EndIf + EndIf + ;SetNPCFrame(n,855) + Else + If n\PrevState=2 Then + AnimateNPC(n,713,855,0.2,False) + If n\Frame > 833.5 Then + PointEntity n\obj,Collider + RotateEntity n\Collider,0,CurveAngle(n\Angle,EntityYaw(n\Collider),10.0),0 + EndIf + ElseIf n\PrevState=1 Then + AnimateNPC(n,602,712,0.2,False) + If n\Frame > 711.5 Then + n\Reload = 0 + EndIf + Else + If n\Frame <= 319.5 Then + AnimateNPC(n,296,320,0.2,False) + ;856-904 + ElseIf n\Frame > 320.5 And n\Frame < 903.5 Then + AnimateNPC(n,856,904,0.2,False) + ;905-953 + ElseIf n\Frame > 904.5 And n\Frame < 952.5 Then + AnimateNPC(n,905,953,0.2,False) + Else + temp = Rand(0,2) + If temp=0 Then + SetNPCFrame(n,296) + ElseIf temp=1 Then + SetNPCFrame(n,856) + Else + SetNPCFrame(n,905) + EndIf + EndIf + EndIf + EndIf Else If (n\ID Mod 2 = 0) Then AnimateNPC(n,1,62,(n\CurrSpeed*28)) Else AnimateNPC(n,100,167,(n\CurrSpeed*28)) EndIf + If n\PrevState = 0 Then + If n\Target = Null Then + If Rand(1,1200)=1 Then + For n2.NPCs = Each NPCs + If n2<>n Then + If n2\NPCtype=n\NPCtype Then + If n2\Target = Null Then + If n2\PrevState=0 Then + If EntityDistance(n\Collider,n2\Collider)<20.0 Then + n\Target = n2 + n2\Target = n + n\Target\CurrSpeed = n\Target\CurrSpeed + 0.0001 + Exit + EndIf + EndIf + EndIf + EndIf + EndIf + Next + EndIf + EndIf + EndIf EndIf ;randomly play the "screaming animation" and revert back to state 0 - If (Rand(5000)=1) Then - n\State = 2 - n\State2 = 0 + If n\Target=Null And n\PrevState=0 Then + If (Rand(5000)=1) Then + n\State = 2 + n\State2 = 0 + + If Not ChannelPlaying(n\SoundChn) Then + dist = EntityDistance(n\Collider,Collider) + If (dist < 20.0) Then + If n\Sound <> 0 Then FreeSound_Strict n\Sound : n\Sound = 0 + n\Sound = LoadSound_Strict("SFX\SCP\1499\Idle"+Rand(1,4)+".ogg") + n\SoundChn = PlaySound2(n\Sound, Camera, n\Collider, 20.0) + EndIf + EndIf + EndIf - If Not ChannelPlaying(n\SoundChn) Then + If (n\ID Mod 2 = 0) And (Not NoTarget) Then dist = EntityDistance(n\Collider,Collider) - If (dist < 20.0) Then - If n\Sound <> 0 Then FreeSound_Strict n\Sound : n\Sound = 0 - n\Sound = LoadSound_Strict("SFX\SCP\1499\Idle"+Rand(1,4)+".ogg") - n\SoundChn = PlaySound2(n\Sound, Camera, n\Collider, 20.0) + If dist < 10.0 Then + If EntityVisible(n\Collider,Collider) Then + ;play the "screaming animation" + n\State = 2 + If dist < 5.0 Then + If n\Sound <> 0 Then FreeSound_Strict n\Sound : n\Sound = 0 + n\Sound = LoadSound_Strict("SFX\SCP\1499\Triggered.ogg") + n\SoundChn = PlaySound2(n\Sound, Camera, n\Collider,20.0) + + n\State2 = 1 ;if player is too close, switch to attack after screaming + + For n2.NPCs = Each NPCs + ;If n2\NPCtype = n\NPCtype And n2 <> n And (n\ID Mod 2 = 0) Then + If n2\NPCtype = n\NPCtype And n2 <> n + If n2\PrevState = 0 Then + n2\State = 1 + n2\State2 = 0 + EndIf + EndIf + Next + Else + n\State2 = 0 ;otherwise keep idling + EndIf + + n\Frame = 203 + EndIf EndIf EndIf - EndIf - - If (n\ID Mod 2 = 0) And (Not NoTarget) Then + ElseIf n\PrevState=1 Then dist = EntityDistance(n\Collider,Collider) - If dist < 10.0 Then - If EntityVisible(n\Collider,Collider) Then - ;play the "screaming animation" - n\State = 2 - If dist < 5.0 Then + If (Not NoTarget) Then + If dist < 4.0 Then + If EntityVisible(n\Collider,Collider) Then If n\Sound <> 0 Then FreeSound_Strict n\Sound : n\Sound = 0 n\Sound = LoadSound_Strict("SFX\SCP\1499\Triggered.ogg") n\SoundChn = PlaySound2(n\Sound, Camera, n\Collider,20.0) - n\State2 = 1 ;if player is too close, switch to attack after screaming + n\State = 1 - For n2.NPCs = Each NPCs - ;If n2\NPCtype = n\NPCtype And n2 <> n And (n\ID Mod 2 = 0) Then - If n2\NPCtype = n\NPCtype And n2 <> n - n2\State = 1 - n2\State2 = 0 - EndIf - Next - Else - n\State2 = 0 ;otherwise keep idling + n\Frame = 203 EndIf - - n\Frame = 203 EndIf EndIf EndIf + ;[End Block] Case 1 ;attacking the player + ;[Block] If NoTarget Then n\State = 0 - If PlayerRoom\RoomTemplate\Name = "dimension1499" - If Music(19)=0 Then Music(19) = LoadSound_Strict("SFX\Music\1499Danger.ogg") + If PlayerRoom\RoomTemplate\Name = "dimension1499" And n\PrevState=0 Then ShouldPlay = 19 EndIf @@ -4678,7 +4611,14 @@ Function UpdateNPCs() dist = EntityDistance(n\Collider,Collider) If n\State2 = 0.0 - n\CurrSpeed = CurveValue(n\Speed*1.75,n\CurrSpeed,10.0) + If n\PrevState=1 Then + n\CurrSpeed = CurveValue(n\Speed*2.0,n\CurrSpeed,10.0) + If n\Target<>Null Then + n\Target\State = 1 + EndIf + Else + n\CurrSpeed = CurveValue(n\Speed*1.75,n\CurrSpeed,10.0) + EndIf If (n\ID Mod 2 = 0) Then AnimateNPC(n,1,62,(n\CurrSpeed*28)) @@ -4688,7 +4628,7 @@ Function UpdateNPCs() EndIf If dist < 0.75 - If (n\ID Mod 2 = 0) Or n\State3 = 1 + If (n\ID Mod 2 = 0) Or n\State3 = 1 Or n\PrevState=1 Or n\PrevState=3 Or n\PrevState=4 Then n\State2 = Rand(1,2) n\State = 3 If n\State2 = 1 @@ -4700,14 +4640,18 @@ Function UpdateNPCs() n\State = 4 EndIf EndIf + ;[End Block] Case 2 ;play the "screaming animation" and switch to n\state2 after it's finished + ;[Block] n\CurrSpeed = 0.0 AnimateNPC(n,203,295,0.1,False) If n\Frame > 294.0 Then n\State = n\State2 EndIf + ;[End Block] Case 3 ;slashing at the player + ;[Block] n\CurrSpeed = CurveValue(0.0,n\CurrSpeed,5.0) dist = EntityDistance(n\Collider,Collider) If n\State2 = 1 @@ -4761,10 +4705,12 @@ Function UpdateNPCs() n\State = 1 EndIf EndIf + ;[End Block] Case 4 ;standing in front of the player + ;[Block] dist = EntityDistance(n\Collider,Collider) n\CurrSpeed = CurveValue(0.0,n\CurrSpeed,5.0) - AnimateNPC(n,296,317,0.2) + AnimateNPC(n,296,320,0.2) PointEntity n\obj,Collider RotateEntity n\Collider,0,CurveAngle(EntityYaw(n\obj),EntityYaw(n\Collider),20.0),0 @@ -4772,6 +4718,7 @@ Function UpdateNPCs() If dist > 0.85 n\State = 1 EndIf + ;[End Block] End Select If n\SoundChn <> 0 And ChannelPlaying(n\SoundChn) Then @@ -5124,18 +5071,12 @@ Function TeleportCloser(n.NPCs) If xtemp < 10.0 And xtemp > 1.0 Then ztemp = Abs(EntityZ(w\obj,True)-EntityZ(n\Collider,True)) If ztemp < 10.0 And ztemp > 1.0 Then - If (EntityDistance(Collider, w\obj)>8) Then - If (SelectedDifficulty\aggressiveNPCs)Then - ;teleports to the nearby waypoint that takes it closest to the player - Local newDist# = EntityDistance(Collider, w\obj) - If (newDist < closestDist Or closestWaypoint = Null) Then - closestDist = newDist - closestWaypoint = w - EndIf - Else - ;just teleports to the first nearby waypoint it finds + If (EntityDistance(Collider, w\obj)>16-(8*SelectedDifficulty\aggressiveNPCs)) Then + ;teleports to the nearby waypoint that takes it closest to the player + Local newDist# = EntityDistance(Collider, w\obj) + If (newDist < closestDist Or closestWaypoint = Null) Then + closestDist = newDist closestWaypoint = w - Exit EndIf EndIf EndIf @@ -5144,8 +5085,13 @@ Function TeleportCloser(n.NPCs) Next If (closestWaypoint<>Null) Then - PositionEntity n\Collider, EntityX(closestWaypoint\obj,True), EntityY(closestWaypoint\obj,True)+0.15, EntityZ(closestWaypoint\obj,True), True - ResetEntity n\Collider + If n\InFacility <> 1 Or n\InFacility = InFacility Or SelectedDifficulty\aggressiveNPCs Then + PositionEntity n\Collider, EntityX(closestWaypoint\obj,True), EntityY(closestWaypoint\obj,True)+0.15, EntityZ(closestWaypoint\obj,True), True + ResetEntity n\Collider + n\PathStatus = 0 + n\PathTimer# = 0.0 + n\PathLocation = 0 + EndIf EndIf End Function @@ -5254,8 +5200,6 @@ Function UpdateMTFUnit(n.NPCs) realType = "939" Case NPCtype066 realType = "066" - Case NPCtype178 - realType = "178" Case NPCtypePdPlane realType = "PDPlane" Case NPCtype966 @@ -5279,6 +5223,9 @@ Function UpdateMTFUnit(n.NPCs) If n\IsDead Then n\BlinkTimer = -1.0 SetNPCFrame(n, 532) + If ChannelPlaying(n\SoundChn2) Then + StopChannel(n\SoundChn2) + EndIf Return EndIf @@ -5307,6 +5254,8 @@ Function UpdateMTFUnit(n.NPCs) If Int(n\State) <> 1 Then n\PrevState = 0 + n\SoundChn2 = LoopSound2(MTFSFX(6),n\SoundChn2,Camera,n\Collider) + If n\Idle>0.0 Then FinishWalking(n,488,522,0.015*26) n\Idle=n\Idle-FPSfactor @@ -6674,7 +6623,9 @@ Function UpdateMTFUnit(n.NPCs) EndIf SetNPCFrame(n\Target,133) n\Target\IsDead = True + n\Target = Null n\State = 0 + Return EndIf n\Reload = 7 @@ -6747,6 +6698,11 @@ Function UpdateMTFUnit(n.NPCs) EndIf EndIf + If n\Target\IsDead = True Then + n\Target = Null + n\State = 0 + EndIf + ;[End Block] End Select @@ -7078,12 +7034,6 @@ Function Console_SpawnNPC(c_input$, c_state$ = "") Curr173 = n If (Curr173\Idle = 3) Then Curr173\Idle = False consoleMSG = "SCP-173 spawned." - - Case "178-1", "1781", "scp-178-1", "scp178-1" - n.NPCs = CreateNPC(NPCtype178, EntityX(Collider), EntityY(Collider) + 0.2, EntityZ(Collider)) - consoleMSG = "SCP-178-1 instance spawned." - CreateConsoleMsg("SCP-178-1 instances will be invisible unless you equip SCP-178.", 255, 255, 0) - Case "372", "scp372", "scp-372" n.NPCs = CreateNPC(NPCtype372, EntityX(Collider), EntityY(Collider) + 0.2, EntityZ(Collider)) consoleMSG = "SCP-372 spawned." diff --git a/Particles.bb b/Particles.bb index 94b4cab77..526b746e8 100644 --- a/Particles.bb +++ b/Particles.bb @@ -155,8 +155,7 @@ Function UpdateEmitters() EyeIrritation=EyeIrritation+FPSfactor * 4 EndIf -End Function - +End Function Function CreateEmitter.Emitters(x#, y#, z#, emittertype%) Local e.Emitters = New Emitters diff --git a/RMesh_Model_Viewer.bb b/RMesh_Model_Viewer.bb index ed3a2b662..3901abd0b 100644 --- a/RMesh_Model_Viewer.bb +++ b/RMesh_Model_Viewer.bb @@ -63,7 +63,7 @@ Function writemesh(mesh,e_filename$) If Instr(l$,"//Exported By") headerwrite=0 Else l$=ReadLine(rfile) - If Instr (l$,"//") Then l$=usv(ReadLine(rfile),1,"//") + If Instr (l$,"//") Then l$=USV(ReadLine(rfile),1,"//") l$=Trim(l$) WriteLine wfile,l$ ;dat$=dat$+l$ @@ -160,7 +160,7 @@ End Function Function GetStringofMatElement$(mesh,x,y) me$=GetMatElement(mesh,x,y) - dp$=usv(me$,2,".") + dp$=USV(me$,2,".") final$=me$ If Len(dp$)=0 final$=me$+"000000" @@ -194,10 +194,10 @@ Function RecursiveAddMesh(h,basescaleX#=1,basescaleY#=1,basescaleZ#=1) WriteLine XE_XF," Frame "+ChiName$+" {" WriteLine XE_XF," FrameTransformMatrix {" - WriteLine XE_XF," "+GetStringOfMatElement(mesh,0,0)+","+GetStringOfMatElement(mesh,0,1)+","+GetStringOfMatElement(mesh,0,2)+",0.000000," - WriteLine XE_XF," "+GetStringOfMatElement(mesh,1,0)+","+GetStringOfMatElement(mesh,1,1)+","+GetStringOfMatElement(mesh,1,2)+",0.000000," - WriteLine XE_XF," "+GetStringOfMatElement(mesh,2,0)+","+GetStringOfMatElement(mesh,2,1)+","+GetStringOfMatElement(mesh,2,2)+",0.000000," - WriteLine XE_XF," "+GetStringOfMatElement(mesh,3,0)+","+GetStringOfMatElement(mesh,3,1)+","+GetStringOfMatElement(mesh,3,2)+",1.000000;;" + WriteLine XE_XF," "+GetStringofMatElement(mesh,0,0)+","+GetStringofMatElement(mesh,0,1)+","+GetStringofMatElement(mesh,0,2)+",0.000000," + WriteLine XE_XF," "+GetStringofMatElement(mesh,1,0)+","+GetStringofMatElement(mesh,1,1)+","+GetStringofMatElement(mesh,1,2)+",0.000000," + WriteLine XE_XF," "+GetStringofMatElement(mesh,2,0)+","+GetStringofMatElement(mesh,2,1)+","+GetStringofMatElement(mesh,2,2)+",0.000000," + WriteLine XE_XF," "+GetStringofMatElement(mesh,3,0)+","+GetStringofMatElement(mesh,3,1)+","+GetStringofMatElement(mesh,3,2)+",1.000000;;" WriteLine XE_XF," }" @@ -350,11 +350,11 @@ Function USV$(in$,which%=1,sep$=",") End If - valueret$ = Mid$(in$,offset+1,nextoffset-offset-1) + ValueRet$ = Mid$(in$,offset+1,nextoffset-offset-1) If which = n - Return valueret + Return ValueRet End If @@ -666,6 +666,7 @@ Function LoadRMesh(file$) If isAlpha=1 Then AddMesh childMesh,Alpha + EntityAlpha childMesh,0.0 Else AddMesh childMesh,Opaque EntityParent childMesh,collisionMeshes diff --git a/SFX/Alarm/Alarm2_10.ogg b/SFX/Alarm/Alarm2_10.ogg index 0d0c4ec7b..3acf056bf 100644 Binary files a/SFX/Alarm/Alarm2_10.ogg and b/SFX/Alarm/Alarm2_10.ogg differ diff --git a/SFX/Alarm/Alarm2_11.ogg b/SFX/Alarm/Alarm2_11.ogg new file mode 100644 index 000000000..d480772ab Binary files /dev/null and b/SFX/Alarm/Alarm2_11.ogg differ diff --git a/SFX/Alarm/Alarm4.ogg b/SFX/Alarm/Alarm4.ogg new file mode 100644 index 000000000..0a0082229 Binary files /dev/null and b/SFX/Alarm/Alarm4.ogg differ diff --git a/SFX/Alarm/Alarm5.ogg b/SFX/Alarm/Alarm5.ogg new file mode 100644 index 000000000..5d2edd449 Binary files /dev/null and b/SFX/Alarm/Alarm5.ogg differ diff --git a/SFX/Ambient/Zone1/Ambient10.ogg b/SFX/Ambient/Zone1/Ambient10.ogg new file mode 100644 index 000000000..f3bf1dcd0 Binary files /dev/null and b/SFX/Ambient/Zone1/Ambient10.ogg differ diff --git a/SFX/Ambient/Zone1/Ambient11.ogg b/SFX/Ambient/Zone1/Ambient11.ogg new file mode 100644 index 000000000..d9bfa10a9 Binary files /dev/null and b/SFX/Ambient/Zone1/Ambient11.ogg differ diff --git a/SFX/Ambient/Zone1/Ambient9.ogg b/SFX/Ambient/Zone1/Ambient9.ogg new file mode 100644 index 000000000..b891d61dc Binary files /dev/null and b/SFX/Ambient/Zone1/Ambient9.ogg differ diff --git a/SFX/Door/ElevatorClose1.ogg b/SFX/Door/ElevatorClose1.ogg new file mode 100644 index 000000000..7e332e918 Binary files /dev/null and b/SFX/Door/ElevatorClose1.ogg differ diff --git a/SFX/Door/ElevatorClose2.ogg b/SFX/Door/ElevatorClose2.ogg new file mode 100644 index 000000000..eb0070e19 Binary files /dev/null and b/SFX/Door/ElevatorClose2.ogg differ diff --git a/SFX/Door/ElevatorClose3.ogg b/SFX/Door/ElevatorClose3.ogg new file mode 100644 index 000000000..ffe053d8b Binary files /dev/null and b/SFX/Door/ElevatorClose3.ogg differ diff --git a/SFX/Door/ElevatorOpen1.ogg b/SFX/Door/ElevatorOpen1.ogg new file mode 100644 index 000000000..7c463ddc0 Binary files /dev/null and b/SFX/Door/ElevatorOpen1.ogg differ diff --git a/SFX/Door/ElevatorOpen2.ogg b/SFX/Door/ElevatorOpen2.ogg new file mode 100644 index 000000000..26e96bb74 Binary files /dev/null and b/SFX/Door/ElevatorOpen2.ogg differ diff --git a/SFX/Door/ElevatorOpen3.ogg b/SFX/Door/ElevatorOpen3.ogg new file mode 100644 index 000000000..d3aefeba5 Binary files /dev/null and b/SFX/Door/ElevatorOpen3.ogg differ diff --git a/SFX/Ending/GateB/682Battle.ogg b/SFX/Ending/GateB/682Battle.ogg index 6c6ba9ed4..5d479b409 100644 Binary files a/SFX/Ending/GateB/682Battle.ogg and b/SFX/Ending/GateB/682Battle.ogg differ diff --git a/SFX/General/Elevator/Moving.ogg b/SFX/General/Elevator/Moving.ogg index ff22bffc8..6b5e8a907 100644 Binary files a/SFX/General/Elevator/Moving.ogg and b/SFX/General/Elevator/Moving.ogg differ diff --git a/SFX/Music/HaveMercyOnMe(Choir).ogg b/SFX/Music/HaveMercyOnMe(Choir).ogg new file mode 100644 index 000000000..491f7a6fc Binary files /dev/null and b/SFX/Music/HaveMercyOnMe(Choir).ogg differ diff --git a/SFX/Music/HaveMercyOnMe(NoChoir).ogg b/SFX/Music/HaveMercyOnMe(NoChoir).ogg new file mode 100644 index 000000000..d4eb86a7a Binary files /dev/null and b/SFX/Music/HaveMercyOnMe(NoChoir).ogg differ diff --git a/SFX/Music/SaveMeFrom.ogg b/SFX/Music/SaveMeFrom.ogg new file mode 100644 index 000000000..077f2d159 Binary files /dev/null and b/SFX/Music/SaveMeFrom.ogg differ diff --git a/SFX/Music/thumbs.db b/SFX/Music/thumbs.db deleted file mode 100644 index 6434bb50d..000000000 Binary files a/SFX/Music/thumbs.db and /dev/null differ diff --git a/SFX/Room/895Chamber/GuardIdle1.ogg b/SFX/Room/895Chamber/GuardIdle1.ogg new file mode 100644 index 000000000..fc1ae18ce Binary files /dev/null and b/SFX/Room/895Chamber/GuardIdle1.ogg differ diff --git a/SFX/Room/895Chamber/GuardIdle2.ogg b/SFX/Room/895Chamber/GuardIdle2.ogg new file mode 100644 index 000000000..28233332f Binary files /dev/null and b/SFX/Room/895Chamber/GuardIdle2.ogg differ diff --git a/SFX/Room/895Chamber/GuardIdle3.ogg b/SFX/Room/895Chamber/GuardIdle3.ogg new file mode 100644 index 000000000..b9ae64523 Binary files /dev/null and b/SFX/Room/895Chamber/GuardIdle3.ogg differ diff --git a/SFX/Room/895Chamber/GuardRadio.ogg b/SFX/Room/895Chamber/GuardRadio.ogg new file mode 100644 index 000000000..2666cf37b Binary files /dev/null and b/SFX/Room/895Chamber/GuardRadio.ogg differ diff --git a/SFX/Room/895Chamber/GuardScream1.ogg b/SFX/Room/895Chamber/GuardScream1.ogg new file mode 100644 index 000000000..5d03083f4 Binary files /dev/null and b/SFX/Room/895Chamber/GuardScream1.ogg differ diff --git a/SFX/Room/895Chamber/GuardScream2.ogg b/SFX/Room/895Chamber/GuardScream2.ogg new file mode 100644 index 000000000..5f1fd3888 Binary files /dev/null and b/SFX/Room/895Chamber/GuardScream2.ogg differ diff --git a/SFX/Room/895Chamber/GuardScream3.ogg b/SFX/Room/895Chamber/GuardScream3.ogg new file mode 100644 index 000000000..b55139637 Binary files /dev/null and b/SFX/Room/895Chamber/GuardScream3.ogg differ diff --git a/SFX/Room/Blackout.ogg b/SFX/Room/Blackout.ogg new file mode 100644 index 000000000..e13c0a20b Binary files /dev/null and b/SFX/Room/Blackout.ogg differ diff --git a/SFX/Room/Intro/Commotion/Commotion24.ogg b/SFX/Room/Intro/Commotion/Commotion24.ogg new file mode 100644 index 000000000..008d85e60 Binary files /dev/null and b/SFX/Room/Intro/Commotion/Commotion24.ogg differ diff --git a/SFX/Room/Intro/Commotion/Commotion25.ogg b/SFX/Room/Intro/Commotion/Commotion25.ogg new file mode 100644 index 000000000..1710c752a Binary files /dev/null and b/SFX/Room/Intro/Commotion/Commotion25.ogg differ diff --git a/SFX/Room/Intro/Guard/Ulgrin/OhAndByTheWay.ogg b/SFX/Room/Intro/Guard/Ulgrin/OhAndByTheWay.ogg new file mode 100644 index 000000000..c397fd156 Binary files /dev/null and b/SFX/Room/Intro/Guard/Ulgrin/OhAndByTheWay.ogg differ diff --git a/SFX/SCP/079/GateB.ogg b/SFX/SCP/079/GateB.ogg index 39d04355c..774985da0 100644 Binary files a/SFX/SCP/079/GateB.ogg and b/SFX/SCP/079/GateB.ogg differ diff --git a/SFX/SCP/096/ElevatorSlam.ogg b/SFX/SCP/096/ElevatorSlam.ogg new file mode 100644 index 000000000..b10ffe94f Binary files /dev/null and b/SFX/SCP/096/ElevatorSlam.ogg differ diff --git a/SFX/SCP/106/WallDecay1.ogg b/SFX/SCP/106/WallDecay1.ogg new file mode 100644 index 000000000..56bdff733 Binary files /dev/null and b/SFX/SCP/106/WallDecay1.ogg differ diff --git a/SFX/SCP/106/WallDecay2.ogg b/SFX/SCP/106/WallDecay2.ogg new file mode 100644 index 000000000..7efbb74d8 Binary files /dev/null and b/SFX/SCP/106/WallDecay2.ogg differ diff --git a/SFX/SCP/106/WallDecay3.ogg b/SFX/SCP/106/WallDecay3.ogg new file mode 100644 index 000000000..6c63f3b69 Binary files /dev/null and b/SFX/SCP/106/WallDecay3.ogg differ diff --git a/SFX/SCP/294/coin_drop.ogg b/SFX/SCP/294/coin_drop.ogg new file mode 100644 index 000000000..434951820 Binary files /dev/null and b/SFX/SCP/294/coin_drop.ogg differ diff --git a/SFX/SCP/427/Effect.ogg b/SFX/SCP/427/Effect.ogg new file mode 100644 index 000000000..ae0d9bc8c Binary files /dev/null and b/SFX/SCP/427/Effect.ogg differ diff --git a/SFX/SCP/427/Transform.ogg b/SFX/SCP/427/Transform.ogg new file mode 100644 index 000000000..7bb47487b Binary files /dev/null and b/SFX/SCP/427/Transform.ogg differ diff --git a/SFX/SCP/914/DoorClose.ogg b/SFX/SCP/914/DoorClose.ogg new file mode 100644 index 000000000..dc76bf7b0 Binary files /dev/null and b/SFX/SCP/914/DoorClose.ogg differ diff --git a/SFX/SCP/914/DoorOpen.ogg b/SFX/SCP/914/DoorOpen.ogg new file mode 100644 index 000000000..705909267 Binary files /dev/null and b/SFX/SCP/914/DoorOpen.ogg differ diff --git a/SFX/SCP/914/Refining.ogg b/SFX/SCP/914/Refining.ogg index 339347572..acfaedd6f 100644 Binary files a/SFX/SCP/914/Refining.ogg and b/SFX/SCP/914/Refining.ogg differ diff --git a/SFX/SCP/970/thumbs.db b/SFX/SCP/970/thumbs.db deleted file mode 100644 index 4d9e47cfc..000000000 Binary files a/SFX/SCP/970/thumbs.db and /dev/null differ diff --git a/Save.bb b/Save.bb index 922b95970..a8f41375f 100644 --- a/Save.bb +++ b/Save.bb @@ -92,7 +92,6 @@ Function SaveGame(file$) WriteByte f, WearingVest WriteByte f, WearingHazmat - WriteByte f, Wearing178 WriteByte f, WearingNightVision WriteByte f, Wearing1499 WriteFloat f,NTF_1499PrevX# @@ -129,8 +128,8 @@ Function SaveGame(file$) WriteInt f, MapWidth WriteInt f, MapHeight For lvl = 0 To 0 - For x = 0 To MapWidth - 1 - For y = 0 To MapHeight - 1 + For x = 0 To MapWidth + For y = 0 To MapHeight WriteInt f, MapTemp(x, y) WriteByte f, MapFound(x, y) Next @@ -271,7 +270,11 @@ Function SaveGame(file$) If r\fr=Null Then ;this room doesn't have a forest WriteByte(f,0) Else ;this room has a forest - WriteByte(f,1) + If (Not I_Zone\HasCustomForest) Then + WriteByte(f,1) + Else + WriteByte(f,2) + EndIf For y=0 To gridsize-1 For x=0 To gridsize-1 WriteByte(f,r\fr\grid[x+(y*gridsize)]) @@ -329,13 +332,13 @@ Function SaveGame(file$) For d.Decals = Each Decals WriteInt f, d\ID - WriteFloat f, d\x - WriteFloat f, d\y - WriteFloat f, d\z + WriteFloat f, EntityX(d\obj,True) + WriteFloat f, EntityY(d\obj,True) + WriteFloat f, EntityZ(d\obj,True) - WriteFloat f, d\pitch - WriteFloat f, d\yaw - WriteFloat f, d\roll + WriteFloat f, EntityPitch(d\obj,True) + WriteFloat f, EntityYaw(d\obj,True) + WriteFloat f, EntityRoll(d\obj,True) WriteByte f, d\blendmode WriteInt f, d\fx @@ -438,6 +441,14 @@ Function SaveGame(file$) EndIf WriteFloat f, CameraFogFar WriteFloat f, StoredCameraFogFar + WriteByte f, I_427\Using + WriteFloat f, I_427\Timer + WriteByte f, I_Zone\Transition[0] + WriteByte f, I_Zone\Transition[1] + WriteByte f, I_Zone\HasCustomForest + WriteByte f, I_Zone\HasCustomMT + + WriteByte f, Wearing714 CloseFile f If Not MenuOpen Then @@ -546,7 +557,6 @@ Function LoadGame(file$) WearingVest = ReadByte(f) WearingHazmat = ReadByte(f) - Wearing178 = ReadByte(f) WearingNightVision = ReadByte(f) Wearing1499 = ReadByte(f) NTF_1499PrevX# = ReadFloat(f) @@ -577,8 +587,8 @@ Function LoadGame(file$) MapWidth = ReadInt(f) MapHeight = ReadInt(f) - For x = 0 To MapWidth - 1 - For y = 0 To MapHeight - 1 + For x = 0 To MapWidth + For y = 0 To MapHeight MapTemp( x, y) = ReadInt(f) MapFound(x, y) = ReadByte(f) Next @@ -778,7 +788,8 @@ Function LoadGame(file$) Next EndIf - If ReadByte(f)=1 Then ;this room has a forest + Local hasForest = ReadByte(f) + If hasForest>0 Then ;this room has a forest If r\fr<>Null Then ;remove the old forest DestroyForest(r\fr) Else @@ -795,7 +806,11 @@ Function LoadGame(file$) lx# = ReadFloat(f) ly# = ReadFloat(f) lz# = ReadFloat(f) - PlaceForest(r\fr,lx,ly,lz,r) + If hasForest=1 Then + PlaceForest(r\fr,lx,ly,lz,r) + Else + PlaceForest_MapCreator(r\fr,lx,ly,lz,r) + EndIf ElseIf r\fr<>Null Then ;remove the old forest DestroyForest(r\fr) Delete r\fr @@ -813,38 +828,90 @@ Function LoadGame(file$) If ReadInt(f) <> 954 Then RuntimeError("Couldn't load the game, save file may be corrupted (error 2)") Local spacing# = 8.0 - For lvl = 0 To 0 - For y = MapHeight - 1 To 1 Step - 1 - - If y < MapHeight/3+1 Then - temp=0 - ElseIf y < MapHeight*(2.0/3.0)-1 - temp=2 - Else - temp=0 - EndIf - - For x = 1 To MapWidth - 2 - If MapTemp(x, y) > 0 Then - If (Floor((x + y) / 2.0) = Ceil((x + y) / 2.0)) Then - If MapTemp(x + 1, y) Then - CreateDoor(lvl, x * spacing + spacing / 2.0, 0, y * spacing, 90, Null, Max(Rand(-3, 1), 0), temp) - EndIf - - If MapTemp(x - 1, y) Then - CreateDoor(lvl, x * spacing - spacing / 2.0, 0, y * spacing, 90, Null, Max(Rand(-3, 1), 0), temp) + Local zone%,shouldSpawnDoor% + For y = MapHeight To 0 Step -1 + + If y=I_Zone\Transition[1]-1 And y 0 Then + If zone = 2 Then temp=2 Else temp=0 + + For r.Rooms = Each Rooms + r\angle = WrapAngle(r\angle) + If Int(r\x/8.0)=x And Int(r\z/8.0)=y Then + shouldSpawnDoor = False + Select r\RoomTemplate\Shape + Case ROOM1 + If r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM2 + If r\angle=90 Or r\angle=270 + shouldSpawnDoor = True + EndIf + Case ROOM2C + If r\angle=0 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM3 + If r\angle=0 Or r\angle=180 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Default + shouldSpawnDoor = True + End Select + If shouldSpawnDoor + If (x+1)<(MapWidth+1) + If MapTemp(x + 1, y) > 0 Then + do.Doors = CreateDoor(r\zone, Float(x) * spacing + spacing / 2.0, 0, Float(y) * spacing, 90, r, Max(Rand(-3, 1), 0), temp) + r\AdjDoor[0] = do + EndIf + EndIf EndIf - If MapTemp(x, y + 1) Then - CreateDoor(lvl, x * spacing, 0, y * spacing + spacing / 2.0, 0, Null, Max(Rand(-3, 1), 0), temp) + shouldSpawnDoor = False + Select r\RoomTemplate\Shape + Case ROOM1 + If r\angle=180 + shouldSpawnDoor = True + EndIf + Case ROOM2 + If r\angle=0 Or r\angle=180 + shouldSpawnDoor = True + EndIf + Case ROOM2C + If r\angle=180 Or r\angle=90 + shouldSpawnDoor = True + EndIf + Case ROOM3 + If r\angle=180 Or r\angle=90 Or r\angle=270 + shouldSpawnDoor = True + EndIf + Default + shouldSpawnDoor = True + End Select + If shouldSpawnDoor + If (y+1)<(MapHeight+1) + If MapTemp(x, y + 1) > 0 Then + do.Doors = CreateDoor(r\zone, Float(x) * spacing, 0, Float(y) * spacing + spacing / 2.0, 0, r, Max(Rand(-3, 1), 0), temp) + r\AdjDoor[3] = do + EndIf + EndIf EndIf - If MapTemp(x, y - 1)Then - CreateDoor(lvl, x * spacing, 0, y * spacing - spacing / 2.0, 0, Null, Max(Rand(-3, 1), 0), temp) - EndIf - End If - EndIf - Next + Exit + EndIf + Next + + End If + Next Next @@ -894,6 +961,12 @@ Function LoadGame(file$) If ReadInt(f) <> 1845 Then RuntimeError("Couldn't load the game, save file corrupted (error 3)") + Local d.Decals + For d.Decals = Each Decals + FreeEntity d\obj + Delete d + Next + temp = ReadInt(f) For i = 1 To temp id% = ReadInt(f) @@ -903,7 +976,7 @@ Function LoadGame(file$) Local pitch# = ReadFloat(f) Local yaw# = ReadFloat(f) Local roll# = ReadFloat(f) - Local d.Decals = CreateDecal(id, x, y, z, pitch, yaw, roll) + d.Decals = CreateDecal(id, x, y, z, pitch, yaw, roll) d\blendmode = ReadByte (f) d\fx = ReadInt(f) @@ -916,7 +989,10 @@ Function LoadGame(file$) ScaleSprite(d\obj, d\Size, d\Size) EntityBlend d\obj, d\blendmode EntityFX d\obj, d\fx + + DebugLog "Created Decal @"+x+","+y+","+z Next + UpdateDecals() temp = ReadInt(f) For i = 1 To temp @@ -943,11 +1019,13 @@ Function LoadGame(file$) e\EventState = 0.0 e\EventStr = "" DebugLog "Reset Eventstate in "+e\EventName - ;Only reset if the dimension has already been generated and the player wasn't saving in it + ;Reset dimension1499 ElseIf e\EventName = "dimension1499" - If e\EventState = 1.0 + If e\EventState > 0.0 e\EventState = 0.0 e\EventStr = "" + HideChunks() + DeleteChunks() For n.NPCs = Each NPCs If n\NPCtype = NPCtype1499 If n\InFacility = 0 @@ -962,6 +1040,10 @@ Function LoadGame(file$) e\EventStr = "" ElseIf e\EventName = "room205" e\EventStr = "" + ElseIf e\EventName = "room106" + If e\EventState2 = False Then + PositionEntity (e\room\Objects[6],EntityX(e\room\Objects[6],True),-1280.0*RoomScale,EntityZ(e\room\Objects[6],True),True) + EndIf EndIf Next @@ -1079,7 +1161,16 @@ Function LoadGame(file$) StoredCameraFogFar = ReadFloat(f) If CameraFogFar = 0 Then CameraFogFar = 6 - EndIf + EndIf + I_427\Using = ReadByte(f) + I_427\Timer = ReadFloat(f) + + I_Zone\Transition[0] = ReadByte(f) + I_Zone\Transition[1] = ReadByte(f) + I_Zone\HasCustomForest = ReadByte(f) + I_Zone\HasCustomMT = ReadByte(f) + + Wearing714 = ReadByte(f) CloseFile f @@ -1130,6 +1221,30 @@ Function LoadGame(file$) Next Next + If PlayerRoom\RoomTemplate\Name = "dimension1499" + BlinkTimer = -1 + ShouldEntitiesFall = False + PlayerRoom = NTF_1499PrevRoom + UpdateDoors() + UpdateRooms() + For it.Items = Each Items + it\disttimer = 0 + Next + EndIf + + If Collider <> 0 Then + If PlayerRoom<>Null Then + ShowEntity PlayerRoom\obj + EndIf + ShowEntity Collider + TeleportEntity(Collider,EntityX(Collider),EntityY(Collider)+0.5,EntityZ(Collider),0.3,True) + If PlayerRoom<>Null Then + HideEntity PlayerRoom\obj + EndIf + EndIf + + UpdateDoorsTimer = 0 + CatchErrors("LoadGame") End Function @@ -1146,6 +1261,7 @@ Function LoadGameQuick(file$) DeafTimer# = 0.0 UnableToMove% = False Msg = "" + SelectedEnding = "" PositionEntity Collider,0,1000.0,0,True ResetEntity Collider @@ -1256,7 +1372,6 @@ Function LoadGameQuick(file$) WearingVest = ReadByte(f) WearingHazmat = ReadByte(f) - Wearing178 = ReadByte(f) WearingNightVision = ReadByte(f) Wearing1499 = ReadByte(f) NTF_1499PrevX# = ReadFloat(f) @@ -1289,8 +1404,8 @@ Function LoadGameQuick(file$) MapHeight = ReadInt(f) DebugLog MapWidth DebugLog MapHeight - For x = 0 To MapWidth - 1 - For y = 0 To MapHeight - 1 + For x = 0 To MapWidth + For y = 0 To MapHeight MapTemp(x, y) = ReadInt(f) MapFound(x, y) = ReadByte(f) Next @@ -1485,7 +1600,7 @@ Function LoadGameQuick(file$) EndIf EndIf - If ReadByte(f)=1 Then ;this room has a forest + If ReadByte(f)>0 Then ;this room has a forest For y=0 To gridsize-1 For x=0 To gridsize-1 ReadByte(f) @@ -1590,7 +1705,10 @@ Function LoadGameQuick(file$) ScaleSprite(d\obj, d\Size, d\Size) EntityBlend d\obj, d\blendmode EntityFX d\obj, d\fx + + DebugLog "Created Decal @"+x+","+y+","+z Next + UpdateDecals() Local e.Events For e.Events = Each Events @@ -1759,9 +1877,84 @@ Function LoadGameQuick(file$) StoredCameraFogFar = ReadFloat(f) If CameraFogFar = 0 Then CameraFogFar = 6 - EndIf + EndIf + I_427\Using = ReadByte(f) + I_427\Timer = ReadFloat(f) + + I_Zone\Transition[0] = ReadByte(f) + I_Zone\Transition[1] = ReadByte(f) + I_Zone\HasCustomForest = ReadByte(f) + I_Zone\HasCustomMT = ReadByte(f) + + Wearing714 = ReadByte(f) CloseFile f + If Collider <> 0 Then + If PlayerRoom<>Null Then + ShowEntity PlayerRoom\obj + EndIf + ShowEntity Collider + TeleportEntity(Collider,EntityX(Collider),EntityY(Collider)+0.5,EntityZ(Collider),0.3,True) + If PlayerRoom<>Null Then + HideEntity PlayerRoom\obj + EndIf + EndIf + + UpdateDoorsTimer = 0 + + ;Free some entities that could potentially cause memory leaks (for the endings) + ;This is only required for the LoadGameQuick function, as the other one is from the menu where everything is already deleted anyways + Local xtemp#,ztemp# + If Sky <> 0 Then + FreeEntity Sky + Sky = 0 + EndIf + For r.Rooms = Each Rooms + If r\RoomTemplate\Name = "gatea" Then + If r\Objects[0]<>0 Then + FreeEntity r\Objects[0] : r\Objects[0] = 0 + xtemp#=EntityX(r\Objects[9],True) + ztemp#=EntityZ(r\Objects[9],True) + FreeEntity r\Objects[9] : r\Objects[9] = 0 + r\Objects[10] = 0 ;r\Objects[10] is already deleted because it is a parent object to r\Objects[9] which is already deleted a line before + ;Readding this object, as it is originally inside the "FillRoom" function but gets deleted when it loads GateA + r\Objects[9]=CreatePivot() + PositionEntity(r\Objects[9], xtemp#, r\y+992.0*RoomScale, ztemp#, True) + EntityParent r\Objects[9], r\obj + ;The GateA wall pieces + xtemp# = EntityX(r\Objects[13],True) + ztemp# = EntityZ(r\Objects[13],True) + FreeEntity r\Objects[13] + r\Objects[13]=LoadMesh_Strict("GFX\map\gateawall1.b3d",r\obj) + PositionEntity(r\Objects[13], xtemp#, r\y-1045.0*RoomScale, ztemp#, True) + EntityColor r\Objects[13], 25,25,25 + EntityType r\Objects[13],HIT_MAP + xtemp# = EntityX(r\Objects[14],True) + ztemp# = EntityZ(r\Objects[14],True) + FreeEntity r\Objects[14] + r\Objects[14]=LoadMesh_Strict("GFX\map\gateawall2.b3d",r\obj) + PositionEntity(r\Objects[14], xtemp#, r\y-1045.0*RoomScale, ztemp#, True) + EntityColor r\Objects[14], 25,25,25 + EntityType r\Objects[14],HIT_MAP + EndIf + If r\Objects[12]<>0 Then + FreeEntity r\Objects[12] : r\Objects[12] = 0 + FreeEntity r\Objects[17] : r\Objects[17] = 0 + EndIf + ElseIf r\RoomTemplate\Name = "exit1" Then + If r\Objects[0]<>0 Then + xtemp# = EntityX(r\Objects[0],True) + ztemp# = EntityZ(r\Objects[0],True) + FreeEntity r\Objects[0] : r\Objects[0] = 0 + r\Objects[0] = CreatePivot(r\obj) + PositionEntity(r\Objects[0], xtemp#, 9767.0*RoomScale, ztemp#, True) + EndIf + EndIf + Next + ;Resetting some stuff (those get changed when going to the endings) + CameraFogMode(Camera, 1) + HideDistance# = 15.0 + CatchErrors("LoadGameQuick") End Function @@ -1804,11 +1997,23 @@ Function LoadSaveGames() Dim SaveGameTime$(SaveGameAmount + 1) Dim SaveGameDate$(SaveGameAmount + 1) + Dim SaveGameVersion$(SaveGameAmount + 1) For i = 1 To SaveGameAmount DebugLog (SavePath + SaveGames(i - 1) + "\save.txt") Local f% = ReadFile(SavePath + SaveGames(i - 1) + "\save.txt") SaveGameTime(i - 1) = ReadString(f) SaveGameDate(i - 1) = ReadString(f) + ;Skip all data until the CompatibleVersion number + ReadInt(f) + For j = 0 To 5 + ReadFloat(f) + Next + ReadString(f) + ReadFloat(f) + ReadFloat(f) + ;End Skip + SaveGameVersion(i - 1) = ReadString(f) + CloseFile f Next @@ -1818,30 +2023,59 @@ End Function Function LoadSavedMaps() CatchErrors("Uncaught (LoadSavedMaps)") - Local i, Dir, file$ + Local i%, Dir, file$ - For i = 0 To MAXSAVEDMAPS-1 + For i = 0 To SavedMapsAmount SavedMaps(i)="" + SavedMapsAuthor(i)="" Next + SavedMapsAmount = 0 + + Dir=ReadDir("Map Creator\Maps") + Repeat + file$=NextFile$(Dir) + + DebugLog file + + If file$="" Then Exit + DebugLog (CurrentDir()+"Map Creator\Maps\"+file$) + If FileType(CurrentDir()+"Map Creator\Maps\"+file$) = 1 Then + If file <> "." And file <> ".." Then + If Right(file,6)="cbmap2" Or Right(file,5)="cbmap" Then + SavedMapsAmount = SavedMapsAmount + 1 + EndIf + EndIf + EndIf + Forever + CloseDir Dir + + Dim SavedMaps(SavedMapsAmount+1) + Dim SavedMapsAuthor$(SavedMapsAmount+1) - Dir=ReadDir("Map Creator\Maps") i = 0 - Repeat + Dir=ReadDir("Map Creator\Maps") + Repeat file$=NextFile$(Dir) DebugLog file - If file$="" Then Exit + If file$="" Then Exit DebugLog (CurrentDir()+"Map Creator\Maps\"+file$) If FileType(CurrentDir()+"Map Creator\Maps\"+file$) = 1 Then - If file <> "." And file <> ".." Then - SavedMaps(i) = Left(file,Max(Len(file)-6,1)) - DebugLog i+": "+file - i=i+1 + If file <> "." And file <> ".." Then + If Right(file,6)="cbmap2" Or Right(file,5)="cbmap" Then + SavedMaps(i) = file + If Right(file,6)="cbmap2" Then + Local f = ReadFile("Map Creator\Maps\"+file) + SavedMapsAuthor$(i) = ReadLine(f) + CloseFile f + Else + SavedMapsAuthor$(i) = "[Unknown]" + EndIf + i=i+1 + EndIf EndIf - - If i > MAXSAVEDMAPS Then Exit - End If + EndIf Forever CloseDir Dir CatchErrors("LoadSavedMaps") @@ -1851,77 +2085,287 @@ Function LoadMap(file$) CatchErrors("Uncaught (LoadMap)") Local f%, x%, y%, name$, angle%, prob# Local r.Rooms, rt.RoomTemplates, e.Events + Local roomamount%,forestpieceamount%,mtpieceamount%,i% - f% = ReadFile(file+".cbmap") - DebugLog file+".cbmap" + f% = ReadFile(file) + DebugLog file - While Not Eof(f) - x = ReadByte(f) - y = ReadByte(f) - name$ = Lower(ReadString(f)) + Dim MapTemp%(MapWidth+1, MapHeight+1) + Dim MapFound%(MapWidth+1, MapHeight+1) + CoffinDistance = 100 + + For x = 0 To MapWidth+1 + For y = 0 To MapHeight+1 + MapTemp(x,y)=False + MapFound(x,y)=False + Next + Next + + If Right(file,6)="cbmap2" Then + ReadLine(f) + ReadLine(f) + I_Zone\Transition[0] = ReadByte(f) + I_Zone\Transition[1] = ReadByte(f) + roomamount = ReadInt(f) + forestpieceamount = ReadInt(f) + mtpieceamount = ReadInt(f) + + If forestpieceamount > 0 Then + I_Zone\HasCustomForest = True + EndIf + If mtpieceamount > 0 Then + I_Zone\HasCustomMT = True + EndIf + + ;Facility rooms + For i = 0 To roomamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = Lower(ReadString(f)) + + angle = ReadByte(f)*90.0 + + DebugLog x+", "+y+": "+name + DebugLog "angle: "+angle + + For rt.RoomTemplates=Each RoomTemplates + If Lower(rt\Name) = name Then + + r.Rooms = CreateRoom(0, rt\Shape, (MapWidth-x) * 8.0, 0, y * 8.0, name) + DebugLog "createroom" + + r\angle = angle + If r\angle<>90 And r\angle<>270 + r\angle = r\angle + 180 + EndIf + r\angle = WrapAngle(r\angle) + + TurnEntity(r\obj, 0, r\angle, 0) + + MapTemp(MapWidth-x,y)=True + + Exit + EndIf + Next + + name = ReadString(f) + prob# = ReadFloat(f) + + If r<>Null Then + If prob>0.0 Then + If Rnd(0.0,1.0)<=prob Then + e.Events = New Events + e\EventName = name + e\room = r + EndIf + ElseIf prob = 0.0 And name <> "" Then + e.Events = New Events + e\EventName = name + e\room = r + EndIf + EndIf + Next - angle = ReadByte(f)*90.0 + Local ForestRoom.Rooms + For r.Rooms = Each Rooms + If r\RoomTemplate\Name = "room860" Then + ForestRoom = r + Exit + EndIf + Next - DebugLog x+", "+y+": "+name - DebugLog "angle: "+angle + If ForestRoom<>Null Then + Local fr.Forest = New Forest + EndIf - For rt.RoomTemplates=Each RoomTemplates - If Lower(rt\Name) = name Then - - r.Rooms = CreateRoom(0, rt\Shape, (MapWidth-x) * 8.0, 0, y * 8.0, name) - DebugLog "createroom" - - r\angle = angle - If r\angle<>90 And r\angle<>270 - r\angle = r\angle + 180 - EndIf - r\angle = WrapAngle(r\angle) - - TurnEntity(r\obj, 0, r\angle, 0) - - MapTemp(MapWidth-x,y)=1 - - Exit + ;Forest rooms + For i = 0 To forestpieceamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = Lower(ReadString(f)) + + angle = ReadByte(f) + + DebugLog x+", "+y+": "+name + DebugLog "angle: "+angle + + If angle <> 0 And angle <> 2 Then + angle = angle + 2 + EndIf + angle = angle + 1 + If angle > 3 Then + angle = (angle Mod 4) + EndIf + + x = (gridsize-1)-x + + If fr<>Null Then + Select name + ;1,2,3,4 = ROOM1 + ;5,6,7,8 = ROOM2 + ;9,10,11,12 = ROOM2C + ;13,14,15,16 = ROOM3 + ;17,18,19,20 = ROOM4 + ;21,22,23,24 = DOORROOM + Case "scp-860-1 endroom" + fr\grid[(y*gridsize)+x] = 1+angle + Case "scp-860-1 path" + fr\grid[(y*gridsize)+x] = 5+angle + Case "scp-860-1 corner" + fr\grid[(y*gridsize)+x] = 9+angle + Case "scp-860-1 t-shaped path" + fr\grid[(y*gridsize)+x] = 13+angle + Case "scp-860-1 4-way path" + fr\grid[(y*gridsize)+x] = 17+angle + Case "scp-860-1 door" + fr\grid[(y*gridsize)+x] = 21+angle + End Select + DebugLog "created forest piece "+Chr(34)+name+Chr(34)+" successfully" + EndIf + Next + + If fr<>Null Then + ForestRoom\fr=fr + PlaceForest_MapCreator(ForestRoom\fr,ForestRoom\x,ForestRoom\y+30.0,ForestRoom\z,ForestRoom) + EndIf + + Local MTRoom.Rooms + For r.Rooms = Each Rooms + If r\RoomTemplate\Name = "room2tunnel" Then + MTRoom = r + Exit EndIf Next - name = ReadString(f) - prob# = ReadFloat(f) + If MTRoom<>Null Then + MTRoom\grid = New Grids + EndIf + + ;Maintenance tunnels rooms + For i = 0 To mtpieceamount-1 + x = ReadByte(f) + y = ReadByte(f) + name$ = Lower(ReadString(f)) + + angle = ReadByte(f) + + DebugLog x+", "+y+": "+name + DebugLog "angle: "+angle + + If angle<>1 And angle<>3 Then + angle = angle + 2 + EndIf + If name = "maintenance tunnel corner" Or name = "maintenance tunnel t-shaped room" Then + angle = angle + 3 + EndIf + If angle > 3 Then + angle = (angle Mod 4) + EndIf + + x = (gridsz-1)-x + + If MTRoom<>Null Then + Select name + Case "maintenance tunnel endroom" + MTRoom\grid\grid[x+(y*gridsz)]=ROOM1 + Case "maintenance tunnel corridor" + MTRoom\grid\grid[x+(y*gridsz)]=ROOM2 + Case "maintenance tunnel corner" + MTRoom\grid\grid[x+(y*gridsz)]=ROOM2C + Case "maintenance tunnel t-shaped room" + MTRoom\grid\grid[x+(y*gridsz)]=ROOM3 + Case "maintenance tunnel 4-way room" + MTRoom\grid\grid[x+(y*gridsz)]=ROOM4 + Case "maintenance tunnel elevator" + MTRoom\grid\grid[x+(y*gridsz)]=ROOM4+1 + Case "maintenance tunnel generator room" + MTRoom\grid\grid[x+(y*gridsz)]=ROOM4+2 + End Select + MTRoom\grid\angles[x+(y*gridsz)]=angle + DebugLog "created mtunnel piece "+Chr(34)+name+Chr(34)+" successfully" + EndIf + Next - If r<>Null Then - If prob>0.0 - If Rnd(0.0,1.0)<=prob + ;If MTRoom<>Null Then + ; PlaceGrid_MapCreator(MTRoom) + ;EndIf + Else + I_Zone\Transition[0] = 13 + I_Zone\Transition[1] = 7 + I_Zone\HasCustomForest = False + I_Zone\HasCustomMT = False + While Not Eof(f) + x = ReadByte(f) + y = ReadByte(f) + name$ = Lower(ReadString(f)) + + angle = ReadByte(f)*90.0 + + DebugLog x+", "+y+": "+name + DebugLog "angle: "+angle + + For rt.RoomTemplates=Each RoomTemplates + If Lower(rt\Name) = name Then + + r.Rooms = CreateRoom(0, rt\Shape, (MapWidth-x) * 8.0, 0, y * 8.0, name) + DebugLog "createroom" + + r\angle = angle + If r\angle<>90 And r\angle<>270 + r\angle = r\angle + 180 + EndIf + r\angle = WrapAngle(r\angle) + + TurnEntity(r\obj, 0, r\angle, 0) + + MapTemp(MapWidth-x,y)=True + + Exit + EndIf + Next + + name = ReadString(f) + prob# = ReadFloat(f) + + If r<>Null Then + If prob>0.0 Then + If Rnd(0.0,1.0)<=prob Then + e.Events = New Events + e\EventName = name + e\room = r + EndIf + ElseIf prob = 0.0 And name <> "" Then e.Events = New Events e\EventName = name - e\room = r + e\room = r EndIf EndIf - EndIf - - Wend + + Wend + EndIf CloseFile f Local temp = 0, zone Local spacing# = 8.0 Local shouldSpawnDoor% = False - ;For y = MapHeight - 1 To 1 Step - 1 + Local d.Doors For y = MapHeight To 0 Step -1 - If y < MapHeight/3+1 Then + If y=I_Zone\Transition[1] And y 0 Then If zone = 2 Then temp=2 Else temp=0 For r.Rooms = Each Rooms + r\angle = WrapAngle(r\angle) If Int(r\x/8.0)=x And Int(r\z/8.0)=y Then shouldSpawnDoor = False Select r\RoomTemplate\Shape @@ -1997,7 +2441,7 @@ Function LoadMap(file$) ;r = CreateRoom(0, ROOM1, 0, 0, 8, "gatea") If IntroEnabled Then r = CreateRoom(0, ROOM1, 8, 0, (MapHeight+2) * 8, "173") r = CreateRoom(0, ROOM1, (MapWidth+2) * 8, 0, (MapHeight+2) * 8, "pocketdimension") - r = CreateRoom(0, ROOM1, 0, 0, -16, "gatea") + r = CreateRoom(0, ROOM1, 0, 500, -16, "gatea") r = CreateRoom(0, ROOM1, -16, 800, 0, "dimension1499") CreateEvent("173", "173", 0) @@ -2034,6 +2478,16 @@ Function LoadMap(file$) Next Next + For x = 0 To MapWidth+1 + For y = 0 To MapHeight+1 + If MapTemp(x,y)>0 Then + DebugLog "MapTemp("+x+","+y+") = True" + Else + DebugLog "MapTemp("+x+","+y+") = False" + EndIf + Next + Next + CatchErrors("LoadMap") End Function diff --git a/StrictLoads.bb b/StrictLoads.bb index f7da8d380..ea472ce05 100644 --- a/StrictLoads.bb +++ b/StrictLoads.bb @@ -125,7 +125,11 @@ Function LoadSound_Strict(file$) snd\name = file snd\internalHandle = 0 snd\releaseTime = 0 - If (Not EnableSFXRelease) Then snd\internalHandle = LoadSound(snd\name) + If (Not EnableSFXRelease) Then + If snd\internalHandle = 0 Then + snd\internalHandle = LoadSound(snd\name) + EndIf + EndIf Return Handle(snd) End Function @@ -205,7 +209,7 @@ Function SetStreamVolume_Strict(streamHandle%,volume#) Local st.Stream = Object.Stream(streamHandle) If st = Null - CreateConsoleMsg("Failed to stop stream Sound: Unknown Stream") + CreateConsoleMsg("Failed to set stream Sound volume: Unknown Stream") Return EndIf If st\chn=0 Or st\chn=-1 @@ -222,7 +226,7 @@ Function SetStreamPaused_Strict(streamHandle%,paused%) Local st.Stream = Object.Stream(streamHandle) If st = Null - CreateConsoleMsg("Failed to stop stream Sound: Unknown Stream") + CreateConsoleMsg("Failed to pause/unpause stream Sound: Unknown Stream") Return EndIf If st\chn=0 Or st\chn=-1 @@ -238,7 +242,7 @@ Function IsStreamPlaying_Strict(streamHandle%) Local st.Stream = Object.Stream(streamHandle) If st = Null - ;CreateConsoleMsg("Failed to stop stream Sound: Unknown Stream") + CreateConsoleMsg("Failed to find stream Sound: Unknown Stream") Return EndIf If st\chn=0 Or st\chn=-1 @@ -254,7 +258,7 @@ Function SetStreamPan_Strict(streamHandle%,pan#) Local st.Stream = Object.Stream(streamHandle) If st = Null - ;CreateConsoleMsg("Failed to stop stream Sound: Unknown Stream") + CreateConsoleMsg("Failed to find stream Sound: Unknown Stream") Return EndIf If st\chn=0 Or st\chn=-1 diff --git a/Update.bb b/Update.bb index a6ad318a7..c940b4e82 100644 --- a/Update.bb +++ b/Update.bb @@ -815,15 +815,19 @@ Function CheckForUpdates() Text 320,240,"Can't extract zlibwapi.dll",True,True Else Text 320,240,"Extracting "+Chr(34)+fileData+Chr(34),True,True - ZipApi_ExtractFile(zipIn, fileData, Replace(fileData,".exe"," "+latest+".exe")) + If Instr(fileData,".exe")=0 Or Instr(fileData,"Map Creator")=0 + ZipApi_ExtractFile(zipIn, fileData, Replace(fileData,".exe"," "+latest+".exe")) + Else + ZipApi_ExtractFile(zipIn, fileData, fileData) + EndIf EndIf Else If FileType(fileData)=0 CreateDir fileData EndIf If Instr(fileData,".exe")>0 Then - newRun=Chr$(34)+Replace(fileData,".exe"," "+latest+".exe")+Chr$(34) - EndIf + newRun=Chr$(34)+"SCP - Containment Breach "+latest+".exe"+Chr$(34) + EndIf EndIf Flip diff --git a/UpdateEvents.bb b/UpdateEvents.bb index b8e760024..57c6e3390 100644 --- a/UpdateEvents.bb +++ b/UpdateEvents.bb @@ -2,7 +2,7 @@ Function UpdateEvents() CatchErrors("Uncaught (UpdateEvents)") Local dist#, i%, temp%, pvt%, strtemp$, j%, k% - Local p.Particles, n.NPCs, r.Rooms, e.Events, e2.Events, it.Items, em.Emitters, sc.SecurityCams, sc2.SecurityCams + Local p.Particles, n.NPCs, r.Rooms, e.Events, e2.Events, it.Items, it2.Items, em.Emitters, sc.SecurityCams, sc2.SecurityCams Local CurrTrigger$ = "" @@ -32,7 +32,15 @@ Function UpdateEvents() Else e\room\RoomDoors[4]\locked=False - e\EventState2 = UpdateElevators(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1], e\room\Objects[8], e\room\Objects[9], e) + If Curr096 <> Null Then + If Curr096\State = 0 Or Curr096\State = 5 Then + e\EventState2 = UpdateElevators(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1], e\room\Objects[8], e\room\Objects[9], e) + Else + e\EventState2 = Update096ElevatorEvent(e,e\EventState2,e\room\RoomDoors[0],e\room\Objects[8]) + EndIf + Else + e\EventState2 = UpdateElevators(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1], e\room\Objects[8], e\room\Objects[9], e) + EndIf EntityAlpha Fog, 1.0 EndIf @@ -290,7 +298,7 @@ Function UpdateEvents() End If EndIf - If (e\EventState3<10) Then + If (e\EventState3<11) Then If (Not ChannelPlaying(e\SoundCHN2)) Then e\EventState3 = e\EventState3+1 @@ -311,14 +319,14 @@ Function UpdateEvents() If i = 0 Then PlaySound_Strict(LoadTempSound("SFX\Room\Intro\PA\scripted\scripted6.ogg")) - If (i>0 And i<24) Then + If (i>0 And i<26) Then If Not CommotionState(i) Then ;Prevents the same commotion file from playing more then once. PlaySound_Strict(LoadTempSound("SFX\Room\Intro\Commotion\Commotion"+i+".ogg")) CommotionState(i) = True EndIf EndIf - If (i>24) Then + If (i>26) Then If e\room\NPC[0] <> Null Then RemoveNPC(e\room\NPC[0]) ;If e\room\NPC[1] <> Null Then RemoveNPC(e\room\NPC[1]) ;If e\room\NPC[2] <> Null Then RemoveNPC(e\room\NPC[2]) @@ -370,7 +378,7 @@ Function UpdateEvents() If e\EventState3 < 3 Then e\EventState3 = e\EventState3+FPSfactor/100.0 - Else + ElseIf e\EventState3 < 15 Or e\EventState3 >= 50 Then e\EventState3 = e\EventState3+FPSfactor/30.0 EndIf @@ -414,31 +422,20 @@ Function UpdateEvents() ShowEntity Collider DropSpeed = 0 e\EventState3 = 15 + Msg = "Pick up the paper on the desk." + MsgTimer=70*7 EndIf user_camera_pitch = 0 RotateEntity Collider, 0, EntityYaw(Camera), 0 - ElseIf e\EventState3 < 30 - If e\EventState3 > 25 Then - e\EventState3 = e\EventState3+FPSfactor/3.0 - Msg = "Pick up the paper on the desk." - MsgTimer=70*7 - e\EventState3=30 - EndIf - ElseIf e\EventState3 < 35 + ElseIf e\EventState3 < 40 If Inventory(0)<>Null Then Msg = "Press "+KeyName(KEY_INV)+" to open the inventory." - MsgTimer=70*4 + MsgTimer=70*7 e\EventState3 = 40 Exit EndIf - Else;If e\EventState > 45 And e\EventState3 < 45 - If InvOpen Then - Msg = "Double click on the document to view it." - MsgTimer=70*4 - e\EventState3 = 45 - EndIf EndIf If SelectedItem <> Null Then @@ -812,8 +809,7 @@ Function UpdateEvents() If e\room\NPC[i]<>Null Then RemoveNPC(e\room\NPC[i]) EndIf - Next - + Next FreeSound_Strict e\room\NPC[3]\Sound e\room\NPC[3]\Sound = LoadSound_Strict("SFX\Room\Intro\Guard\Ulgrin\EscortDone"+Rand(1,5)+".ogg") @@ -825,34 +821,71 @@ Function UpdateEvents() e\room\NPC[6]\CurrSpeed = 0 e\room\NPC[6]\State = 0 - e\EventState3 = 910 + e\EventState3 = 905 ;910 e\room\RoomDoors[3]\locked = False UseDoor(e\room\RoomDoors[3],False) e\room\RoomDoors[3]\locked = True - e\room\RoomDoors[2]\locked = False - UseDoor(e\room\RoomDoors[2],False) - e\room\RoomDoors[2]\locked = True + e\room\NPC[4]\State = 9 + + ;e\room\RoomDoors[2]\locked = False + ;UseDoor(e\room\RoomDoors[2],False) + ;e\room\RoomDoors[2]\locked = True + EndIf + ElseIf e\EventState3 <= 905 + If (Not ChannelPlaying(e\room\NPC[3]\SoundChn)) And e\room\NPC[3]\Frame < 358.0 Then + e\room\NPC[3]\State = 8 + FreeSound_Strict e\room\NPC[3]\Sound + e\room\NPC[3]\Sound = LoadSound_Strict("SFX\Room\Intro\Guard\Ulgrin\OhAndByTheWay.ogg") + e\room\NPC[3]\SoundChn = PlaySound2(e\room\NPC[3]\Sound, Camera, e\room\NPC[3]\Collider) + SetNPCFrame(e\room\NPC[3],358) + ElseIf e\room\NPC[3]\Frame >= 358.0 Then + PointEntity e\room\NPC[3]\Collider,Collider + RotateEntity e\room\NPC[3]\Collider,0,EntityYaw(e\room\NPC[3]\Collider),0 + + If e\room\NPC[3]\Frame <= 481.5 Then + Local prevAnimFrame# = e\room\NPC[3]\Frame + AnimateNPC(e\room\NPC[3],358.0,482.0,0.4,False) + Else + AnimateNPC(e\room\NPC[3],483.0,607.0,0.2,True) + If (EntityDistance(Collider, e\room\NPC[3]\Collider)<1.5) Then + If EntityInView(e\room\NPC[3]\obj, Camera) Then + DrawHandIcon = True + + If MouseHit1 Then + SelectedItem = CreateItem("Document SCP-173", "paper", 0.0, 0.0, 0.0) + + PickItem(SelectedItem) + + e\room\RoomDoors[2]\locked = False + UseDoor(e\room\RoomDoors[2],False) + e\room\RoomDoors[2]\locked = True + e\EventState3 = 910 + SetNPCFrame(e\room\NPC[3],608) + EndIf + EndIf + EndIf + EndIf EndIf Else - e\room\NPC[3]\State = 9 - ;PointEntity e\room\NPC[3]\obj, Collider - ;RotateEntity e\room\NPC[3]\Collider,0,CurveAngle(EntityYaw(e\room\NPC[3]\obj),EntityYaw(e\room\NPC[3]\Collider),20.0),0,True - e\room\NPC[4]\State = 9 - ;PointEntity e\room\NPC[4]\obj, Collider - ;RotateEntity e\room\NPC[4]\Collider,0,CurveAngle(EntityYaw(e\room\NPC[4]\obj),EntityYaw(e\room\NPC[4]\Collider),20.0),0,True - If Distance(EntityX(Collider), EntityZ(Collider), EntityX(e\room\obj), EntityZ(e\room\obj)) < 4.0 Then - e\room\RoomDoors[2]\locked = False - UseDoor(e\room\RoomDoors[2],False) - e\room\RoomDoors[2]\locked = True - e\EventState3 = 0 - e\room\NPC[3]\State = 0 - e\room\NPC[4]\State = 0 - ;e\room\NPC[5]\State = 0 - - UseDoor(e\room\RoomDoors[1],False) - EndIf + If e\room\NPC[3]\Frame <= 620.5 And e\room\NPC[3]\State = 8 Then + AnimateNPC(e\room\NPC[3],608,621,0.4,False) + Else + e\room\NPC[3]\Angle = EntityYaw(e\room\NPC[3]\Collider) + e\room\NPC[3]\State = 9 + e\room\NPC[4]\State = 9 + If Distance(EntityX(Collider), EntityZ(Collider), EntityX(e\room\obj), EntityZ(e\room\obj)) < 4.0 Then + e\room\RoomDoors[2]\locked = False + UseDoor(e\room\RoomDoors[2],False) + e\room\RoomDoors[2]\locked = True + e\EventState3 = 0 + e\room\NPC[3]\State = 0 + e\room\NPC[4]\State = 0 + + UseDoor(e\room\RoomDoors[1],False) + EndIf + EndIf EndIf ;the scientist sitting at his desk @@ -1298,7 +1331,7 @@ Function UpdateEvents() For do.doors = Each Doors If do\room = e\room Then - Delete do + RemoveDoor(do) EndIf Next @@ -1515,17 +1548,13 @@ Function UpdateEvents() If PlayerZone > 0 Then If EntityPitch(e\room\Levers[0],True) > 0 Then ;camera feed on For sc.SecurityCams = Each SecurityCams - If (Not sc\SpecialCam) - If sc\CoffinEffect=0 And sc\room\RoomTemplate\Name<>"room106" And sc\room\RoomTemplate\Name<>"room205" Then sc\CoffinEffect = 2 - If sc\room = e\room Then sc\Screen = True - EndIf + If sc\CoffinEffect=0 And sc\room\RoomTemplate\Name<>"room106" And sc\room\RoomTemplate\Name<>"room205" Then sc\CoffinEffect = 2 + If sc\room = e\room Then sc\Screen = True Next Else ;camera feed off For sc.SecurityCams = Each SecurityCams - If (Not sc\SpecialCam) - If sc\CoffinEffect<>1 Then sc\CoffinEffect = 0 - If sc\room = e\room Then sc\Screen = False - EndIf + If sc\CoffinEffect<>1 Then sc\CoffinEffect = 0 + If sc\room = e\room Then sc\Screen = False Next EndIf EndIf @@ -1548,14 +1577,93 @@ Function UpdateEvents() e\EventState2 = 1 EndIf EndIf + ElseIf CoffinDistance < 3.0 Then + If e\room\NPC[0]=Null Then + e\room\NPC[0]=CreateNPC(NPCtypeGuard,e\room\x,e\room\y,e\room\z) + RotateEntity e\room\NPC[0]\Collider,0,e\room\angle+90,0 + e\room\NPC[0]\State = 8 + ;270, 286, 0.4, False + SetNPCFrame(e\room\NPC[0],270) + e\room\NPC[0]\GravityMult = 0.0 + e\room\NPC[0]\Sound = LoadSound_Strict("SFX\Room\895Chamber\GuardIdle"+Rand(1,3)+".ogg") + e\room\NPC[0]\SoundChn = PlaySound2(e\room\NPC[0]\Sound,Camera,e\room\NPC[0]\Collider) + e\room\NPC[0]\IsDead = True + e\room\NPC[0]\FallingPickDistance = 0.0 + EndIf + ElseIf CoffinDistance > 5.0 Then + If e\room\NPC[0]<>Null Then + If e\room\NPC[0]\PrevState = 0 Then + If ChannelPlaying(e\room\NPC[0]\SoundChn) Then + StopChannel e\room\NPC[0]\SoundChn + EndIf + FreeSound_Strict e\room\NPC[0]\Sound + e\room\NPC[0]\Sound = LoadSound_Strict("SFX\Room\895Chamber\GuardScream"+Rand(1,3)+".ogg") + e\room\NPC[0]\SoundChn = PlaySound2(e\room\NPC[0]\Sound,Camera,e\room\NPC[0]\Collider,100) + e\room\NPC[0]\PrevState = 1 + e\room\NPC[0]\State2 = 0.0 + EndIf + EndIf + EndIf + + If e\room\NPC[0]<>Null Then + UpdateSoundOrigin(e\room\NPC[0]\SoundChn,Camera,e\room\NPC[0]\Collider,100) + If e\room\NPC[0]\PrevState = 0 Then + e\room\NPC[0]\GravityMult = 0.0 + ElseIf e\room\NPC[0]\PrevState = 1 Then + If e\room\NPC[0]\State2 < 70*1 Then + e\room\NPC[0]\State2 = e\room\NPC[0]\State2 + FPSfactor + e\room\NPC[0]\GravityMult = 0.0 + Else + e\room\NPC[0]\GravityMult = 1.0 + EndIf + If EntityY(e\room\NPC[0]\Collider)>(-1531.0*RoomScale)+0.35 Then + dist# = EntityDistance(Collider,e\room\NPC[0]\Collider) + If dist<0.8 Then ;get the player out of the way + fdir# = point_direction(EntityX(Collider,True),EntityZ(Collider,True),EntityX(e\room\NPC[0]\Collider,True),EntityZ(e\room\NPC[0]\Collider,True)) + TranslateEntity Collider,Cos(-fdir+90)*(dist-0.8)*(dist-0.8),0,Sin(-fdir+90)*(dist-0.8)*(dist-0.8) + EndIf + + If EntityY(e\room\NPC[0]\Collider)>0.6 Then EntityType e\room\NPC[0]\Collider,0 + Else + e\EventState=e\EventState+FPSfactor + AnimateNPC(e\room\NPC[0], 270, 286, 0.4, False) + If e\Sound=0 Then + LoadEventSound(e,"SFX\General\BodyFall.ogg") + e\SoundCHN = PlaySound_Strict(e\Sound) + + de.Decals = CreateDecal(3, EntityX(e\room\obj), -1531.0*RoomScale, EntityZ(e\room\obj), 90, Rand(360), 0) + de\Size = 0.4 : ScaleSprite(de\obj,de\Size,de\Size) : UpdateDecals() + EndIf + If e\room\NPC[0]\Frame = 286.0 Then + e\room\NPC[0]\PrevState = 2 + EndIf + EndIf + If e\room\NPC[0]\SoundChn2 = 0 Then + e\room\NPC[0]\Sound2 = LoadSound_Strict("SFX\Room\895Chamber\GuardRadio.ogg") + e\room\NPC[0]\SoundChn2 = LoopSound2(e\room\NPC[0]\Sound2,e\room\NPC[0]\SoundChn2,Camera,e\room\NPC[0]\Collider,5) + EndIf + ElseIf e\room\NPC[0]\PrevState = 2 Then + If (Not ChannelPlaying(e\SoundCHN)) And e\Sound<>0 Then + FreeSound_Strict e\Sound : e\Sound = 0 + e\SoundCHN = 0 + EndIf + If (Not ChannelPlaying(e\room\NPC[0]\SoundChn)) And e\room\NPC[0]\Sound<>0 Then + FreeSound_Strict e\room\NPC[0]\Sound : e\room\NPC[0]\Sound = 0 + e\room\NPC[0]\SoundChn = 0 + EndIf + If e\room\NPC[0]\Sound2 = 0 Then + e\room\NPC[0]\Sound2 = LoadSound_Strict("SFX\Room\895Chamber\GuardRadio.ogg") + EndIf + e\room\NPC[0]\SoundChn2 = LoopSound2(e\room\NPC[0]\Sound2,e\room\NPC[0]\SoundChn2,Camera,e\room\NPC[0]\Collider,5) + EndIf EndIf If WearingNightVision > 0 Then Local hasBatteryFor895% = 0 For i% = 0 To MaxItemAmount - 1 If (Inventory(i) <> Null) Then - If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Then - If Inventory(i)\state > 0.0 Then + If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Or (WearingNightVision = 3 And Inventory(i)\itemtemplate\tempname = "finenvgoggles") Then + If Inventory(i)\state > 0.0 Or WearingNightVision=3 Then hasBatteryFor895 = 1 Exit EndIf @@ -1563,38 +1671,6 @@ Function UpdateEvents() EndIf Next If (CoffinDistance < 4.0) And (hasBatteryFor895) And (Not Wearing714) Then -; -; Sanity = Sanity-(FPSfactor*1.1/WearingNightVision) -; RestoreSanity = False -; BlurTimer = Sin(MilliSecs2()/10)*Abs(Sanity) -; -; tempF# = point_direction(EntityX(Collider,True),EntityZ(Collider,True),EntityX(e\room\Objects[1],True),EntityZ(e\room\Objects[1],True)) -; tempF2# = EntityYaw(Collider) -; tempF3# = angleDist(tempF+90+Sin(WrapAngle(e\EventState3/10)),tempF2) -; -; TurnEntity Collider, 0,tempF3/4,0,True -; -; tempF# = Abs(point_distance(EntityX(Collider,True),EntityZ(Collider,True),EntityX(e\room\Objects[1],True),EntityZ(e\room\Objects[1],True))) -; tempF2# = -60.0 * Min(Max((2.0-tempF)/2.0,0.0),1.0) -; -; user_camera_pitch=(user_camera_pitch * 0.8)+(tempF2 * 0.2) -; -; If (Rand(Int(Max(tempF*100.0,1.0)))=1) And (e\EventState3<0.0) Then -; EntityTexture(NVOverlay, GorePics(Rand(0, 5))) -; PlaySound_Strict(HorrorSFX(1)) -; e\EventState3 = 10.0 -; EntityColor(NVOverlay, 255,255,255) -; EndIf -; If Sanity < (-1000) Then -; If WearingNightVision > 1 -; DeathMSG = Chr(34)+"Class D viewed SCP-895 through a pair of digital night vision goggles, presumably enhanced by SCP-914. It might be possible that the subject" -; DeathMSG = DeathMSG + "was able to resist the memetic effects partially through these goggles. The goggles have been stored for further study."+Chr(34) -; Else -; DeathMSG = Chr(34)+"Class D viewed SCP-895 through a pair of digital night vision goggles, killing him."+Chr(34) -; EndIf -; Kill() -; EndIf - tempF# = point_direction(EntityX(Collider,True),EntityZ(Collider,True),EntityX(e\room\Objects[1],True),EntityZ(e\room\Objects[1],True)) tempF2# = EntityYaw(Collider) tempF3# = angleDist(tempF+90+Sin(WrapAngle(e\EventState3/10)),tempF2) @@ -1606,37 +1682,48 @@ Function UpdateEvents() Sanity = Sanity-(FPSfactor*1.1/WearingNightVision) RestoreSanity = False BlurTimer = Sin(MilliSecs2()/10)*Abs(Sanity) - If Sanity < -1000 + + If VomitTimer < 0 Then + RestoreSanity = False + Sanity = -1010 + EndIf + + If Sanity < -1000 Then If WearingNightVision > 1 - DeathMSG = Chr(34)+"Class D viewed SCP-895 through a pair of digital night vision goggles, presumably enhanced by SCP-914. It might be possible that the subject" + DeathMSG = Chr(34)+"Class D viewed SCP-895 through a pair of digital night vision goggles, presumably enhanced by SCP-914. It might be possible that the subject " DeathMSG = DeathMSG + "was able to resist the memetic effects partially through these goggles. The goggles have been stored for further study."+Chr(34) Else DeathMSG = Chr(34)+"Class D viewed SCP-895 through a pair of digital night vision goggles, killing him."+Chr(34) EndIf EntityTexture(NVOverlay, NVTexture) - Kill() + If VomitTimer < -10 Then + Kill() + EndIf ElseIf Sanity < - 800 Then If Rand(3) = 1 Then EntityTexture(NVOverlay, NVTexture) If Rand(6) < 5 Then EntityTexture(NVOverlay, GorePics(Rand(0, 5))) For i% = 0 To MaxItemAmount - 1 If (Inventory(i) <> Null) Then - If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Then + If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Or (WearingNightVision = 3 And Inventory(i)\itemtemplate\tempname = "finenvgoggles") Then If Inventory(i)\state2 = 1 Then PlaySound_Strict(HorrorSFX(1)) Inventory(i)\state2 = 2 Exit EndIf EndIf Next - EndIf + EndIf BlurTimer = 1000 - ElseIf Sanity < - 500 + If VomitTimer = 0 Then + VomitTimer = 1 + EndIf + ElseIf Sanity < - 500 Then If Rand(7) = 1 Then EntityTexture(NVOverlay, NVTexture) If Rand(50) = 1 Then EntityTexture(NVOverlay, GorePics(Rand(0, 5))) For i% = 0 To MaxItemAmount - 1 If (Inventory(i) <> Null) Then - If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Then + If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Or (WearingNightVision = 3 And Inventory(i)\itemtemplate\tempname = "finenvgoggles") Then If Inventory(i)\state2 = 0 Then PlaySound_Strict(HorrorSFX(0)) Inventory(i)\state2 = 1 Exit @@ -1648,7 +1735,7 @@ Function UpdateEvents() EntityTexture(NVOverlay, NVTexture) For i% = 0 To MaxItemAmount - 1 If (Inventory(i) <> Null) Then - If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Then + If (WearingNightVision = 1 And Inventory(i)\itemtemplate\tempname = "nvgoggles") Or (WearingNightVision = 2 And Inventory(i)\itemtemplate\tempname = "supernv") Or (WearingNightVision = 3 And Inventory(i)\itemtemplate\tempname = "finenvgoggles") Then Inventory(i)\state2 = 0 EndIf EndIf @@ -1672,19 +1759,15 @@ Function UpdateEvents() If UpdateLever(e\room\Levers[0]) Then For sc.SecurityCams = Each SecurityCams - If (Not sc\SpecialCam) - If sc\CoffinEffect=0 And sc\room\RoomTemplate\Name<>"room106" Then sc\CoffinEffect = 2 - If sc\CoffinEffect = 1 Then EntityBlend(sc\ScrOverlay, 3) - If sc\room = e\room Then sc\Screen = True - EndIf + If sc\CoffinEffect=0 And sc\room\RoomTemplate\Name<>"room106" Then sc\CoffinEffect = 2 + If sc\CoffinEffect = 1 Then EntityBlend(sc\ScrOverlay, 3) + If sc\room = e\room Then sc\Screen = True Next Else For sc.SecurityCams = Each SecurityCams - If (Not sc\SpecialCam) - If sc\CoffinEffect <> 1 Then sc\CoffinEffect = 0 - If sc\CoffinEffect = 1 Then EntityBlend(sc\ScrOverlay, 0) - If sc\room = e\room Then sc\Screen = False - EndIf + If sc\CoffinEffect <> 1 Then sc\CoffinEffect = 0 + If sc\CoffinEffect = 1 Then EntityBlend(sc\ScrOverlay, 0) + If sc\room = e\room Then sc\Screen = False Next EndIf Else @@ -1808,7 +1891,15 @@ Function UpdateEvents() EndIf Next - e\EventState = UpdateElevators(e\EventState, e\room\RoomDoors[0], gatea\RoomDoors[1], e\room\Objects[0], e\room\Objects[1], e) + If Curr096 <> Null Then + If Curr096\State = 0 Or Curr096\State = 5 Then + e\EventState = UpdateElevators(e\EventState, e\room\RoomDoors[0], gatea\RoomDoors[1], e\room\Objects[0], e\room\Objects[1], e) + Else + e\EventState = Update096ElevatorEvent(e,e\EventState,e\room\RoomDoors[0],e\room\Objects[0]) + EndIf + Else + e\EventState = UpdateElevators(e\EventState, e\room\RoomDoors[0], gatea\RoomDoors[1], e\room\Objects[0], e\room\Objects[1], e) + EndIf If Contained106 = False Then If e\EventState < -1.5 And e\EventState+FPSfactor=> -1.5 Then PlaySound_Strict(OldManSFX(3)) @@ -1826,7 +1917,7 @@ Function UpdateEvents() Case "lockroom173" ;[Block] If e\room\dist < 6.0 And e\room\dist > 0 Then - If Curr173\Idle = 2 Then + If Curr173\Idle > 1 Then RemoveEvent(e) Else If (Not EntityInView(Curr173\Collider, Camera)) Or EntityDistance(Curr173\Collider, Collider)>15.0 Then @@ -1911,13 +2002,7 @@ Function UpdateEvents() e\room\RoomDoors[0]\open = False e\room\RoomDoors[1]\open = False - If e\EventState > 65*70 Then - If Rand(800)=1 And Curr106\State =>0 Then - PlaySound_Strict HorrorSFX(8) - Curr106\State = -0.1 - e\EventState = 601 - EndIf - ElseIf Curr106\State > 0 ;106 circles around the starting room + If Curr106\State > 0 ;106 circles around the starting room angle = (e\EventState/10 Mod 360) PositionEntity(Curr106\Collider, EntityX(e\room\obj), 0.2+0.35+Sin(e\EventState/14.0+i*20.0)*0.4, EntityX(e\room\obj)) RotateEntity(Curr106\Collider, 0,angle,0) @@ -1925,12 +2010,28 @@ Function UpdateEvents() AnimateNPC(Curr106, 55, 104, 0.5) RotateEntity(Curr106\Collider, 0,angle+90,0) Curr106\Idle = True + ShowEntity Curr106\obj + ShowEntity Curr106\Collider + ResetEntity Curr106\Collider + Curr106\GravityMult = 0.0 + Curr106\DropSpeed = 0 + PositionEntity(Curr106\obj, EntityX(Curr106\Collider), EntityY(Curr106\Collider) - 0.15, EntityZ(Curr106\Collider)) + RotateEntity Curr106\obj, 0, EntityYaw(Curr106\Collider), 0 + + If e\EventState > 65*70 Then + If Rand(800)=1 Then + PlaySound_Strict HorrorSFX(8) + Curr106\State = -0.1 + Curr106\Idle = False + e\EventState = 601 + EndIf + EndIf EndIf EndIf If EntityDistance(Collider, Curr106\Collider) < 0.3 Then ;106 attacks if close enough to player Curr106\Idle = False - Curr106\State = -11 + Curr106\State = -10 EndIf If e\EventState2 = 1 Then ;in the second room @@ -2008,7 +2109,7 @@ Function UpdateEvents() ElseIf dist < 8.0 e\SoundCHN = LoopSound2(e\Sound, e\SoundCHN, Camera, e\room\Objects[20], 8.0) EntityTexture e\room\Objects[20], e\room\Objects[19] - Injuries=Injuries+(8.0-dist)*FPSfactor*0.001 + Injuries=Injuries+(8.0-dist)*FPSfactor*0.0003 If dist<7.0 Then pvt% = CreatePivot() @@ -2066,7 +2167,9 @@ Function UpdateEvents() KillTimer=-1.0 EndIf EndIf - e\SoundCHN = LoopSound2(e\Sound, e\SoundCHN, Camera, e\room\Objects[i], 6.0) + If Float(e\EventStr) < 1000.0 Then + e\SoundCHN = LoopSound2(e\Sound, e\SoundCHN, Camera, e\room\Objects[i], 6.0) + EndIf EndIf Next @@ -2086,16 +2189,19 @@ Function UpdateEvents() temp = EntityDistance(Collider, e\room\Objects[17]) If temp < 2000*RoomScale Then Injuries = Injuries + (FPSfactor/4000) - - If Injuries > 1.0 Then - If Injuries - (FPSfactor/4000)=< 1.0 Then - PlaySound_Strict LoadTempSound("SFX\Room\PocketDimension\Kneel.ogg") - EndIf + e\EventStr = Float(e\EventStr)+(FPSfactor/1000.0) + + ;If Injuries > 1.0 Then + If Float(e\EventStr) > 1.0 And Float(e\EventStr) < 1000.0 Then + PlaySound_Strict LoadTempSound("SFX\Room\PocketDimension\Kneel.ogg") + LoadEventSound(e,"SFX\Room\PocketDimension\Screech.ogg") + e\EventStr = Float(1000.0) + DebugLog "Loaded screech sound" EndIf Sanity = Max(Sanity - FPSfactor / temp / 8,-1000) - e\SoundCHN = LoopSound2(OldManSFX(4), e\SoundCHN, Camera, e\room\Objects[17], 5.0, 0.6) + ;e\SoundCHN = LoopSound2(OldManSFX(4), e\SoundCHN, Camera, e\room\Objects[17], 5.0, 0.6) CurrCameraZoom = Max(CurrCameraZoom, (Sin(Float(MilliSecs2()) / 20.0)+1.0)*15.0*Max((6.0-temp)/6.0,0.0)) @@ -2119,6 +2225,7 @@ Function UpdateEvents() LoadEventSound(e,"SFX\Room\PocketDimension\TrenchPlane.ogg",1) PositionEntity e\room\Objects[20], EntityX(e\room\Objects[8],True)-1000,0,0,True + e\EventStr = Float(0) EndIf ElseIf EntityY(Collider)<-180*RoomScale ;the "exit room" temp = Distance(EntityX(Collider),EntityZ(Collider),EntityX(e\room\Objects[8],True)+1024*RoomScale,EntityZ(e\room\Objects[8],True)) @@ -2152,6 +2259,7 @@ Function UpdateEvents() UpdateRooms() UpdateDoors() + Curr106\State = 10000 Curr106\Idle = False de.decals = CreateDecal(0, EntityX(r\Objects[0],True),EntityY(r\Objects[0],True),EntityZ(r\Objects[0],True), 270, Rand(360), 0) @@ -2167,6 +2275,7 @@ Function UpdateEvents() EndIf Next Exit + Return EndIf Next EndIf @@ -2191,7 +2300,7 @@ Function UpdateEvents() e\EventState = 0 e\EventState2 = 0 - TeleportEntity(Collider,EntityX(r\obj,True),0.4,EntityZ(r\obj,True),0.3,True) + TeleportEntity(Collider,EntityX(r\Objects[10],True),0.4,EntityZ(r\Objects[10],True),0.3,True) GiveAchievement(AchvPD) SecondaryLightOn = PrevSecondaryLightOn @@ -2210,6 +2319,7 @@ Function UpdateEvents() EndIf Next Exit + Return EndIf Next ResetEntity Collider @@ -2285,6 +2395,7 @@ Function UpdateEvents() SecondaryLightOn = PrevSecondaryLightOn PrevSecondaryLightOn = 0.0 TeleportEntity(Collider,EntityX(r\obj,True),0.4,EntityZ(r\obj,True),0.3,True) + Curr106\State = 250 Curr106\Idle = False For e2.Events = Each Events @@ -2297,6 +2408,7 @@ Function UpdateEvents() EndIf Next Exit + Return EndIf Next Case 20,21,22 ;the tower room @@ -2346,6 +2458,14 @@ Function UpdateEvents() TurnEntity(Curr106\Collider, 0, Sin(MilliSecs2() / 20) * 6.0, 0, True) MoveEntity(Curr106\Collider, 0, 0, Sin(MilliSecs2() / 15) * 0.06) + ShowEntity Curr106\obj + ShowEntity Curr106\Collider + ResetEntity Curr106\Collider + Curr106\GravityMult = 0.0 + Curr106\DropSpeed = 0 + PositionEntity(Curr106\obj, EntityX(Curr106\Collider), EntityY(Curr106\Collider) - 0.15, EntityZ(Curr106\Collider)) + RotateEntity Curr106\obj, 0, EntityYaw(Curr106\Collider), 0 + If Rand(750)=1 And e\EventState2 > 12 Then BlinkTimer = -10 e\EventState2 = e\EventState2-1 @@ -2355,12 +2475,12 @@ Function UpdateEvents() If e\EventState2 = 12 Then CameraShake = 1.0 PositionEntity(Curr106\Collider, EntityX(e\room\Objects[e\EventState2],True),-1.0, EntityZ(e\room\Objects[e\EventState2],True)) - Curr106\State = -11 + Curr106\State = -10 ResetEntity Curr106\Collider EndIf Else - Curr106\State = -11 + Curr106\State = -10 Curr106\Idle = False EndIf @@ -2390,11 +2510,11 @@ Function UpdateEvents() Else HideEntity e\room\obj - - CameraClsColor Camera, 0,0,0 + ;CameraClsColor Camera, 0,0,0 e\EventState = 0 e\EventState2 = 0 e\EventState3 = 0 + e\EventStr = Float(0) EndIf ;[End Block] Case "room2cafeteria" @@ -2417,8 +2537,22 @@ Function UpdateEvents() EndIf EndIf Next - Using294=temp - If Using294 Then MouseHit1=False + If SelectedItem<>Null Then + If SelectedItem\itemtemplate\tempname="50ct" Then + RemoveItem(SelectedItem) + SelectedItem=Null + e\EventState2 = 1 + PlaySound_Strict LoadTempSound("SFX\SCP\294\coin_drop.ogg") + EndIf + EndIf + If e\EventState2 = 1 Then + Using294=temp + If Using294 Then MouseHit1=False + Else + Using294=False + Msg = "You need to insert a 50 cent coin in order to use this machine." + MsgTimer = 70*5 + EndIf EndIf EndIf EndIf @@ -2504,8 +2638,27 @@ Function UpdateEvents() EndIf BlinkTimer = Max((70*6.5-e\EventState)/5.0 - Rnd(0.0,2.0),-10) If BlinkTimer =-10 Then - If e\EventState > 70*7.5 And e\EventState-FPSfactor =< 70*7.5 Then PlaySound2(NeckSnapSFX(0),Camera,e\room\NPC[0]\Collider,8.0) - If e\EventState > 70*8.0 And e\EventState-FPSfactor =< 70*8.0 Then PlaySound2(NeckSnapSFX(1),Camera,e\room\NPC[1]\Collider,8.0) + If e\EventState > 70*7.5 And e\EventState-FPSfactor =< 70*7.5 Then + PlaySound2(NeckSnapSFX(0),Camera,e\room\NPC[0]\Collider,8.0) + ;Wallet spawning (with 3 coins) + it.Items = CreateItem("Wallet","wallet",EntityX(e\room\NPC[0]\Collider,True),EntityY(e\room\NPC[0]\Collider,True),EntityZ(e\room\NPC[0]\Collider,True)) + EntityType(it\collider, HIT_ITEM) + PointEntity it\collider,e\room\NPC[1]\Collider + MoveEntity it\collider,-0.4,0,-0.2 + TeleportEntity(it\collider,EntityX(it\collider),EntityY(it\collider),EntityZ(it\collider),-0.02,True,10) + For i = 0 To 2 + it2.Items = CreateItem("50 Cent Coin","50ct",1,1,1) + it2\Picked = True + it2\Dropped = -1 + it2\itemtemplate\found=True + it\SecondInv[i] = it2 + HideEntity(it2\collider) + EntityType(it2\collider, HIT_ITEM) + Next + EndIf + If e\EventState > 70*8.0 And e\EventState-FPSfactor =< 70*8.0 Then + PlaySound2(NeckSnapSFX(1),Camera,e\room\NPC[1]\Collider,8.0) + EndIf SetNPCFrame e\room\NPC[0], 60 e\room\NPC[0]\State=8 @@ -2558,7 +2711,7 @@ Function UpdateEvents() ElseIf e\EventState = 2 If EntityDistance(e\room\NPC[0]\Collider,e\room\Objects[1])<2.0 Then e\room\RoomDoors[0]\open = False - PlaySound2(CloseDoorSFX(0, 0), Camera, e\room\RoomDoors[0]\obj, 8.0) + PlaySound2(CloseDoorSFX(3, 0), Camera, e\room\RoomDoors[0]\obj, 8.0) PlaySound_Strict (LoadTempSound("SFX\Room\Room2ElevatorDeath.ogg")) @@ -2650,6 +2803,19 @@ Function UpdateEvents() e\EventState = UpdateLever(e\room\Objects[1]) UpdateLever(e\room\Objects[3]) EndIf + + If e\EventState3 = 0 Then + n.NPCs = CreateNPC(NPCtypeD,EntityX(e\room\Objects[6],True),0.5,EntityZ(e\room\Objects[6],True)) + RotateEntity n\Collider,0,e\room\angle+90,0 + n\State = 3 + SetNPCFrame(n,40) + n\IsDead = True + n\texture = "GFX\npcs\body2.jpg" + tex = LoadTexture_Strict(n\texture) + EntityTexture(n\obj, tex) + FreeTexture tex + e\EventState3 = 1 + EndIf ;[End Block] Case "room2offices2" ;[Block] @@ -2687,6 +2853,7 @@ Function UpdateEvents() If e\EventState = 0 Then If e\room\dist < 8 Then + HideEntity e\room\Objects[3] If (MilliSecs2() Mod 1500) < 800 Then ShowEntity e\room\Objects[4] Else @@ -2736,6 +2903,7 @@ Function UpdateEvents() PointEntity e\room\NPC[0]\Collider,e\room\Objects[2] e\room\NPC[0]\State = 2 e\EventStr = "step1" + e\EventState = 0 e\EventState2 = 0 e\EventState3 = 0 EndIf @@ -2941,7 +3109,7 @@ Function UpdateEvents() BlinkTimer = -10 - PlaySound_Strict DripSFX(0);HorrorSFX(11) + PlaySound_Strict HorrorSFX(11);DripSFX(0) PositionEntity Collider, EntityX(pvt),EntityY(pvt)+0.05,EntityZ(pvt) UpdateWorld() @@ -2978,6 +3146,12 @@ Function UpdateEvents() Local tempInt%,tempInt2% Local ix%,iy% + If I_Zone\HasCustomMT Then + If e\room\grid\Meshes[0]=0 Then + PlaceGrid_MapCreator(e\room) + EndIf + EndIf + If e\room\grid = Null Then e\room\grid = New Grids @@ -3094,7 +3268,7 @@ Function UpdateEvents() ElseIf e\room\grid\grid[(ix)+((iy+1)*gridsz)]>0 And e\room\grid\grid[(ix)+((iy-1)*gridsz)]>0 Then ;vertical If firstX=-1 Or firstY=-1 Then If e\room\grid\grid[ix-1+(iy*gridsz)]<3 And e\room\grid\grid[ix+1+(iy*gridsz)]<3 And e\room\grid\grid[ix+((iy-1)*gridsz)]<3 And e\room\grid\grid[ix+((iy+1)*gridsz)]<3 Then - If e\room\grid\grid[ix-1+((iy-1)*gridsz)]<1 And e\room\grid\grid[ix+1+((iy-1)*gridsz)]<1 And e\room\grid\grid[ix+1+((iy-1)*gridsz)]<1 And e\room\grid\grid[x-1+((iy+1)*gridsz)]<1 Then + If e\room\grid\grid[ix-1+((iy-1)*gridsz)]<1 And e\room\grid\grid[ix+1+((iy-1)*gridsz)]<1 And e\room\grid\grid[ix+1+((iy-1)*gridsz)]<1 And e\room\grid\grid[ix-1+((iy+1)*gridsz)]<1 Then firstX=ix : firstY=iy EndIf EndIf @@ -3261,7 +3435,7 @@ Function UpdateEvents() End Select If e\room\grid\grid[ix+(iy*gridsz)]=6 Or e\room\grid\grid[ix+(iy*gridsz)]=5 Then - dr=CreateDoor(e\room\zone,e\room\x+(ix*2.0)+(Cos(EntityYaw(tempInt,True))*240.0*RoomScale),8.0,e\room\z+(iy*2.0)+(Sin(EntityYaw(tempInt,True))*240.0*RoomScale),EntityYaw(tempInt,True)+90.0,Null,False,False,False,"") + dr=CreateDoor(e\room\zone,e\room\x+(ix*2.0)+(Cos(EntityYaw(tempInt,True))*240.0*RoomScale),8.0,e\room\z+(iy*2.0)+(Sin(EntityYaw(tempInt,True))*240.0*RoomScale),EntityYaw(tempInt,True)+90.0,Null,False,3,False,"") PositionEntity dr\buttons[0],EntityX(dr\buttons[0],True)+(Cos(EntityYaw(tempInt,True))*0.05),EntityY(dr\buttons[0],True)+0.0,EntityZ(dr\buttons[0],True)+(Sin(EntityYaw(tempInt,True))*0.05),True AddLight%(Null, e\room\x+ix*2.0+(Cos(EntityYaw(tempInt,True))*555.0*RoomScale), 8.0+(469.0*RoomScale), e\room\z+iy*2.0+(Sin(EntityYaw(tempInt,True))*555.0*RoomScale), 2, 600.0 * RoomScale, 255, 255, 255) @@ -3270,11 +3444,31 @@ Function UpdateEvents() RotateEntity tempInt2,0,EntityYaw(tempInt,True)+180.0,0,True PositionEntity tempInt2,e\room\x+(ix*2.0)+(Cos(EntityYaw(tempInt,True))*552.0*RoomScale),8.0+(240.0*RoomScale),e\room\z+(iy*2.0)+(Sin(EntityYaw(tempInt,True))*552.0*RoomScale) If e\room\grid\grid[ix+(iy*gridsz)]=6 Then - e\room\RoomDoors[1]=dr - e\room\Objects[3]=tempInt2 + If e\room\RoomDoors[1]=Null Then + dr\open = (Not e\room\RoomDoors[0]\open) + e\room\RoomDoors[1]=dr + Else + RemoveDoor(dr) + EndIf + If e\room\Objects[3]=0 Then + e\room\Objects[3]=tempInt2 + PositionEntity e\room\Objects[1],e\room\x+ix*2.0,8.0,e\room\z+iy*2.0,True + Else + FreeEntity tempInt2 + EndIf Else - e\room\RoomDoors[3]=dr - e\room\Objects[5]=tempInt2 + If e\room\RoomDoors[3]=Null Then + dr\open = (Not e\room\RoomDoors[2]\open) + e\room\RoomDoors[3]=dr + Else + RemoveDoor(dr) + EndIf + If e\room\Objects[5]=0 Then + e\room\Objects[5]=tempInt2 + PositionEntity e\room\Objects[0],e\room\x+ix*2.0,8.0,e\room\z+iy*2.0,True + Else + FreeEntity tempInt2 + EndIf EndIf EndIf @@ -3471,7 +3665,7 @@ Function UpdateEvents() End Select If e\room\grid\grid[ix+(iy*gridsz)]=6 Or e\room\grid\grid[ix+(iy*gridsz)]=5 Then - dr=CreateDoor(e\room\zone,e\room\x+(ix*2.0)+(Cos(EntityYaw(tempInt,True))*240.0*RoomScale),8.0,e\room\z+(iy*2.0)+(Sin(EntityYaw(tempInt,True))*240.0*RoomScale),EntityYaw(tempInt,True)+90.0,Null,False,False,False,"") + dr=CreateDoor(e\room\zone,e\room\x+(ix*2.0)+(Cos(EntityYaw(tempInt,True))*240.0*RoomScale),8.0,e\room\z+(iy*2.0)+(Sin(EntityYaw(tempInt,True))*240.0*RoomScale),EntityYaw(tempInt,True)+90.0,Null,False,3,False,"") AddLight%(Null, e\room\x+ix*2.0+(Cos(EntityYaw(tempInt,True))*555.0*RoomScale), 8.0+(469.0*RoomScale), e\room\z+iy*2.0+(Sin(EntityYaw(tempInt,True))*555.0*RoomScale), 2, 600.0 * RoomScale, 255, 255, 255) @@ -3480,15 +3674,31 @@ Function UpdateEvents() RotateEntity tempInt2,0,EntityYaw(tempInt,True)+180.0,0,True PositionEntity tempInt2,e\room\x+(ix*2.0)+(Cos(EntityYaw(tempInt,True))*552.0*RoomScale),8.0+(240.0*RoomScale),e\room\z+(iy*2.0)+(Sin(EntityYaw(tempInt,True))*552.0*RoomScale) If e\room\grid\grid[ix+(iy*gridsz)]=6 Then - dr\open = (Not e\room\RoomDoors[0]\open) - e\room\RoomDoors[1]=dr - e\room\Objects[3]=tempInt2 - PositionEntity e\room\Objects[1],e\room\x+ix*2.0,8.0,e\room\z+iy*2.0,True + If e\room\RoomDoors[1]=Null Then + dr\open = (Not e\room\RoomDoors[0]\open) + e\room\RoomDoors[1]=dr + Else + RemoveDoor(dr) + EndIf + If e\room\Objects[3]=0 Then + e\room\Objects[3]=tempInt2 + PositionEntity e\room\Objects[1],e\room\x+ix*2.0,8.0,e\room\z+iy*2.0,True + Else + FreeEntity tempInt2 + EndIf Else - dr\open = (Not e\room\RoomDoors[2]\open) - e\room\RoomDoors[3]=dr - e\room\Objects[5]=tempInt2 - PositionEntity e\room\Objects[0],e\room\x+ix*2.0,8.0,e\room\z+iy*2.0,True + If e\room\RoomDoors[3]=Null Then + dr\open = (Not e\room\RoomDoors[2]\open) + e\room\RoomDoors[3]=dr + Else + RemoveDoor(dr) + EndIf + If e\room\Objects[5]=0 Then + e\room\Objects[5]=tempInt2 + PositionEntity e\room\Objects[0],e\room\x+ix*2.0,8.0,e\room\z+iy*2.0,True + Else + FreeEntity tempInt2 + EndIf EndIf EndIf @@ -3682,8 +3892,8 @@ Function UpdateEvents() Next EndIf ;entityy(collider) >4 - e\EventState2 = UpdateElevators2(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1],e\room\Objects[2],e\room\Objects[3], e) - e\EventState3 = UpdateElevators2(e\EventState3, e\room\RoomDoors[2], e\room\RoomDoors[3],e\room\Objects[4],e\room\Objects[5], e) + e\EventState2 = UpdateElevators(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1],e\room\Objects[2],e\room\Objects[3], e, False) + e\EventState3 = UpdateElevators(e\EventState3, e\room\RoomDoors[2], e\room\RoomDoors[3],e\room\Objects[4],e\room\Objects[5], e, False) Else If e\room\grid <> Null If e\room\grid\Meshes[0]<>0 @@ -3906,6 +4116,7 @@ Function UpdateEvents() PickItem(SelectedItem) FreeEntity(e\room\Objects[2]) + e\room\Objects[2] = 0 e\EventState = 3 RemoveEvent(e) @@ -4694,9 +4905,9 @@ Function UpdateEvents() Case "room3storage" ;[Block] If PlayerRoom = e\room Then - e\EventState2 = UpdateElevators2(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1],e\room\Objects[0],e\room\Objects[1], e) + e\EventState2 = UpdateElevators(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1],e\room\Objects[0],e\room\Objects[1], e) - e\EventState3 = UpdateElevators2(e\EventState3, e\room\RoomDoors[2], e\room\RoomDoors[3],e\room\Objects[2],e\room\Objects[3], e) + e\EventState3 = UpdateElevators(e\EventState3, e\room\RoomDoors[2], e\room\RoomDoors[3],e\room\Objects[2],e\room\Objects[3], e) If EntityY(Collider)<-4600*RoomScale Then @@ -4769,7 +4980,7 @@ Function UpdateEvents() PlayerFallingPickDistance = 0.0 - If EntityY(Collider)<-6400*RoomScale And KillTimer=>0 Then + If EntityY(Collider)<-6400*RoomScale And KillTimer >= 0 And FallTimer >= 0 Then DeathMSG="" PlaySound_Strict LoadTempSound("SFX\Room\PocketDimension\Impact.ogg") KillTimer=-1.0 @@ -4815,6 +5026,7 @@ Function UpdateEvents() n\PathStatus = 0 n\State = 4 n\State2 = 0 + n\State3 = 0 RemoveEvent(e) EndIf Exit @@ -5429,7 +5641,7 @@ Function UpdateEvents() e\EventState3 = UpdateElevators(e\EventState3, e\room\RoomDoors[2], e\room\RoomDoors[3],e\room\Objects[2],e\room\Objects[3], e) Else - ShouldPlay = 8 + ShouldPlay = 25 If e\EventState = 0 Then If e\EventStr = "" And QuickLoadPercent = -1 @@ -5437,68 +5649,95 @@ Function UpdateEvents() QuickLoad_CurrEvent = e e\EventStr = "load0" EndIf + PlaySound_Strict LoadTempSound("SFX\Room\Blackout.ogg") + If EntityDistance(e\room\Objects[11],Collider) 0 + Local prevGenLever + If EntityPitch(e\room\Objects[9],True) > 0 Then + prevGenLever = True + Else + prevGenLever = False + EndIf temp = Not UpdateLever(e\room\Objects[7]) ;power feed x = UpdateLever(e\room\Objects[9]) ;generator e\room\RoomDoors[1]\locked = True e\room\RoomDoors[3]\locked = True + e\room\RoomDoors[1]\IsElevatorDoor = 0 + e\room\RoomDoors[3]\IsElevatorDoor = 0 - If temp Or x Then - ;049 appears when either of the levers is turned - e\EventState = Max(e\EventState,70*180) - - If temp And x Then - e\room\RoomDoors[1]\locked = False - e\room\RoomDoors[3]\locked = False - e\EventState2 = UpdateElevators(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1],e\room\Objects[0],e\room\Objects[1], e) - e\EventState3 = UpdateElevators(e\EventState3, e\room\RoomDoors[2], e\room\RoomDoors[3],e\room\Objects[2],e\room\Objects[3], e) - - If e\Sound2=0 Then LoadEventSound(e,"SFX\General\GeneratorOn.ogg",1) - e\SoundCHN2=LoopSound2(e\Sound2, e\SoundCHN2, Camera, e\room\Objects[8], 6.0, e\EventState3) - - If e\room\NPC[0]\Idle > 0 - i = 0 - If EntityDistance(Collider,e\room\RoomDoors[1]\frameobj)<3.0 - i = 1 - ElseIf EntityDistance(Collider,e\room\RoomDoors[3]\frameobj)<3.0 - i = 3 - EndIf - If i > 0 - ;If EntityVisible(Collider,e\room\RoomDoors[i]\frameobj) - PositionEntity e\room\NPC[0]\Collider,EntityX(e\room\Objects[i],True),EntityY(e\room\Objects[i],True),EntityZ(e\room\Objects[i],True) - ResetEntity e\room\NPC[0]\Collider - PlaySound2(ElevatorBeepSFX, Camera, e\room\Objects[i], 4.0) - UseDoor(e\room\RoomDoors[i],False) - e\room\RoomDoors[i-1]\open = False - e\room\RoomDoors[i]\open = True - e\room\NPC[0]\PathStatus = FindPath(e\room\NPC[0],EntityX(Collider),EntityY(Collider),EntityZ(Collider)) - PlaySound2(LoadTempSound("SFX\SCP\049\Greeting"+Rand(1,2)+".ogg"),Camera, e\room\NPC[0]\Collider) - e\room\NPC[0]\Idle = 0 - e\room\NPC[0]\HideFromNVG = False - ;EndIf - EndIf + If (prevGenLever <> x) Then + If x=False Then + PlaySound_Strict LightSFX + Else + PlaySound_Strict TeslaPowerUpSFX + EndIf + EndIf + + If e\EventState >= 70 Then + If x Then + ShouldPlay = 8 + e\EventState = Max(e\EventState,70*180) + SecondaryLightOn = CurveValue(1.0, SecondaryLightOn, 10.0) + If e\Sound2=0 Then LoadEventSound(e,"SFX\Ambient\Room ambience\fuelpump.ogg",1) + e\SoundCHN2=LoopSound2(e\Sound2, e\SoundCHN2, Camera, e\room\Objects[10], 6.0) + For i = 4 To 6 + e\room\RoomDoors[i]\locked = False + Next + Else + SecondaryLightOn = CurveValue(0.0, SecondaryLightOn, 10.0) + If ChannelPlaying(e\SoundCHN2) Then + StopChannel(e\SoundCHN2) EndIf + For i = 4 To 6 + e\room\RoomDoors[i]\locked = True + Next EndIf + Else + e\EventState = Min(e\EventState+FPSfactor,70) EndIf - If e\EventState < 70*190 Then - e\EventState = Min(e\EventState+FPSfactor,70*190) - ;049 spawns after 3 minutes - If e\EventState > 70*180 Then - - ;If e\room\NPC[0]=Null Then - ; For n.NPCs = Each NPCs - ; If n\NPCtype=NPCtype049 Then e\room\NPC[0]=n : Exit - ; Next - ;EndIf - ;e\room\NPC[0]\State = 1 - - e\room\RoomDoors[4]\open = True - PlaySound_Strict TeslaPowerUpSFX - PlaySound2(OpenDoorSFX(0,Rand(0,2)),Camera, e\room\RoomDoors[4]\obj, 6.0) - + If temp And x Then + e\room\RoomDoors[1]\locked = False + e\room\RoomDoors[3]\locked = False + e\EventState2 = UpdateElevators(e\EventState2, e\room\RoomDoors[0], e\room\RoomDoors[1],e\room\Objects[0],e\room\Objects[1], e) + e\EventState3 = UpdateElevators(e\EventState3, e\room\RoomDoors[2], e\room\RoomDoors[3],e\room\Objects[2],e\room\Objects[3], e) + + If e\room\NPC[0]\Idle > 0 + i = 0 + If EntityDistance(Collider,e\room\RoomDoors[1]\frameobj)<3.0 + i = 1 + ElseIf EntityDistance(Collider,e\room\RoomDoors[3]\frameobj)<3.0 + i = 3 + EndIf + If i > 0 + PositionEntity e\room\NPC[0]\Collider,EntityX(e\room\Objects[i],True),EntityY(e\room\Objects[i],True),EntityZ(e\room\Objects[i],True) + ResetEntity e\room\NPC[0]\Collider + PlaySound2(ElevatorBeepSFX, Camera, e\room\Objects[i], 4.0) + e\room\RoomDoors[i]\locked = False + UseDoor(e\room\RoomDoors[i],False,True) + e\room\RoomDoors[i-1]\open = False + e\room\RoomDoors[i]\open = True + e\room\NPC[0]\PathStatus = FindPath(e\room\NPC[0],EntityX(Collider),EntityY(Collider),EntityZ(Collider)) + If e\room\NPC[0]\Sound2 <> 0 Then FreeSound_Strict(e\room\NPC[0]\Sound2) + e\room\NPC[0]\Sound2 = LoadSound_Strict("SFX\SCP\049\Greeting"+Rand(1,2)+".ogg") + e\room\NPC[0]\SoundChn2 = LoopSound2(e\room\NPC[0]\Sound2,e\room\NPC[0]\SoundChn2,Camera,e\room\NPC[0]\obj) + e\room\NPC[0]\Idle = 0 + e\room\NPC[0]\HideFromNVG = False + e\room\NPC[0]\PrevState = 2 + EndIf + EndIf + EndIf + + If e\EventState < 70*190 Then + If e\EventState >= 70*180 Then e\room\RoomDoors[1]\open = False e\room\RoomDoors[3]\open = False e\room\RoomDoors[0]\open = True @@ -5507,32 +5746,6 @@ Function UpdateEvents() e\EventState= 70*190 EndIf ElseIf e\EventState < 70*240 - ;GiveAchievement(Achv049) - - ;If e\room\NPC[0]=Null Then - ; For n.NPCs = Each NPCs - ; If n\NPCtype=NPCtype049 Then e\room\NPC[0]=n : Exit - ; Next - ;Else - ;If EntityDistance(e\room\NPC[0]\Collider,Collider)<4.0 Then - ; e\EventState=e\EventState+FPSfactor - ; If e\EventState > 70*195 And e\EventState-FPSfactor =< 70*195 Then - ; For n.NPCs = Each NPCs ;awake the zombies - ; If n\NPCtype = NPCtypeZombie And n\State = 0 Then - ; n\State = 1 - ; SetNPCFrame(n, 155) - ; EndIf - ; Next - ; ;PlaySound2(LoadTempSound("SFX\SCP\049\Greeting"+Rand(1,2)+".ogg"),Camera, e\room\NPC[0]\Collider) - ; ElseIf e\EventState > 70*214 And e\EventState-FPSfactor =< 70*214 - ; ;PlaySound2(LoadTempSound("SFX\SCP\049\Spotted"+Rand(1,2)+".ogg"),Camera, e\room\NPC[0]\Collider) - ; ElseIf e\EventState > 70*227 And e\EventState-FPSfactor =< 70*227 - ; ;PlaySound2(LoadTempSound("SFX\SCP\049\Detected"+Rand(1,3)+".ogg"),Camera, e\room\NPC[0]\Collider) - ; e\EventState=70*241 - ; EndIf - ;EndIf - ;EndIf - For n.NPCs = Each NPCs ;awake the zombies If n\NPCtype = NPCtypeZombie And n\State = 0 Then n\State = 1 @@ -5599,12 +5812,10 @@ Function UpdateEvents() n.NPCs = CreateNPC(NPCtypeMTF, EntityX(e\room\Objects[5],True), EntityY(e\room\Objects[5],True)+0.2, EntityZ(e\room\Objects[5],True)) n\State = 6 - ;n\Reload = 70*4.75 - n\Reload = 10000 + n\Reload = 6*70+Rnd(15,30) RotateEntity n\Collider,0,EntityYaw(e\room\NPC[1]\Collider),0 n\State2 = EntityYaw(n\Collider) MoveEntity n\Collider,-0.65,0,0 - e\room\NPC[2] = n MoveEntity e\room\NPC[1]\Collider,0,0,0.1 PointEntity Collider, e\room\NPC[1]\Collider @@ -5625,22 +5836,22 @@ Function UpdateEvents() ;Msg = "" - If e\room\NPC[2]\State = 7 - If e\room\NPC[2]\State3 < 70*1.75 - e\room\NPC[2]\State3 = e\room\NPC[2]\State3 + FPSfactor - Else - e\room\NPC[2]\State = 6 - e\room\NPC[2]\Reload = e\room\NPC[1]\Reload+Rnd(5,10) - EndIf - ElseIf e\room\NPC[2]\State = 6 And e\room\NPC[2]\Reload > 70*4 - If e\room\NPC[2]\State3 > -(70*4) - e\room\NPC[2]\State3 = e\room\NPC[2]\State3 - FPSfactor - Else - e\room\NPC[2]\State3 = 0.0 - e\room\NPC[2]\Reload = 45 - e\room\NPC[2]\State = 7 - EndIf - EndIf +; If e\room\NPC[2]\State = 7 +; If e\room\NPC[2]\State3 < 70*1.75 +; e\room\NPC[2]\State3 = e\room\NPC[2]\State3 + FPSfactor +; Else +; e\room\NPC[2]\State = 6 +; e\room\NPC[2]\Reload = e\room\NPC[1]\Reload+Rnd(5,10) +; EndIf +; ElseIf e\room\NPC[2]\State = 6 And e\room\NPC[2]\Reload > 70*4 +; If e\room\NPC[2]\State3 > -(70*4) +; e\room\NPC[2]\State3 = e\room\NPC[2]\State3 - FPSfactor +; Else +; e\room\NPC[2]\State3 = 0.0 +; e\room\NPC[2]\Reload = 45 +; e\room\NPC[2]\State = 7 +; EndIf +; EndIf pvt% = CreatePivot() PositionEntity pvt%,EntityX(e\room\NPC[1]\Collider),EntityY(e\room\NPC[1]\Collider)+0.2,EntityZ(e\room\NPC[1]\Collider) @@ -5651,7 +5862,6 @@ Function UpdateEvents() FreeEntity pvt% If KillTimer < 0 Then - If ChannelPlaying(e\room\NPC[1]\SoundChn) Then StopChannel(e\room\NPC[1]\SoundChn) PlaySound_Strict LoadTempSound("SFX\Character\MTF\049\Player0492_2.ogg") RemoveEvent(e) Else @@ -5851,15 +6061,17 @@ Function UpdateEvents() EndIf EndIf - UpdateButton(e\room\Objects[4]) - If ClosestButton = e\room\Objects[4] And MouseHit1 Then - e\EventState = 1 ;start the femur breaker - If SoundTransmission = True Then ;only play sounds if transmission is on - If e\SoundCHN2 <> 0 Then - If ChannelPlaying(e\SoundCHN2) Then StopChannel e\SoundCHN2 - EndIf - FemurBreakerSFX = LoadSound_Strict("SFX\Room\106Chamber\FemurBreaker.ogg") - e\SoundCHN2 = PlaySound_Strict (FemurBreakerSFX) + If SoundTransmission Then + UpdateButton(e\room\Objects[4]) + If ClosestButton = e\room\Objects[4] And MouseHit1 Then + e\EventState = 1 ;start the femur breaker + If SoundTransmission = True Then ;only play sounds if transmission is on + If e\SoundCHN2 <> 0 Then + If ChannelPlaying(e\SoundCHN2) Then StopChannel e\SoundCHN2 + EndIf + FemurBreakerSFX = LoadSound_Strict("SFX\Room\106Chamber\FemurBreaker.ogg") + e\SoundCHN2 = PlaySound_Strict (FemurBreakerSFX) + EndIf EndIf EndIf ElseIf e\EventState = 1 ;bone broken @@ -5913,7 +6125,7 @@ Function UpdateEvents() d.Decals = CreateDecal(0, EntityX(e\room\Objects[7], True), EntityY(e\room\Objects[7], True) , EntityZ(e\room\Objects[7], True), 0, 0, 0) RotateEntity(d\obj, EntityPitch(e\room\Objects[7], True)+Rand(10,20), EntityYaw(e\room\Objects[7], True)+30, EntityRoll(d\obj)) - MoveEntity d\obj, 0,0,0.15 + MoveEntity d\obj, 0,0.05,0.2 ;0.15 RotateEntity(d\obj, EntityPitch(e\room\Objects[7], True), EntityYaw(e\room\Objects[7], True), EntityRoll(d\obj)) EntityParent d\obj, e\room\Objects[7] @@ -5923,8 +6135,8 @@ Function UpdateEvents() d\Alpha = 0.01 : d\AlphaChange = 0.005 d\Size = 0.05 : d\SizeChange = 0.002 ElseIf e\EventState3 > 3200 Then - PositionEntity e\room\Objects[8], 0, 1000.0, 0, True - PositionEntity e\room\Objects[7], 0, 1000.0, 0, True + ;PositionEntity e\room\Objects[8], 0, 1000.0, 0, True + ;PositionEntity e\room\Objects[7], 0, 1000.0, 0, True If e\EventState2 = True Then ;magnets off -> 106 caught Contained106 = True @@ -5952,6 +6164,29 @@ Function UpdateEvents() PositionEntity (e\room\Objects[6],EntityX(e\room\Objects[6],True),CurveValue(-1280.0*RoomScale,EntityY(e\room\Objects[6],True),200.0),EntityZ(e\room\Objects[6],True),True) RotateEntity(e\room\Objects[6], 0, EntityYaw(e\room\Objects[6],True), 0, True) EndIf + Else + If PlayerRoom\RoomTemplate\Name = "pocketdimension" Or PlayerRoom\RoomTemplate\Name = "dimension1499" Then + If (e\SoundCHN2<>0) Then + If ChannelPlaying(e\SoundCHN2) Then StopChannel e\SoundCHN2 + EndIf + If (e\SoundCHN<>0) Then + If ChannelPlaying(e\SoundCHN) Then StopChannel e\SoundCHN + EndIf + ElseIf PlayerRoom\RoomTemplate\Name = "room860" Then + For e2.Events = Each Events + If e2\EventName = "room860" Then + If e2\EventState = 1.0 Then + If (e\SoundCHN2<>0) Then + If ChannelPlaying(e\SoundCHN2) Then StopChannel e\SoundCHN2 + EndIf + If (e\SoundCHN<>0) Then + If ChannelPlaying(e\SoundCHN) Then StopChannel e\SoundCHN + EndIf + EndIf + Exit + EndIf + Next + EndIf EndIf ;[End Block] Case "room205" @@ -6258,7 +6493,7 @@ Function UpdateEvents() ;SecondaryLightOn = 0.0 e\EventState = 0.0 - + e\EventState3 = 0.0 Else PlaySound_Strict(LoadTempSound("SFX\Door\WoodenDoorBudge.ogg")) Msg = "The door will not budge." @@ -6275,10 +6510,12 @@ Function UpdateEvents() x = 2.0 EndIf - CameraClsColor Camera,98*x,133*x,162*x - CameraRange Camera,RoomScale,8.5 - CameraFogRange Camera,0.5,8.0 - CameraFogColor Camera,98*x,133*x,162*x + If (Not DebugHUD) + CameraClsColor Camera,98*x,133*x,162*x + CameraRange Camera,RoomScale,8.5 + CameraFogRange Camera,0.5,8.0 + CameraFogColor Camera,98*x,133*x,162*x + EndIf Else @@ -6664,8 +6901,9 @@ Function UpdateEvents() Case "tunnel2" ;[Block] If PlayerRoom = e\room Then - If Curr173\Idle = 2 Then + If Curr173\Idle > 1 Then RemoveEvent(e) + Exit Else If e\EventState = 0 Then If Distance(EntityX(Collider), EntityZ(Collider), EntityX(e\room\obj), EntityZ(e\room\obj)) < 3.5 Then @@ -6674,37 +6912,45 @@ Function UpdateEvents() LightBlink = Rnd(0.0,1.0)*(e\EventState/200) e\EventState = 1 End If - ElseIf e\EventState < 200 - - BlinkTimer = -10 - If e\EventState > 30 Then - LightBlink = 1.0 - If e\EventState-FPSfactor =< 30 Then - PlaySound_Strict LoadTempSound("SFX\ambient\general\ambient3.ogg") - EndIf - EndIf - If e\EventState-FPSfactor =< 100 And e\EventState > 100 Then - PlaySound_Strict LoadTempSound("SFX\ambient\general\ambient6.ogg") - PositionEntity(Curr173\Collider, EntityX(e\room\obj), 0.6, EntityZ(e\room\obj)) - ResetEntity(Curr173\Collider) - Curr173\Idle = True - EndIf - LightBlink = 1.0 - e\EventState = e\EventState + FPSfactor - Else - BlinkTimer = BLINKFREQ - - Curr173\Idle = False - RemoveEvent(e) End If EndIf - EndIf + EndIf + + If e\EventState > 0 And e\EventState < 200 Then + BlinkTimer = -10 + If e\EventState > 30 Then + LightBlink = 1.0 + If e\EventState-FPSfactor =< 30 Then + PlaySound_Strict LoadTempSound("SFX\ambient\general\ambient3.ogg") + EndIf + EndIf + If e\EventState-FPSfactor =< 100 And e\EventState > 100 Then + PlaySound_Strict LoadTempSound("SFX\ambient\general\ambient6.ogg") + PositionEntity(Curr173\Collider, EntityX(e\room\obj), 0.6, EntityZ(e\room\obj)) + ResetEntity(Curr173\Collider) + Curr173\Idle = True + EndIf + LightBlink = 1.0 + e\EventState = e\EventState + FPSfactor + ElseIf e\EventState <> 0 Then + BlinkTimer = BLINKFREQ + + Curr173\Idle = False + RemoveEvent(e) + EndIf ;[End Block] Case "tunnel106" ;[Block] If e\EventState = 0 Then If e\room\dist < 5.0 And e\room\dist > 0 Then - If Curr106\State >= 0 Then e\EventState = 1 + If Curr106\State >= 0 Then + e\EventState = 1 + Else + If Curr106\State <= -10 And EntityDistance(Curr106\Collider,Collider)>5 And (Not EntityInView(Curr106\obj,Camera)) Then + e\EventState = 1 + e\EventState2 = 1 + EndIf + EndIf ElseIf Contained106 RemoveEvent(e) EndIf @@ -6728,20 +6974,41 @@ Function UpdateEvents() End If EndIf Else + If e\EventState2 = 1 Then + ShouldPlay = 10 + EndIf e\EventState = e\EventState+FPSfactor - - PositionEntity(Curr106\Collider, EntityX(e\room\obj, True) - Sin(MilliSecs2() / 150.0) / 4.0, EntityY(Collider) + 1.0 - Min(Sin(e\EventState)*1.5,1.1), EntityZ(e\room\obj, True) - Sin(MilliSecs2() / 190.0) / 4.0) - - ;TranslateEntity(Curr106\Collider, 0, -Max((3.0-dist),0), 0, True) - PointEntity(Curr106\Collider, Camera) - Curr106\State = -11 - AnimateNPC(Curr106, 55, 104, 0.1) - Curr106\Idle = True - - If e\EventState > 180 Then + If e\EventState <= 180 Then + PositionEntity(Curr106\Collider, EntityX(e\room\obj, True), EntityY(Collider) + 1.0 - Min(Sin(e\EventState)*1.5,1.1), EntityZ(e\room\obj, True), True) + PointEntity(Curr106\Collider, Camera) + AnimateNPC(Curr106, 55, 104, 0.1) + Curr106\Idle = True + Curr106\State = 1 + ResetEntity(Curr106\Collider) + Curr106\DropSpeed = 0 + PositionEntity(Curr106\obj, EntityX(Curr106\Collider), EntityY(Curr106\Collider) - 0.15, EntityZ(Curr106\Collider)) + RotateEntity Curr106\obj, 0, EntityYaw(Curr106\Collider), 0 + ShowEntity Curr106\obj + ElseIf e\EventState > 180 And e\EventState < 300 Then Curr106\Idle = False - PositionEntity(Curr106\Collider, EntityX(Curr106\Collider), -3.0, EntityZ(Curr106\Collider), True) - + Curr106\State = -10 + PositionEntity(Curr106\Collider, EntityX(e\room\obj, True), -3.0, EntityZ(e\room\obj, True), True) + Curr106\PathTimer = 70*10 + Curr106\PathStatus = 0 + Curr106\PathLocation = 0 + de.Decals = CreateDecal(0, EntityX(e\room\obj, True), 0.01, EntityZ(e\room\obj, True), 90, Rand(360), 0) + de\Size = 0.05 : de\SizeChange = 0.01 : EntityAlpha(de\obj, 0.8) : UpdateDecals + e\EventState = 300 + ElseIf e\EventState < 800 + If EntityY(Curr106\Collider)>=EntityY(Collider)-0.05 Then + RemoveEvent(e) + Else + TranslateEntity Curr106\Collider, 0, ((EntityY(Collider,True) - 0.11) - EntityY(Curr106\Collider)) / 50.0, 0 + If EntityY(Curr106\Collider)<-0.1 Then + Curr106\CurrSpeed = 0.0 + EndIf + EndIf + Else RemoveEvent(e) EndIf @@ -6766,8 +7033,8 @@ Function UpdateEvents() SpriteViewMode(e\room\Objects[2],2) ScaleSprite(e\room\Objects[2],182.0*RoomScale*0.5, 192.0*RoomScale*0.5) pvt% = CreatePivot(e\room\obj) - PositionEntity pvt%,-595.0,224.0,-208.0,False - ;PositionEntity(e\room\Objects[2], e\room\x - 595.0 * RoomScale, 224.0*RoomScale, e\room\z - 208.0 * RoomScale) + ;PositionEntity pvt%,-595.0,224.0,-208.0,False + PositionEntity pvt%,-632.0,224.0,-208.0,False PositionEntity(e\room\Objects[2], EntityX(pvt,True), EntityY(pvt,True), EntityZ(pvt,True)) FreeEntity pvt RotateEntity e\room\Objects[2],0,e\room\angle,0 @@ -6899,7 +7166,7 @@ Function UpdateEvents() If MouseDown1 Then DrawArrowIcon(2) = True - RotateEntity(e\room\Objects[1], Max(Min(EntityPitch(e\room\Objects[1])+Max(Min(-mouse_y_speed_1,10.0),-10), 89), 35), EntityYaw(e\room\Objects[1]), 0) + RotateEntity(e\room\Levers[0], Max(Min(EntityPitch(e\room\Levers[0])+Max(Min(-mouse_y_speed_1,10.0),-10), 89), 35), EntityYaw(e\room\Levers[0]), 0) EndIf EndIf EndIf @@ -6912,7 +7179,7 @@ Function UpdateEvents() EndIf EndIf - If EntityPitch(e\room\Objects[1],True)<40 Then + If EntityPitch(e\room\Levers[0],True)<40 Then e\EventState = 2 PlaySound_Strict LeverSFX Else @@ -6929,9 +7196,9 @@ Function UpdateEvents() e\room\RoomDoors[1]\locked = False e\room\RoomDoors[2]\locked = False - RotateEntity (e\room\Objects[1],CurveAngle(1,EntityPitch(e\room\Objects[1],True),15.0),EntityYaw(e\room\Objects[1],True),0,True) + RotateEntity (e\room\Levers[0],CurveAngle(1,EntityPitch(e\room\Levers[0],True),15.0),EntityYaw(e\room\Levers[0],True),0,True) - If EntityPitch(e\room\Objects[1],True)=<1.0 Then + If EntityPitch(e\room\Levers[0],True)=<1.0 Then RemoveEvent(e) EndIf EndIf @@ -7114,6 +7381,7 @@ Function UpdateEvents() If Abs(EntityY(it\collider) - (e\room\y + 648.0 * RoomScale)) < 104.0 Then e\EventState = 1 e\SoundCHN = PlaySound2(MachineSFX, Camera, e\room\Objects[1]) + e\room\RoomDoors[1]\SoundCHN = PlaySound2(LoadTempSound("SFX\SCP\914\DoorClose.ogg"), Camera, e\room\RoomDoors[1]\obj) Exit EndIf End If @@ -7187,6 +7455,10 @@ Function UpdateEvents() e\room\RoomDoors[1]\open = False If e\EventState > 70 * 2 Then + If e\room\RoomDoors[0]\open=True Then + e\room\RoomDoors[0]\SoundCHN = PlaySound2(LoadTempSound("SFX\SCP\914\DoorClose.ogg"), Camera, e\room\RoomDoors[0]\obj) + EndIf + e\room\RoomDoors[0]\open = False EndIf @@ -7255,10 +7527,15 @@ Function UpdateEvents() e\room\RoomDoors[1]\open = True RotateEntity(e\room\Objects[0], 0, 0, 0) e\EventState = 0 + + Local opensfx914 = LoadTempSound("SFX\SCP\914\DoorOpen.ogg") + e\room\RoomDoors[0]\SoundCHN = PlaySound2(opensfx914, Camera, e\room\RoomDoors[0]\obj) + e\room\RoomDoors[1]\SoundCHN = PlaySound2(opensfx914, Camera, e\room\RoomDoors[1]\obj) End If End If EndIf + UpdateSoundOrigin(e\SoundCHN,Camera,e\room\Objects[1]) ;[End Block] Case "1048a" ;[Block] @@ -7328,7 +7605,7 @@ Function UpdateEvents() Case 3 Msg = "Ears are growing all over your body. They are crawling on your skin." End Select - + MsgTimer = 70.0 * 3.0 Else If (e\EventState2>600.0 And e\EventState2-FPSfactor <= 600.0) Select Rand(4) @@ -7341,11 +7618,13 @@ Function UpdateEvents() Case 4 Msg = Chr(34)+"Can't... Breathe..."+Chr(34) End Select - + MsgTimer = 70.0 * 5.0 EndIf If (e\EventState2>70*15) Then + DeathMSG = "A dead body covered in ears was found in [REDACTED]. Subject was presumably attacked by an instance of SCP-1048-A and suffocated to death by the ears. " + DeathMSG = DeathMSG + "Body was sent for autopsy." Kill() e\EventState = 4 RemoveEvent(e) @@ -7400,6 +7679,15 @@ Function UpdateEvents() e\EventState = 1 EndIf + + ;WIP + p.Particles = CreateParticle(EntityX(e\room\Objects[0],True), EntityY(e\room\Objects[0],True), EntityZ(e\room\Objects[0],True), 6, 0.2, 0, 10) + p\speed = 0.01 + RotateEntity(p\pvt, -60, e\room\angle-90, 0) + + p\Achange = -0.02 + + e\SoundCHN = LoopSound2(AlarmSFX(3),e\SoundCHN,Camera,e\room\Objects[3],5) EndIf ;[End Block] Case "room2scps2" @@ -7702,6 +7990,7 @@ Function UpdateEvents() e\room\RoomDoors[1]\locked = False UseDoor(e\room\RoomDoors[0]) UseDoor(e\room\RoomDoors[1]) + PlaySound_Strict(AlarmSFX(4)) ElseIf EntityDistance(e\room\Objects[0],Collider)>2.4 e\EventState3 = 0.0 EndIf @@ -7737,7 +8026,7 @@ Function UpdateEvents() FreeEntity pvt EndIf - + ElseIf e\EventState2 > 70*3 And e\EventState < 70*5.5 pvt% = CreatePivot(e\room\obj) For i = 0 To 1 @@ -7796,7 +8085,7 @@ Function UpdateEvents() ;e\EventState2: Variable used for the SCP-049 event ;e\EventState3: Checks if Lever is activated or not - ;Camera-Spawning Code + SCP-049-Spawning (will now be loaded in a pointer) + ;Camera-Spawning Code + SCP-049-Spawning (will now be loaded in the QuickLoadEvents function) ;[Block] If PlayerRoom = e\room If e\EventStr = "" And QuickLoadPercent = -1 @@ -7940,12 +8229,14 @@ Function UpdateEvents() e\room\NPC[0]\PrevState = 2 DebugLog "Path2" Case 3 - ;e\room\NPC[0]\PathStatus = FindPath(e\room\NPC[0],EntityX(e\room\Objects[7],True),EntityY(e\room\Objects[7],True),EntityZ(e\room\Objects[7],True)) - ;e\room\NPC[0]\PathStatus = FindPath(e\room\NPC[0],EntityX(e\room\obj,True),EntityY(e\room\Objects[7],True),EntityZ(e\room\obj,True)) - e\room\NPC[0]\PathStatus = FindPath(e\room\NPC[0],e\room\NPC[0]\PathX,0.1,e\room\NPC[0]\PathZ) - e\room\NPC[0]\PrevState = 1 + e\room\NPC[0]\PathStatus = FindPath(e\room\NPC[0],EntityX(e\room\Objects[17],True),EntityY(e\room\Objects[17],True),EntityZ(e\room\Objects[17],True)) + e\room\NPC[0]\PrevState = 2 DebugLog "Path3" Case 4 + e\room\NPC[0]\PathStatus = FindPath(e\room\NPC[0],e\room\NPC[0]\PathX,0.1,e\room\NPC[0]\PathZ) + e\room\NPC[0]\PrevState = 2 + DebugLog "Path4" + Case 5 e\EventState2 = 5 End Select e\room\NPC[0]\PathTimer# = 0.0 @@ -7955,7 +8246,7 @@ Function UpdateEvents() ElseIf e\EventState2 = 4 If e\room\NPC[0]\State <> 5 e\EventState2 = 7 - e\room\NPC[0]\State3 = 5.0 + e\room\NPC[0]\State3 = 6.0 DebugLog "fffffffff" EndIf ElseIf e\EventState2 = 5 @@ -7978,7 +8269,9 @@ Function UpdateEvents() e\EventState2 = 7 Else ;Still playing the Music for SCP-049 (in the real, SCP-049's State will be set to 2, causing it to stop playing the chasing track) - ShouldPlay = 20 + If PlayerRoom = e\room Then + ShouldPlay = 20 + EndIf If e\room\NPC[0]\PathStatus<>1 e\room\NPC[0]\Idle = 70*60 ;(Making SCP-049 idle for one minute (twice as fast for aggressive NPCs = True)) PositionEntity e\room\NPC[0]\Collider,0,500,0 @@ -8032,72 +8325,77 @@ Function UpdateEvents() EndIf ;[End Block] - ;Lever for checkpoint locking (might have a function in the future for the case if the checkpoint needs to be locked again) - If PlayerRoom = e\room + ;Other code + ;[Block] + If PlayerRoom = e\room Then + ;Lever for checkpoint locking (might have a function in the future for the case if the checkpoint needs to be locked again) e\EventState3 = UpdateLever(e\room\Levers[0]) If e\EventState3 = 1 Then UpdateCheckpointMonitors(0) + If MonitorTimer# < 50 Then + EntityTexture e\room\Objects[20],e\room\Textures[0],1 + Else + EntityTexture e\room\Objects[20],e\room\Textures[0],2 + EndIf Else TurnCheckpointMonitorsOff(0) + EntityTexture e\room\Objects[20],e\room\Textures[0],0 EndIf - EndIf - - ;Checking if the monitors and such should be rendered or not - If PlayerRoom = e\room And Abs(EntityY(e\room\RoomDoors[0]\frameobj)-EntityY(Collider))>1.0 - For i = 0 To 14 - If e\room\Objects[i]<>0 - ShowEntity e\room\Objects[i] - EndIf - Next - For sc.SecurityCams = Each SecurityCams - If sc\IsRoom2slCam - If sc\ScrObj<>0 - ShowEntity sc\ScrObj - EndIf - If sc\ScrOverlay<>0 - ShowEntity sc\ScrOverlay - EndIf - EndIf - If sc\room = e\room - If sc\ScrObj<>0 - ShowEntity sc\ScrObj - EndIf - If sc\ScrOverlay<>0 - ShowEntity sc\ScrOverlay + + ;Checking if the monitors and such should be rendered or not + If Abs(EntityY(e\room\RoomDoors[0]\frameobj)-EntityY(Collider))>1.0 Then + For i = 0 To 14 + If e\room\Objects[i]<>0 And i<>7 Then + ShowEntity e\room\Objects[i] EndIf - EndIf - Next - For i = 0 To 3 - If PlayerRoom\Adjacent[i]<>Null - EntityAlpha(GetChild(PlayerRoom\Adjacent[i]\obj,2),0) - EndIf - Next - Else - For i = 0 To 14 - If e\room\Objects[i]<>0 - HideEntity e\room\Objects[i] - EndIf - Next - For sc.SecurityCams = Each SecurityCams - If sc\IsRoom2slCam - If sc\ScrObj<>0 - HideEntity sc\ScrObj + Next + For sc.SecurityCams = Each SecurityCams + If sc\room = e\room Then + If sc\ScrObj<>0 + ShowEntity sc\ScrObj + EndIf + If sc\ScrOverlay<>0 + ShowEntity sc\ScrOverlay + EndIf + Exit EndIf - If sc\ScrOverlay<>0 - HideEntity sc\ScrOverlay + Next + For i = 0 To 3 + If PlayerRoom\Adjacent[i]<>Null Then + EntityAlpha(GetChild(PlayerRoom\Adjacent[i]\obj,2),0) EndIf - EndIf - If sc\room = e\room - If sc\ScrObj<>0 - HideEntity sc\ScrObj + Next + Else + For i = 0 To 14 + If e\room\Objects[i]<>0 And i<>7 Then + HideEntity e\room\Objects[i] EndIf - If sc\ScrOverlay<>0 - HideEntity sc\ScrOverlay + Next + For sc.SecurityCams = Each SecurityCams + If sc\room = e\room Then + If sc\ScrObj<>0 + HideEntity sc\ScrObj + EndIf + If sc\ScrOverlay<>0 + HideEntity sc\ScrOverlay + EndIf + Exit EndIf - EndIf - Next + Next + EndIf EndIf + For e2.Events = Each Events + If e2\EventName = "008" + If e2\EventState = 2 + EntityTexture e\room\Objects[21],e\room\Textures[0],3 + Else + EntityTexture e\room\Objects[21],e\room\Textures[1],6 + EndIf + EndIf + Next + ;[End Block] + ;[End Block] Case "096spawn" ;[Block] @@ -8149,7 +8447,7 @@ Function UpdateEvents() EndIf For e2.Events = Each Events If e2\EventName = "room2servers" - If e2\EventState = 0 And (Abs(e2\room\dist-e\room\dist)e\room If e\room\Objects[0]<>0 For i = 1 To 15 HideEntity e\room\Objects[i] Next EndIf + If EntityY(Collider)>EntityY(e\room\obj)-0.5 + PlayerRoom = e\room + EndIf EndIf If e\EventState = 2.0 + If e\SoundCHN<>0 Then + StopStream_Strict(e\SoundCHN) + StopChannel(e\SoundCHN2) + e\SoundCHN = 0 + e\SoundCHN2 = 0 + EndIf HideEntity NTF_1499Sky HideChunks() For n.NPCs = Each NPCs @@ -8283,7 +8589,18 @@ Function UpdateEvents() ;n\Idle = True EndIf Next + For du.Dummy1499 = Each Dummy1499 + FreeEntity(du\obj) + Delete du + Next + If e\EventState3 < 70*30 Then + e\EventState3 = 0.0 + EndIf e\EventState = 1.0 + If e\Sound2 <> 0 Then + FreeSound_Strict e\Sound2 + e\Sound2 = 0 + EndIf EndIf ;[End Block] Case "room2offices035" @@ -8327,6 +8644,27 @@ Function UpdateEvents() EndIf EndIf ;[End Block] + Case "room1archive" + ;[Block] + If e\EventState = 0 + e\EventState = Rand(1,3) + Else + e\room\RoomDoors[0]\KeyCard = e\EventState + EndIf + ;[End Block] + Case "room2shaft" + ;[Block] + If e\EventState = 0 Then + e\room\NPC[0]=CreateNPC(NPCtypeGuard, EntityX(e\room\Objects[1],True), EntityY(e\room\Objects[1],True)+0.5, EntityZ(e\room\Objects[1],True)) + RotateEntity e\room\NPC[0]\Collider, 0, e\room\angle+180,0, True + + SetNPCFrame (e\room\NPC[0], 286) + e\room\NPC[0]\State = 8 + + e\EventState = 1 + RemoveEvent(e) + EndIf + ;[End Block] End Select If e<>Null Then @@ -8375,7 +8713,7 @@ Function UpdateEvents() End Function Function UpdateDimension1499() - Local e.Events,n.NPCs,r.Rooms,it.Items + Local e.Events,n.NPCs,n2.NPCs,r.Rooms,it.Items,i%,j%,du.Dummy1499,du2.Dummy1499,temp%,scale#,x%,y% For e.Events = Each Events If e\EventName = "dimension1499" @@ -8384,6 +8722,8 @@ Function UpdateDimension1499() ;0: The player never entered SCP-1499 ;1: The player had already entered the dimension at least once ;2: The player is in dimension + ;e\EventState2: Used to count the amount of times the player has entered the 1499 dimension (for a little spawning event) + ;e\EventState3: Variable used for the 1499 church event If PlayerRoom = e\room Then If e\EventState < 2.0 ;1499 random generator @@ -8408,7 +8748,136 @@ Function UpdateDimension1499() ; ResetEntity n\Collider ; EndIf ;Next + Local value% = Rand(2,3) + If e\EventState2 = value% Or e\EventState2=4 Then + For i = -1 To 1 + For j = -1 To 1 + If i<>0 And j<>0 Then + n.NPCs = CreateNPC(NPCtype1499,EntityX(Collider)+(0.75*i),EntityY(Collider)+0.05,EntityZ(Collider)+(0.75*j)) + PointEntity n\Collider,Collider + RotateEntity n\Collider,0,EntityYaw(n\Collider),0 + n\State = 2 + ElseIf i<>0 Or j<>0 Then + n.NPCs = CreateNPC(NPCtype1499,EntityX(Collider)+i,EntityY(Collider)+0.05,EntityZ(Collider)+j) + PointEntity n\Collider,Collider + RotateEntity n\Collider,0,EntityYaw(n\Collider),0 + n\State = 2 + EndIf + Next + Next + e\EventState2 = 5 + EndIf + If e\EventState3 < 70*30 Then + ;Guards at the entrance to church + n.NPCs = CreateNPC(NPCtype1499,e\room\x+4055.0*RoomScale,e\room\y+240.0*RoomScale,e\room\z+1884.0*RoomScale) + n\PrevState = 3 + n\Angle = 270 + RotateEntity n\Collider,0,n\Angle,0 + n2.NPCs = CreateNPC(NPCtype1499,e\room\x+4055.0*RoomScale,e\room\y+240.0*RoomScale,e\room\z+2876.0*RoomScale) + n2\PrevState = 3 + n2\Angle = 270 + RotateEntity n2\Collider,0,n2\Angle,0 + n\Target = n2 + n2\Target = n + e\room\NPC[2] = n + e\room\NPC[3] = n2 + ;Guard at stairs + n.NPCs = CreateNPC(NPCtype1499,e\room\x-2761.0*RoomScale,e\room\y+240.0*RoomScale,e\room\z+3204.0*RoomScale) + n\PrevState = 1 + n\Angle = 180 + RotateEntity n\Collider,0,n\Angle,0 + n\Speed = 0.0 + ;King + n.NPCs = CreateNPC(NPCtype1499,e\room\x-1917.0*RoomScale,e\room\y+1904.0*RoomScale,e\room\z+2308.0*RoomScale) + n\PrevState = 2 + n\Angle = 270 + RotateEntity n\Collider,0,n\Angle,0 + tex = LoadTexture_Strict("GFX\npcs\1499_King.jpg") + EntityTexture n\obj,tex + FreeTexture tex + e\room\NPC[0] = n + ;Guard next to king + n.NPCs = CreateNPC(NPCtype1499,e\room\x-1917.0*RoomScale,e\room\y+1904.0*RoomScale,e\room\z+2052.0*RoomScale) + n\PrevState = 1 + n\Angle = 270 + RotateEntity n\Collider,0,n\Angle,0 + e\room\NPC[1] = n + ;1499-1 instances praying in church + ;Zone 1 + For x=0 To 7 + For y=0 To 2 + du = New Dummy1499 + For n.NPCs = Each NPCs + If n\NPCtype = NPCtype1499 And n\PrevState<>2 Then + du\obj = CopyEntity(n\obj) + Exit + EndIf + Next + scale# = (GetINIFloat("DATA\NPCs.ini", "SCP-1499-1", "scale") / 4.0) * Rnd(0.8,1.0) + ScaleEntity du\obj, scale#,scale#,scale# + EntityFX du\obj,1 + du\anim = Rand(0,1) + ;2560=x 768=z + ;1687.0 + PositionEntity du\obj,Max(Min((e\room\x+(1887.0-((2560.0/7.0)*x))*RoomScale)+Rnd(-0.5,0.5),e\room\x+1887.0*RoomScale),e\room\x-873.0*RoomScale),e\room\y,Max(Min((e\room\z+(1796.0-(384.0*y))*RoomScale)+Rnd(-0.5,0.5),e\room\z+1796.0*RoomScale),e\room\z+1028.0*RoomScale) + RotateEntity du\obj,0,270,0 + EntityAutoFade du\obj,25,39 + Next + Next + ;Zone 2 + For x=0 To 6 + For y=0 To 2 + du = New Dummy1499 + For n.NPCs = Each NPCs + If n\NPCtype = NPCtype1499 And n\PrevState<>2 Then + du\obj = CopyEntity(n\obj) + Exit + EndIf + Next + scale# = (GetINIFloat("DATA\NPCs.ini", "SCP-1499-1", "scale") / 4.0) * Rnd(0.8,1.0) + ScaleEntity du\obj, scale#,scale#,scale# + EntityFX du\obj,1 + du\anim = Rand(0,1) + ;2048=x 768=z + ;1175.0 + PositionEntity du\obj,Max(Min((e\room\x+(1375.0-((2048.0/6.0)*x))*RoomScale)+Rnd(-0.5,0.5),e\room\x+1375.0*RoomScale),e\room\x-873.0*RoomScale),e\room\y,Max(Min((e\room\z+(3588-(384.0*y))*RoomScale)+Rnd(-0.5,0.5),e\room\z+3588.0*RoomScale),e\room\z+2820.0*RoomScale) + RotateEntity du\obj,0,270,0 + EntityAutoFade du\obj,25,39 + Next + Next + ;4055, 240, 2084 + ;4055, 240, 3076 + ;-2761, 240, 3204 for stairs guard + ;-1449, 240, 1092 + ;-1449, 240, 3524 + ;-1917, 1904, 2052 - guard + ;-1917, 1904, 2308 - king + + ;1687, 240, 1028 + ;1687, 240, 1796 + ;-873, 240, 1796 + ;-873, 240, 1028 + ;that's the First zone + ;1175, 240, 2820 + ;1175, 240, 3588 + ;-873, 240, 3588 + ;-873, 240, 2820 + ;that's For second zone + Else + HideEntity e\room\Levers[1] + EndIf + + For i = 0 To 14 + n.NPCs = CreateNPC(NPCtype1499,EntityX(Collider)+Rnd(-20,20),EntityY(Collider)+0.1,EntityZ(Collider)+Rnd(-20,20)) + If Rand(2)=1 Then n\State2 = 500*3 + n\Angle = Rnd(360) + n\State2 = 0 + If EntityDistance(n\Collider,Collider)<10.0 Then + n\State = 2 + EndIf + Next EndIf + ;PositionEntity e\room\Objects[0],0,800,0 If (Not DebugHUD) CameraFogRange Camera,40,80 @@ -8444,12 +8913,152 @@ Function UpdateDimension1499() EndIf EndIf Next + For du = Each Dummy1499 + If e\EventState3 < 70*30 Then + If du\anim=0 Then + ;321-361 + If AnimTime(du\obj)<=360.5 Then + Animate2(du\obj,AnimTime(du\obj),321,361,0.2,False) + ;362-402 + ElseIf AnimTime(du\obj)>361.5 And AnimTime(du\obj)<=401.5 Then + Animate2(du\obj,AnimTime(du\obj),362,402,0.2,False) + Else + temp = Rand(0,1) + If temp=0 Then + SetAnimTime(du\obj,321) + Else + SetAnimTime(du\obj,362) + EndIf + EndIf + Else + ;413-453 + If AnimTime(du\obj)<=452.5 Then + Animate2(du\obj,AnimTime(du\obj),413,453,0.2,False) + ;454-498 + ElseIf AnimTime(du\obj)>453.5 And AnimTime(du\obj)<=497.5 Then + Animate2(du\obj,AnimTime(du\obj),454,498,0.2,False) + Else + temp = Rand(0,1) + If temp=0 Then + SetAnimTime(du\obj,413) + Else + SetAnimTime(du\obj,454) + EndIf + EndIf + EndIf + Else + If du\anim=0 Then + If AnimTime(du\obj)<=411.5 And AnimTime(du\obj)>320.5 Then + Animate2(du\obj,AnimTime(du\obj),403,412,0.2,False) + Else + Animate2(du\obj,AnimTime(du\obj),296,320,0.2,True) + EndIf + Else + If AnimTime(du\obj)<=507.5 And AnimTime(du\obj)>320.5 Then + Animate2(du\obj,AnimTime(du\obj),499,508,0.2,False) + Else + Animate2(du\obj,AnimTime(du\obj),296,320,0.2,True) + EndIf + EndIf + Local pvt = CreatePivot() + PositionEntity pvt,EntityX(du\obj),EntityY(du\obj),EntityZ(du\obj),True + PointEntity pvt,Collider + RotateEntity du\obj,0,CurveAngle(EntityYaw(pvt),EntityYaw(du\obj)-180,10.0)+180,0 + FreeEntity pvt + EndIf + Next + ;-56,0,2287 + ;X distance: 2160 + ;Z distance: 1408 + + ;Player is inside the church + If e\EventState3 < 70*10 Then + If Abs(EntityX(Collider)-(e\room\x-56.0*RoomScale))<2160.0*RoomScale Then + If Abs(EntityZ(Collider)-(e\room\z+2287.0*RoomScale))<1408.0*RoomScale Then + e\EventState3 = e\EventState3 + FPSfactor + ;CurrMusicVolume = 1.0 + EndIf + EndIf + ElseIf e\EventState3 >= 70*10 And e\EventState3 < 70*20 Then + For i = 0 To 1 + e\room\NPC[i]\Reload = 1 + Next + e\EventState3 = 70*20 + ElseIf e\EventState3 = 70*20 + If e\room\NPC[0]\Frame > 854.5 Then + For i = 2 To 3 + If i = 2 + If e\room\NPC[i]\Sound <> 0 Then FreeSound_Strict e\room\NPC[i]\Sound : e\room\NPC[i]\Sound = 0 + e\room\NPC[i]\Sound = LoadSound_Strict("SFX\SCP\1499\Triggered.ogg") + e\room\NPC[i]\SoundChn = PlaySound2(e\room\NPC[i]\Sound, Camera, e\room\NPC[i]\Collider,20.0) + EndIf + e\room\NPC[i]\State = 1 + e\room\NPC[i]\Frame = 203 + Next + e\EventState3 = 70*30 + EndIf + EndIf + + ;If Abs(EntityX(Collider)-(e\room\x-56.0*RoomScale))<2160.0*RoomScale Then + ; If Abs(EntityZ(Collider)-(e\room\z+2287.0*RoomScale))<1408.0*RoomScale Then + ; ShouldPlay = 66 + ; EndIf + ;EndIf + + If e\room\NPC[0]<>Null Then + ShowEntity e\room\Levers[1] + If e\EventState3 < 70*30 Then + ShouldPlay = 66 + If NowPlaying = 66 Then + If e\SoundCHN = 0 Then + e\Sound2 = LoadSound_Strict("SFX\Music\HaveMercyOnMe(Choir).ogg") + e\SoundCHN = StreamSound_Strict("SFX\Music\HaveMercyOnMe(NoChoir).ogg",MusicVolume) + e\SoundCHN_isStream = True + EndIf + ;If e\SoundCHN2<>0 Then + ; UpdateStreamSoundOrigin(e\SoundCHN2,Camera,e\room\Levers[0]) + ;EndIf + EndIf + If e\Sound2<>0 Then + e\SoundCHN2 = LoopSound2(e\Sound2,e\SoundCHN2,Camera,e\room\Levers[0],10,MusicVolume) + EndIf + Else + ShouldPlay = 19 + If e\SoundCHN<>0 Then + StopStream_Strict(e\SoundCHN) + StopChannel(e\SoundCHN2) + e\SoundCHN = 0 + e\SoundCHN2 = 0 + EndIf + If e\Sound2 <> 0 Then + FreeSound_Strict e\Sound2 + e\Sound2 = 0 + EndIf + EndIf + EndIf + + If EntityDistance(Collider,e\room\obj)>40.0 + For du.Dummy1499 = Each Dummy1499 + HideEntity du\obj + Next + Else + For du.Dummy1499 = Each Dummy1499 + ShowEntity du\obj + Next + EndIf Else DropSpeed = 0 EndIf CurrStepSFX=3 + PlayerFallingPickDistance = 0.0 Else If e\EventState = 2.0 + If e\SoundCHN<>0 Then + StopStream_Strict(e\SoundCHN) + StopChannel(e\SoundCHN2) + e\SoundCHN = 0 + e\SoundCHN2 = 0 + EndIf HideEntity NTF_1499Sky HideChunks() For n.NPCs = Each NPCs @@ -8458,7 +9067,18 @@ Function UpdateDimension1499() ;n\Idle = True EndIf Next + For du.Dummy1499 = Each Dummy1499 + FreeEntity du\obj + Delete du + Next + If e\EventState3 < 70*30 Then + e\EventState3 = 0.0 + EndIf e\EventState = 1.0 + If e\Sound2 <> 0 Then + FreeSound_Strict e\Sound2 + e\Sound2 = 0 + EndIf EndIf EndIf ;[End Block] @@ -8498,6 +9118,10 @@ Function UpdateEndings() For n.NPCs = Each NPCs RemoveNPC(n) Next + Curr173 = Null + Curr106 = Null + Curr096 = Null + Curr5131 = Null CameraFogMode(Camera, 0) SecondaryLightOn = True @@ -8928,6 +9552,8 @@ Function UpdateEndings() EndIf Next Curr173\Idle = True + Curr096 = Null + Curr5131 = Null CameraFogMode(Camera, 0) SecondaryLightOn = True @@ -8935,24 +9561,17 @@ Function UpdateEndings() HideDistance = 35.0 For i = 2 To 4 - e\room\NPC[i] = CreateNPC(NPCtypeApache, e\room\x, 100.0, e\room\z) + e\room\NPC[i] = CreateNPC(NPCtypeApache, e\room\x, e\room\y+11, e\room\z) e\room\NPC[i]\State = (Not Contained106) Next CreateConsoleMsg("WARNING! Teleporting away from this area may cause bugs or crashing.") - TranslateEntity(e\room\obj, 0,12000.0*RoomScale,0) - TranslateEntity(Collider, 0,12000.0*RoomScale,0) - Sky = sky_CreateSky("GFX\map\sky\sky") RotateEntity Sky,0,e\room\angle,0 DrawLoading(60) - For n.NPCs = Each NPCs - If n\NPCtype = NPCtypeMTF Then Delete n - Next - For i = 0 To 1 e\room\NPC[i] = CreateNPC(NPCtypeGuard, EntityX(e\room\Objects[i+5],True),EntityY(e\room\Objects[i+5],True),EntityZ(e\room\Objects[i+5],True)) e\room\NPC[i]\State = 0 @@ -8988,11 +9607,11 @@ Function UpdateEndings() e\room\Objects[9] = LoadMesh_Strict("GFX\map\lightgunbase.b3d") ScaleEntity e\room\Objects[9], RoomScale,RoomScale,RoomScale EntityFX(e\room\Objects[9],0) - PositionEntity(e\room\Objects[9], xtemp, (992.0+12000.0)*RoomScale, ztemp) + PositionEntity(e\room\Objects[9], xtemp, e\room\y+992.0*RoomScale, ztemp) e\room\Objects[10] = LoadMesh_Strict("GFX\map\lightgun.b3d") EntityFX(e\room\Objects[10],0) ScaleEntity e\room\Objects[10], RoomScale,RoomScale,RoomScale - PositionEntity(e\room\Objects[10], xtemp, (992.0+12000.0+288.0)*RoomScale, ztemp-176.0*RoomScale,True) + PositionEntity(e\room\Objects[10], xtemp, e\room\y+(992.0+288.0)*RoomScale, ztemp-176.0*RoomScale,True) EntityParent e\room\Objects[10],e\room\Objects[9] RotateEntity e\room\Objects[9], 0, 48, 0 RotateEntity e\room\Objects[10], 40, 0, 0 @@ -9009,6 +9628,8 @@ Function UpdateEndings() ResetEntity Collider e\EventState = 1.0 + RotateEntity Collider,0,EntityYaw(Collider)+(e\room\angle+180),0 + If (Not Contained106) Then PlaySound_Strict LoadTempSound("SFX\Ending\GateA\106Escape.ogg") DrawLoading(100) @@ -9031,7 +9652,7 @@ Function UpdateEndings() For i = 2 To 4 If e\room\NPC[i]<>Null Then If e\room\NPC[i]\State < 2 Then - PositionEntity(e\room\NPC[i]\Collider, EntityX(e\room\Objects[3],True)+Cos(e\EventState/10+(120*i))*6000.0*RoomScale,15000*RoomScale,EntityZ(e\room\Objects[3],True)+Sin(e\EventState/10+(120*i))*6000.0*RoomScale) + PositionEntity(e\room\NPC[i]\Collider, EntityX(e\room\Objects[3],True)+Cos(e\EventState/10+(120*i))*6000.0*RoomScale,e\room\y+11,EntityZ(e\room\Objects[3],True)+Sin(e\EventState/10+(120*i))*6000.0*RoomScale) RotateEntity e\room\NPC[i]\Collider,7.0,(e\EventState/10+(120*i)),20.0 EndIf EndIf @@ -9213,7 +9834,7 @@ Function UpdateEndings() e\room\RoomDoors[2]\open = True For i = 2 To 4 - Delete e\room\NPC[i] + RemoveNPC(e\room\NPC[i]) e\room\NPC[i]=Null Next @@ -9223,7 +9844,11 @@ Function UpdateEndings() ElseIf e\EventState3 = 1.0 For i = 5 To 8 - If EntityDistance(e\room\NPC[i]\Collider,Collider)> 4.0 Then e\room\NPC[i]\State = 3 + If EntityDistance(e\room\NPC[i]\Collider,Collider)> 4.0 Then + e\room\NPC[i]\State = 3 + Else + e\room\NPC[i]\State = 1 + EndIf Next If Abs(EntityY(Collider)-EntityY(e\room\Objects[11],True))<1.0 Then @@ -9233,14 +9858,16 @@ Function UpdateEndings() ScaleMesh (e\room\Objects[12], 0.32/21.3, 0.32/21.3, 0.32/21.3) PositionEntity e\room\Objects[12], EntityX(e\room\Objects[11],True), EntityY(e\room\Objects[11],True), EntityZ(e\room\Objects[11],True) - obj = CopyEntity(e\room\Objects[12]) - PositionEntity obj, EntityX(e\room\obj,True)-3968*RoomScale, EntityY(e\room\Objects[11],True), EntityZ(e\room\obj,True)-1920*RoomScale + e\room\Objects[17] = CopyEntity(e\room\Objects[12]) + PositionEntity e\room\Objects[17], EntityX(e\room\obj,True)-3968*RoomScale, EntityY(e\room\Objects[11],True), EntityZ(e\room\obj,True)-1920*RoomScale obj = CopyEntity(e\room\Objects[12]) PositionEntity obj, EntityX(e\room\obj,True)-4160*RoomScale, EntityY(e\room\Objects[11],True), EntityZ(e\room\obj,True)-1920*RoomScale + EntityParent obj,e\room\Objects[17] obj = CopyEntity(e\room\Objects[12]) PositionEntity obj, EntityX(e\room\obj,True)-4064*RoomScale, EntityY(e\room\Objects[11],True), EntityZ(e\room\obj,True)-2112*RoomScale + EntityParent obj,e\room\Objects[17] e\SoundCHN = PlaySound2(LoadTempSound("SFX\Ending\GateA\Bell1.ogg"), Camera, e\room\Objects[12]) diff --git a/dplayx.dll b/dplayx.dll new file mode 100644 index 000000000..ca26fca71 Binary files /dev/null and b/dplayx.dll differ