├── .editorconfig
├── .gitattributes
├── .gitignore
├── .gitmodules
├── README.md
├── SessionSeven.sln
├── appveyor.yml
├── screenshot.png
└── src
├── Game
├── Application
│ ├── Application.csproj
│ ├── Program.cs
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── README.md
│ ├── app.config
│ └── icon.ico
├── GameLogic
│ ├── Game Logic.csproj
│ ├── Properties
│ │ ├── AssemblyInfo.cs
│ │ ├── Basement.Resources.Designer.cs
│ │ ├── Basement.Resources.de.resx
│ │ ├── Basement.Resources.es.resx
│ │ ├── Basement.Resources.pl.resx
│ │ ├── Basement.Resources.resx
│ │ ├── Items.Resources.Designer.cs
│ │ ├── Items.Resources.de.resx
│ │ ├── Items.Resources.es.resx
│ │ ├── Items.Resources.pl.resx
│ │ ├── Items.Resources.resx
│ │ ├── Resources.Designer.cs
│ │ ├── Resources.de.resx
│ │ ├── Resources.es.resx
│ │ ├── Resources.pl.resx
│ │ ├── Resources.resx
│ │ ├── Resources_Session_1.Designer.cs
│ │ ├── Resources_Session_1.de.resx
│ │ ├── Resources_Session_1.es.resx
│ │ ├── Resources_Session_1.pl.resx
│ │ ├── Resources_Session_1.resx
│ │ ├── Resources_Session_2.Designer.cs
│ │ ├── Resources_Session_2.de.resx
│ │ ├── Resources_Session_2.es.resx
│ │ ├── Resources_Session_2.pl.resx
│ │ ├── Resources_Session_2.resx
│ │ ├── Resources_Session_3.Designer.cs
│ │ ├── Resources_Session_3.de.resx
│ │ ├── Resources_Session_3.es.resx
│ │ ├── Resources_Session_3.pl.resx
│ │ ├── Resources_Session_3.resx
│ │ ├── Resources_Session_4.Designer.cs
│ │ ├── Resources_Session_4.de.resx
│ │ ├── Resources_Session_4.es.resx
│ │ ├── Resources_Session_4.pl.resx
│ │ ├── Resources_Session_4.resx
│ │ ├── Resources_Session_5.Designer.cs
│ │ ├── Resources_Session_5.de.resx
│ │ ├── Resources_Session_5.es.resx
│ │ ├── Resources_Session_5.pl.resx
│ │ ├── Resources_Session_5.resx
│ │ ├── Resources_Session_6.Designer.cs
│ │ ├── Resources_Session_6.de.resx
│ │ ├── Resources_Session_6.es.resx
│ │ ├── Resources_Session_6.pl.resx
│ │ ├── Resources_Session_6.resx
│ │ ├── Resources_Session_7.Designer.cs
│ │ ├── Resources_Session_7.de.resx
│ │ ├── Resources_Session_7.es.resx
│ │ ├── Resources_Session_7.pl.resx
│ │ └── Resources_Session_7.resx
│ ├── README.md
│ ├── SessionSeven.cs
│ ├── Tree.cs
│ ├── Tree.tt
│ ├── actors
│ │ ├── BlooddropEmitter.cs
│ │ ├── Mouse.cs
│ │ ├── Ryan.cs
│ │ ├── RyanBlooddrop.cs
│ │ ├── RyanVoice.cs
│ │ └── Scene.cs
│ ├── base
│ │ ├── Components
│ │ │ ├── BatteryCompartment.cs
│ │ │ ├── Circle.cs
│ │ │ ├── Combinable.cs
│ │ │ ├── DroneDisplacement.cs
│ │ │ ├── Givable.cs
│ │ │ ├── RandomCountdown.cs
│ │ │ ├── Score.cs
│ │ │ ├── ShadowRectangle.cs
│ │ │ └── TracerLine.cs
│ │ ├── CutsceneDisposeControl.cs
│ │ └── Scene.cs
│ ├── content
│ │ ├── build.bat
│ │ ├── build.tt
│ │ ├── tree.cs
│ │ └── tree.tt
│ ├── gui
│ │ ├── Fader.cs
│ │ ├── Mouse.cs
│ │ ├── Scene.cs
│ │ ├── ScreenText.cs
│ │ ├── dialog
│ │ │ ├── DialogMenuState.cs
│ │ │ ├── Menu.cs
│ │ │ ├── Scene.cs
│ │ │ └── options
│ │ │ │ ├── BaseOption.cs
│ │ │ │ ├── IDialogOptions.cs
│ │ │ │ ├── Options.cs
│ │ │ │ ├── ScoreOption.cs
│ │ │ │ ├── ScoreOptions.cs
│ │ │ │ └── base
│ │ │ │ └── BaseOptions.cs
│ │ ├── interaction
│ │ │ ├── ActionTextLabel.cs
│ │ │ ├── AnyObject.cs
│ │ │ ├── InteractionBar.cs
│ │ │ ├── RandomTexts.cs
│ │ │ ├── Scene.cs
│ │ │ ├── ScrollDownButton.cs
│ │ │ ├── ScrollUpButton.cs
│ │ │ └── verbs
│ │ │ │ ├── GetRandomTextDelegate.cs
│ │ │ │ ├── Keymapping.cs
│ │ │ │ ├── LockedVerb.cs
│ │ │ │ ├── Verbs.cs
│ │ │ │ ├── VerbsHighlight.cs
│ │ │ │ └── base
│ │ │ │ └── VerbButton.cs
│ │ ├── inventory
│ │ │ └── Inventory.cs
│ │ └── positionselection
│ │ │ ├── IPositionable.cs
│ │ │ ├── Label.cs
│ │ │ └── Scene.cs
│ ├── items
│ │ ├── AnimalSkeleton.cs
│ │ ├── BandageStrip.cs
│ │ ├── Bandages.cs
│ │ ├── BandagesCut.cs
│ │ ├── Baton.cs
│ │ ├── BatonWithString.cs
│ │ ├── BatteryA.cs
│ │ ├── BatteryB.cs
│ │ ├── Blanket.cs
│ │ ├── Crowbar.cs
│ │ ├── CrowbarBroken.cs
│ │ ├── DrawerKey.cs
│ │ ├── Drone.cs
│ │ ├── DronePackage.cs
│ │ ├── DrugPrescriptionRyan.cs
│ │ ├── Envelope.cs
│ │ ├── Flashlight.cs
│ │ ├── GuitarStrings.cs
│ │ ├── Hammer.cs
│ │ ├── Hazelnuts.cs
│ │ ├── Paperclip.cs
│ │ ├── Paperclips.cs
│ │ ├── Pills.cs
│ │ ├── Portrait.cs
│ │ ├── RFIDAntenna.cs
│ │ ├── RFIDAntennaBoxCabinet.cs
│ │ ├── RFIDAntennaBoxShelf.cs
│ │ ├── RFIDBook.cs
│ │ ├── RemoteControl.cs
│ │ ├── SawKit.cs
│ │ ├── Scissors.cs
│ │ ├── Screwdriver.cs
│ │ ├── TherapyLog.cs
│ │ ├── WoodenBox.cs
│ │ └── base
│ │ │ └── ItemBase.cs
│ ├── menu
│ │ ├── CreditsWindow.cs
│ │ ├── ExitConfirmation.cs
│ │ ├── MainMenu.cs
│ │ ├── MenuButton.cs
│ │ ├── MenuItems.cs
│ │ ├── SaveLoadGame.cs
│ │ └── SettingsWindow.cs
│ ├── rooms
│ │ ├── basement
│ │ │ ├── BloodOnFloor.cs
│ │ │ ├── Boiler.cs
│ │ │ ├── BoxScrews.cs
│ │ │ ├── BoxWritingMaterials.cs
│ │ │ ├── CabinetLeftDoor.cs
│ │ │ ├── CabinetLock.cs
│ │ │ ├── CabinetRightDoor.cs
│ │ │ ├── CabinetSawKit.cs
│ │ │ ├── CabinetScrapbooks.cs
│ │ │ ├── CabinetSupplies.cs
│ │ │ ├── CabinetToolbox.cs
│ │ │ ├── Cactus.cs
│ │ │ ├── Carpet.cs
│ │ │ ├── CarpetWall.cs
│ │ │ ├── Crates.cs
│ │ │ ├── Crowbar.cs
│ │ │ ├── Crumbs.cs
│ │ │ ├── Desk.cs
│ │ │ ├── Door.cs
│ │ │ ├── DrawerLeft.cs
│ │ │ ├── DrawerRight.cs
│ │ │ ├── DrillingMachine.cs
│ │ │ ├── DrillingMachineCable.cs
│ │ │ ├── DrillingMachineUsed.cs
│ │ │ ├── Drone.cs
│ │ │ ├── DronePackage.cs
│ │ │ ├── FamilyPortrait.cs
│ │ │ ├── Folders.cs
│ │ │ ├── Foreground.cs
│ │ │ ├── Guitar.cs
│ │ │ ├── GuitarCase.cs
│ │ │ ├── GuitarStrings.cs
│ │ │ ├── Hammer.cs
│ │ │ ├── Hazelnuts.cs
│ │ │ ├── HazelnutsOnFloor.cs
│ │ │ ├── LightSwitch.cs
│ │ │ ├── Lights.cs
│ │ │ ├── MedicalCabinet.cs
│ │ │ ├── MedicalCabinetBloodStain.cs
│ │ │ ├── MissingTool.cs
│ │ │ ├── ModemLight.cs
│ │ │ ├── MouseHole.cs
│ │ │ ├── Nut.cs
│ │ │ ├── Portrait.cs
│ │ │ ├── RFIDAntennaCabinet.cs
│ │ │ ├── RFIDAntennaFloor.cs
│ │ │ ├── RFIDAntennaShelf.cs
│ │ │ ├── Receipt.cs
│ │ │ ├── RyanLying.cs
│ │ │ ├── Scene.cs
│ │ │ ├── SceneTransparentFloor.cs
│ │ │ ├── Screwdriver.cs
│ │ │ ├── Shelf.cs
│ │ │ ├── ShelfBlanketFlashlight.cs
│ │ │ ├── ShelfBox.cs
│ │ │ ├── ShelfComicBox.cs
│ │ │ ├── ShelfEngineeringBooks.cs
│ │ │ ├── ShelfRFIDBook.cs
│ │ │ ├── ShelfSingleBook.cs
│ │ │ ├── SocketsCenter.cs
│ │ │ ├── SocketsLeft.cs
│ │ │ ├── ToDoBoard.cs
│ │ │ ├── ToolBar.cs
│ │ │ ├── VentilationShaft.cs
│ │ │ ├── Window.cs
│ │ │ ├── WoodenBox.cs
│ │ │ ├── WoodenPanel.cs
│ │ │ ├── WoodenPanelSoundTrigger.cs
│ │ │ └── Workbench.cs
│ │ ├── jailcell
│ │ │ ├── Foreground.cs
│ │ │ └── Scene.cs
│ │ ├── letter
│ │ │ └── Scene.cs
│ │ ├── office
│ │ │ ├── Ryan.cs
│ │ │ ├── RyanEyes.cs
│ │ │ ├── RyanState.cs
│ │ │ ├── Scene.cs
│ │ │ ├── Table.cs
│ │ │ ├── Therapist.cs
│ │ │ └── Water.cs
│ │ ├── paddedcell
│ │ │ └── Scene.cs
│ │ ├── sunset
│ │ │ └── Scene.cs
│ │ └── title
│ │ │ └── Scene.cs
│ └── sessions
│ │ ├── Scene.cs
│ │ ├── SessionFive.cs
│ │ ├── SessionFour.cs
│ │ ├── SessionOne.cs
│ │ ├── SessionSeven.cs
│ │ ├── SessionSix.cs
│ │ ├── SessionThree.cs
│ │ └── SessionTwo.cs
└── Playthrough
│ ├── Playthrough.cs
│ ├── Playthrough.csproj
│ ├── Properties
│ └── AssemblyInfo.cs
│ ├── README.md
│ ├── app.config
│ └── icon.ico
└── Tests
└── SessionSeven.Functional.Test
├── Circle.cs
├── Cutscene.cs
├── Playthrough.cs
├── Properties
└── AssemblyInfo.cs
├── README.md
├── Resources.cs
├── ScriptsExtension.cs
├── SessionSeven.Functional.Test.csproj
├── TestEngine.cs
└── packages.config
/.gitattributes:
--------------------------------------------------------------------------------
1 | ###############################################################################
2 | # Set default behavior to automatically normalize line endings.
3 | ###############################################################################
4 | * text=auto
5 |
6 | ###############################################################################
7 | # Set default behavior for command prompt diff.
8 | #
9 | # This is need for earlier builds of msysgit that does not have it on by
10 | # default for csharp files.
11 | # Note: This is only used by command line
12 | ###############################################################################
13 | #*.cs diff=csharp
14 |
15 | ###############################################################################
16 | # Set the merge driver for project and solution files
17 | #
18 | # Merging from the command prompt will add diff markers to the files if there
19 | # are conflicts (Merging from VS is not affected by the settings below, in VS
20 | # the diff markers are never inserted). Diff markers may cause the following
21 | # file extensions to fail to load in VS. An alternative would be to treat
22 | # these files as binary and thus will always conflict and require user
23 | # intervention with every merge. To do so, just uncomment the entries below
24 | ###############################################################################
25 | #*.sln merge=binary
26 | #*.csproj merge=binary
27 | #*.vbproj merge=binary
28 | #*.vcxproj merge=binary
29 | #*.vcproj merge=binary
30 | #*.dbproj merge=binary
31 | #*.fsproj merge=binary
32 | #*.lsproj merge=binary
33 | #*.wixproj merge=binary
34 | #*.modelproj merge=binary
35 | #*.sqlproj merge=binary
36 | #*.wwaproj merge=binary
37 |
38 | ###############################################################################
39 | # behavior for image files
40 | #
41 | # image files are treated as binary by default.
42 | ###############################################################################
43 | #*.jpg binary
44 | #*.png binary
45 | #*.gif binary
46 |
47 | ###############################################################################
48 | # diff behavior for common document formats
49 | #
50 | # Convert binary document formats to text before diffing them. This feature
51 | # is only available from the command line. Turn it on by uncommenting the
52 | # entries below.
53 | ###############################################################################
54 | #*.doc diff=astextplain
55 | #*.DOC diff=astextplain
56 | #*.docx diff=astextplain
57 | #*.DOCX diff=astextplain
58 | #*.dot diff=astextplain
59 | #*.DOT diff=astextplain
60 | #*.pdf diff=astextplain
61 | #*.PDF diff=astextplain
62 | #*.rtf diff=astextplain
63 | #*.RTF diff=astextplain
64 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "lib/STACK"]
2 | path = lib/STACK
3 | url = https://github.com/advdotnet/STACK-Engine
4 | branch = master
5 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Session Seven
2 |
3 | [](https://ci.appveyor.com/project/advdotnet/session-seven)
4 |
5 | ## About
6 | *Session Seven* is a free point-and-click escape room game meant for fans of the old school 2D adventures. It has been released as of March the 1st 2019 and can be played on [Steam](https://store.steampowered.com/app/915720/Session_Seven/) or downloaded from the [official homepage](https://www.sessionseven.com).
7 | Experienced players should take about one to two hours to complete the game on the first try. The puzzles are chosen to be a good compromise between easy and hard to target both casual and expert adventure gamers.
8 | The game and its engine are written in C#. You might be able to build the game, but running the game and executing some tests require additional content files which are only provided in the binary distribution.
9 |
10 | ## Story
11 | You play as Ryan, an estranged father and husband who has just awoken, beaten, bruised, and alone in a locked cellar. Your head is throbbing, and you have only a few vague, twisted memories about how you might have gotten there. Armed only with the sparse tools around you and the strange, possibly dark mementos you find along the way, it is up to you to find out what happened and escape the basement.
12 |
13 | Your life is not the only one on the line. Your wife and son may be in danger too. Through a series of puzzles and player-directed flashbacks with an unidentified therapist, you decide how Ryan's story ends... and how it began. It is vital that you find your way out, but it is just as important that you figure out how you got in. Session Seven is a point-and-click adventure and an interactive story, and there are multiple directions in which the player can take their narrative.
14 |
15 | ## Warnings
16 | Reading through the sources might spoil the gameplay experience.
17 |
18 | ## Screenshot
19 | 
20 |
21 | ## Built With
22 |
23 | * [STACK Engine](https://github.com/advdotnet/STACK-Engine) - graphic adventure game engine based on .NET
24 | * [FNA](https://github.com/FNA-XNA/FNA/) - Accuracy-focused XNA4 reimplementation for open platforms
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/appveyor.yml:
--------------------------------------------------------------------------------
1 | version: 1.0.{build}
2 | image: Visual Studio 2019
3 | install:
4 | - cmd: git submodule update --init --recursive
5 | build:
6 | project: SessionSeven.sln
7 | verbosity: minimal
8 | test:
9 | assemblies:
10 | only:
11 | - SessionSeven.Functional.Test
12 | categories:
13 | except:
14 | - GPU
15 | - FileSystem
16 | skip_commits:
17 | files:
18 | - '**/*.png'
19 | - '**/*.gif'
20 | - '**/*.md'
--------------------------------------------------------------------------------
/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/advdotnet/Session-Seven/13ea177ed188ed49e0eb33f8eb42ca62c08e8593/screenshot.png
--------------------------------------------------------------------------------
/src/Game/Application/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using System;
4 | using System.Diagnostics;
5 | using System.IO;
6 |
7 | namespace SessionSeven
8 | {
9 | ///
10 | /// The main class.
11 | ///
12 | public static class Program
13 | {
14 |
15 | ///
16 | /// The main entry point for the application.
17 | ///
18 | [STAThread]
19 | [DebuggerStepThrough]
20 | private static void Main()
21 | {
22 | try
23 | {
24 | AppDomain.CurrentDomain.UnhandledException += (s, e)
25 | => FatalExceptionObject(e.ExceptionObject);
26 |
27 | using (var game = new Window(new Game()))
28 | {
29 | game.IsMouseVisible = false;
30 | game.Run();
31 | }
32 | }
33 | catch (Exception e)
34 | {
35 | HandleException(e);
36 |
37 | if (Debugger.IsAttached)
38 | {
39 | throw;
40 | }
41 | }
42 | }
43 |
44 | private static void FatalExceptionObject(object exceptionObject)
45 | {
46 | var exception = exceptionObject as Exception ?? new NotSupportedException(
47 | $"Unhandled exception doesn't derive from System.Exception: {exceptionObject}");
48 | HandleException(exception);
49 | }
50 |
51 | private static void HandleException(Exception e)
52 | {
53 | FNALoggerEXT.LogInfo("Exception: " + e.ToString());
54 | AppendToFile("error.log", e.ToString());
55 |
56 | if (null != e.InnerException)
57 | {
58 | HandleException(e.InnerException);
59 | }
60 | }
61 |
62 | private static void AppendToFile(string filename, string text)
63 | {
64 | SaveGame.EnsureStorageFolderExists(Game.SAVEGAMEFOLDER);
65 | var directory = SaveGame.UserStorageFolder(Game.SAVEGAMEFOLDER);
66 | var path = System.IO.Path.Combine(directory, filename);
67 | using (var w = File.AppendText(path))
68 | {
69 | w.WriteLine(text);
70 | }
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/Game/Application/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Session Seven")]
8 | [assembly: AssemblyProduct("Session Seven")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyCompany("PianoMitRum")]
12 | [assembly: AssemblyCopyright("Copyright © PianoMitRum")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("97891cc4-2ec5-432b-b37c-d52a8c499180")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/src/Game/Application/README.md:
--------------------------------------------------------------------------------
1 | # Application
2 |
3 | Entry point of the game. Running the game require additional content files which are only provided in the binary distribution.
4 |
5 |
--------------------------------------------------------------------------------
/src/Game/Application/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Game/Application/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/advdotnet/Session-Seven/13ea177ed188ed49e0eb33f8eb42ca62c08e8593/src/Game/Application/icon.ico
--------------------------------------------------------------------------------
/src/Game/GameLogic/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Session Seven")]
9 | [assembly: AssemblyProduct("Session Seven")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyCompany("PianoMitRum")]
13 | [assembly: AssemblyCopyright("Copyright © PianoMitRum")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("97891cc4-2ec5-432b-b37c-d52a8c499180")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
38 | [assembly: InternalsVisibleTo("SessionSeven.Functional.Test")]
39 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/README.md:
--------------------------------------------------------------------------------
1 | # GameLogic
2 |
3 | This class library contains all of the gameplay logic.
4 |
5 | Additional content files are only provided in the binary distribution.
6 |
7 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/actors/RyanVoice.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using SessionSeven.Entities;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 |
8 | namespace SessionSeven.Actors
9 | {
10 | [Serializable]
11 | public class RyanVoice : Entity
12 | {
13 | public RyanVoice()
14 | {
15 | Transform
16 | .Create(this)
17 | .SetPosition((Game.VIRTUAL_WIDTH * 3 / 4) - 120, 150)
18 | .SetAbsolute(true);
19 |
20 | Text
21 | .Create(this)
22 | .SetColor(Color.White)
23 | .SetFont(content.fonts.pixeloperator_outline_BMF)
24 | .SetWidth(600);
25 |
26 | Scripts
27 | .Create(this);
28 | }
29 |
30 | public Script Say(string text, float duration = 0)
31 | {
32 | return Get().Start(SayWrapper(text, duration));
33 | }
34 |
35 | private IEnumerator SayWrapper(string text, float duration = 0)
36 | {
37 | Tree.Basement.RyanLying.Get().State = State.Talking;
38 | var sayScript = Get().Say(text, duration);
39 | yield return Script.WaitFor(sayScript);
40 | Tree.Basement.RyanLying.Get().State = State.Idle;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/actors/Scene.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SessionSeven.Actors
4 | {
5 |
6 | [Serializable]
7 | public class Scene : STACK.Scene
8 | {
9 | public Scene(Inventory playerInventory)
10 | {
11 | Enabled = false;
12 | Visible = true;
13 |
14 | Push(new RyanVoice(),
15 | new Ryan(playerInventory),
16 | new Mouse());
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/Components/Circle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using System;
3 |
4 | namespace SessionSeven.Components
5 | {
6 | [Serializable]
7 | public struct Circle
8 | {
9 | private float _radius;
10 | private float _radiusSquared;
11 | private Vector2 _center;
12 |
13 | public Vector2 Center
14 | {
15 | get => _center;
16 | set => _center = value;
17 | }
18 |
19 | public float Radius
20 | {
21 | get => _radius;
22 | set
23 | {
24 | _radius = value;
25 | _radiusSquared = value * value;
26 | }
27 | }
28 |
29 | public Circle(Vector2 center, float radius) : this()
30 | {
31 | Center = center;
32 | Radius = radius;
33 | }
34 |
35 | ///
36 | /// Returns true if the given point is inside the circle
37 | ///
38 | ///
39 | ///
40 | public bool Contains(Vector2 point)
41 | {
42 | return (point - Center).LengthSquared() <= _radiusSquared;
43 | }
44 |
45 | ///
46 | /// Returns true, if this circle is intersected by a line segment given by vectors a and b.
47 | ///
48 | ///
49 | ///
50 | ///
51 | public bool Intersects(Vector2 a, Vector2 b)
52 | {
53 | if (0 >= Radius)
54 | {
55 | return false;
56 | }
57 |
58 | var p1 = a - Center;
59 | var p2 = b - Center;
60 |
61 | var diff = b - a;
62 | var d = (p1.X * p2.Y) - (p2.X * p1.Y);
63 |
64 | var di = (_radiusSquared * diff.LengthSquared()) - (d * d);
65 |
66 | return (di >= 0) && InBetween(Center.X, a.X, b.X) && InBetween(Center.Y, a.Y, b.Y);
67 | }
68 |
69 | private static bool InBetween(float val, float a, float b)
70 | {
71 | return Math.Min(a, b) <= val &&
72 | val <= Math.Max(a, b);
73 | }
74 |
75 | public override bool Equals(object obj) => obj is Circle circle && this == circle;
76 |
77 | public bool Equals(Circle obj) => this == obj;
78 |
79 | public override int GetHashCode() => Center.GetHashCode() ^ Radius.GetHashCode();
80 |
81 | public static bool operator ==(Circle x, Circle y)
82 | {
83 | return x.Center == y.Center && x.Radius == y.Radius;
84 | }
85 |
86 | public static bool operator !=(Circle x, Circle y)
87 | {
88 | return !(x == y);
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/Components/Combinable.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using System;
3 |
4 | namespace SessionSeven.Components
5 | {
6 | ///
7 | /// Entity can be combined with other entities by the "USE" verb.
8 | ///
9 | [Serializable]
10 | public class Combinable : Component
11 | {
12 | private bool _isCombinable;
13 |
14 | public bool IsCombinable
15 | {
16 | get => _isCombinable;
17 | set => _isCombinable = value;
18 | }
19 |
20 | public Combinable()
21 | {
22 | _isCombinable = true;
23 | }
24 |
25 | public static Combinable Create(Entity entity)
26 | {
27 | return entity.Add();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/Components/DroneDisplacement.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.Components
7 | {
8 | ///
9 | /// Component that calculates a displacement for the drone's position with respect to time.
10 | ///
11 | [Serializable]
12 | public class DroneDisplacement : Component, IUpdate
13 | {
14 | private float _amplitude = 10;
15 | public float Amplitude
16 | {
17 | get => _amplitude;
18 | set => _amplitude = Math.Max(value, 0);
19 | }
20 |
21 | public float Speed { get; set; }
22 | public bool Enabled { get; set; }
23 | public float UpdateOrder { get; set; }
24 |
25 | private int _accelerationPhase = 0;
26 | private int _positionPhase = 0;
27 | private int _amplitudePhase = 0;
28 |
29 | public DroneDisplacement()
30 | {
31 | Speed = 150f;
32 | Enabled = true;
33 | }
34 |
35 | public void Reset()
36 | {
37 | _positionPhase = Entity.World.Get().CreateInt(71);
38 | _amplitudePhase = 0;
39 | _accelerationPhase = Entity.World.Get().CreateInt(71);
40 | }
41 |
42 | public Vector2 GetDisplacement()
43 | {
44 | var scale = 150f;
45 | var acceleratedPositionPhase = Math.Sin(_accelerationPhase / scale) * 2;
46 |
47 | var x = Math.Cos((_positionPhase / scale) + acceleratedPositionPhase);
48 | var y = Math.Sin((_positionPhase / scale) + acceleratedPositionPhase);
49 |
50 | var ampl = Math.Sin(_amplitudePhase / scale) * Amplitude;
51 |
52 | var result = new Vector2((float)x, (float)y);
53 | result.Normalize();
54 |
55 | return result * (float)ampl;
56 | }
57 |
58 | public void Update()
59 | {
60 | _accelerationPhase++;
61 | _positionPhase++;
62 | _amplitudePhase++;
63 | }
64 |
65 | public static DroneDisplacement Create(Entity entity)
66 | {
67 | return entity.Add();
68 | }
69 |
70 | public DroneDisplacement SetAmplitude(float val) { Amplitude = val; return this; }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/Components/Givable.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using System;
3 |
4 | namespace SessionSeven.Components
5 | {
6 | ///
7 | /// Entity can be given to other entities by using the "GIVE" verb.
8 | ///
9 | [Serializable]
10 | public class Givable : Component
11 | {
12 | private bool _isGivable;
13 |
14 | public bool IsGivable
15 | {
16 | get => _isGivable;
17 | set => _isGivable = value;
18 | }
19 |
20 | public Givable()
21 | {
22 | _isGivable = true;
23 | }
24 |
25 | public static Givable Create(Entity entity)
26 | {
27 | return entity.Add();
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/Components/RandomCountdown.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Components
6 | {
7 | ///
8 | /// Component that sequentially counts down a random amount of updates.
9 | ///
10 | [Serializable]
11 | public class RandomCountdown : Component, IUpdate
12 | {
13 | ///
14 | /// True if the count down finished for the amount of frames given by Duration
15 | ///
16 | public bool Action { get; private set; }
17 | public int Duration { get; set; }
18 | public int MinUpdates { get; set; }
19 | public int MaxUpdates { get; set; }
20 | public bool Enabled { get; set; }
21 | public float UpdateOrder { get; set; }
22 |
23 | private const int _uninitialized = -1;
24 | private int _counter = _uninitialized;
25 |
26 | public RandomCountdown()
27 | {
28 | Action = false;
29 | Enabled = true;
30 | }
31 |
32 | public void Reset()
33 | {
34 | _counter = World.Get().CreateInt(MinUpdates, MaxUpdates) + Duration;
35 | }
36 |
37 | public void Update()
38 | {
39 | if (_uninitialized == _counter)
40 | {
41 | Reset();
42 | }
43 |
44 | Action = _counter < Duration;
45 |
46 | _counter = Math.Max(_counter - 1, _uninitialized);
47 | }
48 |
49 | [NonSerialized]
50 | private World _world = null;
51 |
52 | private new World World => _world ?? (_world = (null == Entity) ? Scene.World : Entity.World);
53 |
54 | public static RandomCountdown Create(Entity entity)
55 | {
56 | return entity.Add();
57 | }
58 |
59 | public RandomCountdown SetDuration(int value) { Duration = value; return this; }
60 | public RandomCountdown SetMinUpdates(int value) { MinUpdates = value; return this; }
61 | public RandomCountdown SetMaxUpdates(int value) { MaxUpdates = value; return this; }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/Components/Score.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Actors;
2 | using STACK;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 |
7 | namespace SessionSeven.Components
8 | {
9 | [Serializable]
10 | public enum ScoreType
11 | {
12 | Jail,
13 | Freedom,
14 | Insanity
15 | }
16 |
17 | ///
18 | /// Component that keeps track of the jail / freedom / mental hospital score.
19 | ///
20 | [Serializable]
21 | public class Score : Component
22 | {
23 | private Dictionary _results;
24 |
25 | public Score()
26 | {
27 | Reset();
28 | }
29 |
30 | public void Reset()
31 | {
32 | _results = new Dictionary(Enum.GetNames(typeof(ScoreType)).Length);
33 | var enumValues = Enum.GetValues(typeof(ScoreType)).Cast();
34 | foreach (var enumValue in enumValues)
35 | {
36 | _results.Add(enumValue, 0);
37 | }
38 | }
39 |
40 | public int GetScore(ScoreType type) => _results[type];
41 |
42 | public bool HasScore() => _results.Any(r => r.Value > 0);
43 |
44 | public void Add(ScoreType type, int points)
45 | {
46 | _results[type] = _results[type] + points;
47 | }
48 |
49 | public ScoreType GetScoreTypeResult()
50 | {
51 | var maxScoreKVP = _results.Aggregate((agg, next) => next.Value > agg.Value ? next : agg);
52 |
53 | return maxScoreKVP.Key;
54 | }
55 |
56 | public static Score Create(Ryan entity)
57 | {
58 | return entity.Add();
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/CutsceneDisposeControl.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven
7 | {
8 | ///
9 | /// The liftetime of this class represents an ingame cutscene: the world's interactive
10 | /// state is disabled when constructing this class and enabled when disposing.
11 | ///
12 | [Serializable]
13 | public class CutsceneDisposeControl : IDisposable
14 | {
15 | [NonSerialized]
16 | private World _world;
17 | private readonly Action _resetGUIFn;
18 | private readonly bool _resetInteractive, _resetGUI, _wasSkippingEnabled;
19 |
20 | public CutsceneDisposeControl(World world, Action resetGUIFn, bool resetInteractive = true, bool resetGUI = true, bool updateLabel = true)
21 | {
22 | _world = world;
23 | _resetGUI = resetGUI;
24 | _resetGUIFn = resetGUIFn;
25 | _resetInteractive = resetInteractive;
26 | _wasSkippingEnabled = IsSkippingEnabled();
27 | if (updateLabel)
28 | {
29 | ((GUI.Interaction.Scene)_world.GetScene(Tree.GUI.Interaction.SceneID))?.UpdateLabel();
30 | }
31 | _world.Interactive = false;
32 |
33 | if (!_wasSkippingEnabled)
34 | {
35 | Game.EnableSkipping();
36 | }
37 | }
38 |
39 | public void Dispose()
40 | {
41 | if (null == _world)
42 | {
43 | _world = Tree.World;
44 | }
45 |
46 | if (_resetInteractive)
47 | {
48 | _world.Interactive = true;
49 | }
50 |
51 | if (_resetGUI && null != _resetGUIFn)
52 | {
53 | _resetGUIFn();
54 | }
55 |
56 | if (!_wasSkippingEnabled)
57 | {
58 | Game.StopSkipping();
59 | }
60 | }
61 |
62 | private bool IsSkippingEnabled()
63 | {
64 | var skipContent = _world.Get();
65 |
66 | if (null != skipContent && null != skipContent.SkipCutscene)
67 | {
68 | return skipContent.SkipCutscene.Possible;
69 | }
70 |
71 | return false;
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/base/Scene.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Logging;
3 | using System;
4 | using System.Linq;
5 | using System.Reflection;
6 |
7 | namespace SessionSeven
8 | {
9 | public static class SceneExtension
10 | {
11 | ///
12 | /// Adds all entities from the same namespace using reflection.
13 | ///
14 | /// scene to add entities for
15 | public static void AutoAddEntities(this Scene scene)
16 | {
17 | var @namespace = scene.GetType().Namespace;
18 |
19 | var types = from t in Assembly.GetExecutingAssembly().GetTypes()
20 | where t.IsClass && typeof(Entity).IsAssignableFrom(t) && t.Namespace == @namespace && !t.IsAbstract
21 | select t;
22 |
23 | foreach (var entityType in types)
24 | {
25 | var constructor = entityType.GetConstructor(Type.EmptyTypes);
26 | if (null != constructor)
27 | {
28 | var instance = (Entity)Activator.CreateInstance(entityType);
29 | scene.Push(instance);
30 | Log.WriteLine("Adding " + entityType.Name + " to Scene " + @namespace);
31 | }
32 | else
33 | {
34 | Log.WriteLine("Skipping adding " + entityType.Name + " to Scene " + @namespace + " due to missing parameterless constructor.");
35 | }
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/content/build.tt:
--------------------------------------------------------------------------------
1 | <#@ output extension=".bat" #>
2 | <#@ template debug="false" hostspecific="true" language="C#" #>
3 | <#@ assembly name="System.Core" #>
4 | <#@ assembly name="$(SolutionDir)lib\STACK\src\Tools\ContentAnalyzer\bin\Debug\ContentAnalyzer.dll" #>
5 | <#@ import namespace="ContentAnalyzer" #>
6 | <#@ import namespace="System.Linq" #>
7 | <#@ import namespace="System.Text" #>
8 | <#@ import namespace="System.Collections.Generic" #>
9 | <#
10 | WriteLine("REM ------------------------------------------------------------------------------");
11 | WriteLine("REM ");
12 | WriteLine("REM This code was generated by a tool on " + DateTime.Now.ToString() + ".");
13 | WriteLine("REM ");
14 | WriteLine("REM Changes to this file may cause incorrect behavior and will be lost if");
15 | WriteLine("REM the code is regenerated.");
16 | WriteLine("REM ");
17 | WriteLine("REM ------------------------------------------------------------------------------");
18 | WriteLine("");
19 | var T4Path = this.Host.ResolvePath("");
20 | var Result = BuildContent.CreateScript(T4Path, T4Path + "\\bin");
21 | Write(Result);
22 | #>
--------------------------------------------------------------------------------
/src/Game/GameLogic/content/tree.tt:
--------------------------------------------------------------------------------
1 | <#@ output extension=".cs" #>
2 | <#@ template debug="false" hostspecific="true" language="C#" #>
3 | <#@ assembly name="System.Core" #>
4 | <#@ assembly name="$(SolutionDir)lib\STACK\src\Tools\ContentAnalyzer\bin\Debug\ContentAnalyzer.dll" #>
5 | <#@ import namespace="ContentAnalyzer" #>
6 | <#@ import namespace="System.Linq" #>
7 | <#@ import namespace="System.Text" #>
8 | <#@ import namespace="System.Collections.Generic" #>
9 | <#
10 | WriteLine("// ------------------------------------------------------------------------------");
11 | WriteLine("// ");
12 | WriteLine("// This code was generated by a tool on " + DateTime.Now.ToString() + ".");
13 | WriteLine("// ");
14 | WriteLine("// Changes to this file may cause incorrect behavior and will be lost if");
15 | WriteLine("// the code is regenerated.");
16 | WriteLine("// ");
17 | WriteLine("// ------------------------------------------------------------------------------");
18 | WriteLine("");
19 | var T4Path = this.Host.ResolvePath("");
20 | var Result = ContentTree.Create(T4Path, T4Path + "\\bin", "SessionSeven", "content");
21 | Write(Result);
22 | #>
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/Fader.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.GUI
7 | {
8 | [Serializable]
9 | public class Fader : Entity
10 | {
11 | public Fader()
12 | {
13 | Sprite
14 | .Create(this)
15 | .SetRenderStage(RenderStage.PostBloom)
16 | .SetImage(Sprite.WHITEPIXELIMAGE);
17 |
18 | SpriteData
19 | .Create(this)
20 | .SetColor(Color.Black)
21 | .SetScale(Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT);
22 |
23 | DrawOrder = 1;
24 | }
25 |
26 | public Color Color
27 | {
28 | get => Get().Color;
29 | set => Get().Color = value;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/Mouse.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.GUI
6 | {
7 | [Serializable]
8 | public class Mouse : Entity
9 | {
10 | public Mouse()
11 | {
12 | Transform
13 | .Create(this);
14 |
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.ui.cursor)
18 | .SetRenderStage(RenderStage.PostBloom);
19 |
20 | SpriteData
21 | .Create(this)
22 | .SetOffset(-20, -20);
23 |
24 | MouseFollower
25 | .Create(this);
26 |
27 | InteractiveVisibility
28 | .Create(this);
29 | }
30 |
31 | public void Enable()
32 | {
33 | Enabled = true;
34 | }
35 |
36 | public void Disable()
37 | {
38 | Enabled = false;
39 | Visible = false;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/Scene.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework.Input;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.GUI
6 | {
7 | [Serializable]
8 | public class Scene : STACK.Scene
9 | {
10 | public Scene()
11 | {
12 | this.AutoAddEntities();
13 |
14 | InputDispatcher
15 | .Create(this)
16 | .SetOnKeyDownFn(OnKeyDown);
17 |
18 | Enabled = true;
19 | Visible = true;
20 | DrawOrder = 1019;
21 | }
22 |
23 | public void OnKeyDown(Keys key)
24 | {
25 | if (Keys.Escape == key)
26 | {
27 | if (!STACK.StackGame.Engine.Paused)
28 | {
29 | STACK.StackGame.Engine.Pause();
30 | Game.MainMenu.Show();
31 | STACK.StackGame.Engine.Renderer.GUIManager.ShowSoftwareCursor = true;
32 | }
33 | }
34 |
35 | if (Keys.F5 == key)
36 | {
37 | STACK.StackGame.Engine.SaveState("Quicksave");
38 | }
39 |
40 | if (Keys.F9 == key)
41 | {
42 | var fileName = STACK.StackGame.Engine.ExistsStateByName("Quicksave");
43 | if (null != fileName)
44 | {
45 | STACK.StackGame.Engine.LoadState(fileName);
46 | }
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/ScreenText.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.GUI
7 | {
8 | [Serializable]
9 | public class ScreenText : Entity
10 | {
11 | public ScreenText()
12 | {
13 | Text
14 | .Create(this)
15 | .SetColor(Color.White)
16 | .SetAlign(Alignment.Center)
17 | .SetFont(content.fonts.pixeloperator_outline_BMF)
18 | .SetFadeDuration(3f)
19 | .SetHeight(Game.VIRTUAL_HEIGHT)
20 | .SetWidth(Game.VIRTUAL_WIDTH - 50);
21 |
22 | Transform
23 | .Create(this)
24 | .SetPosition(Game.VIRTUAL_WIDTH / 2, Game.VIRTUAL_HEIGHT / 2);
25 |
26 | Scripts
27 | .Create(this);
28 |
29 | DrawOrder = 2;
30 | }
31 |
32 | public Color Color
33 | {
34 | get => Get().Color;
35 | set => Get().Color = value;
36 | }
37 |
38 | public Script ShowText(string text, float duration = 0)
39 | {
40 | return Get().Say(text, duration);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/DialogMenuState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SessionSeven.GUI.Dialog
4 | {
5 | [Serializable]
6 | public enum DialogMenuState
7 | {
8 | Open, Closed, Opening, Closing
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/Scene.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using SessionSeven.Entities;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 |
7 | namespace SessionSeven.GUI.Dialog
8 | {
9 | [Serializable]
10 | public class Scene : STACK.Scene
11 | {
12 | public Scene()
13 | {
14 | InputDispatcher
15 | .Create(this)
16 | .SetOnMouseUpFn(OnMouseUp);
17 |
18 | Enabled = true;
19 | Visible = true;
20 | Push(new Menu());
21 | DrawOrder = 124;
22 | }
23 |
24 | public void OnMouseUp(Vector2 position, MouseButton button)
25 | {
26 | var oum = World.Get().ObjectUnderMouse;
27 |
28 | if (oum == Tree.GUI.Dialog.Menu)
29 | {
30 | Tree.GUI.Dialog.Menu.Click();
31 | }
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/options/BaseOption.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SessionSeven.GUI.Dialog
4 | {
5 | [Serializable]
6 | public class BaseOption
7 | {
8 | public readonly int ID;
9 | public readonly string Text;
10 |
11 | public BaseOption(int id, string text)
12 | {
13 | ID = id;
14 | Text = text;
15 | }
16 |
17 | public static readonly BaseOption None = new BaseOption(0, string.Empty);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/options/IDialogOptions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace SessionSeven.GUI.Dialog
4 | {
5 | public interface IDialogOptions
6 | {
7 | BaseOption this[int index]
8 | {
9 | get;
10 | }
11 |
12 | int Count { get; }
13 |
14 | IEnumerable SelectTexts();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/options/Options.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SessionSeven.GUI.Dialog
4 | {
5 | ///
6 | /// Simple dialog options
7 | ///
8 | [Serializable]
9 | public class Options : BaseOptions
10 | {
11 | private Options() { }
12 |
13 | public static Options Create() => new Options();
14 |
15 | public Options Add(int id, string text)
16 | {
17 | if (id == -1)
18 | {
19 | throw new ArgumentException("Option.ID must not equal -1.");
20 | }
21 |
22 | OptionSet.Add(new BaseOption(id, text));
23 |
24 | return this;
25 | }
26 |
27 | public Options Add(int id, string text, Func predicate)
28 | {
29 | if (predicate())
30 | {
31 | Add(id, text);
32 | }
33 |
34 | return this;
35 | }
36 |
37 | public Options RemoveByID(int id)
38 | {
39 | for (var i = 0; i < OptionSet.Count; i++)
40 | {
41 | if (id == OptionSet[i].ID)
42 | {
43 | OptionSet.RemoveAt(i);
44 | return this;
45 | }
46 | }
47 |
48 | return this;
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/options/ScoreOption.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace SessionSeven.GUI.Dialog
6 | {
7 | [Serializable]
8 | public class ScoreOption : BaseOption
9 | {
10 | public readonly Dictionary ScoreSet;
11 |
12 | public ScoreOption(int id, string text, Dictionary scoreSet) : base(id, text)
13 | {
14 | ScoreSet = scoreSet;
15 | }
16 |
17 | public static new readonly ScoreOption None = new ScoreOption(0, string.Empty, null);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/options/ScoreOptions.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace SessionSeven.GUI.Dialog
6 | {
7 | ///
8 | /// Dialog options that are associated with one or more points
9 | ///
10 | [Serializable]
11 | public class ScoreOptions : BaseOptions
12 | {
13 | private ScoreOptions() { }
14 |
15 | public static ScoreOptions Create() => new ScoreOptions();
16 |
17 | public ScoreOptions Add(int id, string text, ScoreType scoreType, int scorePoints)
18 | {
19 | Add(id, text, new Dictionary()
20 | {
21 | { scoreType, scorePoints }
22 | });
23 |
24 | return this;
25 | }
26 |
27 | public ScoreOptions Add(int id, string text, Dictionary scores)
28 | {
29 | if (id == -1)
30 | {
31 | throw new ArgumentException("Option.ID must not equal -1.");
32 | }
33 |
34 | OptionSet.Add(new ScoreOption(id, text, scores));
35 |
36 | return this;
37 | }
38 |
39 | public ScoreOptions Add(int id, string text, ScoreType scoreType, int scorePoints, Func predicate)
40 | {
41 | if (predicate())
42 | {
43 | Add(id, text, scoreType, scorePoints);
44 | }
45 |
46 | return this;
47 | }
48 |
49 | public ScoreOptions RemoveByID(int id)
50 | {
51 | for (var i = 0; i < OptionSet.Count; i++)
52 | {
53 | if (id == OptionSet[i].ID)
54 | {
55 | OptionSet.RemoveAt(i);
56 | return this;
57 | }
58 | }
59 |
60 | return this;
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/dialog/options/base/BaseOptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | namespace SessionSeven.GUI.Dialog
6 | {
7 | [Serializable]
8 | public abstract class BaseOptions : IDialogOptions where T : BaseOption
9 | {
10 | protected List OptionSet = new List(3);
11 |
12 | public int Count => OptionSet.Count;
13 |
14 | public BaseOption this[int index] => OptionSet[index];
15 |
16 | public IEnumerable SelectTexts() => OptionSet.Select(o => o.Text);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/ActionTextLabel.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.GUI.Interaction
7 | {
8 | ///
9 | /// Entity to display teh current action text like "Goto object" or "Use object1 with object2".
10 | ///
11 | [Serializable]
12 | public class ActionTextLabel : Entity
13 | {
14 | public ActionTextLabel()
15 | {
16 | Text
17 | .Create(this)
18 | .SetFont(content.fonts.pixeloperator_BMF)
19 | .SetAlign(Alignment.Top)
20 | .SetWidth(Game.VIRTUAL_WIDTH)
21 | .SetWordWrap(false);
22 |
23 | Transform
24 | .Create(this)
25 | .SetZ(InteractionBar.Z + 3)
26 | .SetPosition(Game.VIRTUAL_WIDTH / 2, 338);
27 |
28 | }
29 |
30 | public string ActionText
31 | {
32 | get => Get().Lines.Count == 1 ? Get().Lines[0].Text : string.Empty;
33 | set
34 | {
35 | if (Get().Lines.Count != 1 || Get().Lines[0].Text != value)
36 | {
37 | Get().Set(value, -1, Position);
38 | }
39 | }
40 | }
41 |
42 | public Color Color
43 | {
44 | get => Get().Color;
45 | set => Get().Color = value;
46 | }
47 |
48 | public Vector2 Position
49 | {
50 | get => Get().Position;
51 | set
52 | {
53 | Get().SetPosition(value);
54 | Get().SetPosition(value);
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/AnyObject.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SessionSeven.GUI.Interaction
4 | {
5 | ///
6 | /// Represents any object in interactions.
7 | ///
8 | [Serializable]
9 | public class Any
10 | {
11 | public static readonly Any Object = new Any();
12 |
13 | private Any() { }
14 |
15 | public override bool Equals(object obj)
16 | {
17 | if (!(obj is Any))
18 | {
19 | return false;
20 | }
21 |
22 | return true;
23 | }
24 |
25 | public override int GetHashCode() => 0;
26 |
27 | public override string ToString() => "Any Object";
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/InteractionBar.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.GUI.Interaction
6 | {
7 | [Serializable]
8 | public class InteractionBar : Entity
9 | {
10 | public const float Z = 1;
11 | public const int HEIGHT = 288;
12 |
13 | public InteractionBar()
14 | {
15 | HotspotRectangle
16 | .Create(this)
17 | .SetCaption(string.Empty)
18 | .SetRectangle(0, HEIGHT, Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT - HEIGHT);
19 |
20 | Transform
21 | .Create(this)
22 | .SetZ(Z);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/RandomTexts.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using GlblRes = global::SessionSeven.Properties.Resources;
3 |
4 | namespace SessionSeven.GUI.Interaction
5 | {
6 | public static class RandomTexts
7 | {
8 | public static readonly List Default = new List()
9 | {
10 | GlblRes.Cant_do_that
11 | };
12 |
13 | public static readonly List Pick = new List()
14 | {
15 | GlblRes.There_is_no_need_to_carry_that_around,
16 | GlblRes.I_dont_need_that,
17 | GlblRes.I_dont_see_the_point_in_taking_that
18 | };
19 |
20 | public static readonly List PickInventory = new List()
21 | {
22 | GlblRes.I_have_got_this_already,
23 | GlblRes.I_have_it_already,
24 | GlblRes.Im_carrying_that
25 | };
26 |
27 | public static readonly List Move = new List()
28 | {
29 | GlblRes.I_dont_want_to_move_that,
30 | GlblRes.There_is_no_need_to_move_that
31 | };
32 |
33 | public static readonly List Use = new List()
34 | {
35 | GlblRes.Cant_use_that,
36 | GlblRes.I_cant_do_that,
37 | GlblRes.That_does_not_work
38 | };
39 |
40 | public static readonly List Look = new List()
41 | {
42 | GlblRes.I_dont_see_anything_special,
43 | GlblRes.Nothing_to_see_here
44 | };
45 |
46 | public static readonly List Talk = new List()
47 | {
48 | GlblRes.I_guess_there_wont_be_an_answer,
49 | GlblRes.I_cant_talk_to_that
50 | };
51 |
52 | public static readonly List Close = new List()
53 | {
54 | GlblRes.I_cant_close_that,
55 | GlblRes.This_cant_be_closed,
56 | GlblRes.That_does_not_need_to_be_closed
57 | };
58 |
59 | public static readonly List Open = new List()
60 | {
61 | GlblRes.I_cant_open_that,
62 | GlblRes.This_cant_be_opened,
63 | GlblRes.That_does_not_need_to_be_opened
64 | };
65 |
66 | public static readonly List Give = new List()
67 | {
68 | GlblRes.I_cant_give_that_to_somebody,
69 | GlblRes.No,
70 | GlblRes.How
71 | };
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/ScrollDownButton.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.GUI.Interaction
7 | {
8 | [Serializable]
9 | public class ScrollDownButton : Entity
10 | {
11 | public static readonly Rectangle ScreenRectangle = new Rectangle(290, Verbs.OFFSET + 17 + 46, 38, 46);
12 | public static readonly Rectangle TextureRectangle = new Rectangle(290, 17 + 46, 38, 46);
13 |
14 | public ScrollDownButton()
15 | {
16 | HotspotRectangle
17 | .Create(this)
18 | .SetCaption(string.Empty)
19 | .AddRectangle(ScreenRectangle);
20 |
21 | Transform
22 | .Create(this)
23 | .SetZ(InteractionBar.Z + 1);
24 |
25 | Interactive = false;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/ScrollUpButton.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.GUI.Interaction
7 | {
8 | [Serializable]
9 | public class ScrollUpButton : Entity
10 | {
11 | public static readonly Rectangle ScreenRectangle = new Rectangle(290, Verbs.OFFSET + 17, 38, 46);
12 | public static readonly Rectangle TextureRectangle = new Rectangle(290, 17, 38, 46);
13 |
14 | public ScrollUpButton()
15 | {
16 | HotspotRectangle
17 | .Create(this)
18 | .SetCaption(string.Empty)
19 | .AddRectangle(ScreenRectangle);
20 |
21 | Transform
22 | .Create(this)
23 | .SetZ(InteractionBar.Z + 1);
24 |
25 | Interactive = false;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/verbs/GetRandomTextDelegate.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 |
4 | namespace SessionSeven.GUI.Interaction
5 | {
6 | public delegate string GetRandomTextFn(Randomizer randomizer, InteractionContext interactionContext);
7 | }
8 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/verbs/Keymapping.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework.Input;
2 | using System;
3 |
4 | namespace SessionSeven.GUI.Interaction
5 | {
6 | [Serializable]
7 | public static class KeyMapping
8 | {
9 |
10 | public static LockedVerb GetByKey(Keys key)
11 | {
12 | switch (key)
13 | {
14 | case Keys.Q:
15 | case Keys.NumPad7: return Verbs.Give;
16 |
17 | case Keys.W:
18 | case Keys.NumPad8: return Verbs.Pick;
19 |
20 | case Keys.E:
21 | case Keys.NumPad9: return Verbs.Use;
22 |
23 | case Keys.A:
24 | case Keys.NumPad4: return Verbs.Open;
25 |
26 | case Keys.S:
27 | case Keys.NumPad5: return Verbs.Look;
28 |
29 | case Keys.D:
30 | case Keys.NumPad6: return Verbs.Push;
31 |
32 | case Keys.Y:
33 | case Keys.Z:
34 | case Keys.NumPad1: return Verbs.Close;
35 |
36 | case Keys.X:
37 | case Keys.NumPad2: return Verbs.Talk;
38 |
39 | case Keys.C:
40 | case Keys.NumPad3: return Verbs.Pull;
41 |
42 | default: return null;
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/verbs/LockedVerb.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections.Generic;
6 |
7 | namespace SessionSeven.GUI.Interaction
8 | {
9 | [Serializable]
10 | public class LockedVerb : Verb
11 | {
12 | public Rectangle TextureRectangle { get; private set; }
13 | public Rectangle ScreenRectangle { get; private set; }
14 | public List RandomText { get; private set; }
15 | private readonly GetRandomTextFn _randomTextFn = null;
16 |
17 | public LockedVerb(string id, List defaultTexts, Rectangle textureRectangle, Rectangle screenRectangle, string text, string preposition, bool ditransitive, GetRandomTextFn randomTextFn) : base(text, preposition, ditransitive)
18 | {
19 | Id = id;
20 | TextureRectangle = textureRectangle;
21 | ScreenRectangle = screenRectangle;
22 | RandomText = defaultTexts;
23 | _randomTextFn = randomTextFn;
24 | }
25 |
26 | public static LockedVerb Create(string id, List defaultTexts, Rectangle rectangle, int offset, string text, string preposition = "", bool ditransitive = false, GetRandomTextFn randomTextFn = null)
27 | {
28 | var screenRect = new Rectangle(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height);
29 | screenRect.Offset(0, offset);
30 |
31 | return new LockedVerb(id, defaultTexts, rectangle, screenRect, text, preposition, ditransitive, randomTextFn);
32 | }
33 |
34 | public string GetRandomText(Randomizer randomizer, InteractionContext interactionContext)
35 | {
36 | if (null != _randomTextFn)
37 | {
38 | var result = _randomTextFn(randomizer, interactionContext);
39 | if (!string.IsNullOrEmpty(result))
40 | {
41 | return result;
42 | }
43 | }
44 |
45 | var index = randomizer.CreateInt(RandomText.Count);
46 | return RandomText[index];
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/verbs/VerbsHighlight.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 | using GlblRes = global::SessionSeven.Properties.Resources;
5 |
6 | namespace SessionSeven.GUI.Interaction
7 | {
8 | [Serializable]
9 | public class VerbsHighlight : Entity
10 | {
11 | public VerbsHighlight()
12 | {
13 | Sprite
14 | .Create(this)
15 | .SetRenderStage(RenderStage.PostBloom)
16 | .SetImage(GlblRes.uiverbshighlight);
17 |
18 | SpriteData
19 | .Create(this)
20 | .SetOffset(0, Verbs.OFFSET);
21 |
22 | Visible = false;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/interaction/verbs/base/VerbButton.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.GUI.Interaction
6 | {
7 | [Serializable]
8 | public abstract class VerbButton : Entity
9 | {
10 | public LockedVerb Verb { get; private set; }
11 |
12 | public VerbButton(LockedVerb verb)
13 | {
14 | Verb = verb;
15 |
16 | HotspotRectangle
17 | .Create(this)
18 | .SetCaption(verb.Text)
19 | .AddRectangle(verb.ScreenRectangle);
20 |
21 | Transform
22 | .Create(this)
23 | .SetZ(InteractionBar.Z + 1);
24 | }
25 |
26 | public override void OnLoadContent(ContentLoader content)
27 | {
28 | // Restore static references from savegame
29 | foreach (var verb in Verbs.All)
30 | {
31 | if (Verb.Equals(verb))
32 | {
33 | Verb = verb;
34 | }
35 | }
36 |
37 | base.OnLoadContent(content);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/positionselection/IPositionable.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 |
3 | namespace SessionSeven.GUI.PositionSelection
4 | {
5 | public interface IPositionable
6 | {
7 | void BeginPosition(int mode);
8 | void SetPosition(Vector2 position, int mode);
9 | void EndPosition(int mode);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/positionselection/Label.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using STACK.Graphics;
5 | using System;
6 |
7 | namespace SessionSeven.GUI.PositionSelection
8 | {
9 | ///
10 | /// Entity to display some instruction text.
11 | ///
12 | [Serializable]
13 | public class Label : Entity
14 | {
15 | public Label()
16 | {
17 | Text
18 | .Create(this)
19 | .SetFont(content.fonts.pixeloperator_outline_BMF)
20 | .SetAlign(Alignment.Top)
21 | .SetWidth(Game.VIRTUAL_WIDTH)
22 | .SetWordWrap(true);
23 |
24 | Transform
25 | .Create(this)
26 | .SetPosition(Game.VIRTUAL_WIDTH / 2, 50);
27 |
28 | }
29 |
30 | public override void OnBeginDraw(Renderer renderer)
31 | {
32 | if (renderer.Stage == RenderStage.PostBloom)
33 | {
34 | renderer.SpriteBatch.Draw(renderer.WhitePixelTexture, new Rectangle(0, 0, Game.VIRTUAL_WIDTH, 18 * Get().Lines.Count), new Color(0, 0, 0, 0.5f));
35 | }
36 |
37 | base.OnBeginDraw(renderer);
38 | }
39 |
40 | public string LabelText
41 | {
42 | get => Get().Lines.Count == 1 ? Get().Lines[0].Text : string.Empty;
43 | set
44 | {
45 | if (Get().Lines.Count != 1 || Get().Lines[0].Text != value)
46 | {
47 | Get().Set(value, -1, Position);
48 | }
49 | }
50 | }
51 |
52 | public Color Color
53 | {
54 | get => Get().Color;
55 | set => Get().Color = value;
56 | }
57 |
58 | public Vector2 Position
59 | {
60 | get => Get().Position;
61 | set
62 | {
63 | Get().SetPosition(value);
64 | Get().SetPosition(value);
65 | }
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/gui/positionselection/Scene.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 |
7 | namespace SessionSeven.GUI.PositionSelection
8 | {
9 | [Serializable]
10 | public class Scene : STACK.Scene
11 | {
12 | public bool Aborted { get; private set; }
13 | public Vector2 Result { get; private set; }
14 | private bool _selectionMade = false;
15 |
16 | public Scene()
17 | {
18 | this.AutoAddEntities();
19 |
20 | InputDispatcher
21 | .Create(this)
22 | .SetOnMouseUpFn(OnMouseUp);
23 |
24 | ScenePath
25 | .Create(this);
26 |
27 | Enabled = false;
28 |
29 | DrawOrder = 125;
30 | }
31 |
32 | private void OnMouseUp(Vector2 position, MouseButton button)
33 | {
34 | if (button == MouseButton.Left)
35 | {
36 | Result = position;
37 | _selectionMade = true;
38 | }
39 | else
40 | {
41 | Aborted = true;
42 | }
43 | }
44 |
45 | public const string SCRIPTID = "WAITFORDIALOGSELECTIONSCRIPTID";
46 |
47 | public Script StartSelectionScript(Scripts scripts, IPositionable entityToPosition, bool setInteractive = true, int mode = 0)
48 | {
49 | return scripts.Start(WaitForSelection(entityToPosition, setInteractive, mode), SCRIPTID);
50 | }
51 |
52 | ///
53 | /// IEnumerator that yields until a selection was made.
54 | ///
55 | ///
56 | ///
57 | ///
58 | ///
59 | ///
60 | ///
61 | private IEnumerator WaitForSelection(IPositionable entityToPosition, bool setInteractive = true, int mode = 0)
62 | {
63 | Game.StopSkipping();
64 |
65 | Aborted = false;
66 | Enabled = true;
67 | Visible = true;
68 | _selectionMade = false;
69 |
70 | var previousWorldInteractive = World.Interactive;
71 |
72 | if (setInteractive)
73 | {
74 | World.Interactive = true;
75 | }
76 |
77 | entityToPosition.BeginPosition(mode);
78 |
79 | while (!_selectionMade && !Aborted)
80 | {
81 | SetPosition(entityToPosition, mode);
82 | yield return 0;
83 | }
84 |
85 | SetPosition(entityToPosition, mode);
86 | entityToPosition.EndPosition(mode);
87 |
88 | if (setInteractive)
89 | {
90 | World.Interactive = previousWorldInteractive;
91 | }
92 |
93 | Enabled = false;
94 | Visible = false;
95 | }
96 |
97 | private void SetPosition(IPositionable entityToPosition, int mode)
98 | {
99 | var mousePosition = World.Get().Position;
100 | entityToPosition.SetPosition(mousePosition, mode);
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/AnimalSkeleton.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class AnimalSkeleton : ItemBase
11 | {
12 | public AnimalSkeleton()
13 | : base(content.inventory.animalskeleton, Items_Res.AnimalSkeleton_AnimalSkeleton_AnimalSkeleton)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Game.Ego)
23 | .Add(Verbs.Look, LookScript());
24 | }
25 |
26 | private IEnumerator LookScript()
27 | {
28 | using (Game.CutsceneBlock())
29 | {
30 | yield return Game.Ego.Say(Items_Res.Eww);
31 | }
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Bandages.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Actors;
2 | using SessionSeven.Entities;
3 | using SessionSeven.GUI.Interaction;
4 | using STACK;
5 | using STACK.Components;
6 | using System;
7 | using System.Collections;
8 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
9 |
10 | namespace SessionSeven.InventoryItems
11 | {
12 | [Serializable]
13 | public class Bandages : ItemBase
14 | {
15 | public Bandages() : base(content.inventory.bandages, Items_Res.Bandages_Bandages_ClothBandageRoll, true, false)
16 | {
17 |
18 | }
19 |
20 | protected override Interactions GetInteractions()
21 | {
22 | return Interactions
23 | .Create()
24 | .For(Game.Ego)
25 | .Add(Verbs.Use, UseScript())
26 | .Add(Verbs.Look, LookScript())
27 | .For(Tree.InventoryItems.Scissors)
28 | .Add(Verbs.Use, UseScissorsScript(), Game.Ego);
29 | }
30 |
31 | public Script Use()
32 | {
33 | return Game.Ego.StartScript(UseScript());
34 | }
35 |
36 | private IEnumerator LookScript()
37 | {
38 | using (Game.CutsceneBlock())
39 | {
40 | yield return Game.Ego.Say(Items_Res.A_cloth_bandage_roll_This_is_exactly_what_I_need_right_now);
41 | }
42 | }
43 |
44 | private IEnumerator UseScript()
45 | {
46 | using (Game.CutsceneBlock())
47 | {
48 | yield return Game.Ego.Say(Items_Res.I_should_better_cut_some_part_off);
49 | yield return Game.Ego.Say(Items_Res.Cant_use_the_whole_thing);
50 | }
51 | }
52 |
53 | private IEnumerator UseScissorsScript()
54 | {
55 | using (Game.CutsceneBlock())
56 | {
57 | Game.Ego.Turn(Directions4.Up);
58 |
59 | yield return Game.Ego.StartUse();
60 |
61 | Game.Ego.Inventory.RemoveItem(this);
62 | Game.Ego.Inventory.AddItem();
63 | Game.PlaySoundEffect(content.audio.scissors_cut);
64 | Game.Ego.Inventory.AddItem();
65 |
66 | yield return Game.Ego.StopUse();
67 |
68 | Game.Ego.Get().ResetCommentCounter();
69 | }
70 | }
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/BandagesCut.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class BandagesCut : ItemBase
12 | {
13 | public BandagesCut() : base(content.inventory.bandages_cut, Items_Res.Bandages_Bandages_ClothBandageRoll, true, false)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Game.Ego)
23 | .Add(Verbs.Use, UseScript())
24 | .Add(Verbs.Look, LookScript())
25 | .For(Tree.InventoryItems.Scissors)
26 | .Add(Verbs.Use, UseScissorsScript(), Game.Ego);
27 | }
28 |
29 | public Script Use()
30 | {
31 | return Game.Ego.StartScript(UseScript());
32 | }
33 |
34 | private IEnumerator LookScript()
35 | {
36 | using (Game.CutsceneBlock())
37 | {
38 | yield return Game.Ego.Say(Items_Res.A_cloth_strip_bandage);
39 | }
40 | }
41 |
42 | private IEnumerator UseScript()
43 | {
44 | using (Game.CutsceneBlock())
45 | {
46 | if (Game.Ego.Inventory.HasItem())
47 | {
48 | yield return Game.Ego.Say(Items_Res.I_should_better_use_the_cut_off_part);
49 | }
50 | else
51 | {
52 | yield return Game.Ego.Say(Items_Res.I_dressed_my_wound_already);
53 | }
54 | }
55 | }
56 |
57 | private IEnumerator UseScissorsScript()
58 | {
59 | using (Game.CutsceneBlock())
60 | {
61 | if (Game.Ego.Inventory.HasItem())
62 | {
63 | yield return Game.Ego.Say(Items_Res.I_cut_off_a_part_of_it_already);
64 | }
65 | else
66 | {
67 | yield return Game.Ego.Say(Items_Res.I_dont_need_to_cut_any_more_off_of_that);
68 | }
69 | }
70 | }
71 | }
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/BatonWithString.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class BatonWithString : ItemBase
11 | {
12 |
13 | public BatonWithString()
14 | : base(content.inventory.baton_string, Items_Res.BatonWithString_BatonWithString_BatonWithString)
15 | {
16 |
17 | }
18 |
19 | protected override Interactions GetInteractions()
20 | {
21 | return Interactions
22 | .Create()
23 | .For(Game.Ego)
24 | .Add(Verbs.Close, PushScript())
25 | .Add(Verbs.Push, PushScript())
26 | .Add(Verbs.Open, PullScript())
27 | .Add(Verbs.Pull, PullScript())
28 | .Add(Verbs.Look, LookScript());
29 | }
30 |
31 | private IEnumerator PullScript()
32 | {
33 | using (Game.CutsceneBlock())
34 | {
35 | yield return Game.Ego.Say(Items_Res.Cant_expand_it_any_further);
36 | }
37 | }
38 |
39 | private IEnumerator PushScript()
40 | {
41 | using (Game.CutsceneBlock())
42 | {
43 | yield return Game.Ego.Say(Items_Res.Cant_reduce_it_with_the_string_tied_to_it);
44 | }
45 | }
46 |
47 | private IEnumerator LookScript()
48 | {
49 | using (Game.CutsceneBlock())
50 | {
51 | yield return Game.Ego.Say(Items_Res.Almost_like_a_net);
52 | }
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/BatteryA.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class BatteryA : ItemBase
11 | {
12 | public BatteryA() : base(content.inventory.battery_a, Items_Res.BatteryA_BatteryA_Battery)
13 | {
14 |
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Game.Ego)
22 | .Add(Verbs.Look, LookScript());
23 | }
24 |
25 | private IEnumerator LookScript()
26 | {
27 | using (Game.CutsceneBlock())
28 | {
29 | yield return Game.Ego.Say(Items_Res.A_battery);
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/BatteryB.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class BatteryB : ItemBase
11 | {
12 | public BatteryB() : base(content.inventory.battery_b, Items_Res.BatteryA_BatteryA_Battery)
13 | {
14 |
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Game.Ego)
22 | .Add(Verbs.Look, LookScript());
23 | }
24 |
25 | private IEnumerator LookScript()
26 | {
27 | using (Game.CutsceneBlock())
28 | {
29 | yield return Game.Ego.Say(Items_Res.A_battery);
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Blanket.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using SessionSeven.Entities;
3 | using SessionSeven.GUI.Interaction;
4 | using STACK;
5 | using System;
6 | using System.Collections;
7 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
8 |
9 | namespace SessionSeven.InventoryItems
10 | {
11 | [Serializable]
12 | public class Blanket : ItemBase
13 | {
14 | public Blanket() : base(content.inventory.blanket, Items_Res.Blanket_Blanket_PicnicBlanket, true, false)
15 | {
16 |
17 | }
18 |
19 | protected override Interactions GetInteractions()
20 | {
21 | return Interactions
22 | .Create()
23 | .For(Game.Ego)
24 | .Add(Verbs.Use, UseScript())
25 | .Add(Verbs.Look, LookScript(true))
26 | .For(Tree.InventoryItems.Scissors)
27 | .Add(Verbs.Use, UseScissorsScript(), Game.Ego);
28 | }
29 |
30 | public bool LookedAt { get; private set; }
31 |
32 | public Script LookAt()
33 | {
34 | return Game.Ego.StartScript(LookScript(false));
35 | }
36 |
37 | private IEnumerator LookScript(bool updateLabel)
38 | {
39 | using (Game.CutsceneBlock(true, true, updateLabel))
40 | {
41 | var startSession = Game.Ego.Inventory.HasItem() &&
42 | Tree.InventoryItems.Envelope.ReadLetter &&
43 | !Tree.Cutscenes.Director.FinishedSession(Cutscenes.Sessions.Three);
44 |
45 | if (startSession)
46 | {
47 | Game.PlayBasementEndSong();
48 | }
49 | else if (!LookedAt)
50 | {
51 | Game.PlaySoundEffect(content.audio.puzzle);
52 | }
53 |
54 | yield return Game.Ego.Say(Items_Res.Our_old_picnic_blanket_wow_I_didnt_know_we_kept_it);
55 | yield return Game.Ego.Say(Items_Res.Cynthia_and_me_spent_much_time_on_that_together_especially_before_Landon_was_born);
56 |
57 | LookedAt = true;
58 |
59 | if (startSession)
60 | {
61 | yield return Tree.Cutscenes.Director.StartSession(Cutscenes.Sessions.Three);
62 | }
63 | }
64 | }
65 |
66 | private IEnumerator UseScript()
67 | {
68 | using (Game.CutsceneBlock())
69 | {
70 | yield return Game.Ego.Say(Items_Res.No_picnic_for_now);
71 | }
72 | }
73 |
74 | private IEnumerator UseScissorsScript()
75 | {
76 | using (Game.CutsceneBlock())
77 | {
78 | switch (Game.Ego.Get().GetScoreTypeResult())
79 | {
80 | case ScoreType.Freedom:
81 | yield return Game.Ego.Say(Items_Res.No_There_are_many_good_memories_attached_to_it);
82 | break;
83 | case ScoreType.Jail:
84 | case ScoreType.Insanity:
85 | yield return Game.Ego.Say(Items_Res.Id_love_to_but_I_have_more_important_things_to_tend_to);
86 | break;
87 | }
88 |
89 | }
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Crowbar.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Crowbar : ItemBase
11 | {
12 | public Crowbar() : base(content.inventory.crowbar, Items_Res.Crowbar_Crowbar_Crowbar)
13 | {
14 | }
15 |
16 | protected override Interactions GetInteractions()
17 | {
18 | return Interactions
19 | .Create()
20 | .For(Any.Object)
21 | .Add(Verbs.Use, UseCrowbarWith)
22 | .For(Game.Ego)
23 | .Add(Verbs.Look, LookScript());
24 | }
25 |
26 | private Script UseCrowbarWith(InteractionContext context)
27 | {
28 | return Game.Ego.StartScript(UseCrowbarWithScript(context));
29 | }
30 |
31 | private IEnumerator UseCrowbarWithScript(InteractionContext context)
32 | {
33 | using (Game.CutsceneBlock())
34 | {
35 | if (context.Secondary is ItemBase)
36 | {
37 | yield return Game.Ego.Say(Items_Res.Holding_that_in_my_hands_I_cant_apply_force_on_that);
38 | }
39 | else
40 | {
41 | yield return Game.Ego.GoTo(context.Secondary);
42 | yield return Game.Ego.StartUse();
43 | Game.PlaySoundEffect(content.audio.crowbar_break);
44 | Game.Ego.Inventory.RemoveItem(this);
45 | Game.Ego.Inventory.AddItem();
46 | yield return Game.Ego.StopUse();
47 | yield return Delay.Seconds(2f);
48 | yield return Game.Ego.Say(Items_Res.It_broke_in_two_parts);
49 | yield return Game.Ego.Say(Items_Res.I_cant_believe_what_just_happened);
50 | }
51 | }
52 |
53 | }
54 |
55 | private IEnumerator LookScript()
56 | {
57 | using (Game.CutsceneBlock())
58 | {
59 | yield return Game.Ego.Say(Items_Res.Reliable_and_robust);
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/CrowbarBroken.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class CrowbarBroken : ItemBase
11 | {
12 | public CrowbarBroken() : base(content.inventory.crowbar_broken, Items_Res.CrowbarBroken_CrowbarBroken_BrokenCrowbar)
13 | {
14 | }
15 |
16 | protected override Interactions GetInteractions()
17 | {
18 | return Interactions
19 | .Create()
20 | .For(Any.Object)
21 | .Add(Verbs.Use, UseCrowbarWith)
22 | .For(Game.Ego)
23 | .Add(Verbs.Look, LookScript());
24 | }
25 |
26 | private Script UseCrowbarWith(InteractionContext context)
27 | {
28 | return Game.Ego.StartScript(UseCrowbarWithScript());
29 | }
30 |
31 | private IEnumerator UseCrowbarWithScript()
32 | {
33 | using (Game.CutsceneBlock())
34 | {
35 | yield return Game.Ego.Say(Items_Res.The_two_broken_parts_are_utterly_useless);
36 | }
37 | }
38 |
39 | private IEnumerator LookScript()
40 | {
41 | using (Game.CutsceneBlock())
42 | {
43 | yield return Game.Ego.Say(Items_Res.Unreliable_garbage);
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/DrawerKey.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class DrawerKey : ItemBase
11 | {
12 | public DrawerKey() : base(content.inventory.drawerkey, Items_Res.DrawerKey_DrawerKey_SmallKey)
13 | {
14 |
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Any.Object)
22 | .Add(Verbs.Use, UseAnyScript(), Game.Ego)
23 | .For(Game.Ego)
24 | .Add(Verbs.Look, LookScript());
25 | }
26 |
27 | private IEnumerator UseAnyScript()
28 | {
29 | using (Game.CutsceneBlock())
30 | {
31 | yield return Game.Ego.Say(Items_Res.Cant_use_the_key_with_that);
32 | }
33 | }
34 |
35 | private IEnumerator LookScript()
36 | {
37 | using (Game.CutsceneBlock())
38 | {
39 | yield return Game.Ego.Say(Items_Res.This_small_key_was_glued_to_the_back_of_Landons_portrait);
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Drone.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Drone : ItemBase
11 | {
12 | public Drone() : base(content.inventory.drone, Items_Res.Drone_Drone_Drone, true, true)
13 | {
14 |
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Any.Object)
22 | .Add(Verbs.Use, UseScript(), Game.Ego)
23 | .For(Game.Ego)
24 | .Add(Verbs.Look, LookScript());
25 | }
26 |
27 | private IEnumerator UseScript()
28 | {
29 | using (Game.CutsceneBlock())
30 | {
31 | yield return Game.Ego.Say(Items_Res.I_dont_see_the_point_in_making_the_drone_fly_to_that);
32 | }
33 | }
34 |
35 | private IEnumerator LookScript()
36 | {
37 | yield return Game.Ego.StartScript(DronePackage.LookScript());
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/DronePackage.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class DronePackage : ItemBase
11 | {
12 | public DronePackage() : base(content.inventory.dronepackage, Items_Res.DronePackage_DronePackage_DronePackage, true, false)
13 | {
14 |
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Game.Ego)
22 | .Add(Verbs.Open, OpenScript())
23 | .Add(Verbs.Use, UseScript())
24 | .Add(Verbs.Look, LookScript());
25 | }
26 |
27 | private IEnumerator OpenScript()
28 | {
29 | using (Game.CutsceneBlock())
30 | {
31 | Game.Ego.Turn(STACK.Components.Directions4.Up);
32 | yield return Game.Ego.StartUse();
33 | Game.Ego.Inventory.AddItem();
34 | Game.Ego.Inventory.AddItem();
35 | Game.Ego.Inventory.RemoveItem(this);
36 | yield return Game.Ego.StopUse();
37 | }
38 | }
39 |
40 | private IEnumerator UseScript()
41 | {
42 | using (Game.CutsceneBlock())
43 | {
44 | yield return Game.Ego.Say(Items_Res.I_should_open_the_package_first);
45 | }
46 | }
47 |
48 | public static IEnumerator LookScript()
49 | {
50 | using (Game.CutsceneBlock())
51 | {
52 | yield return Game.Ego.Say(Items_Res.Aw_man_we_hardly_ever_used_this_thing);
53 | yield return Game.Ego.Say(Items_Res.It_was_pretty_fun_freaking_the_neighbors_dog_out_with_it_though);
54 | yield return Game.Ego.Say(Items_Res.Good_memories);
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/DrugPrescriptionRyan.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class DrugPrescriptionRyan : ItemBase
12 | {
13 | public DrugPrescriptionRyan() : base(content.inventory.drugprescriptionryan, Items_Res.DrugPrescriptionRyan_DrugPrescriptionRyan_DrugPrescription)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Game.Ego)
23 | .Add(Verbs.Look, LookScript());
24 | }
25 |
26 | public Script LookAt()
27 | {
28 | return Game.Ego.StartScript(LookScript());
29 | }
30 |
31 | public bool LookedAt { get; private set; }
32 |
33 | public IEnumerator LookScript()
34 | {
35 | var startSession = Game.Ego.Inventory.HasItem() &&
36 | !Tree.Cutscenes.Director.FinishedSession(Cutscenes.Sessions.Four);
37 |
38 | if (startSession)
39 | {
40 | Game.PlayBasementEndSong();
41 | }
42 | else if (!LookedAt)
43 | {
44 | Game.PlaySoundEffect(content.audio.puzzle);
45 | }
46 |
47 | using (Game.CutsceneBlock())
48 | {
49 | yield return Game.Ego.Say(Items_Res.This_is_an_old_xanax_prescription_which_was_issued_for_me_some_years_ago);
50 |
51 | LookedAt = true;
52 | }
53 |
54 | if (startSession)
55 | {
56 | yield return Tree.Cutscenes.Director.StartSession(Cutscenes.Sessions.Four);
57 | }
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Flashlight.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using SessionSeven.Entities;
3 | using SessionSeven.GUI.Interaction;
4 | using STACK;
5 | using System;
6 | using System.Collections;
7 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
8 |
9 | namespace SessionSeven.InventoryItems
10 | {
11 | [Serializable]
12 | public class Flashlight : ItemBase
13 | {
14 | public Flashlight() : base(content.inventory.flashlight, Items_Res.Flashlight_Flashlight_Flashlight, false, true)
15 | {
16 | BatteryCompartment
17 | .Create(this);
18 | }
19 |
20 | protected override Interactions GetInteractions()
21 | {
22 | return Interactions
23 | .Create()
24 | .For(Any.Object)
25 | .Add(Verbs.Use, UseAnyScript(), Game.Ego)
26 | .For(Tree.InventoryItems.BatteryA)
27 | .Add(Verbs.Use, Get().InstallBatteryAScript(true), Game.Ego)
28 | .For(Tree.InventoryItems.BatteryB)
29 | .Add(Verbs.Use, Get().InstallBatteryBScript(true), Game.Ego)
30 | .For(Game.Ego)
31 | .Add(Verbs.Open, Get().OpenScript())
32 | .Add(Verbs.Look, LookScript());
33 | }
34 |
35 | private IEnumerator UseAnyScript()
36 | {
37 | using (Game.CutsceneBlock())
38 | {
39 | yield return Game.Ego.Say(Items_Res.It_is_sufficiently_bright);
40 | }
41 | }
42 |
43 | private IEnumerator LookScript()
44 | {
45 | using (Game.CutsceneBlock())
46 | {
47 | yield return Game.Ego.Say(Items_Res.A_regular_flashlight);
48 | yield return Game.Ego.Say(Items_Res.The_battery_compartment_has_place_for_two_batteries);
49 |
50 | var description = Get().GetDescriptionString();
51 |
52 | yield return Game.Ego.Say(description);
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/GuitarStrings.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class GuitarStrings : ItemBase
12 | {
13 | public GuitarStrings() : base(content.inventory.strings, Items_Res.GuitarStrings_GuitarStrings_Strings, true, true)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Tree.InventoryItems.Baton)
23 | .Add(Verbs.Use, UseStringsWithBatonScript(), Game.Ego)
24 | .For(Game.Ego)
25 | .Add(Verbs.Look, OnLook());
26 | }
27 |
28 | private IEnumerator UseStringsWithBatonScript()
29 | {
30 | if (null != Tree.InventoryItems.Baton)
31 | {
32 | yield return Tree.InventoryItems.Baton.UseStringsScript();
33 | }
34 | }
35 |
36 | private IEnumerator OnLook()
37 | {
38 | using (Game.CutsceneBlock())
39 | {
40 | yield return Game.Ego.Say(Items_Res.These_are_my_replacement_guitar_strings);
41 | }
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Hammer.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Hammer : ItemBase
11 | {
12 | public Hammer()
13 | : base(content.inventory.hammer, Items_Res.Hammer_Hammer_Hammer)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Any.Object)
23 | .Add(Verbs.Use, UseHammerWithScript(), Game.Ego)
24 | .For(Game.Ego)
25 | .Add(Verbs.Look, LookScript());
26 | }
27 |
28 | private IEnumerator LookScript()
29 | {
30 | using (Game.CutsceneBlock())
31 | {
32 | yield return Game.Ego.Say(Items_Res.Its_a_tool_with_a_heavy_piece_of_metal_at_the_end_of_a_handle);
33 | }
34 | }
35 |
36 | private IEnumerator UseHammerWithScript()
37 | {
38 | using (Game.CutsceneBlock())
39 | {
40 | yield return Game.Ego.Say(Items_Res.If_all_you_have_is_a_hammer_everything_looks_like_a_nail);
41 | }
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Paperclip.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Paperclip : ItemBase
11 | {
12 | public Paperclip() : base(content.inventory.paperclip, Items_Res.Paperclip_Paperclip_PaperClip)
13 | {
14 | }
15 |
16 | protected override Interactions GetInteractions()
17 | {
18 | return Interactions
19 | .Create()
20 | .For(Game.Ego)
21 | .Add(Verbs.Look, LookScript());
22 | }
23 |
24 | private IEnumerator LookScript()
25 | {
26 | using (Game.CutsceneBlock())
27 | {
28 | yield return Game.Ego.Say(Items_Res.The_plastic_wrapping_is_missing);
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Paperclips.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Paperclips : ItemBase
11 | {
12 | public Paperclips() : base(content.inventory.paperclips, Items_Res.Paperclips_Paperclips_PaperClips)
13 | {
14 | }
15 |
16 | protected override Interactions GetInteractions()
17 | {
18 | return Interactions
19 | .Create()
20 | .For(Game.Ego)
21 | .Add(Verbs.Look, LookScript());
22 | }
23 |
24 | private IEnumerator LookScript()
25 | {
26 | using (Game.CutsceneBlock())
27 | {
28 | yield return Game.Ego.Say(Items_Res.A_small_box_with_paper_clips);
29 | yield return Game.Ego.Say(Items_Res.The_plastic_wrapping_is_missing_on_some_of_them);
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Pills.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Pills : ItemBase
11 | {
12 | public Pills()
13 | : base(content.inventory.pills, Items_Res.Pills_Pills_Antidepressants, true, false)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Game.Ego)
23 | .Add(Verbs.Pick, UseScript())
24 | .Add(Verbs.Open, UseScript())
25 | .Add(Verbs.Use, UseScript())
26 | .Add(Verbs.Look, LookScript());
27 | }
28 |
29 | private IEnumerator UseScript()
30 | {
31 | using (Game.CutsceneBlock())
32 | {
33 | yield return Game.Ego.Say(Items_Res.Im_not_taking_this_kind_of_medicine);
34 | }
35 | }
36 |
37 | private IEnumerator LookScript()
38 | {
39 | using (Game.CutsceneBlock())
40 | {
41 | yield return Game.Ego.Say(Items_Res.Landons_antidepressants_They_have_not_yet_been_opened);
42 | yield return Game.Ego.Say(Items_Res.I_thought_he_was_taking_them_regularly);
43 | }
44 | }
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Portrait.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Portrait : ItemBase
11 | {
12 | public Portrait() : base(content.inventory.portrait, Items_Res.Portrait_Portrait_Portrait)
13 | {
14 | }
15 |
16 | protected override Interactions GetInteractions()
17 | {
18 | return Interactions
19 | .Create()
20 | .For(Game.Ego)
21 | .Add(Verbs.Look, LookScript());
22 | }
23 |
24 | private IEnumerator LookScript()
25 | {
26 | using (Game.CutsceneBlock())
27 | {
28 | yield return Game.Ego.Say(Items_Res.It_is_a_portrait_of_my_son_Landon_when_he_was_six_years_old);
29 | yield return Game.Ego.Say(Items_Res.He_looks_happy, 1f);
30 |
31 | if (!Game.Ego.Inventory.HasItem())
32 | {
33 | yield return Delay.Seconds(1.5f);
34 | yield return Game.Ego.Say(Items_Res.Hey_Theres_a_small_key_glued_to_the_back_of_this);
35 | Game.Ego.Inventory.AddItem();
36 | }
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/RFIDAntennaBoxCabinet.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class RFIDAntennaBoxCabinet : ItemBase
12 | {
13 | public RFIDAntennaBoxCabinet() : base(content.inventory.cardboard, Items_Res.RFIDAntennaBoxCabinet_RFIDAntennaBoxCabinet_Cardboard)
14 | {
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Game.Ego)
22 | .Add(Verbs.Look, LookScript())
23 | .Add(Verbs.Open, OpenScript())
24 | .Add(Verbs.Use, OpenScript());
25 | }
26 |
27 | private IEnumerator OpenScript()
28 | {
29 | using (Game.CutsceneBlock())
30 | {
31 | yield return Game.Ego.StartUse();
32 | yield return Game.WaitForSoundEffect(content.audio.cardboard_open);
33 |
34 | Game.Ego.Inventory.RemoveItem(this);
35 | Game.Ego.Inventory.AddItem();
36 | yield return Game.Ego.StopUse();
37 |
38 | if (Game.Ego.Inventory.HasItem())
39 | {
40 | yield return Game.Ego.Say(Items_Res.Another_longrange_RFID_antenna);
41 | }
42 | else
43 | {
44 | yield return Game.Ego.StartScript(Tree.InventoryItems.RFIDAntennaCabinet.LookScript(false));
45 | }
46 | }
47 | }
48 |
49 | private IEnumerator LookScript()
50 | {
51 | using (Game.CutsceneBlock())
52 | {
53 | var hasOtherAntenna = Game.Ego.Inventory.HasItem();
54 |
55 | yield return Game.Ego.Say(Items_Res.A_cardboard_without_any_inscription);
56 |
57 | if (Game.Ego.Inventory.HasItem())
58 | {
59 | yield return Game.Ego.Say(Items_Res.Looks_extactly_like_the_other_cardboard_I_got);
60 | }
61 |
62 | if (hasOtherAntenna)
63 | {
64 | yield return Game.Ego.Say(Items_Res.Looks_extactly_like_the_other_cardboard_which_contained_the_RFID_antenna);
65 | }
66 |
67 | yield return Game.Ego.Say(Items_Res.Must_be_Cynthias_or_Landons);
68 |
69 | if (!hasOtherAntenna)
70 | {
71 | yield return Game.Ego.Say(Items_Res.I_wonder_what_is_inside);
72 | }
73 | }
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/RFIDAntennaBoxShelf.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class RFIDAntennaBoxShelf : ItemBase
12 | {
13 | public RFIDAntennaBoxShelf() : base(content.inventory.cardboard, Items_Res.RFIDAntennaBoxCabinet_RFIDAntennaBoxCabinet_Cardboard)
14 | {
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Game.Ego)
22 | .Add(Verbs.Look, LookScript())
23 | .Add(Verbs.Open, OpenScript())
24 | .Add(Verbs.Use, OpenScript());
25 | }
26 |
27 | private IEnumerator OpenScript()
28 | {
29 | using (Game.CutsceneBlock())
30 | {
31 | yield return Game.Ego.StartUse();
32 | yield return Game.WaitForSoundEffect(content.audio.cardboard_open);
33 |
34 | Game.Ego.Inventory.RemoveItem(this);
35 | Game.Ego.Inventory.AddItem();
36 | yield return Game.Ego.StopUse();
37 |
38 | if (Game.Ego.Inventory.HasItem())
39 | {
40 | yield return Game.Ego.Say(Items_Res.Another_longrange_RFID_antenna);
41 | }
42 | else
43 | {
44 | yield return Game.Ego.StartScript(Tree.InventoryItems.RFIDAntennaShelf.LookScript(false));
45 | }
46 | }
47 | }
48 |
49 | private IEnumerator LookScript()
50 | {
51 | using (Game.CutsceneBlock())
52 | {
53 | var hasOtherAntenna = Game.Ego.Inventory.HasItem();
54 |
55 | yield return Game.Ego.Say(Items_Res.A_cardboard_without_any_inscription);
56 |
57 | if (Game.Ego.Inventory.HasItem())
58 | {
59 | yield return Game.Ego.Say(Items_Res.Looks_extactly_like_the_other_cardboard_I_got);
60 | }
61 |
62 | if (hasOtherAntenna)
63 | {
64 | yield return Game.Ego.Say(Items_Res.Looks_extactly_like_the_other_cardboard_which_contained_the_RFID_antenna);
65 | }
66 |
67 | yield return Game.Ego.Say(Items_Res.Must_be_Cynthias_or_Landons);
68 |
69 | if (!hasOtherAntenna)
70 | {
71 | yield return Game.Ego.Say(Items_Res.I_wonder_what_is_inside);
72 | }
73 | }
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/RFIDBook.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class RFIDBook : ItemBase
11 | {
12 | public RFIDBook()
13 | : base(content.inventory.rfidbook, Items_Res.RFIDBook_RFIDBook_RFIDBook, true, false)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Game.Ego)
23 | .Add(Verbs.Open, LookScript())
24 | .Add(Verbs.Use, LookScript())
25 | .Add(Verbs.Look, LookScript());
26 | }
27 |
28 | private IEnumerator LookScript()
29 | {
30 | using (Game.CutsceneBlock())
31 | {
32 | var hasAnyAntenna = Game.Ego.Inventory.HasItem() ||
33 | Game.Ego.Inventory.HasItem();
34 |
35 | if (hasAnyAntenna)
36 | {
37 | yield return Game.Ego.Say(Items_Res.I_wonder_what_Landon_used_those_antennas_for);
38 | yield return Game.Ego.Say(Items_Res.Here_is_a_summary_in_the_book_describing_RFID_antennas);
39 |
40 | yield return Game.Ego.Say(Items_Res._Radio_Frequency_Identification_allows_to_identify_objects_using_data_transmitted_via_radio_waves_);
41 | yield return Game.Ego.Say(Items_Res._RFID_antennas_send_the_RF_energy_to_those_objects_called_RFID_tags_and_receive_the_tags_reply_);
42 | yield return Game.Ego.Say(Items_Res._No_line_of_sight_is_required_between_the_antenna_and_the_tag_Directional_antennas_allow_for_a_greater_coverage_distance_);
43 | yield return Game.Ego.Say(Items_Res._Using_two_directional_RFID_antennas_the_actual_position_of_a_RFID_tag_can_be_triangulated_);
44 | }
45 | else
46 | {
47 | yield return Game.Ego.Say(Items_Res.Its_a_book_about_RFID_technology_I_wrote_a_research_paper_about_it_in_university);
48 | }
49 | }
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/SawKit.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class SawKit : ItemBase
11 | {
12 | public SawKit()
13 | : base(content.inventory.sawkit, Items_Res.SawKit_SawKit_BiMetalHoleSawKit)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Game.Ego)
23 | .Add(Verbs.Look, LookScript());
24 | }
25 |
26 | private IEnumerator LookScript()
27 | {
28 | using (Game.CutsceneBlock())
29 | {
30 | yield return Game.Ego.Say(Items_Res.In_there_are_different_attachments_for_drilling_machines);
31 | yield return Game.Ego.Say(Items_Res.They_can_even_cut_through_metal);
32 | }
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Scissors.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class Scissors : ItemBase
12 | {
13 | public Scissors() : base(content.inventory.scissors, Items_Res.Scissors_Scissors_Scissors)
14 | {
15 | }
16 |
17 | protected override Interactions GetInteractions()
18 | {
19 | return Interactions
20 | .Create()
21 | .For(Any.Object)
22 | .Add(Verbs.Use, UseAnyScript(), Game.Ego)
23 | .For(Game.Ego)
24 | .Add(Verbs.Look, LookScript())
25 | .For(Tree.InventoryItems.Bandages)
26 | .Add(Verbs.Use, OnUseBandages);
27 | }
28 |
29 | private IEnumerator UseAnyScript()
30 | {
31 | using (Game.CutsceneBlock())
32 | {
33 | yield return Game.Ego.Say(Items_Res.I_dont_want_to_cut_that);
34 | }
35 | }
36 |
37 | private Script OnUseBandages(InteractionContext context)
38 | {
39 | return Tree.InventoryItems.Bandages.Use();
40 | }
41 |
42 | private IEnumerator LookScript()
43 | {
44 | using (Game.CutsceneBlock())
45 | {
46 | yield return Game.Ego.Say(Items_Res.One_pair_of_bandage_scissors);
47 | }
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/Screwdriver.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using System;
4 | using System.Collections;
5 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
6 |
7 | namespace SessionSeven.InventoryItems
8 | {
9 | [Serializable]
10 | public class Screwdriver : ItemBase
11 | {
12 | public Screwdriver()
13 | : base(content.inventory.screwdriver, Items_Res.Screwdriver_Screwdriver_Screwdriver)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Any.Object)
23 | .Add(Verbs.Use, UseAnyScript(), Game.Ego)
24 | .For(Game.Ego)
25 | .Add(Verbs.Look, LookScript());
26 | }
27 |
28 | private IEnumerator UseAnyScript()
29 | {
30 | using (Game.CutsceneBlock())
31 | {
32 | yield return Game.Ego.Say(Items_Res.This_does_not_need_to_be_screwed);
33 | }
34 | }
35 |
36 | private IEnumerator LookScript()
37 | {
38 | using (Game.CutsceneBlock())
39 | {
40 | yield return Game.Ego.Say(Items_Res.Its_a_screwdriver);
41 | }
42 | }
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/TherapyLog.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class TherapyLog : ItemBase
12 | {
13 | public TherapyLog() : base(content.inventory.therapylog, Items_Res.TherapyLog_TherapyLog_TherapyLog)
14 | {
15 |
16 | }
17 |
18 | protected override Interactions GetInteractions()
19 | {
20 | return Interactions
21 | .Create()
22 | .For(Game.Ego)
23 | .Add(Verbs.Look, LookScript());
24 | }
25 |
26 | private IEnumerator LookScript()
27 | {
28 | using (Game.CutsceneBlock())
29 | {
30 | Game.EnableSkipping();
31 |
32 | yield return Game.Ego.Say(Items_Res.According_to_the_date_this_therapy_session_happened_some_months_ago);
33 | yield return Delay.Seconds(0.3f);
34 | yield return Game.Ego.Say(Items_Res.It_reads);
35 | yield return Delay.Seconds(0.5f);
36 | yield return Game.Ego.Say(Items_Res.Mr_Psychiatrist__When_you_first_realized_you_were_trapped_what_did_you_do_);
37 |
38 | switch (Tree.Cutscenes.Director.SessionTwoDialogOneOption)
39 | {
40 | case Cutscenes.Director.SessionTwoDialogOneOptionOne:
41 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__I_just_lost_it_I_was_terrified_);
42 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__I_was_just_trying_everything_I_could_to_get_out_of_there_);
43 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__But_then_I_wasnt_even_sure_how_Id_gotten_there_);
44 | break;
45 | case Cutscenes.Director.SessionTwoDialogOneOptionTwo:
46 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__I_got_frustrated_I_tried_to_remember_what_I_was_doing_before_it_all_started_);
47 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__Before_I_was_there_you_know_How_did_it_come_to_this_And_where_was_my_family_);
48 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__I_was_trying_to_think_back_on_it_and_I_just_couldnt_remember_);
49 | break;
50 | case Cutscenes.Director.SessionTwoDialogOneOptionThree:
51 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__I_stayed_calm_I_wasnt_just_going_to_give_up_);
52 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__I_did_my_best_to_figure_out_what_was_going_on_I_wasnt_just_going_to_sit_down_and_take_it_);
53 | yield return Game.Ego.Say(Items_Res.Mr_Schmidt__Especially_not_if_my_family_was_in_danger_somewhere_else_);
54 | break;
55 | }
56 |
57 | yield return Delay.Seconds(1f);
58 |
59 | yield return Game.Ego.Say(Items_Res.It_stops_here_The_other_page_seems_to_be_missing);
60 |
61 | Game.StopSkipping();
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/WoodenBox.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using System;
5 | using System.Collections;
6 | using Items_Res = global::SessionSeven.Properties.Items_Resources;
7 |
8 | namespace SessionSeven.InventoryItems
9 | {
10 | [Serializable]
11 | public class WoodenBox : ItemBase
12 | {
13 | public WoodenBox()
14 | : base(content.inventory.woodenbox, Items_Res.WoodenBox_WoodenBox_WoodenBox)
15 | {
16 |
17 | }
18 |
19 | protected override Interactions GetInteractions()
20 | {
21 | return Interactions
22 | .Create()
23 | .For(Game.Ego)
24 | .Add(Verbs.Open, OpenScript())
25 | .Add(Verbs.Look, LookScript());
26 | }
27 |
28 | public bool Opened { get; private set; }
29 |
30 | private IEnumerator OpenScript()
31 | {
32 | using (Game.CutsceneBlock())
33 | {
34 | Game.Ego.Turn(STACK.Components.Directions4.Up);
35 |
36 | if (Opened)
37 | {
38 | yield return Game.Ego.StartUse();
39 | yield return Game.WaitForSoundEffect(content.audio.box_open);
40 | yield return Game.Ego.Say(Items_Res.Nothing_more_in_there);
41 | yield return Game.Ego.StopUse();
42 | yield break;
43 | }
44 |
45 | Game.PlayBasementEndSong();
46 |
47 | yield return Game.Ego.Say(Items_Res.Lets_see_whats_in_there);
48 |
49 | yield return Game.Ego.StartUse();
50 | yield return Game.WaitForSoundEffect(content.audio.box_open);
51 |
52 | Game.Ego.Inventory.AddItem();
53 | yield return Game.Ego.StopUse();
54 |
55 | yield return Game.Ego.Say(Items_Res.Eww);
56 | yield return Game.Ego.Say(Items_Res.A_rotten_animal_skeleton);
57 |
58 | yield return Game.Ego.StartUse();
59 | Game.Ego.Inventory.AddItem();
60 | yield return Game.Ego.StopUse();
61 |
62 | yield return Game.Ego.Say(Items_Res.Those_are_Landons_antidepressants_They_have_not_yet_been_opened);
63 |
64 | yield return Game.Ego.StartUse();
65 | Game.Ego.Inventory.AddItem();
66 | yield return Game.Ego.StopUse();
67 |
68 | yield return Game.Ego.Say(Items_Res.And_an_expendable_baton);
69 | yield return Game.Ego.Say(Items_Res.What_the_hell_would_he_do_with_a_baton);
70 |
71 | Opened = true;
72 |
73 | yield return Tree.Cutscenes.Director.StartSession(Cutscenes.Sessions.Five);
74 | }
75 | }
76 |
77 | private IEnumerator LookScript()
78 | {
79 | using (Game.CutsceneBlock())
80 | {
81 | yield return Game.Ego.Say(Items_Res.This_small_wooden_box_was_hidden_underneath_a_plank);
82 | yield return Game.Ego.Say(Items_Res.A_RFID_tag_is_glued_to_the_bottom);
83 | }
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/items/base/ItemBase.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.InventoryItems
7 | {
8 | [Serializable]
9 | public abstract class ItemBase : Entity
10 | {
11 | public ItemBase(string image, string caption, bool givable = true, bool combinable = true)
12 | {
13 |
14 | Sprite
15 | .Create(this)
16 | .SetRenderStage(RenderStage.PostBloom)
17 | .SetImage(image);
18 |
19 | Transform
20 | .Create(this);
21 |
22 | Interaction
23 | .Create(this)
24 | .SetGetInteractionsFn(GetInteractions);
25 |
26 | HotspotSprite
27 | .Create(this)
28 | .SetCaption(caption);
29 |
30 | if (givable)
31 | {
32 | Givable
33 | .Create(this);
34 | }
35 |
36 | if (combinable)
37 | {
38 | Combinable
39 | .Create(this);
40 | }
41 | }
42 |
43 | protected virtual Interactions GetInteractions()
44 | {
45 | return Interactions.None;
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/menu/CreditsWindow.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using System;
3 | using TomShane.Neoforce.Controls;
4 | using GlblRes = global::SessionSeven.Properties.Resources;
5 |
6 | namespace SessionSeven
7 | {
8 | public partial class Menu
9 | {
10 | private Bevel _creditsWindow;
11 |
12 | private void AddCreditsWindow(Manager gui)
13 | {
14 | _creditsWindow = new Bevel(gui)
15 | {
16 | Parent = _mainMenuBackground,
17 | Height = _mainMenuBackground.ClientHeight,
18 | Color = Color.Black,
19 | Style = BevelStyle.None,
20 | Visible = false,
21 | Top = 0,
22 | StayOnTop = true,
23 | Width = _mainMenuBackground.ClientWidth
24 | };
25 |
26 | var i = 0;
27 | var newLineNewLine = new string[] { Environment.NewLine + Environment.NewLine };
28 |
29 | foreach (var creditsText in Cutscenes.Director.GetCreditTexts(false))
30 | {
31 | var top = 110 + (i * 23) + (i > 4 ? 23 : 0);
32 | var text = creditsText.Split(newLineNewLine, StringSplitOptions.RemoveEmptyEntries);
33 | if (text.Length == 2)
34 | {
35 | var label = new Label(gui);
36 | label.Init();
37 | label.Width = 300;
38 | label.Height = 100;
39 | label.Alignment = Alignment.TopLeft;
40 | label.TextColor = Color.Black;
41 | label.Parent = _creditsWindow;
42 | label.Text = text[0];
43 | label.Top = top;
44 | label.Left = (_mainMenuBackground.ClientWidth / 2) - (label.Width / 2);
45 |
46 | label = new Label(gui);
47 | label.Init();
48 | label.Width = 300;
49 | label.Height = 100;
50 | label.Alignment = Alignment.TopRight;
51 | label.TextColor = new Color(188, 22, 0, 255);
52 | label.Parent = _creditsWindow;
53 | label.Text = text[1];
54 | label.Top = top;
55 | label.Left = (_mainMenuBackground.ClientWidth / 2) - (label.Width / 2);
56 | }
57 | else
58 | {
59 | var label = new Label(gui);
60 | label.Init();
61 | label.Width = 300;
62 | label.Height = 100;
63 | label.Alignment = Alignment.TopCenter;
64 | label.TextColor = Color.Black;
65 | label.Parent = _creditsWindow;
66 | label.Text = text[0];
67 | label.Top = top;
68 | label.Left = (_mainMenuBackground.ClientWidth / 2) - (label.Width / 2);
69 | }
70 | i++;
71 | }
72 |
73 | var okButton = new MenuButton(gui, _clickSound, _focusSound, _gameSettings);
74 | okButton.Init();
75 | okButton.Parent = _creditsWindow;
76 | okButton.Text = GlblRes.OK;
77 | okButton.Click += (s, e) =>
78 | {
79 | _creditsWindow.Hide();
80 | ShowLogo(true);
81 | };
82 |
83 | okButton.Width = 120;
84 | okButton.Height = 24;
85 | okButton.Left = _mainMenuBackground.ClientWidth - okButton.Width - 6;
86 | okButton.Top = _mainMenuBackground.ClientHeight - okButton.Height - 6 - (30 * 0);
87 | okButton.Anchor = Anchors.Top;
88 |
89 | gui.Add(_creditsWindow);
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/menu/ExitConfirmation.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using TomShane.Neoforce.Controls;
3 | using GlblRes = global::SessionSeven.Properties.Resources;
4 | using Window = TomShane.Neoforce.Controls.Window;
5 |
6 | namespace SessionSeven
7 | {
8 | public partial class Menu
9 | {
10 | private Window _exitConfirmationWindow;
11 |
12 | private void AddExitConfirmationWindow(Manager gui)
13 | {
14 | _exitConfirmationWindow = new Window(gui);
15 | _exitConfirmationWindow.Init();
16 | _exitConfirmationWindow.Text = GlblRes.Really_quit;
17 | _exitConfirmationWindow.Width = 290;
18 | _exitConfirmationWindow.Height = 130;
19 | _exitConfirmationWindow.Resizable = false;
20 | _exitConfirmationWindow.IconVisible = false;
21 | _exitConfirmationWindow.Movable = false;
22 | _exitConfirmationWindow.Center(new Point(Game.VIRTUAL_WIDTH, Game.VIRTUAL_HEIGHT));
23 | _exitConfirmationWindow.Visible = false;
24 | _exitConfirmationWindow.CloseButtonVisible = false;
25 |
26 | var bevel = new Bevel(gui)
27 | {
28 | Parent = _exitConfirmationWindow,
29 | Anchor = Anchors.Bottom | Anchors.Left | Anchors.Right,
30 | Height = 35,
31 | Style = BevelStyle.Raised
32 | };
33 | bevel.Top = _exitConfirmationWindow.ClientHeight - bevel.Height;
34 | bevel.Width = _exitConfirmationWindow.ClientWidth;
35 |
36 |
37 | var text = new Label(gui)
38 | {
39 | Text = GlblRes.Do_you_really_want_to_quit_the_game,
40 | Parent = _exitConfirmationWindow,
41 | Top = 10,
42 | Left = 10,
43 | Width = _exitConfirmationWindow.ClientWidth - 20,
44 | Height = 20
45 | };
46 |
47 | var yes = new MenuButton(gui, _clickSound, _focusSound, _gameSettings)
48 | {
49 | Parent = bevel,
50 | Width = 100,
51 | Text = GlblRes.Yes,
52 | Left = 10,
53 | Top = 5
54 | };
55 | yes.Click += (se, ve) => _engine.Exit();
56 |
57 |
58 | var no = new MenuButton(gui, _clickSound, _focusSound, _gameSettings)
59 | {
60 | Parent = bevel,
61 | Text = GlblRes.Menu_AddExitConfirmationWindow_No,
62 | Width = 100,
63 | Left = 165,
64 | Top = 5
65 | };
66 | no.Click += (se, ev) =>
67 | {
68 | _exitConfirmationWindow.Close();
69 | ShowLogo(true);
70 | };
71 |
72 | gui.Add(_exitConfirmationWindow);
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/menu/MenuButton.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework.Audio;
2 | using STACK;
3 | using STACK.Components;
4 | using TomShane.Neoforce.Controls;
5 |
6 | namespace SessionSeven
7 | {
8 | ///
9 | /// Button with hover and click sounds
10 | ///
11 | public class MenuButton : Button
12 | {
13 | public MenuButton(Manager manager, SoundEffect clickSound, SoundEffect focusSound, GameSettings gameSettings) : base(manager)
14 | {
15 | Click += (a, e) => PlaySoundIfAvaiable(clickSound, gameSettings);
16 | MouseOver += (a, e) => PlaySoundIfAvaiable(focusSound, gameSettings);
17 | }
18 |
19 | private void PlaySoundIfAvaiable(SoundEffect sound, GameSettings gameSettings)
20 | {
21 | if (null != sound && !sound.IsDisposed && !AudioManager.SoundDisabled)
22 | {
23 | sound.Play(gameSettings.SoundEffectVolume, 0f, 0f);
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/BloodOnFloor.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class BloodOnFloor : Entity
12 | {
13 | public BloodOnFloor()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetWalkToClickPosition(true)
18 | .SetPosition(360, 260)
19 | .SetDirection(Directions8.Left)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | Transform
23 | .Create(this)
24 | .SetZ(Carpet.Z + 1);
25 |
26 | HotspotRectangle
27 | .Create(this)
28 | .SetCaption(Basement_Res.bloodstains)
29 | .AddRectangle(263, 250, 11, 8)
30 | .AddRectangle(332, 256, 16, 9);
31 |
32 | Enabled = false;
33 | }
34 |
35 | public Interactions GetInteractions()
36 | {
37 | return Interactions
38 | .Create()
39 | .For(Game.Ego)
40 | .Add(Verbs.Look, LookScript());
41 | }
42 |
43 | private IEnumerator LookScript()
44 | {
45 | yield return Game.Ego.GoTo(this);
46 | using (Game.CutsceneBlock())
47 | {
48 | yield return Game.Ego.Say(Basement_Res.How_the_hell_did_that_happen, 2f);
49 | }
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Boiler.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class Boiler : Entity
12 | {
13 | public Boiler()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(994, 268)
18 | .SetDirection(Directions8.Up)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | HotspotRectangle
22 | .Create(this)
23 | .SetCaption(Basement_Res.boiler)
24 | .AddRectangle(961, 32, 62, 131);
25 |
26 | Enabled = false;
27 | }
28 |
29 | public Interactions GetInteractions()
30 | {
31 | return Interactions
32 | .Create()
33 | .For(Game.Ego)
34 | .Add(Verbs.Look, LookScript());
35 |
36 | }
37 |
38 | private IEnumerator LookScript()
39 | {
40 | yield return Game.Ego.GoTo(this);
41 | using (Game.CutsceneBlock())
42 | {
43 | yield return Game.Ego.Say(Basement_Res.The_boiler_that_keeps_our_hot_water_running);
44 | yield return Delay.Seconds(0.5f);
45 | yield return Game.Ego.Say(Basement_Res.Man_I_could_use_a_hot_shower_right_about_now);
46 | }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/BoxScrews.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class BoxScrews : Entity
12 | {
13 | public BoxScrews()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(573, 260)
18 | .SetDirection(Directions8.Up)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | HotspotRectangle
22 | .Create(this)
23 | .SetCaption(Basement_Res.box)
24 | .AddRectangle(558, 206, 37, 18);
25 |
26 | Transform
27 | .Create(this)
28 | .SetZ(Workbench.Z + 1);
29 |
30 | Enabled = false;
31 | }
32 |
33 | public Interactions GetInteractions()
34 | {
35 | return Interactions
36 | .Create()
37 | .For(Game.Ego)
38 | .Add(Verbs.Open, OpenScript())
39 | .Add(Verbs.Look, LookScript());
40 |
41 | }
42 |
43 | private IEnumerator OpenScript()
44 | {
45 | yield return Game.Ego.GoTo(this);
46 | using (Game.CutsceneBlock())
47 | {
48 | yield return Game.Ego.Say(Basement_Res.There_are_just_some_screws_and_nail_in_there);
49 | yield return Game.Ego.Say(Basement_Res.I_dont_need_them);
50 | }
51 | }
52 |
53 | private IEnumerator LookScript()
54 | {
55 | yield return Game.Ego.GoTo(this);
56 | using (Game.CutsceneBlock())
57 | {
58 | Get().SetCaption(Basement_Res.box_with_screws_and_nails);
59 | yield return Game.Ego.Say(Basement_Res.Im_keeping_some_screws_and_nails_in_this_box);
60 | }
61 | }
62 | }
63 |
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/BoxWritingMaterials.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using SessionSeven.InventoryItems;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class BoxWritingMaterials : Entity
13 | {
14 | public BoxWritingMaterials()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(205, 242)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.box)
25 | .AddRectangle(193, 200, 33, 17);
26 |
27 | Enabled = false;
28 | }
29 |
30 | public Interactions GetInteractions()
31 | {
32 | return Interactions
33 | .Create()
34 | .For(Game.Ego)
35 | .Add(Verbs.Look, LookScript())
36 | .Add(Verbs.Open, OpenScript());
37 |
38 | }
39 |
40 | private IEnumerator OpenScript()
41 | {
42 | yield return Game.Ego.GoTo(this);
43 | using (Game.CutsceneBlock())
44 | {
45 | yield return Game.Ego.Use();
46 | yield return Game.Ego.Say(Basement_Res.Lots_of_gnawed_off_paper_and_plastic);
47 | if (!Game.Ego.Inventory.HasItem())
48 | {
49 | yield return Game.Ego.Say(Basement_Res.Also_there_is_a_single_paper_clip_in_there);
50 | yield return Game.Ego.StartUse();
51 | Game.Ego.Inventory.AddItem();
52 | yield return Game.Ego.StopUse();
53 | }
54 | }
55 | }
56 |
57 | private IEnumerator LookScript()
58 | {
59 | yield return Game.Ego.GoTo(this);
60 | using (Game.CutsceneBlock())
61 | {
62 | Get().SetCaption(Basement_Res.box_with_writing_materials);
63 | yield return Game.Ego.Say(Basement_Res.Cynthia_stores_some_writing_materials_in_this_box);
64 | yield return Game.Ego.Say(Basement_Res.There_are_some_bite_marks_by_a_rat_or_something);
65 | }
66 | }
67 | }
68 |
69 |
70 | }
71 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/CabinetSawKit.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class CabinetSawKit : Entity
12 | {
13 | public CabinetSawKit()
14 | {
15 | HotspotSprite
16 | .Create(this)
17 | .SetCaption(Basement_Res.bimetal_hole_saw_kit)
18 | .SetPixelPerfect(false);
19 |
20 | Interaction
21 | .Create(this)
22 | .SetPosition(703, 247)
23 | .SetDirection(Directions8.Up)
24 | .SetGetInteractionsFn(GetInteractions);
25 |
26 | Transform
27 | .Create(this)
28 | .SetPosition(671, 199)
29 | .SetZ(3);
30 |
31 | Sprite
32 | .Create(this)
33 | .SetImage(content.rooms.basement.sawkit);
34 |
35 | Enabled = false;
36 | Visible = false;
37 | }
38 |
39 | public Interactions GetInteractions()
40 | {
41 | return Interactions
42 | .Create()
43 | .For(Game.Ego)
44 | .Add(Verbs.Look, LookScript())
45 | .Add(Verbs.Open, UseScript())
46 | .Add(Verbs.Pick, PickScript())
47 | .Add(Verbs.Use, UseScript());
48 | }
49 |
50 | private IEnumerator UseScript()
51 | {
52 | yield return Game.Ego.GoTo(this);
53 | using (Game.CutsceneBlock())
54 | {
55 | yield return Game.Ego.Say(Basement_Res.I_better_take_that_with_me_first);
56 | }
57 | }
58 |
59 | private IEnumerator PickScript()
60 | {
61 | yield return Game.Ego.GoTo(this);
62 | using (Game.CutsceneBlock())
63 | {
64 | yield return Game.Ego.StartUse();
65 | Visible = false;
66 | Game.Ego.Inventory.AddItem();
67 | Enabled = false;
68 | yield return Game.Ego.StopUse();
69 | }
70 | }
71 |
72 | private IEnumerator LookScript()
73 | {
74 | yield return Game.Ego.GoTo(this);
75 | using (Game.CutsceneBlock())
76 | {
77 | yield return Game.Ego.Say(Basement_Res.A_bimetal_hole_saw_kit);
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/CabinetScrapbooks.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class CabinetScrapbooksLeft : CabinetScrapbooksBase
13 | {
14 | protected override Rectangle Hotspot => new Rectangle(649, 79, 49, 26);
15 |
16 | protected override Vector2 InteractionPosition => new Vector2(703, 247);
17 | }
18 |
19 | [Serializable]
20 | public class CabinetScrapbooksRight : CabinetScrapbooksBase
21 | {
22 | protected override Rectangle Hotspot => new Rectangle(703, 80, 43, 26);
23 |
24 | protected override Vector2 InteractionPosition => new Vector2(703, 247);
25 | }
26 |
27 | [Serializable]
28 | public abstract class CabinetScrapbooksBase : Entity
29 | {
30 | protected abstract Vector2 InteractionPosition { get; }
31 | protected abstract Rectangle Hotspot { get; }
32 |
33 | public CabinetScrapbooksBase()
34 | {
35 | Interaction
36 | .Create(this)
37 | .SetPosition(InteractionPosition)
38 | .SetDirection(Directions8.Up)
39 | .SetGetInteractionsFn(GetInteractions);
40 |
41 | Transform
42 | .Create(this)
43 | .SetZ(3);
44 |
45 | HotspotRectangle
46 | .Create(this)
47 | .SetCaption(Basement_Res.scrapbooks)
48 | .AddRectangle(Hotspot);
49 |
50 | Enabled = false;
51 | }
52 |
53 | public Interactions GetInteractions()
54 | {
55 | return Interactions
56 | .Create()
57 | .For(Game.Ego)
58 | .Add(Verbs.Look, LookScript())
59 | .Add(Verbs.Use, LookScript())
60 | .Add(Verbs.Pick, PickScript());
61 | }
62 |
63 | private IEnumerator LookScript()
64 | {
65 | yield return Game.Ego.GoTo(this);
66 | using (Game.CutsceneBlock())
67 | {
68 | yield return Game.Ego.Say(Basement_Res.Cynthia_used_to_be_really_into_making_scrapbooks_for_every_year_when_Landon_was_growing_up);
69 | yield return Game.Ego.Say(Basement_Res.I_guess_I_hadnt_really_noticed_she_wasnt_doing_it_any_more);
70 | yield return Game.Ego.Say(Basement_Res.I_cant_quite_bring_myself_to_look_through_them_right_now);
71 | }
72 | }
73 |
74 | private IEnumerator PickScript()
75 | {
76 | yield return Game.Ego.GoTo(this);
77 | using (Game.CutsceneBlock())
78 | {
79 | yield return Game.Ego.Say(Basement_Res.I_cant_quite_bring_myself_to_look_through_them_right_now);
80 | }
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/CabinetSupplies.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class CabinetSupplies : Entity
12 | {
13 | public CabinetSupplies()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(703, 247)
18 | .SetDirection(Directions8.Up)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | Transform
22 | .Create(this)
23 | .SetZ(3);
24 |
25 | HotspotRectangle
26 | .Create(this)
27 | .SetCaption(Basement_Res.arts_and_crafts_supplies)
28 | .AddRectangle(703, 149, 44, 28);
29 |
30 | Enabled = false;
31 | }
32 |
33 | public Interactions GetInteractions()
34 | {
35 | return Interactions
36 | .Create()
37 | .For(Game.Ego)
38 | .Add(Verbs.Look, LookScript())
39 | .Add(Verbs.Pick, PickScript());
40 | }
41 |
42 | private IEnumerator LookScript()
43 | {
44 | yield return Game.Ego.GoTo(this);
45 | using (Game.CutsceneBlock())
46 | {
47 | yield return Game.Ego.Say(Basement_Res.Cynthia_took_control_of_this_cabinet_compartment_for_her_arts_and_crafts_supplies_a_while_ago);
48 | yield return Game.Ego.Say(Basement_Res.Its_full_of_all_sorts_of_glitter_glues_paint_and_what_not);
49 | yield return Game.Ego.Say(Basement_Res.It_doesnt_look_like_shes_touched_any_of_it_in_a_while_though);
50 | }
51 | }
52 |
53 | private IEnumerator PickScript()
54 | {
55 | yield return Game.Ego.GoTo(this);
56 | using (Game.CutsceneBlock())
57 | {
58 | yield return Game.Ego.Say(Basement_Res.I_dont_want_to_carry_that_around_now);
59 | }
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/CabinetToolbox.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class CabinetToolbox : Entity
12 | {
13 | public CabinetToolbox()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(673, 249)
18 | .SetDirection(Directions8.Up)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | Transform
22 | .Create(this)
23 | .SetZ(3);
24 |
25 | HotspotRectangle
26 | .Create(this)
27 | .SetCaption(Basement_Res.toolbox)
28 | .AddRectangle(653, 149, 42, 29);
29 |
30 | Enabled = false;
31 | }
32 |
33 | public Interactions GetInteractions()
34 | {
35 | return Interactions
36 | .Create()
37 | .For(Game.Ego)
38 | .Add(Verbs.Look, LookScript())
39 | .Add(Verbs.Pick, PickScript());
40 | }
41 |
42 | private IEnumerator LookScript()
43 | {
44 | yield return Game.Ego.GoTo(this);
45 | using (Game.CutsceneBlock())
46 | {
47 | yield return Game.Ego.Say(Basement_Res.The_toolbox_Landon_got_me_for_fathers_day_this_year);
48 | yield return Game.Ego.Say(Basement_Res.Its_nice_although_I_havent_found_a_reason_to_saw_anything_yet);
49 | }
50 | }
51 |
52 | private IEnumerator PickScript()
53 | {
54 | yield return Game.Ego.GoTo(this);
55 | using (Game.CutsceneBlock())
56 | {
57 | yield return Game.Ego.Say(Basement_Res.I_dont_want_to_carry_that_around_now);
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Cactus.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class Cactus : Entity
13 | {
14 | public Cactus()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(813, 256)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.cactus)
25 | .AddRectangle(799, 155, 31, 78);
26 |
27 | Enabled = false;
28 | }
29 |
30 | public Interactions GetInteractions()
31 | {
32 | return Interactions
33 | .Create()
34 | .For(Game.Ego)
35 | .Add(Verbs.Look, LookScript())
36 | .Add(Verbs.Talk, TalkScript())
37 | .Add(Verbs.Use, TouchScript())
38 | .Add(Verbs.Pull, TouchScript())
39 | .Add(Verbs.Push, TouchScript());
40 | }
41 |
42 | private IEnumerator TalkScript()
43 | {
44 | yield return Game.Ego.GoTo(this);
45 | using (Game.CutsceneBlock())
46 | {
47 | yield return Game.Ego.Say(Basement_Res.Talking_to_plants_is_Cynthias_job);
48 | }
49 | }
50 |
51 | private IEnumerator LookScript()
52 | {
53 | yield return Game.Ego.GoTo(this);
54 | using (Game.CutsceneBlock())
55 | {
56 | yield return Game.Ego.Say(Basement_Res.Has_Cynthia_been_watering_this_regularly);
57 | yield return Game.Ego.Say(Basement_Res.Cacti_are_so_durable);
58 | }
59 | }
60 |
61 | private int _touchCounter = 0;
62 |
63 | private IEnumerator TouchScript()
64 | {
65 | const int counterInsanityThreshold = 3;
66 |
67 | yield return Game.Ego.GoTo(this);
68 | using (Game.CutsceneBlock())
69 | {
70 | yield return Game.Ego.Use();
71 | yield return Game.Ego.Say(Basement_Res.Ouch);
72 | _touchCounter++;
73 |
74 | if (counterInsanityThreshold == _touchCounter)
75 | {
76 | Game.Ego.Get().Add(ScoreType.Insanity, 1);
77 | }
78 | }
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Carpet.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using SessionSeven.Entities;
3 | using SessionSeven.GUI.Interaction;
4 | using STACK;
5 | using STACK.Components;
6 | using StarFinder;
7 | using System;
8 | using System.Collections;
9 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
10 |
11 | namespace SessionSeven.Basement
12 | {
13 | [Serializable]
14 | public class Carpet : Entity
15 | {
16 | public const int Z = 2;
17 | public Carpet()
18 | {
19 | Interaction
20 | .Create(this)
21 | .SetPosition(397, 275)
22 | .SetWalkToClickPosition(true)
23 | .SetDirection(Directions8.Left)
24 | .SetGetInteractionsFn(GetInteractions);
25 |
26 | HotspotMesh
27 | .Create(this)
28 | .SetCaption(Basement_Res.carpet)
29 | .SetMesh(CreateCarpetMesh());
30 |
31 | Transform
32 | .Create(this)
33 | .SetZ(Z);
34 |
35 | Enabled = false;
36 | }
37 |
38 | private Mesh CreateCarpetMesh()
39 | {
40 | var points = new PathVertex[4]
41 | {
42 | new PathVertex(155, 341),
43 | new PathVertex(373, 342),
44 | new PathVertex(382, 251),
45 | new PathVertex(216, 250)
46 | };
47 |
48 | var indices = new int[6] { 0, 1, 3, 1, 2, 3 };
49 |
50 | return new Mesh(points, indices);
51 | }
52 |
53 | public Interactions GetInteractions()
54 | {
55 | return Interactions
56 | .Create()
57 | .For(Tree.InventoryItems.Scissors)
58 | .Add(Verbs.Use, UseScissorsScript(), Game.Ego)
59 | .For(Tree.InventoryItems.Drone)
60 | .Add(Verbs.Use, UseDroneScript(), Game.Ego)
61 | .For(Game.Ego)
62 | .Add(Verbs.Look, LookScript());
63 | }
64 |
65 | private IEnumerator UseScissorsScript()
66 | {
67 | yield return Game.Ego.GoTo(this);
68 | using (Game.CutsceneBlock())
69 | {
70 | yield return Game.Ego.Say(Basement_Res.Cynthia_would_kill_me);
71 | }
72 | }
73 |
74 | private IEnumerator UseDroneScript()
75 | {
76 | yield return Game.Ego.GoTo(this);
77 | using (Game.CutsceneBlock())
78 | {
79 | yield return Game.Ego.Say(Basement_Res.No_time_to_play);
80 | }
81 | }
82 |
83 | private IEnumerator LookScript()
84 | {
85 | yield return Game.Ego.GoTo(this);
86 | using (Game.CutsceneBlock())
87 | {
88 | yield return Game.Ego.Say(Basement_Res.Cynthia_would_kill_me_if_she_could_see_the_mess_Ive_made_on_her_carpet);
89 |
90 | var currentScoreIsFreedom = ScoreType.Freedom == Game.Ego.Get().GetScoreTypeResult();
91 | var forgaveCynthia = Tree.Cutscenes.Director.FinishedSession(Cutscenes.Sessions.Three) &&
92 | Tree.Cutscenes.Director.ForgaveCynthia;
93 |
94 | if (currentScoreIsFreedom || forgaveCynthia)
95 | {
96 | yield return Game.Ego.Say(Basement_Res.I_hope_shes_okay);
97 | }
98 | }
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/CarpetWall.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using StarFinder;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class CarpetWall : Entity
13 | {
14 | public CarpetWall()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(198, 246)
19 | .SetDirection(Directions8.Left)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotMesh
23 | .Create(this)
24 | .SetCaption(Basement_Res.rugs)
25 | .SetMesh(CreateMesh());
26 |
27 | Enabled = false;
28 | }
29 |
30 | private Mesh CreateMesh()
31 | {
32 | var points = new PathVertex[9]
33 | {
34 | new PathVertex(84, 84),
35 | new PathVertex(107, 83),
36 | new PathVertex(128, 169),
37 | new PathVertex(161, 222),
38 | new PathVertex(152, 236),
39 | new PathVertex(125, 237),
40 | new PathVertex(94, 183),
41 | new PathVertex(95, 126),
42 | new PathVertex(138, 208)
43 | };
44 |
45 | var indices = new int[21]
46 | {
47 | 0, 1, 2, 2, 6, 7,
48 | 0, 2, 7, 4, 6, 8,
49 | 4, 5, 6, 2, 6, 8,
50 | 3, 4, 8
51 | };
52 |
53 | return new Mesh(points, indices);
54 | }
55 |
56 | public Interactions GetInteractions()
57 | {
58 | return Interactions
59 | .Create()
60 | .For(Game.Ego)
61 | .Add(Verbs.Look, LookScript());
62 |
63 | }
64 |
65 | private IEnumerator LookScript()
66 | {
67 | yield return Game.Ego.GoTo(this);
68 | using (Game.CutsceneBlock())
69 | {
70 | yield return Game.Ego.Say(Basement_Res.Some_of_our_failed_statement_rugs);
71 | yield return Game.Ego.Say(Basement_Res.It_took_Cynthia_almost_a_year_to_finally_be_happy_with_the_design_scheme_of_the_house);
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Crates.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class Crates : Entity
13 | {
14 | public Crates()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(908, 269)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.crates)
25 | .AddRectangle(827, 120, 147, 134);
26 |
27 | Enabled = false;
28 | }
29 |
30 | public Interactions GetInteractions()
31 | {
32 | return Interactions
33 | .Create()
34 | .For(Tree.InventoryItems.Hammer)
35 | .Add(Verbs.Use, UseHammerScript(), Game.Ego)
36 | .For(Game.Ego)
37 | .Add(Verbs.Open, OpenScript())
38 | .Add(Verbs.Look, LookScript())
39 | .Add(Verbs.Push, PushScript());
40 | }
41 |
42 | private IEnumerator UseHammerScript()
43 | {
44 | yield return Game.Ego.GoTo(this);
45 | using (Game.CutsceneBlock())
46 | {
47 | yield return Game.Ego.StartUse();
48 | yield return Game.WaitForSoundEffect(content.audio.hammer_wood);
49 | yield return Game.Ego.StopUse();
50 | }
51 | }
52 |
53 | private IEnumerator OpenScript()
54 | {
55 | yield return Game.Ego.GoTo(this);
56 | using (Game.CutsceneBlock())
57 | {
58 | yield return Game.Ego.Say(Basement_Res.They_are_empty_We_just_kept_them_if_we_need_to_move_again);
59 | }
60 | }
61 |
62 | private IEnumerator LookScript()
63 | {
64 | yield return Game.Ego.GoTo(this);
65 | using (Game.CutsceneBlock())
66 | {
67 | yield return Game.Ego.Say(Basement_Res.Man_moving_makes_a_mess);
68 | }
69 | }
70 |
71 | private IEnumerator PushScript()
72 | {
73 | yield return Game.Ego.GoTo(this);
74 | using (Game.CutsceneBlock())
75 | {
76 | yield return Game.Ego.Say(Basement_Res.I_dont_see_the_point_in_that_There_is_nothing_underneath);
77 | }
78 | }
79 | }
80 |
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Crowbar.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class Crowbar : Entity
12 | {
13 | public Crowbar()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.crowbar);
18 |
19 | HotspotRectangle
20 | .Create(this)
21 | .SetRectangle(845, 176, 23, 19)
22 | .SetCaption(Basement_Res.crowbar);
23 |
24 | Transform
25 | .Create(this)
26 | .SetPosition(845, 176)
27 | .SetZ(1);
28 |
29 | Interaction
30 | .Create(this)
31 | .SetPosition(814, 241)
32 | .SetDirection(Directions8.Right)
33 | .SetGetInteractionsFn(GetInteractions);
34 |
35 | Enabled = false;
36 | }
37 |
38 | public Interactions GetInteractions()
39 | {
40 | return Interactions
41 | .Create()
42 | .For(Game.Ego)
43 | .Add(Verbs.Look, LookScript())
44 | .Add(Verbs.Use, UseScript())
45 | .Add(Verbs.Pick, PickScript());
46 | }
47 |
48 | private IEnumerator UseScript()
49 | {
50 | yield return Game.Ego.GoTo(this);
51 | using (Game.CutsceneBlock())
52 | {
53 | yield return Game.Ego.Say(Basement_Res.I_should_take_it_first);
54 | }
55 | }
56 |
57 | private IEnumerator LookScript()
58 | {
59 | yield return Game.Ego.GoTo(this);
60 | using (Game.CutsceneBlock())
61 | {
62 | yield return Game.Ego.Say(Basement_Res.My_good_old_crowbar);
63 | }
64 | }
65 |
66 | private IEnumerator PickScript()
67 | {
68 | yield return Game.Ego.GoTo(this);
69 | using (Game.CutsceneBlock())
70 | {
71 | yield return Game.Ego.Say(Basement_Res.You_will_never_know_when_this_will_come_in_handy);
72 | yield return Game.Ego.StartUse();
73 | Game.Ego.Inventory.AddItem();
74 | Enabled = false;
75 | Visible = false;
76 | yield return Game.Ego.StopUse();
77 | }
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Crumbs.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class CrumbsLeft : Crumbs
13 | {
14 | protected override Rectangle GetHotspotRectangle() { return new Rectangle(185, 233, 32, 10); }
15 | protected override Vector2 GetInteractionPosition() { return new Vector2(198, 258); }
16 | }
17 |
18 | [Serializable]
19 | public class CrumbsRight : Crumbs
20 | {
21 | protected override Rectangle GetHotspotRectangle() { return new Rectangle(774, 225, 20, 11); }
22 | protected override Vector2 GetInteractionPosition() { return new Vector2(783, 251); }
23 | }
24 |
25 | [Serializable]
26 | public abstract class Crumbs : Entity
27 | {
28 | public Crumbs()
29 | {
30 | Interaction
31 | .Create(this)
32 | .SetPosition(GetInteractionPosition())
33 | .SetDirection(Directions8.Up)
34 | .SetGetInteractionsFn(GetInteractions);
35 |
36 | HotspotRectangle
37 | .Create(this)
38 | .SetCaption(Basement_Res.crumbs)
39 | .AddRectangle(GetHotspotRectangle());
40 |
41 | Enabled = false;
42 | }
43 |
44 | protected abstract Rectangle GetHotspotRectangle();
45 | protected abstract Vector2 GetInteractionPosition();
46 |
47 | public Interactions GetInteractions()
48 | {
49 | return Interactions
50 | .Create()
51 | .For(Game.Ego)
52 | .Add(Verbs.Look, LookScript());
53 | }
54 |
55 | private bool LookedAt { get; set; }
56 |
57 | private IEnumerator LookScript()
58 | {
59 | yield return Game.Ego.GoTo(this);
60 | using (Game.CutsceneBlock())
61 | {
62 | if (!LookedAt)
63 | {
64 | yield return Game.Ego.Say(Basement_Res.Since_when_has_Cynthia_allowed_crumbs_into_her_house);
65 | LookedAt = true;
66 | }
67 |
68 | yield return Game.Ego.Say(Basement_Res.Looks_like_plastic_and_paper);
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Desk.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class Desk : Entity
12 | {
13 | public Desk()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.desk);
18 |
19 | HotspotSprite
20 | .Create(this)
21 | .SetCaption(Basement_Res.desk)
22 | .SetPixelPerfect(true);
23 |
24 | Transform
25 | .Create(this)
26 | .SetZ(262);
27 |
28 | Interaction
29 | .Create(this)
30 | .SetPosition(127, 276)
31 | .SetDirection(Directions8.Left)
32 | .SetGetInteractionsFn(GetInteractions);
33 |
34 | Enabled = false;
35 | }
36 |
37 | public Interactions GetInteractions()
38 | {
39 | return Interactions
40 | .Create()
41 | .For(Game.Ego)
42 | .Add(Verbs.Look, LookScript());
43 | }
44 |
45 | private IEnumerator LookScript()
46 | {
47 | yield return Game.Ego.GoTo(this);
48 | using (Game.CutsceneBlock())
49 | {
50 | yield return Game.Ego.Say(Basement_Res.Its_Cynthias_work_desk);
51 | }
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/DrillingMachineCable.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Components;
2 | using SessionSeven.Entities;
3 | using SessionSeven.GUI.Interaction;
4 | using STACK;
5 | using STACK.Components;
6 | using System;
7 | using System.Collections;
8 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
9 |
10 | namespace SessionSeven.Basement
11 | {
12 | [Serializable]
13 | public class DrillingMachineCable : Entity
14 | {
15 | public DrillingMachineCable()
16 | {
17 | Interaction
18 | .Create(this)
19 | .SetPosition(408, 261)
20 | .SetDirection(Directions8.Up)
21 | .SetGetInteractionsFn(GetInteractions);
22 |
23 | HotspotRectangle
24 | .Create(this)
25 | .SetCaption(Basement_Res.cable)
26 | .AddRectangle(387, 224, 28, 13);
27 |
28 | Transform
29 | .Create(this)
30 | .SetPosition(234, 203)
31 | .SetZ(-1.5f);
32 |
33 | Sprite
34 | .Create(this)
35 | .SetImage(content.rooms.basement.cable)
36 | .SetVisible(false);
37 |
38 | Combinable
39 | .Create(this);
40 |
41 | Enabled = false;
42 | }
43 |
44 | public bool PluggedIn
45 | {
46 | get => Get().Visible;
47 | set
48 | {
49 | Interactive = !value;
50 | Get().Visible = value;
51 | Tree.Basement.DrillingMachineCableTop.Get().Visible = value;
52 | Enabled = !value;
53 | }
54 | }
55 |
56 | public Interactions GetInteractions()
57 | {
58 | return Interactions
59 | .Create()
60 | .For(Game.Ego)
61 | .Add(Verbs.Look, LookScript());
62 |
63 | }
64 |
65 | private IEnumerator LookScript()
66 | {
67 | yield return Game.Ego.GoTo(this);
68 | using (Game.CutsceneBlock())
69 | {
70 | yield return Game.Ego.Say(Basement_Res.My_drilling_machines_cable);
71 | }
72 | }
73 | }
74 |
75 | [Serializable]
76 | public class DrillingMachineCableTop : Entity
77 | {
78 | public DrillingMachineCableTop()
79 | {
80 | Transform
81 | .Create(this)
82 | .SetPosition(234, 203)
83 | .SetZ(1f);
84 |
85 | Sprite
86 | .Create(this)
87 | .SetImage(content.rooms.basement.cabletop)
88 | .SetVisible(false);
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/DrillingMachineUsed.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.Basement
7 | {
8 | [Serializable]
9 | public class DrillingMachineUsed : Entity
10 | {
11 | public DrillingMachineUsed()
12 | {
13 | Transform
14 | .Create(this)
15 | .SetPosition(364, 154)
16 | .SetZ(1f);
17 |
18 | Sprite
19 | .Create(this)
20 | .SetImage(content.rooms.basement.drillused)
21 | .SetVisible(false);
22 | }
23 |
24 | public void Show()
25 | {
26 | Get().Visible = true;
27 | Tree.Basement.DrillingMachine.Visible = false;
28 | }
29 |
30 | public void Hide()
31 | {
32 | Get().Visible = false;
33 | Tree.Basement.DrillingMachine.Visible = true;
34 | }
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/DronePackage.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class DronePackage : Entity
13 | {
14 | public DronePackage()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(703, 247)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | Transform
23 | .Create(this)
24 | .SetZ(3);
25 |
26 | HotspotRectangle
27 | .Create(this)
28 | .SetCaption(Basement_Res.drone_package)
29 | .AddRectangle(709, 190, 36, 22);
30 |
31 | Enabled = false;
32 | }
33 |
34 | public Interactions GetInteractions()
35 | {
36 | return Interactions
37 | .Create()
38 | .For(Game.Ego)
39 | .Add(Verbs.Look, LookScript())
40 | .Add(Verbs.Pick, PickScript())
41 | .Add(Verbs.Open, OpenScript());
42 | }
43 |
44 | private IEnumerator OpenScript()
45 | {
46 | yield return Game.Ego.GoTo(this);
47 | using (Game.CutsceneBlock())
48 | {
49 | yield return Game.Ego.Say(Basement_Res.I_should_take_it_out_of_the_cabinet_first);
50 | }
51 | }
52 |
53 | private IEnumerator LookScript()
54 | {
55 | yield return Game.Ego.GoTo(this);
56 | yield return Game.Ego.StartScript(InventoryItems.DronePackage.LookScript());
57 | }
58 |
59 | private IEnumerator PickScript()
60 | {
61 | yield return Game.Ego.GoTo(this);
62 | using (Game.CutsceneBlock())
63 | {
64 | yield return Game.Ego.StartUse();
65 | Game.Ego.Inventory.AddItem();
66 | Enabled = false;
67 | Tree.Basement.CabinetRightDoor.TakeDrone();
68 | yield return Game.Ego.StopUse();
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Folders.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class Folders : Entity
12 | {
13 | public Folders()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(205, 242)
18 | .SetDirection(Directions8.Up)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | HotspotRectangle
22 | .Create(this)
23 | .SetCaption(Basement_Res.folders)
24 | .AddRectangle(189, 148, 63, 45);
25 |
26 | Enabled = false;
27 | }
28 |
29 | public Interactions GetInteractions()
30 | {
31 | return Interactions
32 | .Create()
33 | .For(Game.Ego)
34 | .Add(Verbs.Look, LookScript());
35 | }
36 |
37 | private IEnumerator LookScript()
38 | {
39 | yield return Game.Ego.GoTo(this);
40 | using (Game.CutsceneBlock())
41 | {
42 | yield return Game.Ego.Say(Basement_Res.There_are_all_sorts_of_different_colored_folders_full_of_documents_for_the_new_house_old_tax_files_and_various_papers_for_Landon);
43 | yield return Game.Ego.Say(Basement_Res.I_didnt_realize_how_much_Cynthia_was_handling_on_her_own_while_I_was_away_at_work);
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Foreground.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Basement
6 | {
7 | ///
8 | /// Boxes in the foreground
9 | ///
10 | [Serializable]
11 | public class Foreground : Entity
12 | {
13 | public Foreground()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.foreground);
18 |
19 | Transform
20 | .Create(this)
21 | .SetZ(400);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Guitar.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class Guitar : Entity
13 | {
14 | public Guitar()
15 | {
16 | Sprite
17 | .Create(this)
18 | .SetImage(content.rooms.basement.guitar)
19 | .SetVisible(false);
20 |
21 | Transform
22 | .Create(this)
23 | .SetPosition(128, 129)
24 | .SetZ(GuitarCase.Z + 1);
25 |
26 | Interaction
27 | .Create(this)
28 | .SetPosition(163, 243)
29 | .SetDirection(Directions8.Up)
30 | .SetGetInteractionsFn(GetInteractions);
31 |
32 | HotspotSprite
33 | .Create(this)
34 | .SetPixelPerfect(true)
35 | .SetCaption(Basement_Res.guitar);
36 |
37 | Visible = false;
38 | }
39 |
40 | public Interactions GetInteractions()
41 | {
42 | return Interactions
43 | .Create()
44 | .For(Tree.InventoryItems.GuitarStrings)
45 | .Add(Verbs.Use, UseStringsScript(), Game.Ego)
46 | .For(Game.Ego)
47 | .Add(Verbs.Use, UseScript())
48 | .Add(Verbs.Pick, PickScript())
49 | .Add(Verbs.Look, LookScript());
50 | }
51 |
52 | private IEnumerator UseStringsScript()
53 | {
54 | yield return Game.Ego.GoTo(this);
55 | using (Game.CutsceneBlock())
56 | {
57 | yield return Game.Ego.Say(Basement_Res.The_strings_on_the_guitar_are_still_in_pristine_condition);
58 | }
59 | }
60 |
61 | private IEnumerator PickScript()
62 | {
63 | yield return Game.Ego.GoTo(this);
64 | using (Game.CutsceneBlock())
65 | {
66 | yield return Game.Ego.Say(Basement_Res.I_dont_want_to_carry_that_around_now);
67 | }
68 | }
69 |
70 | private int _trackNumber = 1;
71 |
72 | private IEnumerator UseScript()
73 | {
74 | yield return Game.Ego.GoTo(this);
75 | using (Game.CutsceneBlock())
76 | {
77 | yield return Game.Ego.StartUse();
78 | World.Get().MusicVolume = 0.05f;
79 | yield return Game.WaitForSoundEffect(content.audio._path_ + "guitar_play" + _trackNumber);
80 | World.Get().MusicVolume = 1f;
81 | yield return Game.Ego.StopUse();
82 |
83 | _trackNumber++;
84 | if (_trackNumber > 3)
85 | {
86 | _trackNumber = 1;
87 | }
88 | }
89 | }
90 |
91 | private IEnumerator LookScript()
92 | {
93 | yield return Game.Ego.GoTo(this);
94 | using (Game.CutsceneBlock())
95 | {
96 | yield return Game.Ego.Say(Basement_Res.Its_my_old_guitar_I_used_to_play_every_night_as_Landon_was_going_to_bed);
97 | yield return Game.Ego.Say(Basement_Res.I_didnt_know_it_was_down_here_now);
98 | }
99 | }
100 | }
101 |
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/GuitarStrings.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using SessionSeven.InventoryItems;
4 | using STACK;
5 | using STACK.Components;
6 | using System;
7 | using System.Collections;
8 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
9 |
10 | namespace SessionSeven.Basement
11 | {
12 | [Serializable]
13 | public class GuitarStrings : Entity
14 | {
15 | public GuitarStrings()
16 | {
17 | Sprite
18 | .Create(this)
19 | .SetImage(content.rooms.basement.guitarstringsfloor);
20 |
21 | Transform
22 | .Create(this)
23 | .SetPosition(162, 229);
24 |
25 | Interaction
26 | .Create(this)
27 | .SetPosition(166, 256)
28 | .SetDirection(Directions8.Up)
29 | .SetGetInteractionsFn(GetInteractions);
30 |
31 | HotspotSprite
32 | .Create(this)
33 | .SetPixelPerfect(false)
34 | .SetCaption(Basement_Res.guitar_strings);
35 |
36 | Visible = false;
37 | }
38 |
39 | public Interactions GetInteractions()
40 | {
41 | return Interactions
42 | .Create()
43 | .For(Game.Ego)
44 | .Add(Verbs.Pick, PickScript())
45 | .Add(Verbs.Look, LookScript());
46 | }
47 |
48 | private IEnumerator PickScript()
49 | {
50 | yield return Game.Ego.GoTo(this);
51 | using (Game.CutsceneBlock())
52 | {
53 | var startSession = Game.Ego.Inventory.HasItem()
54 | && Tree.InventoryItems.DrugPrescriptionRyan.LookedAt;
55 |
56 | if (!startSession)
57 | {
58 | Game.PlaySoundEffect(content.audio.puzzle);
59 | }
60 |
61 | yield return Game.Ego.StartUse();
62 | Game.Ego.Inventory.AddItem();
63 | Visible = false;
64 | Enabled = false;
65 | yield return Game.Ego.StopUse();
66 |
67 | if (startSession)
68 | {
69 | yield return Tree.Cutscenes.Director.StartSession(Cutscenes.Sessions.Four);
70 | }
71 | }
72 | }
73 |
74 | private IEnumerator LookScript()
75 | {
76 | yield return Game.Ego.GoTo(this);
77 | using (Game.CutsceneBlock())
78 | {
79 | yield return Game.Ego.Say(Basement_Res.A_guitar_string_package_that_dropped_out_when_I_opened_the_guitar_case);
80 | }
81 | }
82 | }
83 |
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Hammer.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class Hammer : Entity
12 | {
13 | public Hammer()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.hammer);
18 |
19 | HotspotSprite
20 | .Create(this)
21 | .SetCaption(Basement_Res.hammer)
22 | .SetPixelPerfect(false);
23 |
24 | Transform
25 | .Create(this)
26 | .SetPosition(470, 99)
27 | .SetZ(ToolBar.Z + 1);
28 |
29 | Interaction
30 | .Create(this)
31 | .SetPosition(517, 264)
32 | .SetDirection(Directions8.Up)
33 | .SetGetInteractionsFn(GetInteractions);
34 |
35 | Enabled = false;
36 | }
37 |
38 | public Interactions GetInteractions()
39 | {
40 | return Interactions
41 | .Create()
42 | .For(Game.Ego)
43 | .Add(Verbs.Look, LookScript())
44 | .Add(Verbs.Pick, PickScript());
45 | }
46 |
47 | private IEnumerator LookScript()
48 | {
49 | yield return Game.Ego.GoTo(this);
50 | using (Game.CutsceneBlock())
51 | {
52 | yield return Game.Ego.Say(Basement_Res.A_hammer_is_hanging_on_the_tool_bar);
53 | }
54 | }
55 |
56 | private IEnumerator PickScript()
57 | {
58 | yield return Game.Ego.GoTo(this);
59 |
60 | using (Game.CutsceneBlock())
61 | {
62 | yield return Game.Ego.StartUse();
63 | Game.Ego.Inventory.AddItem();
64 | Enabled = false;
65 | Visible = false;
66 | yield return Game.Ego.StopUse();
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Hazelnuts.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class Hazelnuts : Entity
12 | {
13 | public Hazelnuts()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.hazelnuts);
18 |
19 | HotspotSprite
20 | .Create(this)
21 | .SetCaption(Basement_Res.hazelnuts)
22 | .SetPixelPerfect(true);
23 |
24 | Transform
25 | .Create(this)
26 | .SetPosition(31, 201)
27 | .SetZ(263);
28 |
29 | Interaction
30 | .Create(this)
31 | .SetPosition(127, 276)
32 | .SetDirection(Directions8.Left)
33 | .SetGetInteractionsFn(GetInteractions);
34 |
35 | Enabled = false;
36 | }
37 |
38 | public Interactions GetInteractions()
39 | {
40 | return Interactions
41 | .Create()
42 | .For(Game.Ego)
43 | .Add(Verbs.Look, LookScript())
44 | .Add(Verbs.Open, OpenScript())
45 | .Add(Verbs.Pick, PickScript());
46 | }
47 |
48 | private IEnumerator OpenScript()
49 | {
50 | yield return Game.Ego.GoTo(this);
51 | using (Game.CutsceneBlock())
52 | {
53 | yield return Game.Ego.Say(Basement_Res.Better_take_them_first);
54 | }
55 | }
56 |
57 | private IEnumerator LookScript()
58 | {
59 | yield return Game.Ego.GoTo(this);
60 | yield return Game.Ego.StartScript(InventoryItems.Hazelnuts.LookScript());
61 | }
62 |
63 | private IEnumerator PickScript()
64 | {
65 | yield return Game.Ego.GoTo(this);
66 | using (Game.CutsceneBlock())
67 | {
68 | yield return Game.Ego.Say(Basement_Res.Who_knows_how_long_Im_locked_in_here);
69 | yield return Game.Ego.StartUse();
70 | Game.Ego.Inventory.AddItem();
71 | Enabled = false;
72 | Visible = false;
73 | yield return Game.Ego.StopUse();
74 | }
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/HazelnutsOnFloor.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class HazelnutsOnFloor : Entity
12 | {
13 | public HazelnutsOnFloor()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(178, 254)
18 | .SetDirection(Directions8.Left)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | HotspotRectangle
22 | .Create(this)
23 | .SetCaption(Basement_Res.empty_bag_of_hazelnuts)
24 | .AddRectangle(139, 242, 27, 13);
25 |
26 | Enabled = false;
27 | }
28 |
29 | public Interactions GetInteractions()
30 | {
31 | return Interactions
32 | .Create()
33 | .For(Game.Ego)
34 | .Add(Verbs.Pick, PickScript())
35 | .Add(Verbs.Look, LookScript());
36 | }
37 |
38 | private IEnumerator PickScript()
39 | {
40 | yield return Game.Ego.GoTo(this);
41 | using (Game.CutsceneBlock())
42 | {
43 | yield return Game.Ego.Say(Basement_Res.I_dont_want_to_carry_that_empty_bag_around);
44 | }
45 | }
46 |
47 | private IEnumerator LookScript()
48 | {
49 | yield return Game.Ego.GoTo(this);
50 | using (Game.CutsceneBlock())
51 | {
52 | yield return Game.Ego.Say(Basement_Res.An_empty_bag_of_hazelnuts_is_lying_on_the_floor);
53 | yield return Game.Ego.Say(Basement_Res.Looks_like_an_animal_was_chewing_on_it);
54 | }
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/LightSwitch.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class LightSwitch : Entity
13 | {
14 | public LightSwitch()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(289, 242)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.light_switch)
25 | .AddRectangle(290, 136, 11, 10);
26 |
27 | Enabled = false;
28 | }
29 |
30 | public Interactions GetInteractions()
31 | {
32 | return Interactions
33 | .Create()
34 | .For(Game.Ego)
35 | .Add(Verbs.Push, UseScript())
36 | .Add(Verbs.Use, UseScript())
37 | .Add(Verbs.Look, LookScript());
38 | }
39 |
40 | private IEnumerator UseScript()
41 | {
42 | yield return Game.Ego.GoTo(this);
43 | using (Game.CutsceneBlock())
44 | {
45 | yield return Game.Ego.StartUse();
46 | Tree.Basement.Lights.Toggle();
47 | yield return Game.Ego.StopUse();
48 | }
49 | }
50 |
51 | private IEnumerator LookScript()
52 | {
53 | yield return Game.Ego.GoTo(this);
54 | using (Game.CutsceneBlock())
55 | {
56 | yield return Game.Ego.Say(Basement_Res.It_is_a_light_switch);
57 | }
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Lights.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Basement
6 | {
7 | [Serializable]
8 | public class Lights : Entity
9 | {
10 | public Lights()
11 | {
12 | Sprite
13 | .Create(this)
14 | .SetImage(content.rooms.basement.lightsoff);
15 |
16 | DrawOrder = 1;
17 |
18 | Visible = false;
19 | }
20 |
21 | public void SwitchOn()
22 | {
23 | Game.PlaySoundEffect(content.audio.light_on);
24 | Visible = false;
25 | }
26 |
27 | public void SwitchOff()
28 | {
29 | Game.PlaySoundEffect(content.audio.light_off);
30 | Visible = true;
31 | }
32 |
33 | public void Toggle()
34 | {
35 | if (!Visible)
36 | {
37 | SwitchOff();
38 | }
39 | else
40 | {
41 | SwitchOn();
42 | }
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/MedicalCabinetBloodStain.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Basement
6 | {
7 | [Serializable]
8 | public class MedicalCabinetBloodStain : Entity
9 | {
10 | public MedicalCabinetBloodStain()
11 | {
12 | Sprite
13 | .Create(this)
14 | .SetImage(content.rooms.basement.medicalcabinet_blood_stain)
15 | .SetVisible(false);
16 |
17 | Transform
18 | .Create(this)
19 | .SetZ(1)
20 | .SetPosition(772, 105);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/MissingTool.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class MissingTool : Entity
13 | {
14 | public MissingTool()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(517, 264)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.missing_tool)
25 | .AddRectangle(479, 95, 12, 45);
26 |
27 | Transform
28 | .Create(this)
29 | .SetZ(ToolBar.Z + 1);
30 |
31 | Enabled = false;
32 | }
33 |
34 | public Interactions GetInteractions()
35 | {
36 | return Interactions
37 | .Create()
38 | .For(Game.Ego)
39 | .Add(Verbs.Push, MissingCommentScript())
40 | .Add(Verbs.Pull, MissingCommentScript())
41 | .Add(Verbs.Pick, MissingCommentScript())
42 | .Add(Verbs.Talk, TalkScript())
43 | .Add(Verbs.Look, LookScript());
44 |
45 | }
46 |
47 | private IEnumerator LookScript()
48 | {
49 | yield return Game.Ego.GoTo(this);
50 | using (Game.CutsceneBlock())
51 | {
52 | if (Tree.Cutscenes.Director.FinishedSession(Cutscenes.Sessions.Six))
53 | {
54 | yield return Game.Ego.Say(Basement_Res.A_wrench_is_missing);
55 | }
56 | else
57 | {
58 | yield return Game.Ego.Say(Basement_Res.A_tool_in_my_collection_is_missing_I_wonder_which_it_might_be);
59 | }
60 | }
61 | }
62 |
63 | private IEnumerator MissingCommentScript()
64 | {
65 | yield return Game.Ego.GoTo(this);
66 | using (Game.CutsceneBlock())
67 | {
68 | yield return Game.Ego.Say(Basement_Res.The_tool_is_missing);
69 | }
70 | }
71 |
72 | private IEnumerator TalkScript()
73 | {
74 | yield return Game.Ego.GoTo(this);
75 | using (Game.CutsceneBlock())
76 | {
77 | yield return Game.Ego.Say(Basement_Res.Here_I_find_myself_in_the_basement_trying_to_talk_to_nonexistent_objects);
78 | yield return Game.Ego.Say(Basement_Res.How_could_this_happen);
79 | }
80 | }
81 | }
82 |
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ModemLight.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Basement
6 | {
7 | [Serializable]
8 | public class ModemLight : Entity
9 | {
10 | public ModemLight()
11 | {
12 | Sprite
13 | .Create(this)
14 | .SetImage(content.rooms.basement.modemlight, 2);
15 |
16 | Transform
17 | .Create(this)
18 | .SetZ(3)
19 | .SetPosition(241, 214);
20 |
21 | }
22 |
23 | private byte _counter = 0;
24 | private const int _toggleDelay = 23;
25 |
26 | public override void OnUpdate()
27 | {
28 | _counter++;
29 |
30 | if (_counter > _toggleDelay)
31 | {
32 | _counter = 0;
33 | ToggleLight();
34 | }
35 |
36 | base.OnUpdate();
37 | }
38 |
39 | private void ToggleLight()
40 | {
41 | Get().CurrentFrame = Get().CurrentFrame == 1 ? 2 : 1;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Portrait.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class LandonPortrait : Entity
12 | {
13 | public LandonPortrait()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.image);
18 |
19 | HotspotSprite
20 | .Create(this)
21 | .SetCaption(Basement_Res.portrait)
22 | .SetPixelPerfect(true);
23 |
24 | Transform
25 | .Create(this)
26 | .SetPosition(49, 177)
27 | .SetZ(263);
28 |
29 | Interaction
30 | .Create(this)
31 | .SetPosition(145, 281)
32 | .SetDirection(Directions8.Left)
33 | .SetGetInteractionsFn(GetInteractions);
34 |
35 | Enabled = false;
36 | }
37 |
38 | public Interactions GetInteractions()
39 | {
40 | return Interactions
41 | .Create()
42 | .For(Game.Ego)
43 | .Add(Verbs.Look, LookScript())
44 | .Add(Verbs.Pick, PickScript());
45 | }
46 |
47 | private bool _lookedAt = false;
48 |
49 | private IEnumerator LookScript(bool reset = true)
50 | {
51 | yield return Game.Ego.GoTo(this);
52 | using (Game.CutsceneBlock(true, reset))
53 | {
54 | yield return Game.Ego.Say(Basement_Res.Weird_is_this_one_of_Landons_school_pictures_Whats_it_doing_down_here);
55 | _lookedAt = true;
56 | }
57 | }
58 |
59 | private IEnumerator PickScript()
60 | {
61 | yield return Game.Ego.GoTo(this);
62 |
63 | if (!_lookedAt)
64 | {
65 | yield return Game.Ego.StartScript(LookScript(false));
66 | }
67 |
68 | using (Game.CutsceneBlock())
69 | {
70 | yield return Game.Ego.Say(Basement_Res.Might_as_well_keep_it_with_me_Maybe_its_good_luck);
71 | yield return Game.Ego.StartUse();
72 | Game.Ego.Inventory.AddItem();
73 | Enabled = false;
74 | Visible = false;
75 | yield return Game.Ego.StopUse();
76 | }
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/RFIDAntennaShelf.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using SessionSeven.InventoryItems;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class RFIDAntennaShelf : Entity
13 | {
14 | public RFIDAntennaShelf()
15 | {
16 | Sprite
17 | .Create(this)
18 | .SetImage(content.rooms.basement.rfidantennashelf);
19 |
20 | HotspotSprite
21 | .Create(this)
22 | .SetCaption(Basement_Res.cardboard)
23 | .SetPixelPerfect(false);
24 |
25 | Transform
26 | .Create(this)
27 | .SetPosition(1038, 114)
28 | .SetZ(Shelf.Z + 2);
29 |
30 | Interaction
31 | .Create(this)
32 | .SetPosition(1015, 281)
33 | .SetDirection(Directions8.Right)
34 | .SetGetInteractionsFn(GetInteractions);
35 |
36 | Enabled = false;
37 | }
38 |
39 | public Interactions GetInteractions()
40 | {
41 | return Interactions
42 | .Create()
43 | .For(Game.Ego)
44 | .Add(Verbs.Open, OpenScript())
45 | .Add(Verbs.Look, LookScript())
46 | .Add(Verbs.Pick, PickScript());
47 | }
48 |
49 | private bool _lookedAt = false;
50 |
51 | private IEnumerator LookScript(bool reset = true)
52 | {
53 | yield return Game.Ego.GoTo(this);
54 | using (Game.CutsceneBlock(reset))
55 | {
56 | yield return Game.Ego.Say(Basement_Res.A_cardboard_without_any_inscription);
57 | yield return Game.Ego.Say(Basement_Res.I_wonder_who_put_it_here_and_what_is_inside);
58 | _lookedAt = true;
59 | }
60 | }
61 |
62 | private IEnumerator OpenScript()
63 | {
64 | yield return Game.Ego.GoTo(this);
65 | using (Game.CutsceneBlock())
66 | {
67 | yield return Game.Ego.Say(Basement_Res.I_should_take_it_first);
68 | }
69 | }
70 |
71 | private IEnumerator PickScript()
72 | {
73 | yield return Game.Ego.GoTo(this);
74 |
75 | using (Game.CutsceneBlock())
76 | {
77 | if (!_lookedAt)
78 | {
79 | yield return Game.Ego.StartScript(LookScript(false));
80 | }
81 | yield return Game.Ego.StartUse();
82 | Game.Ego.Inventory.AddItem();
83 | Visible = false;
84 | Enabled = false;
85 | yield return Game.Ego.StopUse();
86 | }
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Receipt.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 | using System.Collections;
5 |
6 | namespace SessionSeven.Basement
7 | {
8 | [Serializable]
9 | public class Receipt : Entity
10 | {
11 | public Receipt()
12 | {
13 | Sprite
14 | .Create(this)
15 | .SetImage(content.rooms.basement.receipt_anim, 11);
16 |
17 | Transform
18 | .Create(this)
19 | .SetPosition(673, 130)
20 | .SetZ(3);
21 |
22 | Enabled = false;
23 | Visible = false;
24 | }
25 |
26 | public IEnumerator FallDownScript()
27 | {
28 | const int delay = 6;
29 |
30 | for (var i = 0; i < Get().Columns; i++)
31 | {
32 | yield return Delay.Updates(delay);
33 | Get().CurrentFrame = i + 1;
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/RyanLying.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework.Audio;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.Basement
7 | {
8 |
9 | [Serializable]
10 | public enum RyanLyingState
11 | {
12 | EyesClosed,
13 | EyesOpen,
14 | SittingEyesOpen,
15 | SittingEyesClosed
16 | }
17 |
18 | [Serializable]
19 | public class RyanLying : Entity
20 | {
21 | public RyanLying()
22 | {
23 | Sprite
24 | .Create(this)
25 | .SetImage(content.rooms.basement.ryanlying, 8);
26 |
27 | Transform
28 | .Create(this)
29 | .SetPosition(259, 178)
30 | .SetScale(1.25f)
31 | .SetZ(263);
32 |
33 | Scripts
34 | .Create(this);
35 |
36 | SpriteTransformAnimation
37 | .Create(this)
38 | .SetSetFrameFn(SetFrame);
39 |
40 | State = RyanLyingState.EyesClosed;
41 | }
42 |
43 | public RyanLyingState State { get; set; }
44 |
45 | public SoundEffectInstance PlayWhiningSound()
46 | {
47 | return Game.PlaySoundEffect(content.audio.whining);
48 | }
49 |
50 | private readonly Frames _framesEyesClosed = Frames.Create(1, 2);
51 | private readonly Frames _framesEyesOpen = Frames.Create(3, 4);
52 | private readonly Frames _framesSittingEyesOpen = Frames.Create(5);
53 | private readonly Frames _framesTalking = Frames.Create(5, 6, 7);
54 | private readonly Frames _sittingEyesClosed = Frames.Create(8);
55 |
56 | private Frames GetAnimationFrames(RyanLyingState lyingState, State state)
57 | {
58 | if (state.Has(STACK.Components.State.Talking))
59 | {
60 | return _framesTalking;
61 | }
62 |
63 | switch (lyingState)
64 | {
65 | case RyanLyingState.EyesClosed:
66 | return _framesEyesClosed;
67 | case RyanLyingState.EyesOpen:
68 | return _framesEyesOpen;
69 | case RyanLyingState.SittingEyesOpen:
70 | return _framesSittingEyesOpen;
71 | case RyanLyingState.SittingEyesClosed:
72 | return _sittingEyesClosed;
73 | }
74 |
75 | return _framesEyesClosed;
76 | }
77 |
78 | private int GetAnimationDelay(State state)
79 | {
80 | if (state.Has(STACK.Components.State.Talking))
81 | {
82 | return 8;
83 | }
84 |
85 | return 37;
86 | }
87 |
88 | private int SetFrame(Transform transform, int step, int lastFrame)
89 | {
90 | var delay = GetAnimationDelay(transform.State);
91 | var scaledStep = step / delay;
92 | var frames = GetAnimationFrames(State, transform.State);
93 |
94 | return frames[scaledStep % frames.Count];
95 | }
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Scene.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Basement
6 | {
7 |
8 | [Serializable]
9 | public class Scene : Location
10 | {
11 | public Scene() : base(content.rooms.basement.scene)
12 | {
13 | this.AutoAddEntities();
14 |
15 | ScenePath
16 | .Create(this)
17 | .SetPathFile(content.rooms.basement.path);
18 |
19 | DrawOrder = 20;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/SceneTransparentFloor.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Basement
6 | {
7 | ///
8 | ///
9 | ///
10 | [Serializable]
11 | public class SceneTransparentFloor : Entity
12 | {
13 | public SceneTransparentFloor()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.scene_transparent_floor);
18 |
19 | Transform
20 | .Create(this)
21 | .SetZ(0.5f);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Screwdriver.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class Screwdriver : Entity
12 | {
13 | public Screwdriver()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.basement.screwdriver);
18 |
19 | HotspotSprite
20 | .Create(this)
21 | .SetCaption(Basement_Res.screwdriver)
22 | .SetPixelPerfect(false);
23 |
24 | Transform
25 | .Create(this)
26 | .SetPosition(505, 101)
27 | .SetZ(ToolBar.Z + 1);
28 |
29 | Interaction
30 | .Create(this)
31 | .SetPosition(517, 264)
32 | .SetDirection(Directions8.Up)
33 | .SetGetInteractionsFn(GetInteractions);
34 |
35 | Enabled = false;
36 | }
37 |
38 | public Interactions GetInteractions()
39 | {
40 | return Interactions
41 | .Create()
42 | .For(Game.Ego)
43 | .Add(Verbs.Look, LookScript())
44 | .Add(Verbs.Pick, PickScript());
45 | }
46 |
47 | private IEnumerator LookScript()
48 | {
49 | yield return Game.Ego.GoTo(this);
50 | using (Game.CutsceneBlock())
51 | {
52 | yield return Game.Ego.Say(Basement_Res.A_quality_screwdriver_that_does_not_break_on_the_first_screw);
53 | }
54 | }
55 |
56 | private IEnumerator PickScript()
57 | {
58 | yield return Game.Ego.GoTo(this);
59 |
60 | using (Game.CutsceneBlock())
61 | {
62 | yield return Game.Ego.StartUse();
63 | Game.Ego.Inventory.AddItem();
64 | Enabled = false;
65 | Visible = false;
66 | yield return Game.Ego.StopUse();
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Shelf.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class Shelf : Entity
13 | {
14 | public const float Z = 1;
15 |
16 | public Shelf()
17 | {
18 | Interaction
19 | .Create(this)
20 | .SetPosition(1020, 295)
21 | .SetDirection(Directions8.Right)
22 | .SetGetInteractionsFn(GetInteractions);
23 |
24 | HotspotRectangle
25 | .Create(this)
26 | .SetCaption(Basement_Res.shelf)
27 | .AddRectangle(1028, 107, 81, 167);
28 |
29 | Transform
30 | .Create(this)
31 | .SetZ(Z);
32 |
33 | Enabled = false;
34 | }
35 |
36 | public Interactions GetInteractions()
37 | {
38 | return Interactions
39 | .Create()
40 | .For(Game.Ego)
41 | .Add(Verbs.Look, LookScript())
42 | .Add(Verbs.Pick, PickScript());
43 | }
44 |
45 | private bool _firstLook = true;
46 |
47 | private IEnumerator LookScript()
48 | {
49 | yield return Game.Ego.GoTo(this);
50 | using (Game.CutsceneBlock())
51 | {
52 | yield return Game.Ego.Say(Basement_Res.This_bookcase_is_mostly_made_up_of_my_and_Cynthias_old_college_textbooks);
53 | if (_firstLook)
54 | {
55 | Tree.Basement.ShelfBox.Enabled = true;
56 | Tree.Basement.ShelfEngineeringBooks.Enabled = true;
57 | Tree.Basement.ShelfRFIDBook.Enabled = true;
58 | Tree.Basement.ShelfBlanketFlashlight.Enabled = true;
59 | Tree.Basement.RFIDAntennaShelf.Enabled = true;
60 | Tree.Basement.ShelfComicBox.Enabled = true;
61 | _firstLook = false;
62 | }
63 | }
64 | }
65 |
66 | private IEnumerator PickScript()
67 | {
68 | yield return Game.Ego.GoTo(this);
69 | using (Game.CutsceneBlock())
70 | {
71 | yield return Game.Ego.Say(Basement_Res.This_is_to_big_to_carry_around);
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ShelfBlanketFlashlight.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class ShelfBlanketFlashlight : Entity
13 | {
14 | private const int _blanketFrame = 1;
15 | private const int _flashlightFrame = 2;
16 |
17 | public ShelfBlanketFlashlight()
18 | {
19 | Interaction
20 | .Create(this)
21 | .SetPosition(1020, 295)
22 | .SetDirection(Directions8.Right)
23 | .SetGetInteractionsFn(GetInteractions);
24 |
25 | Sprite
26 | .Create(this)
27 | .SetImage(content.rooms.basement.blanketflashlight, 2)
28 | .SetFrame(_blanketFrame);
29 |
30 | HotspotSprite
31 | .Create(this)
32 | .SetCaption(Basement_Res.blanket)
33 | .SetPixelPerfect(false);
34 |
35 | Transform
36 | .Create(this)
37 | .SetPosition(1070, 246)
38 | .SetZ(Shelf.Z + 2);
39 |
40 | Enabled = false;
41 | }
42 |
43 | private Interactions GetInteractions()
44 | {
45 | return Interactions
46 | .Create()
47 | .For(Game.Ego)
48 | .Add(Verbs.Look, LookScript())
49 | .Add(Verbs.Pick, PickScript());
50 | }
51 |
52 | public bool LookedAt { get; private set; }
53 |
54 | private IEnumerator LookScript()
55 | {
56 | yield return Game.Ego.GoTo(this);
57 | using (Game.CutsceneBlock())
58 | {
59 | if (_blanketFrame == Get().CurrentFrame)
60 | {
61 | yield return Game.Ego.Say(Basement_Res.Looks_like_our_old_picnic_blanket);
62 | }
63 | else if (_flashlightFrame == Get().CurrentFrame)
64 | {
65 | yield return Game.Ego.Say(Basement_Res.Below_the_blanket_was_a_flashlight);
66 | }
67 | }
68 | }
69 |
70 | private IEnumerator PickScript()
71 | {
72 | yield return Game.Ego.GoTo(this);
73 | using (Game.CutsceneBlock())
74 | {
75 | yield return Game.Ego.StartUse();
76 |
77 | if (_blanketFrame == Get().CurrentFrame)
78 | {
79 | Get().CurrentFrame = _flashlightFrame;
80 | Get().SetCaption(Basement_Res.flashlight);
81 | Game.Ego.Inventory.AddItem();
82 | }
83 | else if (_flashlightFrame == Get().CurrentFrame)
84 | {
85 | Visible = false;
86 | Enabled = false;
87 | Game.Ego.Inventory.AddItem();
88 | }
89 |
90 | yield return Game.Ego.StopUse();
91 |
92 | if (Game.Ego.Inventory.HasItem() && Visible)
93 | {
94 | yield return Tree.InventoryItems.Blanket.LookAt();
95 | }
96 | }
97 | }
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ShelfComicBox.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class ShelfComicBox : Entity
12 | {
13 | public ShelfComicBox()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(1020, 295)
18 | .SetDirection(Directions8.Right)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | HotspotRectangle
22 | .Create(this)
23 | .SetCaption(Basement_Res.box)
24 | .AddRectangle(1047, 220, 29, 39);
25 |
26 | Transform
27 | .Create(this)
28 | .SetZ(Shelf.Z + 1);
29 |
30 | Enabled = false;
31 | }
32 |
33 | private Interactions GetInteractions()
34 | {
35 | return Interactions
36 | .Create()
37 | .For(Game.Ego)
38 | .Add(Verbs.Look, LookScript())
39 | .Add(Verbs.Open, OpenScript())
40 | .Add(Verbs.Pick, PickScript());
41 | }
42 |
43 | private IEnumerator OpenScript()
44 | {
45 | yield return Game.Ego.GoTo(this);
46 | using (Game.CutsceneBlock())
47 | {
48 | if (!LookedAt)
49 | {
50 | yield return Game.Ego.StartScript(LookScript(false));
51 | }
52 | yield return Game.Ego.StartUse();
53 |
54 | yield return Game.WaitForSoundEffect(content.audio.rustling1);
55 |
56 | yield return Game.Ego.StopUse();
57 |
58 | yield return Game.Ego.Say(Basement_Res.Nothing_in_there_but_comic_books);
59 | yield return Game.Ego.Say(Basement_Res.Theyre_looking_pretty_torn_up);
60 | }
61 | }
62 |
63 | public bool LookedAt { get; private set; }
64 |
65 | private IEnumerator LookScript(bool reset = true)
66 | {
67 | yield return Game.Ego.GoTo(this);
68 | using (Game.CutsceneBlock(reset))
69 | {
70 | yield return Game.Ego.Say(Basement_Res.In_this_box_we_store_some_of_Landons_old_comic_books);
71 | LookedAt = true;
72 | Get().SetCaption(Basement_Res.box_with_comic_books);
73 | }
74 | }
75 |
76 | private IEnumerator PickScript()
77 | {
78 | yield return Game.Ego.GoTo(this);
79 | using (Game.CutsceneBlock())
80 | {
81 | if (!LookedAt)
82 | {
83 | yield return Game.Ego.StartScript(LookScript(false));
84 | }
85 | yield return Game.Ego.Say(Basement_Res.I_have_more_important_things_to_tend_to);
86 | }
87 | }
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ShelfEngineeringBooks.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class ShelfEngineeringBooks : Entity
13 | {
14 | public ShelfEngineeringBooks()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(1020, 295)
19 | .SetDirection(Directions8.Right)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.books)
25 | .AddRectangle(1043, 178, 57, 49)
26 | .AddRectangle(1039, 153, 28, 12);
27 |
28 | Transform
29 | .Create(this)
30 | .SetZ(Shelf.Z + 1);
31 |
32 | Enabled = false;
33 | }
34 |
35 | public Interactions GetInteractions()
36 | {
37 | return Interactions
38 | .Create()
39 | .For(Game.Ego)
40 | .Add(Verbs.Look, LookScript())
41 | .Add(Verbs.Use, UseScript())
42 | .Add(Verbs.Pick, PickScript());
43 | }
44 |
45 | private IEnumerator UseScript()
46 | {
47 | yield return Game.Ego.GoTo(this);
48 | using (Game.CutsceneBlock())
49 | {
50 | yield return Game.Ego.Say(Basement_Res.I_have_more_important_things_to_tend_to);
51 | }
52 | }
53 |
54 | private IEnumerator LookScript()
55 | {
56 | yield return Game.Ego.GoTo(this);
57 | using (Game.CutsceneBlock())
58 | {
59 | yield return Game.Ego.Say(Basement_Res.My_old_engineering_textbooks);
60 | yield return Game.Ego.Say(Basement_Res.I_keep_them_for_sentimental_reasons);
61 | Get().SetCaption(Basement_Res.engineering_books);
62 | Tree.Basement.ShelfSingleBook.Enabled = true;
63 | }
64 | }
65 |
66 | private IEnumerator PickScript()
67 | {
68 | yield return Game.Ego.GoTo(this);
69 | using (Game.CutsceneBlock())
70 | {
71 | yield return Game.Ego.Say(Basement_Res.I_dont_need_them_any_more);
72 | }
73 | }
74 | }
75 |
76 |
77 | }
78 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ShelfRFIDBook.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using SessionSeven.InventoryItems;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class ShelfRFIDBook : Entity
13 | {
14 | public ShelfRFIDBook()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(1020, 295)
19 | .SetDirection(Directions8.Right)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.book)
25 | .AddRectangle(1064, 113, 32, 11);
26 |
27 | Transform
28 | .Create(this)
29 | .SetPosition(1064, 114)
30 | .SetZ(Shelf.Z + 1);
31 |
32 | Sprite
33 | .Create(this)
34 | .SetImage(content.rooms.basement.rfidbook)
35 | .SetVisible(false); // sprite is shown when taken
36 |
37 | Enabled = false;
38 | }
39 |
40 | public Interactions GetInteractions()
41 | {
42 | return Interactions
43 | .Create()
44 | .For(Game.Ego)
45 | .Add(Verbs.Look, LookScript())
46 | .Add(Verbs.Use, PickScript())
47 | .Add(Verbs.Pick, PickScript());
48 | }
49 |
50 | private IEnumerator LookScript(bool reset = true)
51 | {
52 | yield return Game.Ego.GoTo(this);
53 | using (Game.CutsceneBlock(true, reset))
54 | {
55 | yield return Game.Ego.Say(Basement_Res.This_books_title_is_RFID_Applied);
56 | yield return Game.Ego.Say(Basement_Res.I_wonder_what_its_doing_on_the_top_shelf_compartment);
57 | yield return Game.Ego.Say(Basement_Res.Landon_was_interested_in_RFID_technology_for_some_reason_some_time_ago);
58 | yield return Game.Ego.Say(Basement_Res.Maybe_he_put_it_up_there);
59 | Get().SetCaption(Basement_Res.RFID_Applied);
60 | LookedAt = true;
61 | }
62 | }
63 |
64 | public bool LookedAt { get; private set; }
65 |
66 | private IEnumerator PickScript()
67 | {
68 | yield return Game.Ego.GoTo(this);
69 |
70 | if (!LookedAt)
71 | {
72 | yield return Game.Ego.StartScript(LookScript(false));
73 | }
74 |
75 | using (Game.CutsceneBlock())
76 | {
77 | yield return Game.Ego.StartUse();
78 | Enabled = false;
79 | Get().SetVisible(true);
80 | Game.Ego.Inventory.AddItem();
81 | yield return Game.Ego.StopUse();
82 | }
83 | }
84 | }
85 |
86 |
87 | }
88 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ShelfSingleBook.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class ShelfSingleBook : Entity
12 | {
13 | public ShelfSingleBook()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(1020, 295)
18 | .SetDirection(Directions8.Right)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | HotspotRectangle
22 | .Create(this)
23 | .SetCaption(Basement_Res.notebook)
24 | .AddRectangle(1049, 183, 3, 24);
25 |
26 | Transform
27 | .Create(this)
28 | .SetZ(Shelf.Z + 2);
29 |
30 | Enabled = false;
31 | }
32 |
33 | private Interactions GetInteractions()
34 | {
35 | return Interactions
36 | .Create()
37 | .For(Game.Ego)
38 | .Add(Verbs.Look, LookScript())
39 | .Add(Verbs.Pick, PickScript());
40 | }
41 |
42 | private IEnumerator LookScript()
43 | {
44 | yield return Game.Ego.GoTo(this);
45 | using (Game.CutsceneBlock())
46 | {
47 | yield return Game.Ego.Say(Basement_Res.An_old_notebook_from_university);
48 | yield return Game.Ego.Use();
49 | yield return Game.Ego.Say(Basement_Res.The_first_page_reads);
50 | yield return Game.Ego.Say(Basement_Res._There_was_a_time_that_the_pieces_fit_but_I_watched_them_fall_away_);
51 | yield return Game.Ego.Say(Basement_Res._Mildewed_and_smoldering_strangled_by_our_coveting_);
52 |
53 | }
54 | }
55 |
56 | private IEnumerator PickScript()
57 | {
58 | yield return Game.Ego.GoTo(this);
59 | using (Game.CutsceneBlock())
60 | {
61 | yield return Game.Ego.Say(Basement_Res.I_dont_need_that);
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/SocketsCenter.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class SocketsCenter : Entity
13 | {
14 | public SocketsCenter()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(543, 262)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.sockets)
25 | .AddRectangle(538, 197, 13, 15);
26 |
27 | Transform
28 | .Create(this)
29 | .SetZ(Workbench.Z + 1);
30 |
31 | Enabled = false;
32 | }
33 |
34 | public Interactions GetInteractions()
35 | {
36 | return Interactions
37 | .Create()
38 | .For(Game.Ego)
39 | .Add(Verbs.Look, LookScript())
40 | .For(Tree.Basement.DrillingMachine)
41 | .Add(Verbs.Use, LookScript(), Game.Ego)
42 | .For(Tree.Basement.DrillingMachineCable)
43 | .Add(Verbs.Use, LookScript(), Game.Ego);
44 | }
45 |
46 | private IEnumerator LookScript()
47 | {
48 | yield return Game.Ego.GoTo(this);
49 | using (Game.CutsceneBlock())
50 | {
51 | yield return Game.Ego.Say(Basement_Res.These_sockets_have_been_defective_since_we_moved_in);
52 | yield return Game.Ego.Say(Basement_Res.I_never_found_the_time_to_deal_with_them);
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/SocketsLeft.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class SocketsLeft : Entity
13 | {
14 | public SocketsLeft()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(233, 251)
19 | .SetDirection(Directions8.Up)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.sockets)
25 | .AddRectangle(229, 198, 11, 12);
26 |
27 | Enabled = false;
28 | }
29 |
30 | public Interactions GetInteractions()
31 | {
32 | return Interactions
33 | .Create()
34 | .For(Game.Ego)
35 | .Add(Verbs.Look, LookScript())
36 | .For(Tree.Basement.DrillingMachine)
37 | .Add(Verbs.Use, UseDrillingMachineCableScript(), Game.Ego)
38 | .For(Tree.Basement.DrillingMachineCable)
39 | .Add(Verbs.Use, UseDrillingMachineCableScript(), Game.Ego);
40 | }
41 |
42 | private IEnumerator UseDrillingMachineCableScript()
43 | {
44 | yield return Game.Ego.GoTo(Tree.Basement.DrillingMachineCable);
45 | using (Game.CutsceneBlock())
46 | {
47 | if (!Tree.Basement.DrillingMachineCable.PluggedIn)
48 | {
49 | yield return Game.Ego.Use();
50 | yield return Game.Ego.GoTo(this);
51 | yield return Game.Ego.StartUse();
52 | Game.PlaySoundEffect(content.audio.socket_plugin_in);
53 | Tree.Basement.DrillingMachineCable.PluggedIn = true;
54 | yield return Game.Ego.StopUse();
55 | }
56 | else
57 | {
58 | yield return Game.Ego.Say(Basement_Res.Its_already_plugged_in);
59 | }
60 | }
61 | }
62 |
63 | private IEnumerator LookScript()
64 | {
65 | yield return Game.Ego.GoTo(this);
66 | using (Game.CutsceneBlock())
67 | {
68 | yield return Game.Ego.Say(Basement_Res.These_sockets_are_working_actually);
69 | }
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ToDoBoard.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | [Serializable]
11 | public class ToDoBoard : Entity
12 | {
13 | public ToDoBoard()
14 | {
15 | Interaction
16 | .Create(this)
17 | .SetPosition(127, 276)
18 | .SetDirection(Directions8.Left)
19 | .SetGetInteractionsFn(GetInteractions);
20 |
21 | HotspotRectangle
22 | .Create(this)
23 | .SetCaption(Basement_Res.bulletin_board)
24 | .AddRectangle(3, 98, 61, 69);
25 |
26 | Enabled = false;
27 | }
28 |
29 | public Interactions GetInteractions()
30 | {
31 | return Interactions
32 | .Create()
33 | .For(Game.Ego)
34 | .Add(Verbs.Look, LookScript());
35 | }
36 |
37 | private IEnumerator LookScript()
38 | {
39 | yield return Game.Ego.GoTo(this);
40 | using (Game.CutsceneBlock())
41 | {
42 | yield return Game.Ego.Say(Basement_Res.This_bulletin_board_is_covered_in_reminders_for_meetings_with_the_realtor_the_bank_and_Landons_teachers_as_well_as_an_alphabetized_shopping_list_of_Cynthias);
43 | yield return Game.Ego.Say(Basement_Res.Landon_drew_something_in_the_corner_but_its_too_faded_now_to_make_out_what_its_supposed_to_be);
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/ToolBar.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class ToolBar : Entity
13 | {
14 | public const float Z = 1;
15 |
16 | public ToolBar()
17 | {
18 | Interaction
19 | .Create(this)
20 | .SetPosition(517, 264)
21 | .SetDirection(Directions8.Up)
22 | .SetGetInteractionsFn(GetInteractions);
23 |
24 | HotspotRectangle
25 | .Create(this)
26 | .SetCaption(Basement_Res.tools)
27 | .AddRectangle(461, 95, 119, 45);
28 |
29 | Transform
30 | .Create(this)
31 | .SetZ(Z);
32 |
33 | Enabled = false;
34 | }
35 |
36 | public Interactions GetInteractions()
37 | {
38 | return Interactions
39 | .Create()
40 | .For(Game.Ego)
41 | .Add(Verbs.Look, LookScript())
42 | .Add(Verbs.Pick, LookScript());
43 | }
44 |
45 | private IEnumerator LookScript()
46 | {
47 | yield return Game.Ego.GoTo(this);
48 | using (Game.CutsceneBlock())
49 | {
50 | yield return Game.Ego.Say(Basement_Res.My_old_tools);
51 | yield return Game.Ego.Say(Basement_Res.Hang_on_is_one_of_them_missing);
52 | yield return Game.Ego.Say(Basement_Res.Damn_Ive_told_Landon_a_thousand_times_to_bring_back_anything_he_borrows);
53 |
54 | Tree.Basement.MissingTool.Enabled = true;
55 | Tree.Basement.Hammer.Enabled = true;
56 | Tree.Basement.Screwdriver.Enabled = true;
57 | Enabled = false;
58 | }
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/VentilationShaft.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using StarFinder;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class VentilationShaft : Entity
13 | {
14 | public VentilationShaft()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(449, 294)
19 | .SetDirection(Directions8.Right)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotMesh
23 | .Create(this)
24 | .SetCaption(Basement_Res.ventilation_shaft)
25 | .SetMesh(CreateMesh());
26 |
27 | Enabled = false;
28 | }
29 |
30 | private Mesh CreateMesh()
31 | {
32 | var points = new PathVertex[11]
33 | {
34 | new PathVertex(539, 0),
35 | new PathVertex(528, 34),
36 | new PathVertex(529, 61),
37 | new PathVertex(572, 60),
38 | new PathVertex(576, 50),
39 | new PathVertex(648, 56),
40 | new PathVertex(650, 41),
41 | new PathVertex(580, 38),
42 | new PathVertex(588, 15),
43 | new PathVertex(601, 15),
44 | new PathVertex(607, 0)
45 | };
46 |
47 | var indices = new int[27]
48 | {
49 | 0, 8, 10, 8, 9, 10,
50 | 0, 1, 8, 1, 7, 8,
51 | 1, 2, 7, 2, 4, 7,
52 | 2, 3, 4, 5, 6, 7,
53 | 4, 5, 7
54 | };
55 |
56 | return new Mesh(points, indices);
57 | }
58 |
59 | public Interactions GetInteractions()
60 | {
61 | return Interactions
62 | .Create()
63 | .For(Game.Ego)
64 | .Add(Verbs.Look, LookScript());
65 |
66 | }
67 |
68 | private IEnumerator LookScript()
69 | {
70 | yield return Game.Ego.GoTo(this);
71 | using (Game.CutsceneBlock())
72 | {
73 | yield return Game.Ego.Say(Basement_Res.A_ventilation_shaft_At_least_I_have_AC_down_here);
74 | }
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/WoodenBox.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using SessionSeven.GUI.Interaction;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 | using System.Collections;
7 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
8 |
9 | namespace SessionSeven.Basement
10 | {
11 | [Serializable]
12 | public class WoodenBox : Entity
13 | {
14 | public WoodenBox()
15 | {
16 | Interaction
17 | .Create(this)
18 | .SetPosition(649, 277)
19 | .SetDirection(Directions8.Left)
20 | .SetGetInteractionsFn(GetInteractions);
21 |
22 | HotspotRectangle
23 | .Create(this)
24 | .SetCaption(Basement_Res.wooden_box)
25 | .AddRectangle(615, 271, 14, 9);
26 |
27 | Enabled = false;
28 | }
29 |
30 | public Interactions GetInteractions()
31 | {
32 | return Interactions
33 | .Create()
34 | .For(Game.Ego)
35 | .Add(Verbs.Open, OpenScript())
36 | .Add(Verbs.Look, LookScript())
37 | .Add(Verbs.Pick, PickScript());
38 | }
39 |
40 | private IEnumerator OpenScript()
41 | {
42 | yield return Game.Ego.GoTo(this);
43 | using (Game.CutsceneBlock())
44 | {
45 | yield return Game.Ego.Say(Basement_Res.I_should_take_it_first);
46 | }
47 | }
48 |
49 | private IEnumerator LookScript()
50 | {
51 | yield return Game.Ego.GoTo(this);
52 | using (Game.CutsceneBlock())
53 | {
54 | yield return Game.Ego.Say(Basement_Res.A_small_wooden_box_was_hidden_underneath_a_panel);
55 | }
56 | }
57 |
58 | private IEnumerator PickScript()
59 | {
60 | yield return Game.Ego.GoTo(this);
61 | using (Game.CutsceneBlock())
62 | {
63 | yield return Game.Ego.StartUse();
64 | Enabled = false;
65 | Tree.Basement.WoodenPanel.Get().CurrentFrame = 3;
66 | Game.Ego.Inventory.AddItem();
67 | Visible = false;
68 | yield return Game.Ego.StopUse();
69 | }
70 | }
71 | }
72 |
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/WoodenPanelSoundTrigger.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.Basement
7 | {
8 | [Serializable]
9 | public class WoodenPanelSoundTrigger : Entity
10 | {
11 | public WoodenPanelSoundTrigger()
12 | {
13 | Enabled = true;
14 | Visible = false;
15 | }
16 |
17 | private bool _playerWasOnCollider = false;
18 |
19 | public override void OnUpdate()
20 | {
21 | base.OnUpdate();
22 |
23 | if (Game.Ego.DrawScene != DrawScene ||
24 | (Tree.Basement.WoodenPanel.Visible && !Tree.Basement.WoodenPanel.Enabled))
25 | {
26 | return;
27 | }
28 |
29 | // check if player steps on collider and play sound
30 | var playerPosition = Game.Ego.Get().Position;
31 | var playerOnCollider = WoodenPanel.Collider.Contains(playerPosition);
32 |
33 | if (!_playerWasOnCollider && playerOnCollider)
34 | {
35 | Game.PlaySoundEffect(content.audio._path_ + "squeak_" + World.Get().CreateInt(1, 4));
36 | }
37 |
38 | _playerWasOnCollider = playerOnCollider;
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/basement/Workbench.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.GUI.Interaction;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using System.Collections;
6 | using Basement_Res = global::SessionSeven.Properties.Basement_Resources;
7 |
8 | namespace SessionSeven.Basement
9 | {
10 | ///
11 | /// Workbench
12 | ///
13 | [Serializable]
14 | public class Workbench : Entity
15 | {
16 | public const int Z = 246;
17 | public Workbench()
18 | {
19 | Sprite
20 | .Create(this)
21 | .SetImage(content.rooms.basement.bench);
22 |
23 | Transform
24 | .Create(this)
25 | .SetPosition(609, 162)
26 | .SetZ(Z);
27 |
28 | HotspotRectangle
29 | .Create(this)
30 | .SetCaption(Basement_Res.workbench)
31 | .AddRectangle(416, 153, 225, 94);
32 |
33 | Interaction
34 | .Create(this)
35 | .SetPosition(510, 259)
36 | .SetDirection(Directions8.Up)
37 | .SetGetInteractionsFn(GetInteractions);
38 |
39 | Enabled = false;
40 | }
41 |
42 | public Interactions GetInteractions()
43 | {
44 | return Interactions
45 | .Create()
46 | .For(Game.Ego)
47 | .Add(Verbs.Look, LookScript())
48 | .Add(Verbs.Use, UseScript());
49 | }
50 |
51 | private IEnumerator UseScript()
52 | {
53 | yield return Game.Ego.GoTo(this);
54 | using (Game.CutsceneBlock())
55 | {
56 | yield return Game.Ego.Say(Basement_Res.I_have_no_idea_on_what_to_work_at_the_moment);
57 | }
58 | }
59 |
60 | private IEnumerator LookScript()
61 | {
62 | yield return Game.Ego.GoTo(this);
63 | using (Game.CutsceneBlock())
64 | {
65 | yield return Game.Ego.Say(Basement_Res.Its_my_workbench);
66 | yield return Game.Ego.Say(Basement_Res.I_told_Landon_a_while_ago_that_I_would_help_him_make_a_box_car_for_class_with_these_tools);
67 | yield return Game.Ego.Say(Basement_Res.I_still_havent_looked_up_how_to_make_one_Come_to_think_of_it_the_assignment_is_probably_over_by_now);
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/jailcell/Foreground.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.JailCell
6 | {
7 | ///
8 | /// Boxes in the foreground
9 | ///
10 | [Serializable]
11 | public class Foreground : Entity
12 | {
13 | public Foreground()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.jailcell.foreground);
18 |
19 | DrawOrder = 400;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/jailcell/Scene.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.JailCell
6 | {
7 |
8 | [Serializable]
9 | public class Scene : Location
10 | {
11 | public Scene() : base(content.rooms.jailcell.scene)
12 | {
13 | this.AutoAddEntities();
14 |
15 | ScenePath
16 | .Create(this)
17 | .SetPathFile(content.rooms.jailcell.path);
18 |
19 | DrawOrder = 22;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/letter/Scene.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 | using GlblRes = global::SessionSeven.Properties.Resources;
6 |
7 | namespace SessionSeven.Letter
8 | {
9 |
10 | [Serializable]
11 | public class Scene : Location
12 | {
13 | public Scene() : base(GlblRes.RoomsLetterScene)
14 | {
15 | Background
16 | .Get()
17 | .SetRenderStage(RenderStage.PostBloom);
18 |
19 | DrawOrder = 500;
20 |
21 | InputDispatcher
22 | .Create(this)
23 | .SetOnMouseUpFn(OnMouseUp);
24 | }
25 |
26 | private void OnMouseUp(Vector2 position, MouseButton button)
27 | {
28 | Enabled = false;
29 | Visible = false;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/office/RyanEyes.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using SessionSeven.Components;
3 | using SessionSeven.Entities;
4 | using STACK;
5 | using STACK.Components;
6 | using System;
7 |
8 | namespace SessionSeven.Office
9 | {
10 | [Serializable]
11 | public class RyanEyesClosed : Entity
12 | {
13 | private readonly Vector2 _defaultPosition = new Vector2(289, 231);
14 | private bool _blinking = true;
15 | public bool Blinking
16 | {
17 | get => _blinking;
18 | set
19 | {
20 | Visible = false;
21 | if (value && _blinking != value)
22 | {
23 | Get().Reset();
24 | }
25 | _blinking = value;
26 | }
27 | }
28 |
29 | public RyanEyesClosed()
30 | {
31 | Transform
32 | .Create(this)
33 | .SetPosition(_defaultPosition)
34 | .SetZ(2)
35 | .SetAbsolute(true);
36 |
37 | Sprite
38 | .Create(this)
39 | .SetImage(content.rooms.office.ryaneyes, 2)
40 | .SetFrame(1);
41 |
42 | RandomCountdown
43 | .Create(this)
44 | .SetDuration(7)
45 | .SetMinUpdates(300)
46 | .SetMaxUpdates(500);
47 |
48 | DrawOrder = Ryan.PRIORITY + 1;
49 | }
50 |
51 | public override void OnUpdate()
52 | {
53 | if (Blinking)
54 | {
55 | Visible = Get().Action;
56 | }
57 |
58 | var ryanCurrentFrame = Tree.Office.Ryan.Get().CurrentFrame;
59 |
60 | switch (ryanCurrentFrame)
61 | {
62 | case 1:
63 | Get().SetPosition(290, 232);
64 | Get().CurrentFrame = 1;
65 | break;
66 | case 2:
67 | Get().SetPosition(288, 232);
68 | Get().CurrentFrame = 1;
69 | break;
70 |
71 | case 3:
72 | case 4:
73 | case 5:
74 | Get().SetPosition(287, 233);
75 | Get().CurrentFrame = 2;
76 | break;
77 |
78 | case 7:
79 | case 8:
80 | case 9:
81 | case 10:
82 | case 11:
83 | case 12:
84 | case 13:
85 |
86 | case 17:
87 | case 18:
88 | case 19:
89 | Get().SetPosition(_defaultPosition);
90 | Get().CurrentFrame = 1;
91 | break;
92 |
93 | case 14:
94 | case 15:
95 | case 16:
96 | Get().SetPosition(286, 231);
97 | Get().CurrentFrame = 1;
98 | break;
99 | }
100 |
101 | base.OnUpdate();
102 | }
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/office/RyanState.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace SessionSeven.Office
4 | {
5 | [Serializable]
6 | public enum RyanState
7 | {
8 | ArmsCrossed,
9 | ArmsRaised,
10 | HandsIntertwined,
11 | Neutral
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/office/Scene.cs:
--------------------------------------------------------------------------------
1 | using SessionSeven.Entities;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.Office
7 | {
8 |
9 | [Serializable]
10 | public class Scene : Location
11 | {
12 | private static readonly string _earlyImage = content.rooms.office.scene;
13 | private static readonly string _lateImage = content.rooms.office.scenenight;
14 |
15 | public Scene() : base(_earlyImage)
16 | {
17 | this.AutoAddEntities();
18 |
19 | DrawOrder = 20;
20 | }
21 |
22 | public bool IsEarly()
23 | {
24 | return _earlyImage == Background.Get().Image;
25 | }
26 |
27 | public void SetupEarly()
28 | {
29 | Background.Get().SetImage(_earlyImage);
30 | Tree.Office.WaterDay.Visible = true;
31 | Tree.Office.WaterDay.Enabled = true;
32 | Tree.Office.WaterNight.Visible = false;
33 | Tree.Office.WaterNight.Enabled = false;
34 | }
35 |
36 | public void SetupLate()
37 | {
38 | Background.Get().SetImage(_lateImage);
39 | Tree.Office.WaterDay.Visible = false;
40 | Tree.Office.WaterDay.Enabled = false;
41 | Tree.Office.WaterNight.Visible = true;
42 | Tree.Office.WaterNight.Enabled = true;
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/office/Table.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Office
6 | {
7 | ///
8 | /// Image of the table to obstruct Ryan's pixelated feet.
9 | ///
10 | [Serializable]
11 | public class Table : Entity
12 | {
13 | public Table()
14 | {
15 | Sprite
16 | .Create(this)
17 | .SetImage(content.rooms.office.table);
18 |
19 | Transform
20 | .Create(this)
21 | .SetZ(400);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/office/Therapist.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using STACK;
3 | using STACK.Components;
4 | using System;
5 |
6 | namespace SessionSeven.Office
7 | {
8 | [Serializable]
9 | public class Therapist : Entity
10 | {
11 | public Therapist()
12 | {
13 | Transform
14 | .Create(this)
15 | .SetPosition(440, 200)
16 | .SetZ(2)
17 | .SetAbsolute(true);
18 |
19 | Text
20 | .Create(this)
21 | .SetColor(Color.OrangeRed)
22 | .SetFont(content.fonts.pixeloperator_outline_BMF)
23 | .SetWidth(300);
24 |
25 | Sprite
26 | .Create(this)
27 | .SetImage(content.rooms.office.therapist, 5, 1);
28 |
29 | SpriteTransformAnimation
30 | .Create(this)
31 | .SetSetFrameFn(SetFrame);
32 |
33 | SpriteData
34 | .Create(this)
35 | .SetOffset(-87, 45);
36 |
37 | Scripts
38 | .Create(this);
39 | }
40 |
41 | public Script Say(string text, float duration = 0)
42 | {
43 | return Get().Say(text, duration);
44 | }
45 |
46 | private int SetFrame(Transform transform, int step, int lastFrame)
47 | {
48 | // 1,2 talk
49 | // 3,4,5 write
50 |
51 | var scaledStep = step / 10;
52 |
53 | if (transform.State == State.Idle)
54 | {
55 | return 1;
56 | }
57 |
58 | if (transform.State.Has(State.Talking))
59 | {
60 | if (lastFrame < 2 && World.Get().CreateInt(10) > 4)
61 | {
62 | return lastFrame;
63 | }
64 |
65 | var result = scaledStep % 2;
66 |
67 | return 1 + result;
68 | }
69 |
70 | // writing
71 | return 3 + (scaledStep % 3);
72 | }
73 |
74 | public void StartWriting()
75 | {
76 | Get().SetState(State.Custom);
77 | }
78 |
79 | public void StopWriting()
80 | {
81 | Get().SetState(State.Idle);
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/office/Water.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using Microsoft.Xna.Framework.Graphics;
3 | using STACK;
4 | using STACK.Components;
5 | using System;
6 |
7 | namespace SessionSeven.Office
8 | {
9 | [Serializable]
10 | public class WaterDay : Water
11 | {
12 | public override Vector2 GetPosition() { return new Vector2(0, 247); }
13 | public override string GetImagePath() { return content.rooms.office.anim.day._path_; }
14 | }
15 |
16 | [Serializable]
17 | public class WaterNight : Water
18 | {
19 | public override Vector2 GetPosition() { return new Vector2(0, 261); }
20 | public override string GetImagePath() { return content.rooms.office.anim.night._path_; }
21 | }
22 |
23 | [Serializable]
24 | public abstract class Water : Entity
25 | {
26 | public abstract Vector2 GetPosition();
27 | public abstract string GetImagePath();
28 |
29 | [NonSerialized]
30 | private Texture2D[] _textures;
31 |
32 | public Water()
33 | {
34 | Sprite
35 | .Create(this);
36 |
37 | Transform
38 | .Create(this)
39 | .SetPosition(GetPosition())
40 | .SetZ(1);
41 |
42 | }
43 |
44 | public override void OnLoadContent(ContentLoader content)
45 | {
46 | _textures = new Texture2D[20];
47 |
48 | for (var i = 0; i < _textures.Length; i++)
49 | {
50 | _textures[i] = content.Load(GetImagePath() + i);
51 | }
52 |
53 | base.OnLoadContent(content);
54 | }
55 |
56 | private int _current = 1;
57 | private int _oldFrame = -1;
58 |
59 | public override void OnUpdate()
60 | {
61 | base.OnUpdate();
62 |
63 | _current++;
64 |
65 | var frame = _current / 7 % 20;
66 |
67 | // Optimization for skipping cutscenes
68 | if (null != World.Get().SkipCutscene && !World.Get().SkipCutscene.Enabled)
69 | {
70 | if (_oldFrame != frame)
71 | {
72 | _oldFrame = frame;
73 | Get().SetTexture(_textures[frame]);
74 | }
75 | }
76 | }
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/paddedcell/Scene.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.PaddedCell
6 | {
7 |
8 | [Serializable]
9 | public class Scene : Location
10 | {
11 | public Scene() : base(content.rooms.paddedcell.scene)
12 | {
13 | this.AutoAddEntities();
14 |
15 | ScenePath
16 | .Create(this)
17 | .SetPathFile(content.rooms.paddedcell.path);
18 |
19 | DrawOrder = 22;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/sunset/Scene.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.SunSet
6 | {
7 |
8 | [Serializable]
9 | public class Scene : Location
10 | {
11 | public Scene() : base(content.rooms.sunset.scene)
12 | {
13 | this.AutoAddEntities();
14 |
15 | ScenePath
16 | .Create(this)
17 | .SetPathFile(content.rooms.sunset.path);
18 |
19 | DrawOrder = 22;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/Game/GameLogic/rooms/title/Scene.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 | using STACK.Components;
3 | using System;
4 |
5 | namespace SessionSeven.Title
6 | {
7 |
8 | [Serializable]
9 | public class Scene : Location
10 | {
11 | public Scene() : base(content.rooms.title.scene)
12 | {
13 | Background.Get().SetRenderStage(RenderStage.PostBloom);
14 |
15 | DrawOrder = 20;
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Game/Playthrough/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // General Information about an assembly is controlled through the following
5 | // set of attributes. Change these attribute values to modify the information
6 | // associated with an assembly.
7 | [assembly: AssemblyTitle("Session Seven")]
8 | [assembly: AssemblyProduct("Session Seven")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyCompany("PianoMitRum")]
12 | [assembly: AssemblyCopyright("Copyright © PianoMitRum")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Setting ComVisible to false makes the types in this assembly not visible
17 | // to COM components. If you need to access a type in this assembly from
18 | // COM, set the ComVisible attribute to true on that type.
19 | [assembly: ComVisible(false)]
20 |
21 | // The following GUID is for the ID of the typelib if this project is exposed to COM
22 | [assembly: Guid("97891cc4-2ec5-432b-b37c-d52a8c499180")]
23 |
24 | // Version information for an assembly consists of the following four values:
25 | //
26 | // Major Version
27 | // Minor Version
28 | // Build Number
29 | // Revision
30 | //
31 | // You can specify all the values or you can default the Build and Revision Numbers
32 | // by using the '*' as shown below:
33 | // [assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/src/Game/Playthrough/README.md:
--------------------------------------------------------------------------------
1 | # Playthrough
2 |
3 | This console application does a "playthrough" of the game and creates dedicated save games for testing purposes.
4 |
5 | Additional content files are required to execute the application which are only provided in the binary distribution.
6 |
7 |
--------------------------------------------------------------------------------
/src/Game/Playthrough/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/src/Game/Playthrough/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/advdotnet/Session-Seven/13ea177ed188ed49e0eb33f8eb42ca62c08e8593/src/Game/Playthrough/icon.ico
--------------------------------------------------------------------------------
/src/Tests/SessionSeven.Functional.Test/Circle.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using Microsoft.Xna.Framework;
3 | using SessionSeven.Components;
4 | using System;
5 |
6 | namespace SessionSeven.Functional.Test
7 | {
8 | [TestClass]
9 | public class CircleTest
10 | {
11 | [TestMethod]
12 | public void EqualityTestPositive()
13 | {
14 | var circleA = new Circle(new Vector2(10, 10), 5);
15 | var circleB = new Circle(new Vector2(10, 10), 5);
16 |
17 | Assert.IsTrue(circleA.Equals(circleB));
18 | Assert.IsTrue(circleA == circleB);
19 | }
20 |
21 | [TestMethod]
22 | public void EqualityTestNegative()
23 | {
24 | var circleA = new Circle(new Vector2(10, 10), 5);
25 | var circleB = new Circle(new Vector2(10, 10), 5.2f);
26 |
27 | Assert.IsFalse(circleA.Equals(circleB));
28 | Assert.IsFalse(circleA == circleB);
29 | }
30 |
31 | [TestMethod]
32 | public void ContainsTestPositive()
33 | {
34 | var circle = new Circle(Vector2.Zero, 1 * 2);
35 |
36 | Assert.IsTrue(circle.Contains(Vector2.UnitX * 2));
37 | Assert.IsTrue(circle.Contains(Vector2.UnitY * 2));
38 | Assert.IsTrue(circle.Contains(-Vector2.UnitX * 2));
39 | Assert.IsTrue(circle.Contains(-Vector2.UnitY * 2));
40 | Assert.IsTrue(circle.Contains((Vector2.UnitX + Vector2.UnitY) * 2 / (float)Math.Sqrt(2)));
41 | }
42 |
43 | [TestMethod]
44 | public void ContainsTestNegative()
45 | {
46 | var circle = new Circle(Vector2.Zero, 1);
47 |
48 | Assert.IsFalse(circle.Contains(1.01f * Vector2.UnitX));
49 | Assert.IsFalse(circle.Contains(1.01f * Vector2.UnitY));
50 | Assert.IsFalse(circle.Contains(1.01f * -Vector2.UnitX));
51 | Assert.IsFalse(circle.Contains(1.01f * -Vector2.UnitY));
52 | Assert.IsFalse(circle.Contains(Vector2.UnitX + Vector2.UnitY));
53 | }
54 |
55 | [TestMethod]
56 | public void IntersectsTestPositive()
57 | {
58 | var circle = new Circle(Vector2.Zero, 1 * 2);
59 |
60 | Assert.IsTrue(circle.Intersects(Vector2.UnitX, Vector2.UnitY));
61 | Assert.IsTrue(circle.Intersects(Vector2.UnitY, Vector2.UnitX));
62 | Assert.IsTrue(circle.Intersects(Vector2.Zero, Vector2.UnitX));
63 | }
64 |
65 | [TestMethod]
66 | public void IntersectsTestNegative()
67 | {
68 | var circle = new Circle(Vector2.Zero, 1);
69 |
70 | Assert.IsFalse(circle.Intersects(Vector2.UnitX, new Vector2(2, 0)));
71 | Assert.IsFalse(circle.Intersects(new Vector2(1, 2), new Vector2(1, -2)));
72 | Assert.IsFalse(circle.Intersects(new Vector2(2, 2), new Vector2(2, -2)));
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/Tests/SessionSeven.Functional.Test/Cutscene.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.TestTools.UnitTesting;
2 | using SessionSeven.Entities;
3 | using STACK;
4 | using STACK.TestBase;
5 |
6 | namespace SessionSeven.Functional.Test
7 | {
8 | [TestClass]
9 | public class Cutscene
10 | {
11 | [TestMethod]
12 | public void CutsceneDisposeControlTestResetGUIAndWorldInteractive()
13 | {
14 | var world = new World(new TestServiceProvider());
15 | Tree.World = world;
16 | var reset = false;
17 | void ResetFn() => reset = true;
18 |
19 | using (new CutsceneDisposeControl(world, ResetFn))
20 | {
21 | Assert.IsFalse(world.Interactive);
22 | Assert.IsFalse(reset);
23 | }
24 | Assert.IsTrue(reset);
25 | Assert.IsTrue(world.Interactive);
26 | }
27 |
28 | [TestMethod]
29 | public void CutsceneDisposeControlTestResetWorldInteractive()
30 | {
31 | var world = new World(new TestServiceProvider());
32 | Tree.World = world;
33 | var reset = false;
34 | void ResetFn() => reset = true;
35 |
36 | using (new CutsceneDisposeControl(world, ResetFn, true, false))
37 | {
38 | Assert.IsFalse(world.Interactive);
39 | Assert.IsFalse(reset);
40 | }
41 | Assert.IsFalse(reset);
42 | Assert.IsTrue(world.Interactive);
43 | }
44 |
45 | [TestMethod]
46 | public void CutsceneDisposeControlTestResetGUI()
47 | {
48 | var world = new World(new TestServiceProvider());
49 | Tree.World = world;
50 | var reset = false;
51 | void ResetFn() => reset = true;
52 |
53 | using (new CutsceneDisposeControl(world, ResetFn, false, true))
54 | {
55 | Assert.IsFalse(world.Interactive);
56 | Assert.IsFalse(reset);
57 | }
58 | Assert.IsTrue(reset);
59 | Assert.IsFalse(world.Interactive);
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/Tests/SessionSeven.Functional.Test/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 |
4 | // Allgemeine Informationen über eine Assembly werden über folgende
5 | // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
6 | // die einer Assembly zugeordnet sind.
7 | [assembly: AssemblyTitle("WEISS.Functional.Test")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("Microsoft")]
11 | [assembly: AssemblyProduct("WEISS.Functional.Test")]
12 | [assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // Wenn ComVisible auf "false" festgelegt wird, sind die Typen innerhalb dieser Assembly
17 | // für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
18 | // COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
19 | [assembly: ComVisible(false)]
20 |
21 | // Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
22 | [assembly: Guid("f569ebf2-f54a-48b8-939a-8b6136900f00")]
23 |
24 | // Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
25 | //
26 | // Hauptversion
27 | // Nebenversion
28 | // Buildnummer
29 | // Revision
30 | //
31 | // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
32 | // durch Einsatz von '*', wie in nachfolgendem Beispiel:
33 | // [Assembly: AssemblyVersion("1.0.*")]
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/src/Tests/SessionSeven.Functional.Test/README.md:
--------------------------------------------------------------------------------
1 | # SessionSeven.Functional.Test
2 |
3 | Additional content files are required to execute some of the tests which are only provided in the binary distribution.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/Tests/SessionSeven.Functional.Test/ScriptsExtension.cs:
--------------------------------------------------------------------------------
1 | using STACK;
2 |
3 | namespace SessionSeven.Functional.Test
4 | {
5 | public static class ScriptsExtension
6 | {
7 | ///
8 | /// Returns whether this script waits for a dialog / position selection.
9 | ///
10 | ///
11 | ///
12 | public static bool WaitsforSelection(this Script script)
13 | {
14 | return InnerMostScriptHasID(script, GUI.Dialog.Menu.SCRIPTID) ||
15 | InnerMostScriptHasID(script, GUI.PositionSelection.Scene.SCRIPTID);
16 | }
17 |
18 | private static bool InnerMostScriptHasID(Script script, string id)
19 | {
20 | var innerScript = script.GetNestedScript();
21 |
22 | while (innerScript != null && innerScript.GetNestedScript() != null)
23 | {
24 | innerScript = innerScript.GetNestedScript();
25 | }
26 |
27 | return (null != innerScript) && (id == innerScript.ID);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/Tests/SessionSeven.Functional.Test/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------