├── .config
└── dotnet-tools.json
├── .editorconfig
├── .gitattributes
├── .gitignore
├── ConsoleAdventure.sln
├── ConsoleAdventure
├── .config
│ └── dotnet-tools.json
├── CaModLoader.cs
├── CaModLoaderAPI
│ ├── EmptyMod.cs
│ ├── GlobalItem.cs
│ ├── GlobalPlayer.cs
│ ├── IMod.cs
│ ├── Main.cs
│ ├── Mod.cs
│ ├── ModItem.cs
│ └── ModTags.cs
├── ColorAssets.cs
├── ConsoleAdventure.cs
├── ConsoleAdventure.csproj
├── ConsoleAdventure.csproj.DEBUG
├── Content
│ ├── AudioFiles
│ │ └── Music
│ │ │ ├── ItsMagicRain.mp3
│ │ │ ├── StrangeWorld.mp3
│ │ │ └── WorldInsideOut.mp3
│ ├── Content.mgcb
│ ├── Fonts
│ │ └── font.spritefont
│ ├── Localization
│ │ ├── en.json
│ │ └── ru.json
│ ├── Scripts
│ │ ├── Abstracts
│ │ │ ├── PathFinder.cs
│ │ │ ├── Position.cs
│ │ │ ├── Rotation.cs
│ │ │ └── Time.cs
│ │ ├── Audio
│ │ │ ├── MusicEngine.cs
│ │ │ ├── SoundEngine.cs
│ │ │ └── Wave.cs
│ │ ├── Buffs
│ │ │ ├── Buff.cs
│ │ │ └── InTheFlames.cs
│ │ ├── CharTexture.cs
│ │ ├── Debug
│ │ │ └── Commands
│ │ │ │ ├── ChunkCommand.cs
│ │ │ │ ├── Command.cs
│ │ │ │ ├── ExploreWorld.cs
│ │ │ │ ├── GetItem.cs
│ │ │ │ ├── GodMod.cs
│ │ │ │ ├── HackLight.cs
│ │ │ │ ├── Help.cs
│ │ │ │ ├── PlaceTextMark.cs
│ │ │ │ ├── PlaceTrees.cs
│ │ │ │ ├── SetTime.cs
│ │ │ │ ├── ShowTypes.cs
│ │ │ │ └── TeleportPlayer.cs
│ │ ├── Display.cs
│ │ ├── Entities
│ │ │ ├── Bomb.cs
│ │ │ ├── Cat.cs
│ │ │ ├── Entity.cs
│ │ │ ├── EntityColor.cs
│ │ │ ├── Explosion.cs
│ │ │ ├── Fire.cs
│ │ │ ├── HighTemperatureFire.cs
│ │ │ ├── Leaves.cs
│ │ │ └── StateMachine
│ │ │ │ ├── IState.cs
│ │ │ │ ├── StateMachine.cs
│ │ │ │ ├── States
│ │ │ │ ├── IdleState.cs
│ │ │ │ └── MovingState.cs
│ │ │ │ └── StatesEnum.cs
│ │ ├── FormatString.cs
│ │ ├── FrameSystem.cs
│ │ ├── IO
│ │ │ ├── SerializeData.cs
│ │ │ ├── Tags.cs
│ │ │ └── WorldIO.cs
│ │ ├── InputLogic
│ │ │ ├── Input.cs
│ │ │ ├── InputConfig.cs
│ │ │ └── TextInput.cs
│ │ ├── Items
│ │ │ ├── Inventory
│ │ │ │ ├── Inventory.cs
│ │ │ │ ├── ItemType.cs
│ │ │ │ └── Stack.cs
│ │ │ ├── Item.cs
│ │ │ ├── Loot.cs
│ │ │ ├── Recipe.cs
│ │ │ ├── Storage.cs
│ │ │ └── content
│ │ │ │ ├── food
│ │ │ │ ├── Apple.cs
│ │ │ │ ├── Food.cs
│ │ │ │ └── FoodItem.cs
│ │ │ │ ├── furniture
│ │ │ │ ├── AlfisolFloorItem.cs
│ │ │ │ ├── AnvilItem.cs
│ │ │ │ ├── BlackSoilIFloortem.cs
│ │ │ │ ├── BrokenLogItem.cs
│ │ │ │ ├── ChestItem.cs
│ │ │ │ ├── DoorItem.cs
│ │ │ │ ├── FloorItem.cs
│ │ │ │ ├── FurnaceItem.cs
│ │ │ │ ├── GraniteFloorItem.cs
│ │ │ │ ├── GraniteWallItem.cs
│ │ │ │ ├── PlaceableItem.cs
│ │ │ │ ├── RuineItem.cs
│ │ │ │ ├── SandFloorItem.cs
│ │ │ │ ├── TorchItem.cs
│ │ │ │ ├── WallItem.cs
│ │ │ │ ├── WoodFloorItem.cs
│ │ │ │ └── WorkbenchItem.cs
│ │ │ │ ├── materials
│ │ │ │ ├── AlfisolItem.cs
│ │ │ │ ├── BiotiteItem.cs
│ │ │ │ ├── BlackSoilItem.cs
│ │ │ │ ├── BrownIronOreItem.cs
│ │ │ │ ├── GraniteItem.cs
│ │ │ │ ├── IronBar.cs
│ │ │ │ ├── Log.cs
│ │ │ │ ├── QuartzItem.cs
│ │ │ │ ├── RubyItem.cs
│ │ │ │ ├── SaltItem.cs
│ │ │ │ ├── StoneItem.cs
│ │ │ │ ├── TreeSeed.cs
│ │ │ │ ├── WebItem.cs
│ │ │ │ └── ZoisiteItem.cs
│ │ │ │ ├── tools
│ │ │ │ ├── BombItem.cs
│ │ │ │ ├── IronHammer.cs
│ │ │ │ └── IronPick.cs
│ │ │ │ └── weapons
│ │ │ │ └── IronSword.cs
│ │ ├── Language.cs
│ │ ├── Light.cs
│ │ ├── Localization.cs
│ │ ├── Map.cs
│ │ ├── MapChunk.cs
│ │ ├── OpenSimplex.cs
│ │ ├── PerlinNoise.cs
│ │ ├── Player
│ │ │ ├── Cursor.cs
│ │ │ ├── Player.cs
│ │ │ ├── PlayerInfo.cs
│ │ │ └── PlayerMovement.cs
│ │ ├── Settings
│ │ │ ├── Docs.cs
│ │ │ ├── ExceptionLogger.cs
│ │ │ ├── Loger.cs
│ │ │ └── MessageType.cs
│ │ ├── SettingsSystem.cs
│ │ ├── SineNoise.cs
│ │ ├── Transform.cs
│ │ ├── UI
│ │ │ ├── Bar.cs
│ │ │ ├── BaseUI.cs
│ │ │ ├── CharPaintUtil
│ │ │ │ └── CharPaint.cs
│ │ │ ├── ChestUI.cs
│ │ │ ├── InfoPanel.cs
│ │ │ ├── ListUI.cs
│ │ │ ├── Menu
│ │ │ │ ├── ControlConfig.cs
│ │ │ │ ├── KeyPanel.cs
│ │ │ │ ├── Menu.cs
│ │ │ │ ├── MenuButton.cs
│ │ │ │ ├── MenuState.cs
│ │ │ │ └── ModList.cs
│ │ │ ├── ModPanel.cs
│ │ │ ├── OnlineModPanel.cs
│ │ │ ├── ProgressBar.cs
│ │ │ ├── RecipesUI.cs
│ │ │ ├── TextInputField.cs
│ │ │ ├── TextListUI.cs
│ │ │ └── WorldPanel.cs
│ │ ├── Utils.cs
│ │ └── WorldEngine
│ │ │ ├── Biomes
│ │ │ └── Biome.cs
│ │ │ ├── Chunk.cs
│ │ │ ├── Events
│ │ │ ├── GameEvent.cs
│ │ │ └── Rain.cs
│ │ │ ├── Field.cs
│ │ │ ├── Generate
│ │ │ ├── EmptyGenerator.cs
│ │ │ ├── Generator.cs
│ │ │ ├── LandspaceGenerator.cs
│ │ │ ├── Properties
│ │ │ │ └── NoisesProperties.cs
│ │ │ ├── Structures
│ │ │ │ ├── House.cs
│ │ │ │ ├── Structure.cs
│ │ │ │ ├── StructureMap.cs
│ │ │ │ └── Treasury.cs
│ │ │ ├── WorldGenUtils.cs
│ │ │ └── WorldPropertiesGenerator.cs
│ │ │ ├── IWorldObject.cs
│ │ │ ├── Levels
│ │ │ ├── Cavern.cs
│ │ │ ├── LavaCavern.cs
│ │ │ ├── Sedimentary.cs
│ │ │ ├── Surface.cs
│ │ │ └── UnloadWorldLevel.cs
│ │ │ ├── LoadedChunk.cs
│ │ │ ├── NoiseBuffer.cs
│ │ │ ├── Objects
│ │ │ ├── BrokenLog.cs
│ │ │ ├── Buildings
│ │ │ │ ├── Anvil.cs
│ │ │ │ ├── Chest.cs
│ │ │ │ ├── Climb.cs
│ │ │ │ ├── Descent.cs
│ │ │ │ ├── Door.cs
│ │ │ │ ├── Floor.cs
│ │ │ │ ├── Furnace.cs
│ │ │ │ ├── Torch.cs
│ │ │ │ └── Workbench.cs
│ │ │ ├── Charcoal.cs
│ │ │ ├── Floors
│ │ │ │ ├── CharcoalFloor.cs
│ │ │ │ ├── GraniteFloor.cs
│ │ │ │ └── WoodFloor.cs
│ │ │ ├── GraniteWall.cs
│ │ │ ├── Grass.cs
│ │ │ ├── Plank.cs
│ │ │ ├── Rocks
│ │ │ │ ├── Biotite.cs
│ │ │ │ ├── Granite.cs
│ │ │ │ ├── Ores
│ │ │ │ │ ├── BrownIronOre.cs
│ │ │ │ │ └── Ruby.cs
│ │ │ │ ├── Quartz.cs
│ │ │ │ ├── Salt.cs
│ │ │ │ ├── Soils
│ │ │ │ │ ├── Alfisol.cs
│ │ │ │ │ ├── AlfisolFloor.cs
│ │ │ │ │ ├── BlackSoil.cs
│ │ │ │ │ ├── BlackSoilFloor.cs
│ │ │ │ │ └── SandFloor.cs
│ │ │ │ ├── Stone.cs
│ │ │ │ └── Zoisite.cs
│ │ │ ├── Ruine.cs
│ │ │ ├── Seedling.cs
│ │ │ ├── Stalactite.cs
│ │ │ ├── TextMark.cs
│ │ │ ├── Trees
│ │ │ │ ├── AppleTree.cs
│ │ │ │ ├── PineTree.cs
│ │ │ │ ├── SpruceTree.cs
│ │ │ │ └── Tree.cs
│ │ │ ├── UnloadedTransform.cs
│ │ │ ├── Wall.cs
│ │ │ ├── Water.cs
│ │ │ └── Web.cs
│ │ │ ├── Observer.cs
│ │ │ ├── RenderFieldType.cs
│ │ │ ├── Renderer.cs
│ │ │ ├── SpawnCondition.cs
│ │ │ ├── Spawner.cs
│ │ │ ├── StringPaint.cs
│ │ │ ├── UnloadedChunk.cs
│ │ │ ├── VanillaTransforms.cs
│ │ │ ├── World.cs
│ │ │ ├── WorldLevel.cs
│ │ │ └── WorldLevelsSystem.cs
│ └── logoAnim.png
├── FontEditor.cs
├── Icon.ico
├── ModCreator.cs
├── NetworkManager.cs
├── Networks
│ ├── ClientObject.cs
│ ├── NetPacket.cs
│ └── Server.cs
├── Program.cs
├── TextAssets.cs
└── app.manifest
└── README.md
/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {}
5 | }
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 |
3 | # CS1591: Отсутствует комментарий XML для открытого видимого типа или члена
4 | dotnet_diagnostic.CS1591.severity = none
5 |
--------------------------------------------------------------------------------
/ConsoleAdventure.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.8.34511.84
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleAdventure", "ConsoleAdventure\ConsoleAdventure.csproj", "{A8BD34AF-63A0-4C87-BAFC-E9A40014C2A6}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F3F9FF8B-E0AC-414E-A1EC-F211502E6521}"
9 | ProjectSection(SolutionItems) = preProject
10 | .editorconfig = .editorconfig
11 | EndProjectSection
12 | EndProject
13 | Global
14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
15 | Debug|Any CPU = Debug|Any CPU
16 | Release|Any CPU = Release|Any CPU
17 | EndGlobalSection
18 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
19 | {A8BD34AF-63A0-4C87-BAFC-E9A40014C2A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20 | {A8BD34AF-63A0-4C87-BAFC-E9A40014C2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
21 | {A8BD34AF-63A0-4C87-BAFC-E9A40014C2A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
22 | {A8BD34AF-63A0-4C87-BAFC-E9A40014C2A6}.Release|Any CPU.Build.0 = Release|Any CPU
23 | EndGlobalSection
24 | GlobalSection(SolutionProperties) = preSolution
25 | HideSolutionNode = FALSE
26 | EndGlobalSection
27 | GlobalSection(ExtensibilityGlobals) = postSolution
28 | SolutionGuid = {2D46C511-5E79-4713-B3D8-8FBF266EDB2D}
29 | EndGlobalSection
30 | EndGlobal
31 |
--------------------------------------------------------------------------------
/ConsoleAdventure/.config/dotnet-tools.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "isRoot": true,
4 | "tools": {
5 | "dotnet-mgcb": {
6 | "version": "3.8.1.303",
7 | "commands": [
8 | "mgcb"
9 | ]
10 | },
11 | "dotnet-mgcb-editor": {
12 | "version": "3.8.1.303",
13 | "commands": [
14 | "mgcb-editor"
15 | ]
16 | },
17 | "dotnet-mgcb-editor-linux": {
18 | "version": "3.8.1.303",
19 | "commands": [
20 | "mgcb-editor-linux"
21 | ]
22 | },
23 | "dotnet-mgcb-editor-windows": {
24 | "version": "3.8.1.303",
25 | "commands": [
26 | "mgcb-editor-windows"
27 | ]
28 | },
29 | "dotnet-mgcb-editor-mac": {
30 | "version": "3.8.1.303",
31 | "commands": [
32 | "mgcb-editor-mac"
33 | ]
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/ConsoleAdventure/CaModLoaderAPI/EmptyMod.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Content.Scripts;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure.CaModLoaderAPI
9 | {
10 | internal class EmptyMod : IMod
11 | {
12 | ///
13 | /// Название папки мода
14 | ///
15 | public string dirName { get; set; }
16 |
17 | ///
18 | /// Название мода
19 | ///
20 | public string modName { get; set; } = "undefined";
21 |
22 | ///
23 | /// Версия мода
24 | ///
25 | public string modVersion { get; set; } = "1.0.0";
26 |
27 | ///
28 | /// Описание мода
29 | ///
30 | public string modDescription { get; set; } = "No description";
31 |
32 | ///
33 | /// Автор мода
34 | ///
35 | public string modAuthor { get; set; } = "Anonymous";
36 |
37 | ///
38 | /// Иконка мода
39 | ///
40 | public CharTexture modIcon { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ConsoleAdventure/CaModLoaderAPI/GlobalItem.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Content.Scripts.Player;
2 |
3 | namespace ConsoleAdventure.CaModLoaderAPI
4 | {
5 | public abstract class GlobalItem
6 | {
7 | public virtual string GetDescription(Item item)
8 | {
9 | return null;
10 | }
11 |
12 | public virtual bool? CanBePickedUp(Item item, Player player)
13 | {
14 | return null;
15 | }
16 |
17 | public virtual Recipe EditRecipes(Item item)
18 | {
19 | return null;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ConsoleAdventure/CaModLoaderAPI/GlobalPlayer.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Content.Scripts.Player;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure.CaModLoaderAPI
9 | {
10 | public class GlobalPlayer
11 | {
12 | public virtual bool OnTheScreen(Player player)
13 | {
14 | return true;
15 | }
16 |
17 | public virtual bool CraftItem(Player player, Recipe recipe)
18 | {
19 | return true;
20 | }
21 |
22 | public virtual bool? CanBuildAt(Player player, Position pos, int layer)
23 | {
24 | return null;
25 | }
26 |
27 | public virtual bool? CanDestroyAt(Player player, Position pos, int layer)
28 | {
29 | return null;
30 | }
31 |
32 | public virtual void PostInteractWithWorld(Player player)
33 | {
34 |
35 | }
36 |
37 | public virtual List SetStartItems(List startInventory)
38 | {
39 | return null;
40 | }
41 |
42 | public virtual void PostConnect(Player player)
43 | {
44 |
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/ConsoleAdventure/CaModLoaderAPI/IMod.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Content.Scripts;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure.CaModLoaderAPI
9 | {
10 | public interface IMod
11 | {
12 | ///
13 | /// Название папки мода
14 | ///
15 | public string dirName { get; set; }
16 |
17 | ///
18 | /// Название мода
19 | ///
20 | public string modName { get; set; }
21 |
22 | ///
23 | /// Версия мода
24 | ///
25 | public string modVersion { get; set; }
26 |
27 | ///
28 | /// Описание мода
29 | ///
30 | public string modDescription { get; set; }
31 |
32 | ///
33 | /// Автор мода
34 | ///
35 | public string modAuthor { get; set; }
36 |
37 | ///
38 | /// Иконка мода
39 | ///
40 | public CharTexture modIcon { get; set; }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ConsoleAdventure/CaModLoaderAPI/ModItem.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ConsoleAdventure.CaModLoaderAPI
4 | {
5 | [Serializable]
6 | public abstract class ModItem : Item
7 | {
8 | public virtual void Init()
9 | {
10 | name = "ModItem Name missing";
11 | description = "ModItem Description missing";
12 | }
13 |
14 | public ModItem() {
15 | Init();
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ConsoleAdventure/CaModLoaderAPI/ModTags.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Content.Scripts.IO;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure.CaModLoaderAPI
9 | {
10 | public class ModTags
11 | {
12 | string modName;
13 |
14 | Tags tags;
15 |
16 | public ModTags(Tags tags, string modName)
17 | {
18 | this.modName = modName;
19 | this.tags = tags;
20 | }
21 |
22 | public object this[string key]
23 | {
24 | get
25 | {
26 | return tags[modName + "." + key];
27 | }
28 | set
29 | {
30 | tags[modName + "." + key] = value;
31 | }
32 | }
33 |
34 | public T SafelyGet(string key)
35 | {
36 | return tags.SafelyGet(modName + "." + key);
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ConsoleAdventure/ColorAssets.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure
9 | {
10 | public class ColorAssets
11 | {
12 | public static readonly Color woodenColor = new Color(94, 61, 38);
13 | public static readonly Color graniteColor = new Color(45, 45, 45);
14 | public static readonly Color theLionColor = new Color(140, 102, 81);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ConsoleAdventure/ConsoleAdventure.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net6.0-windows
5 |
6 | Major
7 | false
8 | false
9 | true
10 | bin\Debug\net6.0-windows\ConsoleAdventure.xml
11 |
12 |
13 |
14 | true
15 | app.manifest
16 | Icon.ico
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Always
25 |
26 |
27 | Always
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/ConsoleAdventure/ConsoleAdventure.csproj.DEBUG:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net6.0-windows
5 |
6 | Major
7 | false
8 | false
9 |
10 |
11 |
12 | true
13 | app.manifest
14 | Icon.ico
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Always
23 |
24 |
25 | Always
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/AudioFiles/Music/ItsMagicRain.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdSayen/ConsoleAdventure/eefe459dbb5f531d66e530e0d5a9319808e1a20e/ConsoleAdventure/Content/AudioFiles/Music/ItsMagicRain.mp3
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/AudioFiles/Music/StrangeWorld.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdSayen/ConsoleAdventure/eefe459dbb5f531d66e530e0d5a9319808e1a20e/ConsoleAdventure/Content/AudioFiles/Music/StrangeWorld.mp3
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/AudioFiles/Music/WorldInsideOut.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AbdSayen/ConsoleAdventure/eefe459dbb5f531d66e530e0d5a9319808e1a20e/ConsoleAdventure/Content/AudioFiles/Music/WorldInsideOut.mp3
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Content.mgcb:
--------------------------------------------------------------------------------
1 |
2 | #----------------------------- Global Properties ----------------------------#
3 |
4 | /outputDir:bin/$(Platform)
5 | /intermediateDir:obj/$(Platform)
6 | /platform:Windows
7 | /config:
8 | /profile:Reach
9 | /compress:False
10 |
11 | #-------------------------------- References --------------------------------#
12 |
13 |
14 | #---------------------------------- Content ---------------------------------#
15 |
16 | #begin AudioFiles/Music/ItsMagicRain.mp3
17 | /importer:Mp3Importer
18 | /processor:SongProcessor
19 | /processorParam:Quality=Best
20 | /build:AudioFiles/Music/ItsMagicRain.mp3
21 |
22 | #begin AudioFiles/Music/StrangeWorld.mp3
23 | /importer:Mp3Importer
24 | /processor:SongProcessor
25 | /processorParam:Quality=Best
26 | /build:AudioFiles/Music/StrangeWorld.mp3
27 |
28 | #begin AudioFiles/Music/WorldInsideOut.mp3
29 | /importer:Mp3Importer
30 | /processor:SongProcessor
31 | /processorParam:Quality=Best
32 | /build:AudioFiles/Music/WorldInsideOut.mp3
33 |
34 | #begin Fonts/font.spritefont
35 | /importer:FontDescriptionImporter
36 | /processor:FontDescriptionProcessor
37 | /processorParam:PremultiplyAlpha=True
38 | /processorParam:TextureFormat=Compressed
39 | /build:Fonts/font.spritefont
40 |
41 | #begin logoAnim.png
42 | /importer:TextureImporter
43 | /processor:TextureProcessor
44 | /processorParam:ColorKeyColor=255,0,255,255
45 | /processorParam:ColorKeyEnabled=True
46 | /processorParam:GenerateMipmaps=False
47 | /processorParam:PremultiplyAlpha=True
48 | /processorParam:ResizeToPowerOfTwo=False
49 | /processorParam:MakeSquare=False
50 | /processorParam:TextureFormat=Color
51 | /build:logoAnim.png
52 |
53 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Fonts/font.spritefont:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Consolas
5 | 12
6 | 0
7 | true
8 |
9 |
10 |
11 |
12 |
13 | ⸗
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Abstracts/Rotation.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace ConsoleAdventure
4 | {
5 | [Serializable]
6 | public enum Rotation
7 | {
8 | up,
9 | upRight,
10 | right,
11 | rightDown,
12 | down,
13 | downLeft,
14 | left,
15 | upLeft
16 | }
17 | }
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Abstracts/Time.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 |
4 | namespace ConsoleAdventure
5 | {
6 | [Serializable]
7 | public class Time
8 | {
9 | public int day { get; private set; } = 1;
10 | public int hour { get; private set; } = 8;
11 | public int minute { get; private set; }
12 | public int second { get; private set; }
13 |
14 | private int multiplier = 1;
15 |
16 | public void PassTime(int secondsPass)
17 | {
18 | second += secondsPass * multiplier;
19 | Stack();
20 | }
21 |
22 | public string GetTime()
23 | {
24 | return $"{TextAssets.Day + day} {TextAssets.Time} {hour}:{minute.ToString("D2")}";
25 | }
26 |
27 | private void Stack()
28 | {
29 | while (hour >= 24)
30 | {
31 | day++;
32 | hour -= 24;
33 | }
34 | while (second >= 60)
35 | {
36 | minute++;
37 | second -= 60;
38 | }
39 | while (minute >= 60)
40 | {
41 | hour++;
42 | minute -= 60;
43 | }
44 | }
45 |
46 | public int GetDaySeconds()
47 | {
48 | return ((hour * 3600) + (minute * 60) + second);
49 | }
50 |
51 | public int GetAllSeconds()
52 | {
53 | return (day * 86400) + (hour * 3600) + (minute * 60) + second;
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Buffs/Buff.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Microsoft.Xna.Framework;
4 | using Microsoft.Xna.Framework.Graphics;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace ConsoleAdventure.Content.Scripts
10 | {
11 | public class Buff
12 | {
13 | public int time;
14 | public int maxTime;
15 |
16 | public void SetMaxTime(int time)
17 | {
18 | maxTime = time;
19 | this.time = time;
20 | }
21 |
22 | public Buff(int time)
23 | {
24 | SetMaxTime(time);
25 | }
26 |
27 | public virtual void Update(Entity entity)
28 | {
29 | }
30 |
31 | public virtual CharTexture GetTexture()
32 | {
33 | return new CharTexture().AddLayer("B");
34 | }
35 |
36 | public void Draw(SpriteBatch spriteBatch, Vector2 position)
37 | {
38 | Color color = Color.White * ((float)(time) / (float)(maxTime));
39 | spriteBatch.DrawFrame(ConsoleAdventure.Font, TextAssets.NormalFrame3x2, position, color);
40 |
41 | GetTexture().Draw(spriteBatch, position + new Vector2(7, 9));
42 | }
43 |
44 | public virtual string GetName()
45 | {
46 | return Localization.GetTranslation("Buffs", GetType().Name);
47 | }
48 |
49 | public virtual string GetDescription()
50 | {
51 | return Localization.GetTranslation("BuffDescription", GetType().Name);
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Buffs/InTheFlames.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Xna.Framework;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace ConsoleAdventure.Content.Scripts
10 | {
11 | public class InTheFlames : Buff
12 | {
13 | public InTheFlames(int time) : base(time)
14 | {
15 | }
16 |
17 | float timer = -1;
18 | public override CharTexture GetTexture()
19 | {
20 | timer++;
21 | return new CharTexture()
22 | .AddLayer("●", Color.OrangeRed, new(-0.58f, -0.03f))
23 | .AddLayer("•", Color.OrangeRed * 0.8f, new Vector2(0.42f + (float)(Math.Sin(timer / 30 * Math.PI) / 2), -2.4f))
24 | .AddLayer("•", Color.Orange * (float)(1 + Math.Sin(timer / 60 * Math.PI) / 4), new(0.2f, -0.03f));
25 | }
26 |
27 | public override void Update(Entity entity)
28 | {
29 | if(time % 30 == 0)
30 | {
31 | entity.life -= 1;
32 | }
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/ChunkCommand.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.WorldEngine;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
9 | {
10 | public class ChunkCommand : Command
11 | {
12 | public ChunkCommand()
13 | {
14 | Name = "chunk";
15 | Description = "???";
16 | Arguments = new List()
17 | {
18 | "attribute",
19 | "x",
20 | "y"
21 | };
22 | }
23 |
24 | public override void Logic(string[] args, short id = -2)
25 | {
26 | string a = GetStringArg(args, "attribute");
27 | int x = GetIntArg(args, "x");
28 | int y = GetIntArg(args, "y");
29 |
30 | try
31 | {
32 | if (a == "load")
33 | {
34 | ConsoleAdventure.world.LoadChunk(x, y, false);
35 | }
36 |
37 | if (a == "unload")
38 | {
39 | ConsoleAdventure.world.UnloadChunk(x, y);
40 | }
41 | }
42 |
43 | catch (Exception)
44 | {
45 | if(a == "a")
46 | {
47 |
48 | }
49 | }
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/GetItem.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Settings;
2 | using ConsoleAdventure.WorldEngine;
3 | using SharpDX.DirectWrite;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
11 | {
12 | public class GetItem: Command
13 | {
14 | public GetItem()
15 | {
16 | Name = "item";
17 | Description = "gives the player \nan item";
18 | Arguments = new List()
19 | {
20 | "name",
21 | "count",
22 | "namespace"
23 | };
24 | }
25 |
26 | public override void Logic(string[] args, short id = -2)
27 | {
28 | try
29 | {
30 | string name = GetStringArg(args, "name");
31 | int count = GetIntArg(args, "count");
32 | string namespace_ = "ConsoleAdventure";
33 | if (args.Length >= 3)
34 | namespace_ = GetStringArg(args, "namespace");
35 |
36 | try
37 | {
38 | Type[] type = new Type[2] { Type.GetType(namespace_ + "." + name), Type.GetType(namespace_ + "." + name + "Item") };
39 |
40 | for (int i = 0; i < type.Length; i++)
41 | {
42 | if (type[i] != null && type[i].IsSubclassOf(typeof(Item)))
43 | {
44 | if (count < 1) count = 1;
45 |
46 | Item item = (Item)Activator.CreateInstance(type[i]);
47 | if (id == -2) id = NetworkManager.Id;
48 | if (id == -1) id = 0;
49 | Player.Player pl = ConsoleAdventure.world.players[id];
50 | pl.inventory.PickUpItems(new List() { new Stack(item, count) });
51 | break;
52 | }
53 | }
54 | }
55 |
56 | catch (Exception) { }
57 | }
58 | catch
59 | {
60 | Loger.AddLog("Неверный формат аргумента!");
61 | }
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/GodMod.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Settings;
2 | using ConsoleAdventure.WorldEngine;
3 | using SharpDX.DirectWrite;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
11 | {
12 | public class GodMode : Command
13 | {
14 | public GodMode()
15 | {
16 | Name = "godmode";
17 | Description = "set/reset god mode";
18 | Arguments = new List()
19 | {
20 | };
21 | }
22 |
23 | public override void Logic(string[] args, short id = -2)
24 | {
25 | ConsoleAdventure.GodMode = !ConsoleAdventure.GodMode;
26 | if (ConsoleAdventure.GodMode) Loger.AddLog("god mode activated!");
27 | if (!ConsoleAdventure.GodMode) Loger.AddLog("god mode deactivated!");
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/HackLight.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Settings;
2 | using ConsoleAdventure.WorldEngine;
3 | using SharpDX.DirectWrite;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
11 | {
12 | public class HackLight : Command
13 | {
14 | public HackLight()
15 | {
16 | Name = "hacklight";
17 | Description = "gives a complete initial\nvision";
18 | Arguments = new List()
19 | {
20 | };
21 | }
22 |
23 | public override void Logic(string[] args, short id = -2)
24 | {
25 | Light.hackLight = !Light.hackLight;
26 | if (Light.hackLight) Loger.AddLog("now you can see in the\ndark!");
27 | if (!Light.hackLight) Loger.AddLog("you stopped seeing in\nthe dark!");
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/Help.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Settings;
2 | using ConsoleAdventure.WorldEngine;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
10 | {
11 | public class Help : Command
12 | {
13 | public Help()
14 | {
15 | Name = "help";
16 | Description = "help for commands";
17 | Arguments = new List()
18 | {
19 | "command"
20 | };
21 | }
22 |
23 | public override void Logic(string[] args, short id = -1)
24 | {
25 | try
26 | {
27 | if (args.Length < 1)
28 | {
29 | for (int i = 0; i < Commands.Count; i++)
30 | {
31 | Loger.AddLog(GetCommandHelp(Commands.ElementAt(i).Key));
32 | }
33 | }
34 | else
35 | {
36 | string name = GetStringArg(args, "command");
37 | if (Commands.Keys.Contains(name))
38 | Loger.AddLog(GetCommandHelp(name) + "\n " + Commands[name].Description.Replace("\n", "\n "));
39 | }
40 | }
41 |
42 | catch (Exception) { }
43 | }
44 |
45 | private string GetCommandHelp(string cmd)
46 | {
47 | Command command = Commands[cmd];
48 | string argsText = "";
49 |
50 | for (int j = 0; j < command.Arguments.Count; j++)
51 | {
52 | argsText += command.Arguments[j];
53 | if (j < command.Arguments.Count - 1)
54 | argsText += ", ";
55 | }
56 |
57 | return command.Name + " - " + argsText;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/PlaceTextMark.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Settings;
2 | using ConsoleAdventure.WorldEngine;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using static System.Net.Mime.MediaTypeNames;
9 |
10 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
11 | {
12 | public class PlaceTextMark : Command
13 | {
14 | public PlaceTextMark()
15 | {
16 | Name = "textmark";
17 | Description = "place a text in world";
18 | Arguments = new List()
19 | {
20 | "text"
21 | };
22 | }
23 |
24 | public override void Logic(string[] args, short id = -1)
25 | {
26 | try
27 | {
28 | StringBuilder stringBuilder = new StringBuilder();
29 | for (int i = 0; i < args.Length; i++)
30 | {
31 | stringBuilder.Append(args[i]);
32 |
33 | if (i != args.Length - 1)
34 | {
35 | stringBuilder.Append(" ");
36 | }
37 | }
38 |
39 | Position position = ConsoleAdventure.world.GetLocalPlayer().position;
40 | (new TextMark(position, ConsoleAdventure.world.Surface)).LoadData(stringBuilder.ToString());
41 | }
42 |
43 | catch (Exception) { }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/PlaceTrees.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Settings;
2 | using ConsoleAdventure.WorldEngine;
3 | using SharpDX.DirectWrite;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Reflection;
8 | using System.Text;
9 | using System.Threading.Tasks;
10 |
11 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
12 | {
13 | public class PlaceTrees : Command
14 | {
15 | public PlaceTrees()
16 | {
17 | Name = "placetrees";
18 | Description = "place all trees";
19 | Arguments = new List()
20 | {
21 | };
22 | }
23 |
24 | public override void Logic(string[] args, short id = -2)
25 | {
26 | int chunk = 0;
27 |
28 | Type baseType = typeof(Transform);
29 | IEnumerable list = Assembly.GetAssembly(baseType).GetTypes().Where(type => type.IsSubclassOf(baseType)).ToList().Concat(CaModLoader.modTransforms);
30 | foreach (Type type in list)
31 | {
32 | if (type.IsAbstract)
33 | continue;
34 |
35 | if (type.IsSubclassOf(typeof(Tree)))
36 | {
37 | Position position = new Position(8, 8) + new Position(chunk * 16, 0);
38 |
39 | ConsoleAdventure.world.chunks[chunk, 0] = new LoadedChunk();
40 | Transform.Init(type, position, ConsoleAdventure.world.Surface, null, null);
41 |
42 | string text = ConsoleAdventure.world.GetField(position, World.BlocksLayerId, ConsoleAdventure.world.Surface)?.content?.ModifyTooltip() ?? "~*??*~";
43 | (new TextMark(position + new Position(0, 5), ConsoleAdventure.world.Surface)).LoadData(text);
44 |
45 | ConsoleAdventure.world.chunks[chunk, 0].IsUpdated = true;
46 | chunk++;
47 | }
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/SetTime.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.WorldEngine;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
9 | {
10 | public class SetTime : Command
11 | {
12 | public SetTime()
13 | {
14 | Name = "addtime";
15 | Description = "set world time";
16 | Arguments = new List()
17 | {
18 | "hours",
19 | "mins"
20 | };
21 | }
22 |
23 | public override void Logic(string[] args, short id = -2)
24 | {
25 |
26 | int h = GetIntArg(args, "hours");
27 | int m = GetIntArg(args, "mins");
28 |
29 | try
30 | {
31 | ConsoleAdventure.world.time.PassTime((h * 3600) + (m * 60));
32 | }
33 |
34 | catch (Exception) { }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/ShowTypes.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.Settings;
2 | using ConsoleAdventure.WorldEngine;
3 | using SharpDX.DirectWrite;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
11 | {
12 | public class ShowTypes : Command
13 | {
14 | public ShowTypes()
15 | {
16 | Name = "showtypes";
17 | Description = "on/off display types";
18 | Arguments = new List()
19 | {
20 | };
21 | }
22 |
23 | public override void Logic(string[] args, short id = -2)
24 | {
25 | ConsoleAdventure.ShowTypes = !ConsoleAdventure.ShowTypes;
26 | if (ConsoleAdventure.ShowTypes) Loger.AddLog("types is shown!");
27 | if (!ConsoleAdventure.ShowTypes) Loger.AddLog("types is hidden!");
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Debug/Commands/TeleportPlayer.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.WorldEngine;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace ConsoleAdventure.Content.Scripts.Debug.Commands
9 | {
10 | public class TeleportPlayer : Command
11 | {
12 | public TeleportPlayer()
13 | {
14 | Name = "tp";
15 | Description = "teleports the player \nto specified coordinates";
16 | Arguments = new List()
17 | {
18 | "x",
19 | "y"
20 | };
21 | }
22 |
23 | public override void Logic(string[] args, short id = -2)
24 | {
25 |
26 | int x = GetIntArg(args, "x");
27 | int y = GetIntArg(args, "y");
28 |
29 | try
30 | {
31 | if (x < 0)
32 | return;
33 | if (y < 0)
34 | return;
35 | if (x > ConsoleAdventure.world.size)
36 | return;
37 | if (y > ConsoleAdventure.world.size)
38 | return;
39 |
40 | if (id == -2) id = NetworkManager.Id;
41 | if (id == -1) id = 0;
42 | Player.Player pl = ConsoleAdventure.world.players[id];
43 | pl.SetPosition(new(x, y));
44 | }
45 |
46 | catch (Exception) { }
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Entities/EntityColor.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.WorldEngine;
2 | using Microsoft.Xna.Framework;
3 |
4 | namespace ConsoleAdventure.Content.Scripts.Entities;
5 |
6 | public class EntityColor
7 | {
8 | public Color[] Colors = new Color[9]
9 | {
10 | new Color(50, 50, 50),
11 | new Color(131, 105, 44),
12 | new Color(193, 138, 45),
13 | new Color(243, 171, 51),
14 | new Color(140, 147, 153),
15 | new Color(255, 255, 255),
16 | new Color(196, 207, 211),
17 | new Color(250, 194, 45),
18 | new Color(240, 210, 80),
19 | };
20 |
21 | public int ColorIndex { get; set; }
22 |
23 | public EntityColor()
24 | {
25 | ColorIndex = ConsoleAdventure.rand.Next(0, Colors.Length);
26 | }
27 |
28 | public void ChooseColor(Position position, int w)
29 | {
30 | SetColor(Colors[ColorIndex], position, w);
31 | }
32 |
33 | private void SetColor(Color color, Position position, int w)
34 | {
35 | //ConsoleAdventure.world.GetField(position.x, position.y, World.MobsLayerId, w).content.color = color;
36 | }
37 | }
--------------------------------------------------------------------------------
/ConsoleAdventure/Content/Scripts/Entities/Explosion.cs:
--------------------------------------------------------------------------------
1 | using ConsoleAdventure.WorldEngine;
2 | using Microsoft.Xna.Framework;
3 | using System;
4 | using System.Collections.Generic;
5 | using ConsoleAdventure.Content.Scripts.Entities.StateMachine;
6 | using System.Reflection;
7 | using System.Threading;
8 |
9 | namespace ConsoleAdventure.Content.Scripts
10 | {
11 | [Serializable]
12 | public class Explosion : Entity
13 | {
14 | static string[] Symbols = new string[]
15 | {
16 | " ",
17 | "@@",
18 | "¼¼",
19 | "÷÷",
20 | "\\\\",
21 | "~~",
22 | "··"
23 | };
24 |
25 | int frame;
26 |
27 | public Explosion(Position position, int w, List