├── texts ├── thenine_blank.txt ├── bookofdays_blank.txt ├── casinogames_blank.txt ├── gamehistory_blank.txt ├── kellhistory_blank.txt ├── keybindings_blank.txt ├── oneternalism_blank.txt ├── roguelikes_blank.txt ├── strategy_blank.txt ├── titlepoem10_blank.txt ├── titlepoem11_blank.txt ├── titlepoem12_blank.txt ├── titlepoem13_blank.txt ├── titlepoem2_blank.txt ├── titlepoem3_blank.txt ├── titlepoem4_blank.txt ├── titlepoem5_blank.txt ├── titlepoem6_blank.txt ├── titlepoem7_blank.txt ├── titlepoem8_blank.txt ├── titlepoem9_blank.txt ├── titlepoem_blank.txt ├── yewhistory_blank.txt ├── faeriefragment_blank.txt ├── gnordvarhistory_blank.txt ├── isendunchronicle_blank.txt ├── shrines_history_blank.txt ├── stoneheimhistory_blank.txt ├── tel_and_floridel_blank.txt ├── titlepoem4_en.txt ├── titlepoem6_en.txt ├── titlepoem12_en.txt ├── titlepoem5_en.txt ├── titlepoem13_en.txt ├── titlepoem7_en.txt ├── titlepoem8_en.txt ├── titlepoem9_en.txt ├── titlepoem3_en.txt └── titlepoem11_en.txt ├── logs ├── .gitignore └── README ├── asset_zip.sh ├── world ├── tiles │ ├── source │ │ ├── unit_tests │ │ │ ├── StaircaseTile_test.cpp │ │ │ ├── BushTile_test.cpp │ │ │ └── RoadTile_test.cpp │ │ ├── StaircaseTile.cpp │ │ ├── TreeSpecies.cpp │ │ └── WeatherProperties.cpp │ ├── include │ │ ├── TreeSpeciesFactory.hpp │ │ ├── WeatherProperties.hpp │ │ ├── DigChancesFactory.hpp │ │ ├── CairnTile.hpp │ │ ├── WheatTile.hpp │ │ ├── PierTile.hpp │ │ ├── ReedsTile.hpp │ │ ├── RoadTile.hpp │ │ ├── RockyEarthTile.hpp │ │ ├── ScrubTile.hpp │ │ ├── BeachTile.hpp │ │ ├── HillsTile.hpp │ │ ├── GraveTile.hpp │ │ ├── GraveyardTile.hpp │ │ ├── BarrowTile.hpp │ │ ├── WellTile.hpp │ │ ├── FruitTreeTile.hpp │ │ ├── WildOrchardTile.hpp │ │ ├── MagicalTreeTile.hpp │ │ ├── EvergreenTreeTile.hpp │ │ ├── FieldTile.hpp │ │ └── SewerTile.hpp │ └── features │ │ ├── include │ │ ├── EntranceTypes.hpp │ │ └── FeatureProperties.hpp │ │ └── source │ │ └── unit_tests │ │ ├── Bed_test.cpp │ │ ├── EntranceState_test.cpp │ │ ├── Forge_test.cpp │ │ ├── Table_test.cpp │ │ ├── Bench_test.cpp │ │ ├── Pulper_test.cpp │ │ ├── Tannery_test.cpp │ │ ├── Fountain_test.cpp │ │ ├── StoneMarker_test.cpp │ │ ├── WheelAndLoom_test.cpp │ │ ├── EastWestPew_test.cpp │ │ └── JewelerWorkbench_test.cpp ├── include │ ├── WeaponTypes.hpp │ ├── AlignmentEnums.hpp │ ├── InventoryFactory.hpp │ ├── WeavingConstants.hpp │ ├── MapFactory.hpp │ ├── CreatureTypes.hpp │ ├── RaceConstants.hpp │ ├── RarityTypes.hpp │ ├── Ring.hpp │ ├── Amulet.hpp │ ├── BrandConstants.hpp │ ├── SmithingConstants.hpp │ ├── Armour.hpp │ ├── DamageFlagFactory.hpp │ ├── StatisticTypes.hpp │ ├── GenerationProperties.hpp │ ├── WaterTypes.hpp │ ├── IntelligenceConstants.hpp │ ├── MiscItem.hpp │ ├── Boat.hpp │ ├── Staff.hpp │ └── DamageFlag.hpp ├── materials │ ├── source │ │ └── Material.cpp │ └── include │ │ └── MaterialFactory.hpp ├── religion │ └── include │ │ ├── ReligionFactory.hpp │ │ └── ChampionTypes.hpp ├── magic │ ├── include │ │ ├── EffectProperties.hpp │ │ └── SpellShapeFactory.hpp │ └── source │ │ └── EffectProperties.cpp └── source │ ├── RaceConstants.cpp │ ├── WeavingConstants.cpp │ ├── MapTypes.cpp │ ├── CreatureTypes.cpp │ ├── BrandConstants.cpp │ ├── unit_tests │ └── Race_test.cpp │ ├── SmithingConstants.cpp │ ├── ThreatConstants.cpp │ └── IntelligenceConstants.cpp ├── SDL2.dll ├── zlib1.dll ├── codebase.bat ├── pdcurses.dll ├── sotw_icon.ico ├── sotw_procdump.bat ├── SDL2_image.dll ├── SDL2_mixer.dll ├── docs ├── Guide.pdf ├── Commands.pdf └── src │ ├── Commands.tex │ └── generate_docs.sh ├── item_sprites.xcf ├── libpng16-16.dll ├── licenses └── lua.txt ├── sotw_music.fms ├── sys_sprites.xcf ├── xerces-c_3_3.dll ├── engine ├── creatures │ ├── source │ │ └── unit_tests │ │ │ └── StatusEffect_test.cpp │ └── include │ │ ├── CreatureStatusTypes.hpp │ │ ├── CreatureGenerationOptionsStringBuilder.hpp │ │ ├── NPCSkillDistributor.hpp │ │ ├── AirSafetyCondition.hpp │ │ ├── WaterSafetyCondition.hpp │ │ └── GroundSafetyCondition.hpp ├── decision_strategies │ ├── search │ │ ├── source │ │ │ └── GreedySearchStrategy.cpp │ │ └── include │ │ │ ├── SearchTypes.hpp │ │ │ ├── GreedySearchStrategy.hpp │ │ │ ├── BreadthFirstSearchStrategy.hpp │ │ │ └── SearchStrategyFactory.hpp │ ├── deity │ │ └── include │ │ │ ├── DeityDecisionTypes.hpp │ │ │ └── DeityDecisionStrategyFactory.hpp │ ├── include │ │ └── NPCDropDecisionStrategy.hpp │ └── magic │ │ ├── include │ │ ├── NPCMagicDecisionFactory.hpp │ │ ├── INPCEffectDecider.hpp │ │ ├── AttackNPCMagicDecision.hpp │ │ └── NullNPCMagicDecision.hpp │ │ └── source │ │ └── NullNPCMagicDecision.cpp ├── include │ ├── MessageSpacing.hpp │ ├── HighScoreConstants.hpp │ ├── LogFiles.hpp │ ├── ClassManager.hpp │ ├── AlignmentUtils.hpp │ ├── DeityUtils.hpp │ ├── FileWriter.hpp │ ├── SettingKeybindings.hpp │ └── Messages.hpp ├── field_of_view │ └── include │ │ ├── FieldOfViewTypes.hpp │ │ └── BresenhamLine.hpp ├── serialization │ └── include │ │ └── SerializationTypes.hpp ├── commands │ ├── select_tile │ │ ├── include │ │ │ ├── SelectTileTypes.hpp │ │ │ └── TileSelectionRangeChecker.hpp │ │ └── source │ │ │ └── unit_tests │ │ │ └── TileSelectionCommandFactory_test.cpp │ ├── source │ │ └── unit_tests │ │ │ └── CommandFactory_test.cpp │ ├── include │ │ └── IKeyboardCommandMap.hpp │ ├── skills │ │ ├── include │ │ │ ├── SkillsCommandProcessorFactory.hpp │ │ │ └── ShowSkillsCommandProcessor.hpp │ │ └── source │ │ │ └── unit_tests │ │ │ ├── SkillsCommandFactory_test.cpp │ │ │ └── SkillsKeyboardCommandMap_test.cpp │ ├── help │ │ ├── source │ │ │ └── unit_tests │ │ │ │ ├── HelpCommandFactory_test.cpp │ │ │ │ └── HelpKeyboardCommandMap_test.cpp │ │ └── include │ │ │ └── HelpCommandProcessor.hpp │ ├── magic │ │ └── source │ │ │ └── unit_tests │ │ │ └── MagicCommandFactory_test.cpp │ ├── order │ │ ├── source │ │ │ └── unit_tests │ │ │ │ ├── OrderCommandFactory_test.cpp │ │ │ │ └── OrderKeyboardCommandMap_test.cpp │ │ └── include │ │ │ └── OrderCommandProcessor.hpp │ ├── screens │ │ ├── include │ │ │ ├── ScreenCommandKeys.hpp │ │ │ └── ScreenCommands.hpp │ │ └── source │ │ │ ├── unit_tests │ │ │ └── ScreenCommandFactory_test.cpp │ │ │ └── ScreenCommandKeys.cpp │ ├── equipment │ │ └── source │ │ │ └── unit_tests │ │ │ └── EquipmentCommandFactory_test.cpp │ └── inventory │ │ └── source │ │ └── unit_tests │ │ └── InventoryCommandFactory_test.cpp ├── items │ ├── include │ │ ├── LuaItemFilter.hpp │ │ ├── IItemFilter.hpp │ │ ├── ArtifactItemFilter.hpp │ │ ├── ItemFactory.hpp │ │ ├── EdibleItemFilter.hpp │ │ ├── ItemUnpaidFilter.hpp │ │ ├── ReadableItemFilter.hpp │ │ └── UnidentifiedItemFilter.hpp │ └── source │ │ ├── ArtifactItemFilter.cpp │ │ ├── NullItemFilter.cpp │ │ ├── ReadableItemFilter.cpp │ │ ├── unit_tests │ │ └── NullItemFilter_test.cpp │ │ └── UnidentifiedItemFilter.cpp ├── generators │ ├── include │ │ ├── PillarTypes.hpp │ │ ├── CellularAutomataTypes.hpp │ │ ├── HillsGenerator.hpp │ │ ├── SeaGenerator.hpp │ │ ├── DesertGenerator.hpp │ │ ├── PillarGeneratorFactory.hpp │ │ └── SkyGenerator.hpp │ ├── crypts │ │ └── include │ │ │ ├── CryptLayoutTypes.hpp │ │ │ ├── CryptLayoutStrategyFactory.hpp │ │ │ ├── EmptyCryptLayoutStrategy.hpp │ │ │ └── PillarCryptLayoutStrategy.hpp │ ├── rooms │ │ ├── source │ │ │ └── NullRoomGenerator.cpp │ │ └── include │ │ │ ├── RoomGeneratorFactory.hpp │ │ │ ├── DankRoomGenerator.hpp │ │ │ ├── NullRoomGenerator.hpp │ │ │ ├── BasicRoomGenerator.hpp │ │ │ ├── RoomTypes.hpp │ │ │ └── IRoomGenerator.hpp │ ├── tile_config │ │ ├── source │ │ │ ├── DefaultTileConfiguration.cpp │ │ │ └── WheatTileConfiguration.cpp │ │ └── include │ │ │ ├── CairnTileConfiguration.hpp │ │ │ ├── WheatTileConfiguration.hpp │ │ │ ├── WeedsTileConfiguration.hpp │ │ │ ├── EvergreenTreeTileConfiguration.hpp │ │ │ ├── AquaticVegetationTileConfiguration.hpp │ │ │ └── DefaultTileConfiguration.hpp │ ├── fortresses │ │ ├── include │ │ │ ├── KeepRuinsGenerator.hpp │ │ │ ├── CastleGeneratorStrategyFactory.hpp │ │ │ └── CastleGeneratorStrategy.hpp │ │ └── source │ │ │ └── KeepRuinsGenerator.cpp │ ├── settlements │ │ ├── include │ │ │ ├── SettlementTypes.hpp │ │ │ └── SettlementRuinsGenerator.hpp │ │ └── sector │ │ │ ├── include │ │ │ ├── GardenTypes.hpp │ │ │ ├── SectorFeatureGeneratorFactory.hpp │ │ │ ├── CitySectorGenerator.hpp │ │ │ ├── ShopSectorFeature.hpp │ │ │ ├── GraveyardSectorFeature.hpp │ │ │ └── StorehouseSectorFeature.hpp │ │ │ └── source │ │ │ └── DefaultSectorFeatureGenerator.cpp │ ├── worship_sites │ │ ├── source │ │ │ └── ChurchGeneratorFactory.cpp │ │ └── include │ │ │ ├── ChurchGeneratorFactory.hpp │ │ │ └── WorshipSiteGenerator.hpp │ └── source │ │ └── unit_tests │ │ └── PillarGeneratorFactory_test.cpp ├── maps │ ├── tiles │ │ ├── source │ │ │ └── NullTileDamageProcessor.cpp │ │ ├── include │ │ │ ├── TileManipulatorFactory.hpp │ │ │ ├── GraveTileManipulator.hpp │ │ │ ├── NullTileDamageProcessor.hpp │ │ │ ├── TileDamageProcessorFactory.hpp │ │ │ ├── AcidTileDamageProcessor.hpp │ │ │ ├── ColdTileDamageProcessor.hpp │ │ │ ├── HeatTileDamageProcessor.hpp │ │ │ └── ITileManipulator.hpp │ │ └── features │ │ │ ├── source │ │ │ └── FeatureManipulator.cpp │ │ │ └── include │ │ │ ├── EvilAltarManipulator.hpp │ │ │ ├── GoodAltarManipulator.hpp │ │ │ ├── NeutralAltarManipulator.hpp │ │ │ └── IFeatureManipulatorFactory.hpp │ ├── include │ │ ├── MapMovementTypes.hpp │ │ ├── MapTypeQueryFactory.hpp │ │ ├── MapTypeQueries.hpp │ │ └── IMapTypeQuery.hpp │ └── source │ │ ├── unit_tests │ │ └── MapRegistry_test.cpp │ │ └── MapTypeQueries.cpp ├── skills │ ├── include │ │ ├── FishingTypes.hpp │ │ ├── StealthSkillProcessor.hpp │ │ ├── HidingSkillProcessor.hpp │ │ ├── SwimmingSkillProcessor.hpp │ │ ├── MountainLoreSkillProcessor.hpp │ │ ├── DetectionSkillProcessor.hpp │ │ └── SkillProcessorFactory.hpp │ └── source │ │ └── SkillProcessor.cpp ├── calculators │ ├── include │ │ ├── SeedCalculator.hpp │ │ ├── MeleeWeaponRangeCalculator.hpp │ │ ├── ThieveryCalculator.hpp │ │ ├── FoodCalculator.hpp │ │ ├── StealthCalculator.hpp │ │ ├── CalcUtils.hpp │ │ ├── ForagablesCalculator.hpp │ │ ├── MineCalculator.hpp │ │ ├── FieldCalculator.hpp │ │ ├── DangerLevelProperties.hpp │ │ ├── PrimordialCalculator.hpp │ │ ├── HitPointsCalculator.hpp │ │ ├── IHitTypeFactory.hpp │ │ ├── ReadCalculator.hpp │ │ ├── ItemDropRateCalculator.hpp │ │ ├── ArcanaPointsCalculator.hpp │ │ ├── FenceCalculator.hpp │ │ ├── NullAttackSpeedCalculator.hpp │ │ ├── WandsCombatSkillMarker.hpp │ │ ├── RangedAttackSpeedCalculator.hpp │ │ ├── RangedCombatSkillMarker.hpp │ │ ├── MagicalCombatSkillMarker.hpp │ │ ├── MagicalAttackSpeedCalculator.hpp │ │ ├── ModifyStatisticsCalculator.hpp │ │ ├── BaseDangerLevelCalculator.hpp │ │ ├── SkillMarkerFactory.hpp │ │ ├── PapercraftCalculator.hpp │ │ ├── ScythingCalculator.hpp │ │ ├── ScoreConstants.hpp │ │ ├── SmithingCalculator.hpp │ │ ├── FishingCalculator.hpp │ │ ├── ScribingCalculator.hpp │ │ ├── CreatureToHitCalculator.hpp │ │ ├── WandsToHitCalculator.hpp │ │ ├── CreatureCalculator.hpp │ │ ├── KilnCalculator.hpp │ │ ├── AttackSpeedCalculatorFactory.hpp │ │ ├── WandsAttackSpeedCalculator.hpp │ │ ├── CowardiceCalculator.hpp │ │ ├── CreatureAdditionalDamageCalculator.hpp │ │ ├── UnarmedCombatCalculator.hpp │ │ └── WandsCombatTargetNumberCalculator.hpp │ └── source │ │ ├── NullAttackSpeedCalculator.cpp │ │ ├── CalcUtils.cpp │ │ ├── DangerLevelProperties.cpp │ │ ├── WandsCombatSkillMarker.cpp │ │ ├── UntimedStatusCalculator.cpp │ │ ├── WandsCombatTargetNumberCalculator.cpp │ │ └── SeedCalculator.cpp ├── description │ ├── source │ │ └── IDescriber.cpp │ ├── codex │ │ ├── source │ │ │ └── ArmourCodexDescriber.cpp │ │ └── include │ │ │ ├── CodexDescriberFactory.hpp │ │ │ ├── ArmourCodexDescriber.hpp │ │ │ └── WandCodexDescriber.hpp │ └── include │ │ ├── IDescriber.hpp │ │ ├── BlindFeatureDescriber.hpp │ │ └── QuestDescriber.hpp ├── time │ ├── include │ │ ├── WorldTimeKeeperCoordinator.hpp │ │ ├── BoatingMovementAccumulationChecker.hpp │ │ ├── FallingMovementAccumulationChecker.hpp │ │ ├── RegenerationConstants.hpp │ │ ├── CreatureModifiers.hpp │ │ ├── CreatureStatuses.hpp │ │ ├── DefaultMovementAccumulationChecker.hpp │ │ └── SwimmingMovementAccumulationChecker.hpp │ └── source │ │ ├── unit_tests │ │ ├── AgeTimeObserver_test.cpp │ │ ├── MapTimeObserver_test.cpp │ │ ├── WorldTimeKeeper_test.cpp │ │ ├── ShopsTimeObserver_test.cpp │ │ ├── SpecialDayObserver_test.cpp │ │ ├── SeasonsTimeObserver_test.cpp │ │ ├── CreatureTimeObserver_test.cpp │ │ └── TileTransformObserver_test.cpp │ │ ├── RegenerationConstants.cpp │ │ └── BoatingMovementAccumulationChecker.cpp ├── source │ ├── HighScoreConstants.cpp │ └── unit_tests │ │ └── Game_test.cpp ├── magic │ ├── source │ │ └── ReflectiveBeamShapeProcessor.cpp │ └── include │ │ ├── ReflectiveBeamShapeProcessor.hpp │ │ └── TileMagicChecker.hpp ├── screens │ ├── include │ │ ├── WelcomeScreen.hpp │ │ ├── HelpScreen.hpp │ │ ├── SexSelectionScreen.hpp │ │ ├── EyeSelectionScreen.hpp │ │ ├── WornLocationScreenFactory.hpp │ │ ├── HairSelectionScreen.hpp │ │ ├── EquipmentScreen.hpp │ │ ├── OrderScreen.hpp │ │ └── LoadGameScreen.hpp │ └── source │ │ ├── unit_tests │ │ └── ComponentAlignment_test.cpp │ │ └── TextComponent.cpp ├── XML │ ├── custom_maps │ │ ├── features │ │ │ ├── include │ │ │ │ ├── XMLBedReader.hpp │ │ │ │ ├── XMLDoorReader.hpp │ │ │ │ ├── XMLKilnReader.hpp │ │ │ │ ├── XMLPewReader.hpp │ │ │ │ ├── XMLSignReader.hpp │ │ │ │ ├── XMLBarrelReader.hpp │ │ │ │ ├── XMLFenceReader.hpp │ │ │ │ ├── XMLForgeReader.hpp │ │ │ │ ├── XMLPulperReader.hpp │ │ │ │ ├── XMLTableReader.hpp │ │ │ │ ├── XMLBenchReader.hpp │ │ │ │ ├── XMLTanneryReader.hpp │ │ │ │ ├── XMLFountainReader.hpp │ │ │ │ ├── XMLStoneMarkerReader.hpp │ │ │ │ ├── XMLFirePillarReader.hpp │ │ │ │ ├── XMLSarcophagusReader.hpp │ │ │ │ ├── XMLSlotMachineReader.hpp │ │ │ │ ├── XMLDecorativeStatueReader.hpp │ │ │ │ ├── XMLWheelAndLoomReader.hpp │ │ │ │ ├── XMLJewelerWorkbenchReader.hpp │ │ │ │ ├── XMLAltarReader.hpp │ │ │ │ └── XMLConfigurableFeatureCMReader.hpp │ │ │ └── source │ │ │ │ └── XMLSignReader.cpp │ │ └── include │ │ │ └── XMLMapTilesReader.hpp │ ├── include │ │ ├── XMLModifierReader.hpp │ │ ├── XMLScrollReader.hpp │ │ ├── XMLResistancesReader.hpp │ │ ├── XMLRingReader.hpp │ │ ├── XMLConsumableReader.hpp │ │ ├── XMLSpellbookReader.hpp │ │ ├── XMLToolReader.hpp │ │ ├── XMLAmuletReader.hpp │ │ ├── XMLBaseFeatureReader.hpp │ │ ├── XMLWandReader.hpp │ │ ├── XMLBoatReader.hpp │ │ ├── XMLPotionReader.hpp │ │ ├── XMLReadableReader.hpp │ │ ├── XMLScriptsReader.hpp │ │ ├── XMLCalendarReader.hpp │ │ └── XMLTrapsReader.hpp │ └── source │ │ ├── XMLScrollReader.cpp │ │ ├── XMLBoatReader.cpp │ │ ├── XMLRingReader.cpp │ │ └── XMLFoodReader.cpp ├── combat │ ├── include │ │ ├── DamageText.hpp │ │ ├── LevelConstants.hpp │ │ ├── PlayerDeathManager.hpp │ │ ├── DeathManagerFactory.hpp │ │ └── HitTypes.hpp │ └── source │ │ └── LevelConstants.cpp ├── actions │ ├── include │ │ ├── CurrencyAction.hpp │ │ ├── LatestMessagesAction.hpp │ │ ├── ShowConductsAction.hpp │ │ ├── MovementAccumulationUpdater.hpp │ │ ├── VersionAction.hpp │ │ ├── BreedAction.hpp │ │ ├── DateTimeWeatherAction.hpp │ │ ├── ExperienceAction.hpp │ │ └── KeyManager.hpp │ └── read │ │ └── include │ │ └── ScrollReadStrategy.hpp ├── scripting │ ├── include │ │ ├── ScriptConstants.hpp │ │ └── MapScript.hpp │ └── source │ │ └── ScriptConstants.cpp ├── strings │ ├── include │ │ ├── PlayerTextKeys.hpp │ │ ├── MembershipTextKeys.hpp │ │ ├── WorldMapLocationTextKeys.hpp │ │ ├── VictoryTextKeys.hpp │ │ ├── FileConstants.hpp │ │ └── TileDangerConfirmationKeys.hpp │ └── source │ │ ├── PlayerTextKeys.cpp │ │ └── MembershipTextKeys.cpp ├── translators │ └── include │ │ ├── ItemTranslator.hpp │ │ ├── ViewMapTranslator.hpp │ │ └── EquipmentTranslator.hpp ├── effects │ └── include │ │ └── GainAttributesTypes.hpp └── conversion │ └── include │ ├── AttackDumper.hpp │ └── StatsDumper.hpp ├── xerces-c_3_3D.dll ├── creature_sprites.xcf ├── feature_sprites.xcf ├── terrain_sprites.xcf ├── get_assets.sh ├── scripts ├── quests │ ├── atuaelar │ │ ├── tir.lua │ │ └── mountain_elf_scholar.lua │ ├── telari │ │ ├── the_sentry.lua │ │ └── the_worldsinger.lua │ ├── carcassia │ │ ├── herbalist.lua │ │ ├── runic_student.lua │ │ ├── summonings_student.lua │ │ ├── evocations_student.lua │ │ ├── enchantments_student.lua │ │ ├── guild_greeter.lua │ │ ├── calabus.lua │ │ └── gambler.lua │ ├── magici_merchant.lua │ ├── fae_caravan │ │ └── eakauri.lua │ └── yew │ │ └── advisor.lua ├── areas │ ├── eka.lua │ ├── far_shore.lua │ ├── last_rock.lua │ ├── far_reaches.lua │ ├── events │ │ ├── wintersea_keep.lua │ │ ├── forest_of_yew.lua │ │ └── whalings_end.lua │ ├── infinite_sewer.lua │ └── infinite_dungeon.lua ├── death │ └── gas_cloud.lua ├── level │ ├── ogre.lua │ ├── giant.lua │ ├── goblin.lua │ ├── fae.lua │ └── warrior.lua └── create │ └── cat.lua ├── win_release_zip.bat ├── include ├── buildinfo.hpp ├── UnhandledExceptions.hpp └── ColourUtils.hpp ├── display ├── include │ ├── curses.hpp │ ├── SDLUtils.hpp │ ├── sdl.hpp │ ├── SDLInit.hpp │ ├── DisplayProperties.hpp │ ├── CursesUtils.hpp │ └── PromptProcessor.hpp ├── source │ ├── unit_tests │ │ └── SDLDisplay_test.cpp │ └── DisplayProperties.cpp └── animation │ ├── include │ ├── DefaultAnimationFactory.hpp │ ├── DefaultDrawAnimationInstruction.hpp │ └── PauseAnimationInstruction.hpp │ └── source │ ├── AnimationFactory.cpp │ ├── DrawAnimationInstruction.cpp │ └── DefaultAnimationFactory.cpp ├── sound └── source │ └── unit_tests │ ├── SDLSound_test.cpp │ └── NullSound_test.cpp ├── win_release_sprites_zip.bat ├── cleanup.sh └── win_release_sounds_zip.bat /texts/thenine_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/bookofdays_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/casinogames_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/gamehistory_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/kellhistory_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/keybindings_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/oneternalism_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/roguelikes_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/strategy_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem10_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem11_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem12_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem13_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem2_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem3_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem4_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem5_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem6_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem7_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem8_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem9_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/titlepoem_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/yewhistory_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/faeriefragment_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/gnordvarhistory_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/isendunchronicle_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/shrines_history_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/stoneheimhistory_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /texts/tel_and_floridel_blank.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /asset_zip.sh: -------------------------------------------------------------------------------- 1 | zip -r ShadowOfTheWyrm-assets.zip assets 2 | -------------------------------------------------------------------------------- /world/tiles/source/unit_tests/StaircaseTile_test.cpp: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/SDL2.dll -------------------------------------------------------------------------------- /zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/zlib1.dll -------------------------------------------------------------------------------- /codebase.bat: -------------------------------------------------------------------------------- 1 | dir /s *.cpp *.hpp *.ini *.xsd *.xml *.lua *.py *.rb *.txt *.tex *.ogg 2 | -------------------------------------------------------------------------------- /pdcurses.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/pdcurses.dll -------------------------------------------------------------------------------- /sotw_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/sotw_icon.ico -------------------------------------------------------------------------------- /sotw_procdump.bat: -------------------------------------------------------------------------------- 1 | start sotw.exe 2 | timeout 6 3 | start procdump -ma -e sotw.exe 4 | -------------------------------------------------------------------------------- /SDL2_image.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/SDL2_image.dll -------------------------------------------------------------------------------- /SDL2_mixer.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/SDL2_mixer.dll -------------------------------------------------------------------------------- /docs/Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/docs/Guide.pdf -------------------------------------------------------------------------------- /item_sprites.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/item_sprites.xcf -------------------------------------------------------------------------------- /libpng16-16.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/libpng16-16.dll -------------------------------------------------------------------------------- /licenses/lua.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/licenses/lua.txt -------------------------------------------------------------------------------- /sotw_music.fms: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/sotw_music.fms -------------------------------------------------------------------------------- /sys_sprites.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/sys_sprites.xcf -------------------------------------------------------------------------------- /xerces-c_3_3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/xerces-c_3_3.dll -------------------------------------------------------------------------------- /docs/Commands.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/docs/Commands.pdf -------------------------------------------------------------------------------- /engine/creatures/source/unit_tests/StatusEffect_test.cpp: -------------------------------------------------------------------------------- 1 | // This set of unit tests currently empty. -------------------------------------------------------------------------------- /xerces-c_3_3D.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/xerces-c_3_3D.dll -------------------------------------------------------------------------------- /creature_sprites.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/creature_sprites.xcf -------------------------------------------------------------------------------- /feature_sprites.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/feature_sprites.xcf -------------------------------------------------------------------------------- /terrain_sprites.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prolog/shadow-of-the-wyrm/HEAD/terrain_sprites.xcf -------------------------------------------------------------------------------- /engine/decision_strategies/search/source/GreedySearchStrategy.cpp: -------------------------------------------------------------------------------- 1 | #include "GreedySearchStrategy.hpp" 2 | 3 | -------------------------------------------------------------------------------- /get_assets.sh: -------------------------------------------------------------------------------- 1 | curl -O https://www.shadowofthewyrm.org/assets/ShadowOfTheWyrm-assets.zip 2 | unzip ShadowOfTheWyrm-assets.zip 3 | -------------------------------------------------------------------------------- /scripts/quests/atuaelar/tir.lua: -------------------------------------------------------------------------------- 1 | add_message_with_pause("TIR_SPEECH_TEXT_SID") 2 | clear_and_add_message("TIR_SPEECH2_TEXT_SID") 3 | 4 | -------------------------------------------------------------------------------- /docs/src/Commands.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | \usepackage{enumitem} 3 | \begin{document} 4 | \input{CommandRef.tex} 5 | \end{document} 6 | -------------------------------------------------------------------------------- /texts/titlepoem4_en.txt: -------------------------------------------------------------------------------- 1 | Winter seclusion - %b 2 | Listening that evening %b 3 | to the mountain rain. 4 | %p 5 | - Kobayashi Issa 6 | %p 7 | -------------------------------------------------------------------------------- /engine/include/MessageSpacing.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct MessageSpacing 4 | { 5 | DEFAULT_SPACING = 0, 6 | NO_SPACING = 1 7 | }; 8 | -------------------------------------------------------------------------------- /engine/field_of_view/include/FieldOfViewTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct FieldOfViewAlgorithmType 4 | { 5 | FOV_RAY_CASTING = 0 6 | }; 7 | -------------------------------------------------------------------------------- /world/include/WeaponTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct WeaponStyle 4 | { 5 | WEAPON_STYLE_MELEE = 0, 6 | WEAPON_STYLE_RANGED = 1 7 | }; 8 | -------------------------------------------------------------------------------- /win_release_zip.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | cd dist 3 | 7z.exe a -tzip ShadowOfTheWyrm-Win.zip * -r -x!*.pdb 4 | cd .. 5 | @ECHO dist\ShadowOfTheWyrm.zip created! 6 | -------------------------------------------------------------------------------- /logs/README: -------------------------------------------------------------------------------- 1 | Git won't allow an empty directory to be tracked, and the logs directory should 2 | be part of version control, so I'm adding this file. 3 | 4 | I miss Mercurial. 5 | -------------------------------------------------------------------------------- /engine/creatures/include/CreatureStatusTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct StatusRemovalType 4 | { 5 | STATUS_REMOVAL_UNDO, 6 | STATUS_REMOVAL_FINALIZE 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /engine/serialization/include/SerializationTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct SerializationReturnCode 4 | { 5 | SERIALIZATION_OK = 0, 6 | SERIALIZATION_ERROR = 1 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /engine/commands/select_tile/include/SelectTileTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct SelectCreatureType 4 | { 5 | SELECT_CREATURE_PREVIOUS = 0, 6 | SELECT_CREATURE_NEXT = 1 7 | }; 8 | 9 | -------------------------------------------------------------------------------- /world/include/AlignmentEnums.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct AlignmentRange 4 | { 5 | ALIGNMENT_RANGE_EVIL = 0, 6 | ALIGNMENT_RANGE_NEUTRAL = 1, 7 | ALIGNMENT_RANGE_GOOD = 2 8 | }; 9 | -------------------------------------------------------------------------------- /engine/decision_strategies/deity/include/DeityDecisionTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct DeityDecisionType 4 | { 5 | DEITY_DECISION_NOTHING = 0, 6 | DEITY_DECISION_FULL_HP = 1 7 | }; 8 | -------------------------------------------------------------------------------- /engine/items/include/LuaItemFilter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | constexpr auto CITEM_FILTER_NONE = 0; 4 | constexpr auto CITEM_FILTER_UNIDENTIFIED = 1; 5 | constexpr auto CITEM_FILTER_ARTIFACT = 2; 6 | 7 | -------------------------------------------------------------------------------- /include/buildinfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | static const int MAJOR_VERSION = 1; 4 | static const int MINOR_VERSION = 8; 5 | static const int REVISION = 4; 6 | static const int REVISION_PATCH = 0; 7 | -------------------------------------------------------------------------------- /engine/generators/include/PillarTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct PillarType 4 | { 5 | PILLAR_TYPE_SQUARE = 0, 6 | PILLAR_TYPE_CROSS = 1, 7 | PILLAR_TYPE_LAST = 2 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /scripts/areas/eka.lua: -------------------------------------------------------------------------------- 1 | require('areas') 2 | local eka = Area:new(4, 53) 3 | 4 | eka:set_custom_map_id("eka") 5 | eka:set_extra_description_sid("TILE_EXTRA_DESCRIPTION_EKA") 6 | 7 | eka:insert() 8 | -------------------------------------------------------------------------------- /world/tiles/source/StaircaseTile.cpp: -------------------------------------------------------------------------------- 1 | #include "StaircaseTile.hpp" 2 | 3 | ClassIdentifier StaircaseTile::internal_class_identifier() const 4 | { 5 | return ClassIdentifier::CLASS_ID_STAIRCASE_TILE; 6 | } -------------------------------------------------------------------------------- /engine/maps/tiles/source/NullTileDamageProcessor.cpp: -------------------------------------------------------------------------------- 1 | #include "NullTileDamageProcessor.hpp" 2 | 3 | bool NullTileDamageProcessor::affects_item(ItemPtr /*item*/) 4 | { 5 | return false; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /scripts/quests/telari/the_sentry.lua: -------------------------------------------------------------------------------- 1 | if get_num_deities() == 0 then 2 | clear_and_add_message("THE_SENTRY_GODSLAYER_SPEECH_TEXT_SID") 3 | else 4 | clear_and_add_message("THE_SENTRY_SPEECH_TEXT_SID") 5 | end 6 | -------------------------------------------------------------------------------- /engine/skills/include/FishingTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct FishingType 4 | { 5 | FISHING_TYPE_NONE = -1, 6 | FISHING_TYPE_ROD_AND_LINE = 0, 7 | FISHING_TYPE_SPEAR = 1 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /display/include/curses.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef _MSC_VER 3 | #include 4 | #else 5 | #ifndef NCURSES_OPAQUE 6 | constexpr auto NCURSES_OPAQUE = 0; 7 | #endif 8 | #include 9 | #endif 10 | -------------------------------------------------------------------------------- /engine/calculators/include/SeedCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Date.hpp" 3 | 4 | class SeedCalculator 5 | { 6 | public: 7 | double calculate_sprouting_seconds(const Date& current_date); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/description/source/IDescriber.cpp: -------------------------------------------------------------------------------- 1 | #include "IDescriber.hpp" 2 | 3 | IDescriber::~IDescriber() 4 | { 5 | } 6 | 7 | std::string IDescriber::describe_for_tile_selection() const 8 | { 9 | return describe(); 10 | } -------------------------------------------------------------------------------- /engine/generators/include/CellularAutomataTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct CellValue 4 | { 5 | CELL_OFF = 0, 6 | CELL_ON = 1 7 | }; 8 | 9 | using CellMap = std::vector>; 10 | 11 | -------------------------------------------------------------------------------- /engine/time/include/WorldTimeKeeperCoordinator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class WorldTimeKeeper; 3 | 4 | class WorldTimeKeeperCoordinator 5 | { 6 | public: 7 | void setup_time_keeper(WorldTimeKeeper& time_keeper); 8 | }; 9 | -------------------------------------------------------------------------------- /world/tiles/include/TreeSpeciesFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TreeSpecies.hpp" 3 | 4 | class TreeSpeciesFactory 5 | { 6 | public: 7 | TreeSpecies create_tree_species(const TreeSpeciesID species_id); 8 | }; 9 | -------------------------------------------------------------------------------- /engine/source/HighScoreConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "HighScoreConstants.hpp" 2 | 3 | using namespace std; 4 | 5 | const uint HighScoreConstants::MAX_ENTRIES = 100; 6 | const string HighScoreConstants::FILENAME = "scores.dat"; 7 | 8 | -------------------------------------------------------------------------------- /world/include/InventoryFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IInventory.hpp" 3 | 4 | class InventoryFactory 5 | { 6 | public: 7 | static IInventoryPtr create_inventory(const ClassIdentifier cl_id); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/description/codex/source/ArmourCodexDescriber.cpp: -------------------------------------------------------------------------------- 1 | #include "ArmourCodexDescriber.hpp" 2 | 3 | ArmourCodexDescriber::ArmourCodexDescriber(WearablePtr wearable) 4 | : WearableCodexDescriber(wearable, true) 5 | { 6 | } 7 | 8 | -------------------------------------------------------------------------------- /display/include/SDLUtils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef ENABLE_SDL 3 | 4 | #include "sdl.hpp" 5 | 6 | class SDLUtils 7 | { 8 | public: 9 | bool sdl_color_eq(const SDL_Color& col1, const SDL_Color& col2) const; 10 | }; 11 | 12 | #endif -------------------------------------------------------------------------------- /engine/magic/source/ReflectiveBeamShapeProcessor.cpp: -------------------------------------------------------------------------------- 1 | #include "ReflectiveBeamShapeProcessor.hpp" 2 | 3 | // Reflective beams are, well, reflective. 4 | bool ReflectiveBeamShapeProcessor::should_beam_reflect() const 5 | { 6 | return true; 7 | } -------------------------------------------------------------------------------- /scripts/areas/far_shore.lua: -------------------------------------------------------------------------------- 1 | require('areas') 2 | 3 | local far_shore = Area:new(90, 0) 4 | far_shore:set_custom_map_id("far_shore") 5 | far_shore:set_extra_description_sid("TILE_EXTRA_DESCRIPTION_FAR_SHORE") 6 | 7 | far_shore:insert() 8 | 9 | -------------------------------------------------------------------------------- /scripts/areas/last_rock.lua: -------------------------------------------------------------------------------- 1 | require('areas') 2 | 3 | local last_rock = Area:new(86, 99) 4 | last_rock:set_custom_map_id("last_rock") 5 | last_rock:set_extra_description_sid("TILE_EXTRA_DESCRIPTION_LAST_ROCK") 6 | 7 | last_rock:insert() 8 | 9 | -------------------------------------------------------------------------------- /engine/calculators/include/MeleeWeaponRangeCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class MeleeWeaponRangeCalculator 5 | { 6 | public: 7 | int get_primary_melee_range(CreaturePtr creature) const; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/items/source/ArtifactItemFilter.cpp: -------------------------------------------------------------------------------- 1 | #include "ArtifactItemFilter.hpp" 2 | 3 | using namespace std; 4 | 5 | bool ArtifactItemFilter::passes_filter(ItemPtr item) const 6 | { 7 | return (item && item->get_artifact()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/maps/include/MapMovementTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "common.hpp" 5 | #include "DisplayTile.hpp" 6 | 7 | using MovementPath = std::vector>>; 8 | 9 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/TileManipulatorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ITileManipulator.hpp" 3 | 4 | class TileManipulatorFactory 5 | { 6 | public: 7 | ITileManipulatorPtr create_tile_manipulator(TilePtr tile); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /sound/source/unit_tests/SDLSound_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Sound_SDLSound, serialization_id) 4 | { 5 | SDLSound ss; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SDL_SOUND, ss.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /display/include/sdl.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define SDL_MAIN_HANDLED 3 | #ifdef ENABLE_SDL 4 | #ifdef _MSC_VER 5 | #include "SDL.h" 6 | #include "SDL_mixer.h" 7 | #else 8 | #include "SDL2/SDL.h" 9 | #include "SDL2/SDL_mixer.h" 10 | #endif 11 | #endif -------------------------------------------------------------------------------- /engine/generators/crypts/include/CryptLayoutTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct CryptLayoutType 4 | { 5 | CRYPT_LAYOUT_PILLARS = 0, 6 | CRYPT_LAYOUT_VAULT = 1, 7 | CRYPT_LAYOUT_EMPTY = 2, 8 | CRYPT_LAYOUT_LAST = 3 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /sound/source/unit_tests/NullSound_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Sound_NullSound, serialization_id) 4 | { 5 | NullSound ns; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_NULL_SOUND, ns.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /texts/titlepoem6_en.txt: -------------------------------------------------------------------------------- 1 | Come away, O human child! %b 2 | To the waters and the wild %b 3 | With a faery, hand in hand, %b 4 | For the world's more full of weeping than you can understand. 5 | %p 6 | - From "The Stolen Child", W.B. Yeats 7 | %p 8 | -------------------------------------------------------------------------------- /engine/field_of_view/include/BresenhamLine.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "common.hpp" 4 | 5 | class BresenhamLine 6 | { 7 | public: 8 | std::vector get_points_in_line(int y1, int x1, int y2, int x2); 9 | }; 10 | -------------------------------------------------------------------------------- /engine/generators/rooms/source/NullRoomGenerator.cpp: -------------------------------------------------------------------------------- 1 | #include "NullRoomGenerator.hpp" 2 | 3 | void NullRoomGenerator::generate(MapPtr /*map*/, const int /*start_row*/, const int /*end_row*/, const int /*start_col*/, const int /*end_col*/) 4 | { 5 | } 6 | 7 | -------------------------------------------------------------------------------- /engine/include/HighScoreConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "common.hpp" 4 | 5 | class HighScoreConstants 6 | { 7 | public: 8 | static const uint MAX_ENTRIES; 9 | static const std::string FILENAME; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /world/tiles/features/include/EntranceTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // The current state of the entrance. 4 | enum struct EntranceStateType 5 | { 6 | ENTRANCE_TYPE_DESTROYED = 0, 7 | ENTRANCE_TYPE_OPEN = 1, 8 | ENTRANCE_TYPE_CLOSED = 2 9 | }; 10 | -------------------------------------------------------------------------------- /display/source/unit_tests/SDLDisplay_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Display_SDLDisplay, serialization_id) 4 | { 5 | SDLDisplay sd; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SDL_DISPLAY, sd.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/screens/include/WelcomeScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Screen.hpp" 3 | 4 | class WelcomeScreen : public Screen 5 | { 6 | public: 7 | WelcomeScreen(DisplayPtr display); 8 | 9 | protected: 10 | void initialize() override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/calculators/include/ThieveryCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class ThieveryCalculator 5 | { 6 | public: 7 | int calculate_pct_chance_steal(CreaturePtr stealing_creature, CreaturePtr steal_creature); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/items/source/NullItemFilter.cpp: -------------------------------------------------------------------------------- 1 | #include "NullItemFilter.hpp" 2 | 3 | bool NullItemFilter::passes_filter(ItemPtr /*item*/) const 4 | { 5 | return true; 6 | } 7 | 8 | #ifdef UNIT_TESTS 9 | #include "unit_tests/NullItemFilter_test.cpp" 10 | #endif 11 | -------------------------------------------------------------------------------- /engine/maps/source/unit_tests/MapRegistry_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_MapRegistry, serialization_id) 4 | { 5 | MapRegistry mr; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_MAP_REGISTRY, mr.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/screens/source/unit_tests/ComponentAlignment_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Screens_ComponentAlignment, default_override_value) 4 | { 5 | ComponentAlignment ca; 6 | 7 | EXPECT_FALSE(ca.get_override_default()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLBedReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLBedReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& bed_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLDoorReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLDoorReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& door_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLKilnReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLKilnReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& kiln_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLPewReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLPewReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& pew_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLSignReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLSignReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& pew_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/include/LogFiles.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class LogFiles 4 | { 5 | public: 6 | // Remove log files older than the given number of days. 7 | // Return value is the number of logs removed. 8 | int remove_old(const int days_old); 9 | }; 10 | -------------------------------------------------------------------------------- /engine/maps/tiles/features/source/FeatureManipulator.cpp: -------------------------------------------------------------------------------- 1 | #include "FeatureManipulator.hpp" 2 | #include "ItemManager.hpp" 3 | #include "RNG.hpp" 4 | 5 | bool FeatureManipulator::desecrate(CreaturePtr /*creature*/, MapPtr /*current_map*/) 6 | { 7 | return false; 8 | } 9 | -------------------------------------------------------------------------------- /texts/titlepoem12_en.txt: -------------------------------------------------------------------------------- 1 | ...Whose world, or mine or theirs %b 2 | or is it of none? %b 3 | First came the seen, then thus the palpable %b 4 | Elysium, though it were in the halls of hell... 5 | %p 6 | - From "Canto LXXXI", Ezra Pound 7 | %p 8 | -------------------------------------------------------------------------------- /win_release_sprites_zip.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | mkdir dist_sprites 3 | copy assets\sprites\* dist_sprites 4 | copy license dist_sprites 5 | cd dist_sprites 6 | 7z.exe a -tzip ShadowOfTheWyrm-Sprites.zip * -r 7 | cd .. 8 | @ECHO dist_sprites\ShadowOfTheWyrm-Sprites.zip created! 9 | -------------------------------------------------------------------------------- /cleanup.sh: -------------------------------------------------------------------------------- 1 | rm -rf *.o 2 | rm -rf Debug 3 | rm -rf Release 4 | rm -rf dist 5 | rm -rf bin 6 | rm -rf obj 7 | rm -rf .objs 8 | rm *.html 9 | rm *.sws 10 | rm sl-*.log 11 | rm gmon.out 12 | rm jrcpp_cb.exe 13 | rm ShadowOfTheWyrm.exe 14 | rm sotw.exe 15 | rm MapTester.exe 16 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLBarrelReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLBarrelReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& barrel_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLFenceReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLFenceReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& fence_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLForgeReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLForgeReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& forge_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLPulperReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLPulperReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& pulper_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLTableReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLTableReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& table_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/generators/tile_config/source/DefaultTileConfiguration.cpp: -------------------------------------------------------------------------------- 1 | #include "DefaultTileConfiguration.hpp" 2 | 3 | void DefaultTileConfiguration::configure(TilePtr /*tile*/, const Season /*season*/) const 4 | { 5 | } 6 | 7 | void DefaultTileConfiguration::initialize() 8 | { 9 | } -------------------------------------------------------------------------------- /engine/include/ClassManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class ClassManager 5 | { 6 | public: 7 | ClassManager(); 8 | 9 | Class* get_class(const std::string& class_id); 10 | std::string get_title(CreaturePtr creature); 11 | }; 12 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/GraveTileManipulator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ITileManipulator.hpp" 3 | 4 | class GraveTileManipulator : public ITileManipulator 5 | { 6 | public: 7 | bool dig(CreaturePtr creature, MapPtr map, TilePtr tile) override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLBenchReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLBenchReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& workbench_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLTanneryReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLTanneryReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& tannery_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /scripts/areas/far_reaches.lua: -------------------------------------------------------------------------------- 1 | require('areas') 2 | 3 | local last_island_lair = Area:new(2, 2) 4 | last_island_lair:set_custom_map_id("last_island_lair") 5 | last_island_lair:set_extra_description_sid("TILE_EXTRA_DESCRIPTION_LAST_ISLAND_LAIR") 6 | 7 | last_island_lair:insert() 8 | 9 | -------------------------------------------------------------------------------- /scripts/death/gas_cloud.lua: -------------------------------------------------------------------------------- 1 | require('death') 2 | 3 | local function explode(creature_id, attacking_creature_id, map_id) 4 | cast_spell(creature_id, "a_01_wreath_of_fire") 5 | end 6 | 7 | local explode_fn = explode 8 | death.set_death_fn("gas_cloud", explode_fn) 9 | 10 | -------------------------------------------------------------------------------- /world/include/WeavingConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class WeavingConstants 5 | { 6 | public: 7 | static const std::string WEAVING_MATERIAL_TYPE_KEY; 8 | 9 | protected: 10 | WeavingConstants(); 11 | ~WeavingConstants(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLFountainReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLFountainReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& fountain_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLStoneMarkerReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLStoneMarkerReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& sm_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/calculators/include/FoodCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.hpp" 3 | 4 | class FoodCalculator 5 | { 6 | public: 7 | int calculate_nutrition(ItemPtr item) const; 8 | 9 | protected: 10 | float get_item_status_multiplier(const ItemStatus status) const; 11 | }; -------------------------------------------------------------------------------- /engine/calculators/include/StealthCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class StealthCalculator 5 | { 6 | public: 7 | int calculate_pct_chance_sneak_attack(CreaturePtr attacking_creature, CreaturePtr attacked_creature) const; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/calculators/source/NullAttackSpeedCalculator.cpp: -------------------------------------------------------------------------------- 1 | #include "NullAttackSpeedCalculator.hpp" 2 | 3 | // Assume 1 speed as a default for everything that is not defined. 4 | ActionCostValue NullAttackSpeedCalculator::calculate(CreaturePtr /*creature*/) 5 | { 6 | return 1; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /engine/creatures/include/CreatureGenerationOptionsStringBuilder.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CreatureGenerationOptions.hpp" 3 | 4 | class CreatureGenerationOptionsStringBuilder 5 | { 6 | public: 7 | std::string build(const CreatureGenerationOptions& cgo); 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/description/codex/include/CodexDescriberFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CodexDescriber.hpp" 3 | #include "Item.hpp" 4 | 5 | class CodexDescriberFactory 6 | { 7 | public: 8 | CodexDescriberPtr create_codex_describer(const ItemPtr item); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/NullTileDamageProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileDamageProcessor.hpp" 3 | 4 | class NullTileDamageProcessor : public TileDamageProcessor 5 | { 6 | protected: 7 | virtual bool affects_item(ItemPtr item) override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/screens/include/HelpScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Screen.hpp" 3 | #include "Display.hpp" 4 | 5 | class HelpScreen : public Screen 6 | { 7 | public: 8 | HelpScreen(DisplayPtr new_display); 9 | 10 | protected: 11 | void initialize() override; 12 | }; 13 | -------------------------------------------------------------------------------- /scripts/areas/events/wintersea_keep.lua: -------------------------------------------------------------------------------- 1 | require('map_events') 2 | 3 | local wintersea_map_id = args[MAP_ID] 4 | 5 | function init_wintersea_keep(map_id) 6 | generate_adventurer(map_id, 12, 0, 1) 7 | end 8 | 9 | map_events.set_map_fn(wintersea_map_id, init_wintersea_keep) 10 | -------------------------------------------------------------------------------- /world/include/MapFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Map.hpp" 3 | 4 | class MapFactory 5 | { 6 | public: 7 | static MapPtr create_map(); 8 | static MapExitPtr create_map_exit(); 9 | 10 | protected: 11 | MapFactory(); 12 | ~MapFactory(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /display/include/SDLInit.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef ENABLE_SDL 3 | 4 | #include "sdl.hpp" 5 | 6 | // Singleton class used to ensure the SDL functions are properly set up. 7 | class SDLInit 8 | { 9 | public: 10 | void set_up(); 11 | void tear_down(); 12 | }; 13 | 14 | #endif -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLFirePillarReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLFirePillarReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& fire_pillar_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLSarcophagusReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLSarcophagusReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& sarcophagus_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLSlotMachineReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLSlotMachineReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& smachine_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/include/XMLModifierReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class Modifier; 3 | class XMLNode; 4 | 5 | class XMLModifierReader 6 | { 7 | public: 8 | XMLModifierReader(); 9 | ~XMLModifierReader(); 10 | 11 | Modifier get_modifier(const XMLNode& modifiers_node); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/calculators/include/CalcUtils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CalcUtils 4 | { 5 | public: 6 | // Returns the parameter if between 0 and 100. If less than 0, 7 | // returns 0. If greater than 100, returns 100. 8 | static int pct_val(const int pct); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/calculators/include/ForagablesCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class ForagablesCalculator 5 | { 6 | public: 7 | int calculate_pct_chance_foragables(CreaturePtr creature); 8 | int calculate_pct_chance_herbs(CreaturePtr creature); 9 | }; 10 | -------------------------------------------------------------------------------- /engine/commands/source/unit_tests/CommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_CommandFactory, serialization_id) 4 | { 5 | CommandFactory cf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_COMMAND_FACTORY, cf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/decision_strategies/include/NPCDropDecisionStrategy.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Command.hpp" 3 | #include "Creature.hpp" 4 | #include "Map.hpp" 5 | 6 | class NPCDropDecisionStrategy 7 | { 8 | public: 9 | CommandPtr decide(CreaturePtr creature, MapPtr map); 10 | }; 11 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/AgeTimeObserver_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_AgeTimeObserver, serialization_id) 4 | { 5 | AgeTimeObserver ato; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_AGE_TIME_OBSERVER, ato.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/MapTimeObserver_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_MapTimeObserver, serialization_id) 4 | { 5 | MapTimeObserver mto; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_MAP_TIME_OBSERVER, mto.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/WorldTimeKeeper_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_WorldTimeKeeper, serialization_id) 4 | { 5 | WorldTimeKeeper wtk; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_WORLD_TIME_KEEPER, wtk.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/herbalist.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('merchant_common') 3 | 4 | local sw_cost = 50 5 | 6 | merchant_common.chat(PLAYER_ID, SILVERWEED_ID, sw_cost, "HERBALIST_OFFER_SID", "HERBALIST_ACCEPT_SID", "HERBALIST_DECLINE_SID", "HERBALIST_INSUFFICIENT_FUNDS_SID") 7 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/runic_student.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('tower_student_common') 3 | 4 | tower_student_common.chat(BLANK_SCROLL_ID, 3, "_unstoning_potion", "RUNIC_STUDENT_TRADE_SID", "TOWER_STUDENT_ACCEPT_SID", "TOWER_STUDENT_SHRUG_SID", "TOWER_STUDENT_DEFAULT_SID") 5 | -------------------------------------------------------------------------------- /world/materials/source/Material.cpp: -------------------------------------------------------------------------------- 1 | #include "Material.hpp" 2 | 3 | using namespace std; 4 | 5 | Colour Material::get_colour() const 6 | { 7 | return Colour::COLOUR_WHITE; 8 | } 9 | 10 | bool Material::get_material_floats() const 11 | { 12 | return false; // most things don't 13 | } -------------------------------------------------------------------------------- /world/religion/include/ReligionFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Religion.hpp" 3 | #include "Deity.hpp" 4 | 5 | class ReligionFactory 6 | { 7 | public: 8 | static Religion create_religion(const DeityMap& deities); 9 | 10 | protected: 11 | ReligionFactory(); 12 | }; 13 | -------------------------------------------------------------------------------- /world/tiles/include/WeatherProperties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class WeatherProperties 5 | { 6 | public: 7 | static const std::string WEATHER_PROPERTIES_WIND_SPEED; 8 | 9 | protected: 10 | WeatherProperties(); 11 | ~WeatherProperties(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLDecorativeStatueReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLDecorativeStatueReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& ds_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLWheelAndLoomReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLWheelAndLoomReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& wheel_and_loom_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/include/XMLScrollReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLReadableReader.hpp" 3 | #include "Scroll.hpp" 4 | 5 | class XMLScrollReader : public XMLReadableReader 6 | { 7 | public: 8 | XMLScrollReader(); 9 | ~XMLScrollReader(); 10 | 11 | protected: 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/calculators/include/MineCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class MineCalculator 4 | { 5 | public: 6 | int calculate_pct_chance_magici_shards(const int danger_level) const; 7 | 8 | protected: 9 | static const int BASE_CHANCE_MAGICI_SHARDS; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/generators/fortresses/include/KeepRuinsGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "KeepGenerator.hpp" 3 | 4 | class KeepRuinsGenerator : public KeepGenerator 5 | { 6 | public: 7 | KeepRuinsGenerator(MapPtr new_base_map); 8 | virtual ~KeepRuinsGenerator() = default; 9 | }; 10 | -------------------------------------------------------------------------------- /engine/time/include/BoatingMovementAccumulationChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ITerrainMovementAccumulationChecker.hpp" 3 | 4 | class BoatingMovementAccumulationChecker : public ITerrainMovementAccumulationChecker 5 | { 6 | public: 7 | void check(CreaturePtr creature) override; 8 | }; 9 | -------------------------------------------------------------------------------- /engine/time/include/FallingMovementAccumulationChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ITerrainMovementAccumulationChecker.hpp" 3 | 4 | class FallingMovementAccumulationChecker : public ITerrainMovementAccumulationChecker 5 | { 6 | public: 7 | void check(CreaturePtr creature) override; 8 | }; 9 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/ShopsTimeObserver_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_ShopsTimeObserver, serialization_id) 4 | { 5 | ShopsTimeObserver so; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SHOPS_TIME_OBSERVER, so.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /include/UnhandledExceptions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifdef _MSC_VER 3 | #include 4 | 5 | LONG sotw_fault_handler(struct _EXCEPTION_POINTERS * ExInfo); 6 | void write_minidump(struct _EXCEPTION_POINTERS * e); 7 | #endif 8 | 9 | void register_unhandled_exception_handler(); 10 | 11 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/summonings_student.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('tower_student_common') 3 | 4 | tower_student_common.chat(MAGICI_SHARD_ID, 10, GOLDEN_APPLE_ID, "SUMMONINGS_STUDENT_TRADE_SID", "TOWER_STUDENT_ACCEPT_SID", "TOWER_STUDENT_SHRUG_SID", "TOWER_STUDENT_DEFAULT_SID") 5 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLJewelerWorkbenchReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | class XMLJewelerWorkbenchReader : public IXMLFeatureReader 5 | { 6 | public: 7 | FeaturePtr create(const XMLNode& workbench_node) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/XML/source/XMLScrollReader.cpp: -------------------------------------------------------------------------------- 1 | #include "XMLScrollReader.hpp" 2 | 3 | XMLScrollReader::XMLScrollReader() 4 | { 5 | } 6 | 7 | XMLScrollReader::~XMLScrollReader() 8 | { 9 | } 10 | 11 | // Methods for reading in details about scrolls from XML nodes conformant to the Scroll type. 12 | 13 | -------------------------------------------------------------------------------- /engine/calculators/include/FieldCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "common.hpp" 3 | #include "Creature.hpp" 4 | 5 | class FieldCalculator 6 | { 7 | public: 8 | int calc_pct_chance_wild_grains(CreaturePtr creature, const int world_height, const Coordinate& world_map_pos) const; 9 | }; 10 | -------------------------------------------------------------------------------- /engine/combat/include/DamageText.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Colours.hpp" 3 | #include "Creature.hpp" 4 | 5 | class DamageText 6 | { 7 | public: 8 | Colour get_colour(CreaturePtr creature) const; 9 | 10 | protected: 11 | static const float PCT_PLAYER_HP_COLOUR_CHANGE; 12 | }; 13 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/SpecialDayObserver_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_SpecialDayObserver, serialization_id) 4 | { 5 | SpecialDayObserver sd; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SPECIAL_DAY_OBSERVER, sd.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/evocations_student.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('tower_student_common') 3 | 4 | tower_student_common.chat(BLANK_SCROLL_ID, 10, SILVER_APPLE_ID, "EVOCATIONS_STUDENT_TRADE_SID", "TOWER_STUDENT_ACCEPT_SID", "TOWER_STUDENT_SHRUG_SID", "TOWER_STUDENT_DEFAULT_SID") 5 | 6 | -------------------------------------------------------------------------------- /world/materials/include/MaterialFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Material.hpp" 3 | 4 | class MaterialFactory 5 | { 6 | public: 7 | static MaterialPtr create_material(const MaterialType type); 8 | 9 | protected: 10 | MaterialFactory(); 11 | ~MaterialFactory(); 12 | }; 13 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/Bed_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_Bed, serialization_id) 4 | { 5 | Symbol s('~', Colour::COLOUR_WHITE); 6 | Bed b(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_BED, b.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /engine/combat/source/LevelConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "LevelConstants.hpp" 2 | 3 | LevelConstants::LevelConstants() 4 | { 5 | } 6 | 7 | LevelConstants::~LevelConstants() 8 | { 9 | } 10 | 11 | const uint LevelConstants::DEFAULT_HIT_DICE = 6; 12 | const uint LevelConstants::DEFAULT_AP_DICE = 1; 13 | 14 | -------------------------------------------------------------------------------- /engine/generators/settlements/include/SettlementTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct SettlementType 4 | { 5 | SETTLEMENT_TYPE_ORDERLY_VILLAGE = 0, 6 | SETTLEMENT_TYPE_HAMLET = 1, 7 | SETTLEMENT_TYPE_WALLED = 2, 8 | SETTLEMENT_TYPE_SCATTERED = 3, 9 | SETTLEMENT_TYPE_MAX = 3 10 | }; 11 | -------------------------------------------------------------------------------- /engine/generators/worship_sites/source/ChurchGeneratorFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "ChurchGeneratorFactory.hpp" 2 | 3 | ChurchGeneratorFactory::ChurchGeneratorFactory() 4 | { 5 | } 6 | 7 | GeneratorPtr ChurchGeneratorFactory::create_generator() 8 | { 9 | GeneratorPtr null; 10 | return null; 11 | } 12 | -------------------------------------------------------------------------------- /engine/items/include/IItemFilter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.hpp" 3 | 4 | class IItemFilter 5 | { 6 | public: 7 | virtual ~IItemFilter() = default; 8 | virtual bool passes_filter(ItemPtr item) const = 0; 9 | }; 10 | 11 | using IItemFilterPtr = std::shared_ptr; 12 | 13 | -------------------------------------------------------------------------------- /engine/screens/include/SexSelectionScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Screen.hpp" 3 | #include "Display.hpp" 4 | 5 | class SexSelectionScreen : public Screen 6 | { 7 | public: 8 | SexSelectionScreen(DisplayPtr display); 9 | 10 | protected: 11 | void initialize() override; 12 | }; 13 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/SeasonsTimeObserver_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_SeasonsTimeObserver, serialization_id) 4 | { 5 | SeasonsTimeObserver sto; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SEASONS_TIME_OBSERVER, sto.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /scripts/areas/infinite_sewer.lua: -------------------------------------------------------------------------------- 1 | require('areas') 2 | 3 | local sewer = Area:new(82, 79) 4 | sewer:set_additional_properties({["MAP_PROPERTIES_PERMANENCE"] = "0", ["MAP_PROPERTIES_MAX_DEPTH"] = "inf"}) 5 | sewer:set_extra_description_sid("TILE_EXTRA_DESCRIPTION_INFINITE_SEWER") 6 | 7 | sewer:insert() 8 | 9 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/enchantments_student.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('tower_student_common') 3 | 4 | tower_student_common.chat(MAGICI_SHARD_ID, 3, "_ether_potion", "ENCHANTMENTS_STUDENT_TRADE_SID", "TOWER_STUDENT_ACCEPT_SID", "TOWER_STUDENT_SHRUG_SID", "TOWER_STUDENT_DEFAULT_SID") 5 | 6 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/EntranceState_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_EntranceState, serialization_id) 4 | { 5 | EntranceState es; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_ENTRANCE_STATE, es.get_class_identifier()); 8 | } 9 | 10 | 11 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/include/XMLMapTilesReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Map.hpp" 3 | #include "TileGenerator.hpp" 4 | #include "XMLDataStructures.hpp" 5 | 6 | class XMLMapTilesReader 7 | { 8 | public: 9 | TilesContainer parse_tiles(const XMLNode& tiles_node, const int cols); 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/calculators/source/CalcUtils.cpp: -------------------------------------------------------------------------------- 1 | #include "CalcUtils.hpp" 2 | 3 | int CalcUtils::pct_val(const int pct) 4 | { 5 | if (pct < 0) return 0; 6 | if (pct > 100) return 100; 7 | 8 | return pct; 9 | } 10 | 11 | #ifdef UNIT_TESTS 12 | #include "unit_tests/CalcUtils_test.cpp" 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /engine/combat/include/LevelConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "common.hpp" 3 | 4 | class LevelConstants 5 | { 6 | public: 7 | static const uint DEFAULT_HIT_DICE; 8 | static const uint DEFAULT_AP_DICE; 9 | 10 | protected: 11 | LevelConstants(); 12 | ~LevelConstants(); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/commands/include/IKeyboardCommandMap.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // Keyboard command map interface 5 | class IKeyboardCommandMap 6 | { 7 | public: 8 | virtual ~IKeyboardCommandMap() = default; 9 | 10 | virtual std::string get_settings_prefix() const = 0; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/creatures/include/NPCSkillDistributor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class NPCSkillDistributor 5 | { 6 | public: 7 | void distribute_unused_skill_points(CreaturePtr creature); 8 | std::vector get_skills_to_improve(CreaturePtr creature) const; 9 | }; 10 | -------------------------------------------------------------------------------- /engine/decision_strategies/search/include/SearchTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct SearchType 4 | { 5 | SEARCH_TYPE_MINDLESS = 0, // Random movement 6 | SEARCH_TYPE_BREADTH_FIRST = 1, 7 | SEARCH_TYPE_DEPTH_FIRST = 2, 8 | SEARCH_TYPE_UNIFORM_COST = 3, 9 | SEARCH_TYPE_ASTAR = 4 10 | }; 11 | -------------------------------------------------------------------------------- /engine/generators/fortresses/source/KeepRuinsGenerator.cpp: -------------------------------------------------------------------------------- 1 | #include "KeepRuinsGenerator.hpp" 2 | #include "TileGenerator.hpp" 3 | #include "RNG.hpp" 4 | 5 | using std::string; 6 | 7 | KeepRuinsGenerator::KeepRuinsGenerator(MapPtr new_base_map) 8 | : KeepGenerator(new_base_map, 10) 9 | { 10 | } 11 | 12 | -------------------------------------------------------------------------------- /engine/generators/settlements/sector/include/GardenTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct GardenType 4 | { 5 | GARDEN_TYPE_FIRST = 0, 6 | GARDEN_TYPE_SHADE = 0, 7 | GARDEN_TYPE_ROCK = 1, 8 | GARDEN_TYPE_WILDFLOWER = 2, 9 | GARDEN_TYPE_VEGETABLE = 3, 10 | GARDEN_TYPE_LAST = 4 11 | }; 12 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/TileDamageProcessorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileDamageProcessor.hpp" 3 | #include "Damage.hpp" 4 | 5 | class TileDamageProcessorFactory 6 | { 7 | public: 8 | TileDamageProcessorPtr create_tile_damage_processor(const DamageType dt); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/skills/source/SkillProcessor.cpp: -------------------------------------------------------------------------------- 1 | #include "SkillProcessor.hpp" 2 | 3 | bool SkillProcessor::is_skill_implemented() const 4 | { 5 | return true; 6 | } 7 | 8 | ActionCostValue SkillProcessor::get_default_skill_action_cost_value(CreaturePtr /*creature*/) const 9 | { 10 | return 1; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/CreatureTimeObserver_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_CreatureTimeObserver, serialization_id) 4 | { 5 | CreatureTimeObserver cto; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_CREATURE_TIME_OBSERVER, cto.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/time/source/unit_tests/TileTransformObserver_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Time_TileTransformObserver, serialization_id) 4 | { 5 | TileTransformObserver tt; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_TILE_TRANSFORM_OBSERVER, tt.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /world/include/CreatureTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class CreatureReferences 5 | { 6 | public: 7 | static const std::string HIRELING; 8 | static const std::string ADVENTURER; 9 | 10 | protected: 11 | CreatureReferences(); 12 | ~CreatureReferences(); 13 | }; 14 | -------------------------------------------------------------------------------- /world/include/RaceConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class RaceConstants 5 | { 6 | public: 7 | static const std::string RACE_CONSTANTS_RACE_ID_HUMANOID; 8 | static const std::string RACE_CONSTANTS_RACE_ID_ANIMAL; 9 | 10 | protected: 11 | RaceConstants(); 12 | }; 13 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/Forge_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_Forge, serialization_id) 4 | { 5 | Symbol s('&', Colour::COLOUR_WHITE); 6 | Forge f(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_FORGE, f.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/Table_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_Table, serialization_id) 4 | { 5 | Symbol s('&', Colour::COLOUR_WHITE); 6 | Table t(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_TABLE, t.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /engine/calculators/include/DangerLevelProperties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class DangerLevelProperties 5 | { 6 | public: 7 | static const std::string DANGER_LEVEL_PROPERTIES_TILE_TYPE; 8 | 9 | protected: 10 | DangerLevelProperties(); 11 | ~DangerLevelProperties(); 12 | }; -------------------------------------------------------------------------------- /engine/calculators/include/PrimordialCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class PrimordialCalculator 5 | { 6 | public: 7 | int get_max_skill_castings(CreaturePtr creature); 8 | 9 | protected: 10 | static const int SKILL_CASTINGS_DIVISOR; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/commands/skills/include/SkillsCommandProcessorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ISkillsCommandProcessor.hpp" 3 | #include "SkillTypes.hpp" 4 | 5 | class SkillsCommandProcessorFactory 6 | { 7 | public: 8 | static ISkillsCommandProcessorPtr create(const SkillsSelectionType sst); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/skills/include/StealthSkillProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SkillProcessor.hpp" 3 | 4 | class StealthSkillProcessor : public SkillProcessor 5 | { 6 | public: 7 | ActionCostValue process(CreaturePtr creature, MapPtr map); 8 | virtual SkillProcessorPtr clone() override; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/time/include/RegenerationConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class RegenerationConstants 4 | { 5 | public: 6 | static const int MINUTES_PER_HP_BASE; 7 | static const int MINUTES_PER_AP_BASE; 8 | 9 | protected: 10 | RegenerationConstants(); 11 | ~RegenerationConstants(); 12 | }; 13 | -------------------------------------------------------------------------------- /texts/titlepoem5_en.txt: -------------------------------------------------------------------------------- 1 | "We must not look at goblin men, %b 2 | We must not buy their fruits: %b 3 | Who knows upon what soil they fed %b 4 | Their hungry thirsty roots?" %b 5 | "Come buy," call the goblins %b 6 | Hobbling down the glen. 7 | %p 8 | - From "Goblin Market", Christina Rossetti 9 | %p 10 | -------------------------------------------------------------------------------- /world/magic/include/EffectProperties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class EffectProperties 5 | { 6 | public: 7 | static const std::string EFFECT_PROPERTIES_TELEPORT_LOCATION; 8 | 9 | protected: 10 | EffectProperties(); 11 | ~EffectProperties(); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /world/source/RaceConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "RaceConstants.hpp" 2 | 3 | using namespace std; 4 | 5 | const string RaceConstants::RACE_CONSTANTS_RACE_ID_HUMANOID = "_humanoid"; 6 | const string RaceConstants::RACE_CONSTANTS_RACE_ID_ANIMAL = "_animal"; 7 | 8 | RaceConstants::RaceConstants() 9 | { 10 | } 11 | 12 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/Bench_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Feature_Bench, serialization_id) 4 | { 5 | Symbol s('-', Colour::COLOUR_WHITE); 6 | Bench bench(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_BENCH, bench.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/Pulper_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_Pulper, serialization_id) 4 | { 5 | Symbol s(':', Colour::COLOUR_WHITE); 6 | Pulper p(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_PULPER, p.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/Tannery_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_Tannery, serialization_id) 4 | { 5 | Symbol s('&', Colour::COLOUR_WHITE); 6 | Tannery t(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_TANNERY, t.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /engine/commands/help/source/unit_tests/HelpCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Help_HelpCommandFactory, serialization_id) 4 | { 5 | HelpCommandFactory hcf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_HELP_COMMAND_FACTORY, hcf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/decision_strategies/magic/include/NPCMagicDecisionFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "INPCMagicDecision.hpp" 3 | #include "SpellTypes.hpp" 4 | 5 | class NPCMagicDecisionFactory 6 | { 7 | public: 8 | static INPCMagicDecisionPtr create_npc_magic_decision(const MagicClassification mc); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/include/AlignmentUtils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Alignment.hpp" 3 | 4 | class AlignmentUtils 5 | { 6 | public: 7 | static bool are_alignments_opposites(const AlignmentRange a1, const AlignmentRange a2); 8 | 9 | protected: 10 | AlignmentUtils(); 11 | ~AlignmentUtils(); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/skills/include/HidingSkillProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SkillProcessor.hpp" 3 | 4 | class HidingSkillProcessor : public SkillProcessor 5 | { 6 | public: 7 | ActionCostValue process(CreaturePtr creature, MapPtr map); 8 | virtual SkillProcessorPtr clone() override; 9 | 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/time/include/CreatureModifiers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ICreatureRegeneration.hpp" 3 | 4 | class CreatureModifiers : public ICreatureRegeneration 5 | { 6 | public: 7 | void tick(CreaturePtr creature, TilePtr tile, const ulonglong minutes_this_tick, const ulonglong total_minutes_elapsed) override; 8 | }; 9 | -------------------------------------------------------------------------------- /world/source/WeavingConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "WeavingConstants.hpp" 2 | 3 | using namespace std; 4 | 5 | WeavingConstants::WeavingConstants() 6 | { 7 | } 8 | 9 | WeavingConstants::~WeavingConstants() 10 | { 11 | } 12 | 13 | const string WeavingConstants::WEAVING_MATERIAL_TYPE_KEY = "weav_con_mat_type"; 14 | 15 | -------------------------------------------------------------------------------- /engine/calculators/include/HitPointsCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class HitPointsCalculator 5 | { 6 | public: 7 | static int calculate_hit_points_bonus(const CreaturePtr& creature); 8 | 9 | protected: 10 | HitPointsCalculator(); 11 | ~HitPointsCalculator(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/calculators/include/IHitTypeFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IHitTypeCalculator.hpp" 3 | #include "HitTypes.hpp" 4 | 5 | class IHitTypeFactory 6 | { 7 | public: 8 | static IHitTypeCalculatorPtr create_hit_type(const HitTypeEnum hit_type); 9 | 10 | protected: 11 | IHitTypeFactory(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/calculators/include/ReadCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ActionCost.hpp" 3 | #include "Creature.hpp" 4 | 5 | class ReadCalculator 6 | { 7 | public: 8 | ActionCostValue calculate_reading_acv(CreaturePtr creature); 9 | 10 | protected: 11 | static const int BASE_READING_ACV; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/commands/help/source/unit_tests/HelpKeyboardCommandMap_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Help_HelpKeyboardCommandMap, serialization_id) 4 | { 5 | HelpKeyboardCommandMap hkcm; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_HELP_KEYBOARD_COMMAND_MAP, hkcm.get_class_identifier()); 8 | } 9 | -------------------------------------------------------------------------------- /engine/commands/magic/source/unit_tests/MagicCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Magic_MagicCommandFactory, serialization_id) 4 | { 5 | MagicCommandFactory mcf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_MAGIC_COMMAND_FACTORY, mcf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/commands/order/source/unit_tests/OrderCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Help_OrderCommandFactory, serialization_id) 4 | { 5 | OrderCommandFactory ocf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_ORDER_COMMAND_FACTORY, ocf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/decision_strategies/search/include/GreedySearchStrategy.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Search.hpp" 3 | 4 | // Used for mindless creatures that shouldn't do any intelligent pathfinding. 5 | class GreedySearchStrategy : public Search 6 | { 7 | protected: 8 | // JCD FIXME: Won't be instantiated yet. 9 | }; 10 | -------------------------------------------------------------------------------- /engine/generators/crypts/include/CryptLayoutStrategyFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ICryptLayoutStrategy.hpp" 3 | #include "CryptLayoutTypes.hpp" 4 | 5 | class CryptLayoutStrategyFactory 6 | { 7 | public: 8 | static ICryptLayoutStrategyPtr create_layout_strategy(const CryptLayoutType layout_type); 9 | }; 10 | -------------------------------------------------------------------------------- /include/ColourUtils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Colours.hpp" 3 | 4 | class ColourUtils 5 | { 6 | public: 7 | static Colour get_alternate_hue(const Colour c); 8 | 9 | protected: 10 | ColourUtils(); 11 | ~ColourUtils(); 12 | 13 | static const int COLOUR_BOLD_OFFSET; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /display/animation/include/DefaultAnimationFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AnimationFactory.hpp" 3 | 4 | class DefaultAnimationFactory : public AnimationFactory 5 | { 6 | public: 7 | virtual AnimationInstructionPtr create_draw_instruction(const Coordinate& c, const DisplayTile& display_tile) const; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/actions/include/CurrencyAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IActionManager.hpp" 3 | 4 | class CurrencyAction : public IActionManager 5 | { 6 | public: 7 | ActionCostValue count_currency(CreaturePtr creature); 8 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/calculators/include/ItemDropRateCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class ItemDropRateCalculator 5 | { 6 | public: 7 | int calculate_pct_chance_item_drop(CreaturePtr creature); 8 | int calculate_pct_chance_item_drop(CreaturePtr creature, const int item_base_rate); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/commands/skills/source/unit_tests/SkillsCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Skills_SkillsCommandFactory, serialization_id) 4 | { 5 | SkillsCommandFactory scf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SKILLS_COMMAND_FACTORY, scf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/decision_strategies/magic/include/INPCEffectDecider.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class INPCEffectDecider 5 | { 6 | public: 7 | virtual ~INPCEffectDecider() = default; 8 | virtual bool decide() const = 0; 9 | }; 10 | 11 | using INPCEffectDeciderPtr = std::unique_ptr; 12 | 13 | -------------------------------------------------------------------------------- /engine/generators/worship_sites/include/ChurchGeneratorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Generator.hpp" 3 | 4 | class ChurchGeneratorFactory 5 | { 6 | public: 7 | // Right now, this does nothing... 8 | static GeneratorPtr create_generator(); 9 | 10 | protected: 11 | ChurchGeneratorFactory(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/maps/tiles/features/include/EvilAltarManipulator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AltarManipulator.hpp" 3 | 4 | class EvilAltarManipulator : public AltarManipulator 5 | { 6 | public: 7 | EvilAltarManipulator(FeaturePtr feature); 8 | 9 | std::string get_creature_action_key() const override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/maps/tiles/features/include/GoodAltarManipulator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AltarManipulator.hpp" 3 | 4 | class GoodAltarManipulator : public AltarManipulator 5 | { 6 | public: 7 | GoodAltarManipulator(FeaturePtr feature); 8 | 9 | std::string get_creature_action_key() const override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /display/include/DisplayProperties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class DisplayProperties 5 | { 6 | public: 7 | static const std::string DISPLAY_PROPERTIES_ID; 8 | static const std::string DISPLAY_PROPERTIES_NAME_SID; 9 | 10 | protected: 11 | DisplayProperties(); 12 | ~DisplayProperties(); 13 | }; -------------------------------------------------------------------------------- /docs/src/generate_docs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Called twice due to the two passes needed for the table of contents. 4 | echo 'Generating the Guidebook.' 5 | pdflatex Guide.tex 6 | pdflatex Guide.tex 7 | mv Guide.pdf .. 8 | 9 | echo 'Generating the Command Reference.' 10 | pdflatex Commands.tex 11 | mv Commands.pdf .. 12 | 13 | -------------------------------------------------------------------------------- /engine/calculators/include/ArcanaPointsCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class ArcanaPointsCalculator 5 | { 6 | public: 7 | static int calculate_arcana_points_bonus(const CreaturePtr& c); 8 | 9 | protected: 10 | ArcanaPointsCalculator(); 11 | ~ArcanaPointsCalculator(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/commands/screens/include/ScreenCommandKeys.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class ScreenCommandKeys 5 | { 6 | public: 7 | static const std::string NEXT_PAGE; 8 | static const std::string PREVIOUS_PAGE; 9 | 10 | protected: 11 | ScreenCommandKeys(); 12 | ~ScreenCommandKeys(); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/commands/screens/source/unit_tests/ScreenCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Screens_ScreenCommandFactory, serialization_id) 4 | { 5 | ScreenCommandFactory scf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SCREEN_COMMAND_FACTORY, scf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/scripting/include/ScriptConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class ScriptConstants 5 | { 6 | public: 7 | static const std::string NPC_LEVEL_SCRIPT; 8 | static const std::string SPECIAL_DAY_SCRIPT; 9 | 10 | protected: 11 | ScriptConstants(); 12 | ~ScriptConstants(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /scripts/areas/infinite_dungeon.lua: -------------------------------------------------------------------------------- 1 | require('areas') 2 | 3 | local inf_dungeon = Area:new(89, 98) 4 | inf_dungeon:set_additional_properties({["MAP_PROPERTIES_PERMANENCE"] = "0", ["MAP_PROPERTIES_MAX_DEPTH"] = "inf"}) 5 | inf_dungeon:set_extra_description_sid("TILE_EXTRA_DESCRIPTION_INFINITE_DUNGEON") 6 | 7 | inf_dungeon:insert() 8 | 9 | -------------------------------------------------------------------------------- /texts/titlepoem13_en.txt: -------------------------------------------------------------------------------- 1 | The hard sand breaks, %b 2 | and the grains of it %b 3 | are clear as wine. 4 | %p 5 | Far off over, the leagues of it, %b 6 | the wind, %b 7 | playing on the wide shore, %b 8 | piles little ridges, %b 9 | and the great waves %b 10 | break over it. 11 | %p 12 | - From "Hermes of the Ways", H.D. 13 | %p 14 | -------------------------------------------------------------------------------- /texts/titlepoem7_en.txt: -------------------------------------------------------------------------------- 1 | Theirs be the music, the colour, the glory, the gold; %b 2 | Mine be a handful of ashes, a mouthful of mould. %b 3 | Of the maimed, of the halt and the blind in the rain and the cold - %b 4 | Of these shall my songs be fashioned, my tales be told. 5 | %p 6 | - From "Consecration", John Masefield 7 | %p 8 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/Fountain_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_Fountain, serialization_id) 4 | { 5 | Symbol s('~', Colour::COLOUR_WHITE); 6 | Fountain fountain(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_FOUNTAIN, fountain.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/StoneMarker_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_StoneMarker, serialization_id) 4 | { 5 | Symbol s('&', Colour::COLOUR_WHITE); 6 | StoneMarker st(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_STONE_MARKER, st.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /engine/creatures/include/AirSafetyCondition.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileSafetyCondition.hpp" 3 | 4 | // A class used to determine if an Air tile is safe. 5 | class AirSafetyCondition : public TileSafetyCondition 6 | { 7 | protected: 8 | bool is_tile_safe(CreaturePtr creature, TilePtr tile) const override; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/generators/fortresses/include/CastleGeneratorStrategyFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CastleGenerator.hpp" 3 | #include "CastleGeneratorStrategy.hpp" 4 | 5 | class CastleGeneratorStrategyFactory 6 | { 7 | public: 8 | static CastleGeneratorStrategyPtr create_strategy(const CastleType castle_type); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/generators/include/HillsGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Generator.hpp" 3 | 4 | class HillsGenerator : public SOTW::Generator 5 | { 6 | public: 7 | HillsGenerator(const std::string& map_exit_id); 8 | virtual ~HillsGenerator() = default; 9 | 10 | MapPtr generate(const Dimensions& dim) override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/include/DeityUtils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Game.hpp" 3 | #include "Deity.hpp" 4 | 5 | class DeityUtils 6 | { 7 | public: 8 | static std::pair get_random_deity_with_align(const Game& game); 9 | 10 | protected: 11 | DeityUtils(); 12 | ~DeityUtils(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/items/include/ArtifactItemFilter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IItemFilter.hpp" 3 | 4 | // Used for displaying only artifacts 5 | class ArtifactItemFilter : public IItemFilter 6 | { 7 | public: 8 | virtual ~ArtifactItemFilter() = default; 9 | 10 | bool passes_filter(ItemPtr item) const override; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/items/include/ItemFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.hpp" 3 | 4 | class ItemFactory 5 | { 6 | public: 7 | static ItemPtr create(ItemPtr item_to_clone); 8 | 9 | protected: 10 | ItemFactory(); 11 | ~ItemFactory(); 12 | 13 | static void randomize_item_status(ItemPtr item); 14 | }; 15 | -------------------------------------------------------------------------------- /engine/items/source/ReadableItemFilter.cpp: -------------------------------------------------------------------------------- 1 | #include "ReadableItemFilter.hpp" 2 | 3 | // Check to see if the item is readable 4 | bool ReadableItemFilter::passes_filter(ItemPtr item) const 5 | { 6 | return (item && item->get_readable()); 7 | } 8 | 9 | #ifdef UNIT_TESTS 10 | #include "unit_tests/ReadableItemFilter_test.cpp" 11 | #endif -------------------------------------------------------------------------------- /engine/maps/tiles/features/include/NeutralAltarManipulator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AltarManipulator.hpp" 3 | 4 | class NeutralAltarManipulator : public AltarManipulator 5 | { 6 | public: 7 | NeutralAltarManipulator(FeaturePtr feature); 8 | 9 | std::string get_creature_action_key() const override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/strings/include/PlayerTextKeys.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class PlayerTextKeys 5 | { 6 | public: 7 | static const std::string PLAYER_TEXT_DETAILS_SID; 8 | static const std::string PLAYER_SPEECH_TEXT_SID; 9 | 10 | protected: 11 | PlayerTextKeys(); 12 | ~PlayerTextKeys(); 13 | }; -------------------------------------------------------------------------------- /engine/translators/include/ItemTranslator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.hpp" 3 | 4 | class DisplayItem; 5 | 6 | class ItemTranslator 7 | { 8 | public: 9 | static DisplayItem create_display_item(const bool blind, const ItemPtr& item); 10 | 11 | protected: 12 | ItemTranslator(); 13 | ~ItemTranslator(); 14 | }; 15 | -------------------------------------------------------------------------------- /world/source/MapTypes.cpp: -------------------------------------------------------------------------------- 1 | #include "MapTypes.hpp" 2 | 3 | using namespace std; 4 | 5 | MapID::MapID() 6 | { 7 | } 8 | 9 | const string MapID::MAP_ID_WORLD_MAP = "world_map"; 10 | 11 | MapEventScripts::MapEventScripts() 12 | { 13 | } 14 | 15 | const string MapEventScripts::MAP_EVENT_SCRIPT_CREATE = "map_event_script_create"; 16 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/WheelAndLoom_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_WheelAndLoom, serialization_id) 4 | { 5 | Symbol s('&', Colour::COLOUR_WHITE); 6 | WheelAndLoom w(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_WHEEL_AND_LOOM, w.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /engine/calculators/include/FenceCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class FenceCalculator 5 | { 6 | public: 7 | int calc_pct_chance_break(CreaturePtr creature) const; 8 | int calc_pct_chance_board(CreaturePtr creature) const; 9 | 10 | protected: 11 | static const int PCT_CHANCE_BOARD; 12 | }; 13 | -------------------------------------------------------------------------------- /engine/calculators/include/NullAttackSpeedCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackSpeedCalculator.hpp" 3 | 4 | class NullAttackSpeedCalculator : public AttackSpeedCalculator 5 | { 6 | public: 7 | virtual ~NullAttackSpeedCalculator() = default; 8 | 9 | ActionCostValue calculate(CreaturePtr creature) override; 10 | }; 11 | -------------------------------------------------------------------------------- /engine/calculators/include/WandsCombatSkillMarker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ISkillMarker.hpp" 3 | 4 | class WandsCombatSkillMarker : public ISkillMarker 5 | { 6 | public: 7 | virtual ~WandsCombatSkillMarker() = default; 8 | 9 | virtual std::vector get_marked_skills(CreaturePtr creature) const override; 10 | }; 11 | -------------------------------------------------------------------------------- /engine/commands/order/source/unit_tests/OrderKeyboardCommandMap_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Help_OrderKeyboardCommandMap, serialization_id) 4 | { 5 | OrderKeyboardCommandMap okcm(false, false); 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_ORDER_KEYBOARD_COMMAND_MAP, okcm.get_class_identifier()); 8 | } 9 | -------------------------------------------------------------------------------- /engine/generators/include/SeaGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Generator.hpp" 3 | 4 | class SeaGenerator : public SOTW::Generator 5 | { 6 | public: 7 | SeaGenerator(const std::string& map_exit_id); 8 | virtual ~SeaGenerator() = default; 9 | 10 | virtual MapPtr generate(const Dimensions& dim) override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/generators/settlements/sector/include/SectorFeatureGeneratorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CitySectorTypes.hpp" 3 | #include "SectorFeatureGenerator.hpp" 4 | 5 | class SectorFeatureGeneratorFactory 6 | { 7 | public: 8 | static SectorFeatureGeneratorPtr create(const CitySectorType sector_type); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /world/include/RarityTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | // General rarity enumeration 3 | enum struct Rarity 4 | { 5 | RARITY_COMMON = 0, 6 | RARITY_UNCOMMON = 1, 7 | RARITY_RARE = 2, 8 | RARITY_VERY_RARE = 3 9 | }; 10 | 11 | // Decrement rarity - no wrapping. 12 | Rarity& operator--(Rarity &r); 13 | Rarity operator--(Rarity& r, int); 14 | -------------------------------------------------------------------------------- /world/religion/include/ChampionTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Describes a creature's champion status with a particular deity - 4 | // a creature can be crowned, uncrowned, or a fallen champion. 5 | enum struct ChampionType 6 | { 7 | CHAMPION_TYPE_UNCROWNED = 0, 8 | CHAMPION_TYPE_CROWNED = 1, 9 | CHAMPION_TYPE_FALLEN = 2 10 | }; 11 | -------------------------------------------------------------------------------- /display/include/CursesUtils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class CursesMenuUtils 5 | { 6 | public: 7 | static std::string get_first_menu_selection_shortcut(); 8 | static std::string get_last_menu_selection_shortcut(); 9 | static std::string get_next_menu_selection_shortcut(const char* current_value); 10 | }; 11 | -------------------------------------------------------------------------------- /engine/calculators/include/RangedAttackSpeedCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackSpeedCalculator.hpp" 3 | 4 | class RangedAttackSpeedCalculator : public AttackSpeedCalculator 5 | { 6 | public: 7 | virtual ~RangedAttackSpeedCalculator() = default; 8 | 9 | ActionCostValue calculate(CreaturePtr creature) override; 10 | }; 11 | -------------------------------------------------------------------------------- /engine/calculators/include/RangedCombatSkillMarker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ISkillMarker.hpp" 3 | 4 | class RangedCombatSkillMarker : public ISkillMarker 5 | { 6 | public: 7 | virtual ~RangedCombatSkillMarker() = default; 8 | 9 | virtual std::vector get_marked_skills(CreaturePtr creature) const override; 10 | }; 11 | -------------------------------------------------------------------------------- /engine/commands/equipment/source/unit_tests/EquipmentCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Equipment_EquipmentCommandFactory, serialization_id) 4 | { 5 | EquipmentCommandFactory ecf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_EQUIPMENT_COMMAND_FACTORY, ecf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/commands/inventory/source/unit_tests/InventoryCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Inventory_InventoryCommandFactory, serialization_id) 4 | { 5 | InventoryCommandFactory icf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_INVENTORY_COMMAND_FACTORY, icf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/commands/skills/source/unit_tests/SkillsKeyboardCommandMap_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_Skills_SkillsKeyboardCommandMap, serialization_id) 4 | { 5 | SkillsKeyboardCommandMap skcm; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_SKILLS_KEYBOARD_COMMAND_MAP, skcm.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/generators/rooms/include/RoomGeneratorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IRoomGenerator.hpp" 3 | #include "RoomTypes.hpp" 4 | 5 | class RoomGeneratorFactory 6 | { 7 | public: 8 | IRoomGeneratorPtr create_room_generator(const RoomType room_type); 9 | IRoomGeneratorPtr create_random_special_room_generator(); 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/generators/settlements/sector/source/DefaultSectorFeatureGenerator.cpp: -------------------------------------------------------------------------------- 1 | #include "DefaultSectorFeatureGenerator.hpp" 2 | 3 | bool DefaultSectorFeatureGenerator::create_feature(MapPtr /*map*/, const Coordinate& /*start_coord*/, const Coordinate& /*end_coord*/, const int /*feat_idx*/, const int /*f_type*/) 4 | { 5 | return false; 6 | } 7 | -------------------------------------------------------------------------------- /engine/maps/source/MapTypeQueries.cpp: -------------------------------------------------------------------------------- 1 | #include "MapTypeQueries.hpp" 2 | 3 | // General overworld queries 4 | bool DepthlessMapTypeQuery::should_update_depth() const 5 | { 6 | return false; 7 | } 8 | 9 | // General underworld, air, cosmos queries 10 | bool DepthMapTypeQuery::should_update_depth() const 11 | { 12 | return true; 13 | } 14 | -------------------------------------------------------------------------------- /engine/strings/include/MembershipTextKeys.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class MembershipTextKeys 5 | { 6 | public: 7 | static const std::string MEMBERSHIP_CHAMPION; 8 | static const std::string MEMBERSHIP_FALLEN_CHAMPION; 9 | 10 | protected: 11 | MembershipTextKeys(); 12 | ~MembershipTextKeys(); 13 | }; 14 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/guild_greeter.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | 3 | -- The friendly thief in the SW "house" in Carcassia A1. 4 | message_sid = "CARCASSIA_THIEF_HOUSE_SID" 5 | 6 | if creature_is_class(PLAYER_ID, CLASS_ID_THIEF) then 7 | message_sid = "CARCASSIA_THIEF_WELCOME_SID" 8 | end 9 | 10 | clear_and_add_message(message_sid) 11 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/EastWestPew_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_EastWestPew, serialization_id) 4 | { 5 | Symbol s('|', Colour::COLOUR_WHITE); 6 | 7 | EastWestPew ewpew(s); 8 | 9 | EXPECT_EQ(ClassIdentifier::CLASS_ID_EAST_WEST_PEW, ewpew.get_class_identifier()); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /engine/actions/include/LatestMessagesAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "IActionManager.hpp" 4 | 5 | class LatestMessagesAction : public IActionManager 6 | { 7 | public: 8 | ActionCostValue latest_messages(CreaturePtr creature); 9 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 10 | }; 11 | -------------------------------------------------------------------------------- /engine/actions/include/ShowConductsAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "IActionManager.hpp" 4 | 5 | class ShowConductsAction : public IActionManager 6 | { 7 | public: 8 | ActionCostValue show_conducts(CreaturePtr creature); 9 | 10 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/calculators/include/MagicalCombatSkillMarker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ISkillMarker.hpp" 3 | 4 | class MagicalCombatSkillMarker : public ISkillMarker 5 | { 6 | public: 7 | virtual ~MagicalCombatSkillMarker() = default; 8 | 9 | virtual std::vector get_marked_skills(CreaturePtr creature) const override; 10 | }; 11 | -------------------------------------------------------------------------------- /engine/effects/include/GainAttributesTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct GainAttributesEnum 4 | { 5 | GAIN_ATTRIBUTES_STRENGTH, 6 | GAIN_ATTRIBUTES_DEXTERITY, 7 | GAIN_ATTRIBUTES_AGILITY, 8 | GAIN_ATTRIBUTES_HEALTH, 9 | GAIN_ATTRIBUTES_INTELLIGENCE, 10 | GAIN_ATTRIBUTES_WILLPOWER, 11 | GAIN_ATTRIBUTES_CHARISMA 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/generators/include/DesertGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Generator.hpp" 3 | 4 | class DesertGenerator : public SOTW::Generator 5 | { 6 | public: 7 | DesertGenerator(const std::string& map_exit_id); 8 | virtual ~DesertGenerator() = default; 9 | 10 | virtual MapPtr generate(const Dimensions& dim) override; 11 | }; 12 | -------------------------------------------------------------------------------- /scripts/quests/telari/the_worldsinger.lua: -------------------------------------------------------------------------------- 1 | if get_num_deities() == 0 then 2 | clear_and_add_message("THE_WORLDSINGER_GODSLAYER_SPEECH_TEXT_SID") 3 | else 4 | add_message_with_pause("THE_WORLDSINGER_SPEECH_TEXT_SID") 5 | add_message_with_pause("THE_WORLDSINGER_SPEECH_TEXT2_SID") 6 | clear_and_add_message("THE_WORLDSINGER_SPEECH_TEXT3_SID") 7 | end 8 | -------------------------------------------------------------------------------- /world/include/Ring.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Wearable.hpp" 3 | 4 | class Ring : public Wearable 5 | { 6 | public: 7 | Ring(); 8 | ~Ring(); 9 | 10 | Item* clone() override; 11 | 12 | private: 13 | ClassIdentifier internal_class_identifier() const override; 14 | }; 15 | 16 | using RingPtr = std::shared_ptr; 17 | -------------------------------------------------------------------------------- /world/tiles/features/source/unit_tests/JewelerWorkbench_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_Features_JewelerWorkbench, serialization_id) 4 | { 5 | Symbol s('&', Colour::COLOUR_WHITE); 6 | JewelerWorkbench j(s); 7 | 8 | EXPECT_EQ(ClassIdentifier::CLASS_ID_JEWELER_WORKBENCH, j.get_class_identifier()); 9 | } 10 | 11 | -------------------------------------------------------------------------------- /display/animation/source/AnimationFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "AnimationFactory.hpp" 2 | #include "PauseAnimationInstruction.hpp" 3 | 4 | AnimationInstructionPtr AnimationFactory::create_pause_instruction() const 5 | { 6 | AnimationInstructionPtr pause; 7 | 8 | pause = std::make_unique(); 9 | 10 | return pause; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /engine/XML/include/XMLResistancesReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class Resistances; 4 | class XMLNode; 5 | 6 | class XMLResistancesReader 7 | { 8 | public: 9 | Resistances get_resistances(const XMLNode& resistances_node); 10 | 11 | protected: 12 | void parse_resistances(Resistances& resistances, const XMLNode& resistances_node); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/calculators/include/MagicalAttackSpeedCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackSpeedCalculator.hpp" 3 | 4 | class MagicalAttackSpeedCalculator : public AttackSpeedCalculator 5 | { 6 | public: 7 | virtual ~MagicalAttackSpeedCalculator() = default; 8 | 9 | ActionCostValue calculate(CreaturePtr creature) override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/calculators/include/ModifyStatisticsCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Class that calculates the length of the Modify Statistics effect. 4 | class ModifyStatisticsCalculator 5 | { 6 | public: 7 | int calculate_duration() const; 8 | 9 | protected: 10 | static const int BASE_MODIFY_STATISTICS_DURATION_MEAN; 11 | }; 12 | 13 | 14 | -------------------------------------------------------------------------------- /engine/calculators/source/DangerLevelProperties.cpp: -------------------------------------------------------------------------------- 1 | #include "DangerLevelProperties.hpp" 2 | 3 | using namespace std; 4 | 5 | const string DangerLevelProperties::DANGER_LEVEL_PROPERTIES_TILE_TYPE = "tile_type"; 6 | 7 | DangerLevelProperties::DangerLevelProperties() 8 | { 9 | } 10 | 11 | DangerLevelProperties::~DangerLevelProperties() 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /engine/calculators/source/WandsCombatSkillMarker.cpp: -------------------------------------------------------------------------------- 1 | #include "WandsCombatSkillMarker.hpp" 2 | 3 | using namespace std; 4 | 5 | // Ranged combat trains archery and the appropriate weapon skill. 6 | vector WandsCombatSkillMarker::get_marked_skills(CreaturePtr /*creature*/) const 7 | { 8 | return {SkillType::SKILL_GENERAL_WANDCRAFT}; 9 | } 10 | -------------------------------------------------------------------------------- /engine/combat/include/PlayerDeathManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DeathManager.hpp" 3 | 4 | class PlayerDeathManager : public DeathManager 5 | { 6 | public: 7 | PlayerDeathManager(CreaturePtr attacking_creature, CreaturePtr dead_creature, MapPtr map); 8 | virtual ~PlayerDeathManager(); 9 | 10 | void die() const override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/magic/include/ReflectiveBeamShapeProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "BeamShapeProcessor.hpp" 3 | 4 | class ReflectiveBeamShapeProcessor : public BeamShapeProcessor 5 | { 6 | public: 7 | virtual ~ReflectiveBeamShapeProcessor() = default; 8 | 9 | protected: 10 | virtual bool should_beam_reflect() const override; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/maps/include/MapTypeQueryFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IMapTypeQuery.hpp" 3 | #include "MapTypes.hpp" 4 | 5 | class MapTypeQueryFactory 6 | { 7 | public: 8 | static IMapTypeQueryPtr create_map_type_query(const MapType map_type); 9 | 10 | protected: 11 | MapTypeQueryFactory(); 12 | ~MapTypeQueryFactory(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/skills/include/SwimmingSkillProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SkillProcessor.hpp" 3 | 4 | class SwimmingSkillProcessor : public SkillProcessor 5 | { 6 | public: 7 | ActionCostValue process(CreaturePtr creature, MapPtr map /* unused by SwimmingSkillProcessor */) override; 8 | virtual SkillProcessorPtr clone() override; 9 | }; 10 | -------------------------------------------------------------------------------- /world/source/CreatureTypes.cpp: -------------------------------------------------------------------------------- 1 | #include "CreatureTypes.hpp" 2 | 3 | using namespace std; 4 | 5 | CreatureReferences::CreatureReferences() 6 | { 7 | } 8 | 9 | CreatureReferences::~CreatureReferences() 10 | { 11 | } 12 | 13 | const string CreatureReferences::HIRELING = "hireling"; 14 | const string CreatureReferences::ADVENTURER = "adventurer"; 15 | 16 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLAltarReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | // Create an Altar from the given Altar node. See CustomMap.xsd for 5 | // details. 6 | class XMLAltarReader : public IXMLFeatureReader 7 | { 8 | public: 9 | FeaturePtr create(const XMLNode& altar_node) const override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/include/XMLConfigurableFeatureCMReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IXMLFeatureReader.hpp" 3 | 4 | // Reads ConfigurableFeatures from custom maps 5 | class XMLConfigurableFeatureCMReader : public IXMLFeatureReader 6 | { 7 | public: 8 | FeaturePtr create(const XMLNode& config_feature_node) const override; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/calculators/include/BaseDangerLevelCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DangerLevelCalculator.hpp" 3 | 4 | class BaseDangerLevelCalculator : public DangerLevelCalculator 5 | { 6 | public: 7 | virtual ~BaseDangerLevelCalculator() = default; 8 | 9 | virtual int calculate(MapPtr old_map, MapPtr new_map) const override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/calculators/include/SkillMarkerFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackTypes.hpp" 3 | #include "ISkillMarker.hpp" 4 | 5 | class SkillMarkerFactory 6 | { 7 | public: 8 | static ISkillMarkerPtr create_skill_marker(const AttackType attack_type); 9 | 10 | protected: 11 | SkillMarkerFactory(); 12 | ~SkillMarkerFactory(); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/commands/help/include/HelpCommandProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ActionCost.hpp" 3 | #include "Creature.hpp" 4 | 5 | class HelpCommandProcessor 6 | { 7 | public: 8 | static ActionCostValue process(CreaturePtr creature, Command* command); 9 | 10 | protected: 11 | HelpCommandProcessor(); 12 | ~HelpCommandProcessor(); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/commands/screens/include/ScreenCommands.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Command.hpp" 3 | 4 | class NextPageScreenCommand : public Command 5 | { 6 | public: 7 | NextPageScreenCommand(int key); 8 | }; 9 | 10 | class PreviousPageScreenCommand : public Command 11 | { 12 | public: 13 | PreviousPageScreenCommand(int key); 14 | }; 15 | 16 | 17 | -------------------------------------------------------------------------------- /engine/description/codex/include/ArmourCodexDescriber.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WearableCodexDescriber.hpp" 3 | #include "Wearable.hpp" 4 | 5 | class ArmourCodexDescriber : public WearableCodexDescriber 6 | { 7 | public: 8 | ArmourCodexDescriber(WearablePtr wearable); 9 | virtual ~ArmourCodexDescriber() = default; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/generators/tile_config/include/CairnTileConfiguration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DefaultTileConfiguration.hpp" 3 | 4 | class CairnTileConfiguration : public DefaultTileConfiguration 5 | { 6 | public: 7 | virtual void configure(TilePtr tile, const Season season) const override; 8 | virtual ~CairnTileConfiguration() = default; 9 | }; 10 | -------------------------------------------------------------------------------- /engine/generators/tile_config/include/WheatTileConfiguration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DefaultTileConfiguration.hpp" 3 | 4 | class WheatTileConfiguration : public DefaultTileConfiguration 5 | { 6 | public: 7 | virtual void configure(TilePtr tile, const Season season) const override; 8 | virtual ~WheatTileConfiguration() = default; 9 | }; 10 | -------------------------------------------------------------------------------- /engine/items/include/EdibleItemFilter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IItemFilter.hpp" 3 | 4 | // A filter that includes only items whose type is either FOOD or PLANT. 5 | class EdibleItemFilter : public IItemFilter 6 | { 7 | public: 8 | virtual ~EdibleItemFilter() = default; 9 | 10 | bool passes_filter(ItemPtr item) const override; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/time/source/RegenerationConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "RegenerationConstants.hpp" 2 | 3 | const int RegenerationConstants::MINUTES_PER_HP_BASE = 30; 4 | const int RegenerationConstants::MINUTES_PER_AP_BASE = 30; 5 | 6 | RegenerationConstants::RegenerationConstants() 7 | { 8 | } 9 | 10 | RegenerationConstants::~RegenerationConstants() 11 | { 12 | } 13 | 14 | -------------------------------------------------------------------------------- /world/include/Amulet.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Wearable.hpp" 3 | 4 | class Amulet : public Wearable 5 | { 6 | public: 7 | Amulet(); 8 | ~Amulet(); 9 | 10 | Item* clone() override; 11 | 12 | private: 13 | ClassIdentifier internal_class_identifier() const override; 14 | }; 15 | 16 | using AmuletPtr = std::shared_ptr; 17 | -------------------------------------------------------------------------------- /world/include/BrandConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class BrandConstants 4 | { 5 | public: 6 | static const double BRAND_RESISTANCE_AMOUNT; 7 | static const int BRAND_ADDITIONAL_WEAPON_DICE; 8 | static const int BRAND_DAMAGE_MODIFIER; 9 | 10 | protected: 11 | BrandConstants(); 12 | ~BrandConstants(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /world/include/SmithingConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class SmithingConstants 5 | { 6 | public: 7 | static const std::string SMITHING_CONSTANTS_MATERIAL_TYPE; 8 | static const std::string SMITHING_CONSTANTS_JEWELRY_MATERIAL_TYPE; 9 | 10 | protected: 11 | SmithingConstants(); 12 | ~SmithingConstants(); 13 | }; 14 | -------------------------------------------------------------------------------- /world/magic/source/EffectProperties.cpp: -------------------------------------------------------------------------------- 1 | #include "EffectProperties.hpp" 2 | 3 | using namespace std; 4 | 5 | EffectProperties::EffectProperties() 6 | { 7 | } 8 | 9 | EffectProperties::~EffectProperties() 10 | { 11 | } 12 | 13 | const string EffectProperties::EFFECT_PROPERTIES_TELEPORT_LOCATION = "EFFECT_PROPERTIES_TELEPORT_LOCATION"; 14 | 15 | -------------------------------------------------------------------------------- /engine/calculators/include/PapercraftCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class PapercraftCalculator 5 | { 6 | public: 7 | int calculate_pct_chance_success(CreaturePtr creature); 8 | 9 | protected: 10 | static const int BASE_PCT_CHANCE_SUCCESS; 11 | static const int PAPERCRAFT_SKILL_DIVISOR; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/calculators/include/ScythingCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class ScythingCalculator 5 | { 6 | public: 7 | int calc_pct_chance_scything_continues(CreaturePtr creature, const SkillType st, const int total_attacks); 8 | 9 | protected: 10 | static const int SCYTHING_ATTACK_MULTIPLIER; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/combat/include/DeathManagerFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DeathManager.hpp" 3 | 4 | class DeathManagerFactory 5 | { 6 | public: 7 | static DeathManagerPtr create_death_manager(CreaturePtr attacking_creature, CreaturePtr dead_creature, MapPtr map); 8 | 9 | protected: 10 | DeathManagerFactory(); 11 | ~DeathManagerFactory(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/commands/select_tile/source/unit_tests/TileSelectionCommandFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Commands_SelectTile_TileSelectionCommandFactory, serialization_id) 4 | { 5 | TileSelectionCommandFactory tscf; 6 | 7 | EXPECT_EQ(ClassIdentifier::CLASS_ID_TILE_SELECTION_COMMAND_FACTORY, tscf.get_class_identifier()); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/description/include/IDescriber.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class IDescriber 6 | { 7 | public: 8 | virtual ~IDescriber(); 9 | virtual std::string describe() const = 0; 10 | virtual std::string describe_for_tile_selection() const; 11 | }; 12 | 13 | using IDescriberPtr = std::unique_ptr; 14 | -------------------------------------------------------------------------------- /engine/generators/rooms/include/DankRoomGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IRoomGenerator.hpp" 3 | 4 | class DankRoomGenerator : public IRoomGenerator 5 | { 6 | public: 7 | void generate(MapPtr map, const int start_row, const int end_row, const int start_col, const int end_col) override; 8 | virtual ~DankRoomGenerator() = default; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/generators/rooms/include/NullRoomGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IRoomGenerator.hpp" 3 | 4 | class NullRoomGenerator : public IRoomGenerator 5 | { 6 | public: 7 | void generate(MapPtr map, const int start_row, const int end_row, const int start_col, const int end_col) override; 8 | virtual ~NullRoomGenerator() = default; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/generators/tile_config/include/WeedsTileConfiguration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TreeTileConfiguration.hpp" 3 | 4 | class WeedsTileConfiguration : public TreeTileConfiguration 5 | { 6 | public: 7 | virtual ~WeedsTileConfiguration() = default; 8 | 9 | protected: 10 | virtual void initialize_tree_species_details() override; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/scripting/source/ScriptConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "ScriptConstants.hpp" 2 | 3 | using namespace std; 4 | 5 | ScriptConstants::ScriptConstants() 6 | { 7 | } 8 | 9 | ScriptConstants::~ScriptConstants() 10 | { 11 | } 12 | 13 | const string ScriptConstants::NPC_LEVEL_SCRIPT = "npc_lvl"; 14 | const string ScriptConstants::SPECIAL_DAY_SCRIPT = "spec_day"; 15 | 16 | -------------------------------------------------------------------------------- /engine/skills/include/MountainLoreSkillProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SkillProcessor.hpp" 3 | 4 | class MountainLoreSkillProcessor : public SkillProcessor 5 | { 6 | public: 7 | ActionCostValue process(CreaturePtr creature, MapPtr map /* Unused by MountainLoreSkillProcessor */); 8 | virtual SkillProcessorPtr clone() override; 9 | 10 | }; 11 | -------------------------------------------------------------------------------- /engine/strings/include/WorldMapLocationTextKeys.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class WorldMapLocationTextKeys 5 | { 6 | public: 7 | static const std::string STARTING_LOCATION; 8 | static const std::string CURRENT_PLAYER_LOCATION; 9 | 10 | protected: 11 | WorldMapLocationTextKeys(); 12 | ~WorldMapLocationTextKeys(); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/translators/include/ViewMapTranslator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Map.hpp" 3 | 4 | class ViewMapTranslator 5 | { 6 | public: 7 | static MapPtr create_view_map_around_tile(CreaturePtr creature, MapPtr original_map, const Coordinate& centre, const int size); 8 | 9 | protected: 10 | ViewMapTranslator(); 11 | ~ViewMapTranslator(); 12 | }; 13 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/calabus.lua: -------------------------------------------------------------------------------- 1 | add_message_with_pause("CALABUS_SPEECH_TEXT_SID") 2 | add_message_with_pause("CALABUS_SPEECH_TEXT2_SID") 3 | add_message_with_pause("CALABUS_SPEECH_TEXT3_SID") 4 | add_message_with_pause("CALABUS_SPEECH_TEXT4_SID") 5 | add_message_with_pause("CALABUS_SPEECH_TEXT5_SID") 6 | clear_and_add_message("CALABUS_SPEECH_TEXT6_SID") 7 | 8 | -------------------------------------------------------------------------------- /win_release_sounds_zip.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | mkdir dist_sounds\effects 3 | mkdir dist_sounds\music 4 | copy assets\sound\effects\* dist_sounds\effects 5 | copy assets\sound\music\* dist_sounds\music 6 | copy license dist_sounds 7 | cd dist_sounds 8 | 7z.exe a -tzip ShadowOfTheWyrm-Sounds.zip * -r 9 | cd .. 10 | @ECHO dist_sounds\ShadowOfTheWyrm-Sounds.zip created! 11 | -------------------------------------------------------------------------------- /world/include/Armour.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Wearable.hpp" 3 | 4 | class Armour : public Wearable 5 | { 6 | public: 7 | Armour(); 8 | ~Armour(); 9 | 10 | Item* clone() override; 11 | 12 | private: 13 | virtual ClassIdentifier internal_class_identifier() const override; 14 | }; 15 | 16 | using ArmourPtr = std::shared_ptr; 17 | -------------------------------------------------------------------------------- /display/animation/source/DrawAnimationInstruction.cpp: -------------------------------------------------------------------------------- 1 | #include "DrawAnimationInstruction.hpp" 2 | 3 | DrawAnimationInstruction::DrawAnimationInstruction(const Coordinate& new_coords, const DisplayTile& new_tile) 4 | : coords(new_coords), tile(new_tile) 5 | { 6 | } 7 | 8 | Coordinate DrawAnimationInstruction::get_coords() const 9 | { 10 | return coords; 11 | } 12 | -------------------------------------------------------------------------------- /engine/XML/include/XMLRingReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLWearableReader.hpp" 3 | #include "Ring.hpp" 4 | 5 | class XMLRingReader : public XMLWearableReader 6 | { 7 | public: 8 | XMLRingReader(); 9 | ~XMLRingReader(); 10 | 11 | void parse(RingPtr ring, GenerationValues& igv, const XMLNode& ring_node); 12 | 13 | protected: 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /engine/calculators/include/ScoreConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "common.hpp" 5 | 6 | class ScoreConstants 7 | { 8 | public: 9 | static const uint END_BOSS_BONUS; 10 | static const uint LEVEL_MULTIPLIER; 11 | static const std::vector> EXPERIENCE_TIER_MULTIPLIERS; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/generators/rooms/include/BasicRoomGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IRoomGenerator.hpp" 3 | 4 | class BasicRoomGenerator : public IRoomGenerator 5 | { 6 | public: 7 | void generate(MapPtr map, const int start_row, const int end_row, const int start_col, const int end_col) override; 8 | virtual ~BasicRoomGenerator() = default; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/items/include/ItemUnpaidFilter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "IItemFilter.hpp" 4 | 5 | // Display an item if it's unpaid. 6 | class ItemUnpaidFilter : public IItemFilter 7 | { 8 | public: 9 | ItemUnpaidFilter(); 10 | virtual ~ItemUnpaidFilter() = default; 11 | 12 | bool passes_filter(ItemPtr item) const override; 13 | }; 14 | -------------------------------------------------------------------------------- /engine/time/include/CreatureStatuses.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "HPRegenerationCalculator.hpp" 3 | #include "ICreatureRegeneration.hpp" 4 | 5 | class CreatureStatuses : public ICreatureRegeneration 6 | { 7 | public: 8 | void tick(CreaturePtr creature, TilePtr tile, const ulonglong minutes_this_tick, const ulonglong total_minutes_elapsed) override; 9 | }; 10 | -------------------------------------------------------------------------------- /world/include/DamageFlagFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "DamageFlag.hpp" 4 | 5 | class DamageFlagFactory 6 | { 7 | public: 8 | DamageFlagFactory(); 9 | 10 | DamageFlag create_damage_flag(const DamageFlagType dft); 11 | 12 | protected: 13 | std::map description_sids; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /world/tiles/include/DigChancesFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DigChances.hpp" 3 | #include "ClassIdentifiers.hpp" 4 | 5 | class DigChancesFactory 6 | { 7 | public: 8 | static std::pair create_feature_dig_chances(const ClassIdentifier ci); 9 | 10 | protected: 11 | DigChancesFactory(); 12 | ~DigChancesFactory(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/XML/include/XMLConsumableReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Consumable.hpp" 3 | #include "XMLItemReader.hpp" 4 | 5 | class XMLConsumableReader : public XMLItemReader 6 | { 7 | public: 8 | XMLConsumableReader(); 9 | ~XMLConsumableReader(); 10 | 11 | void parse(ConsumablePtr consumable, GenerationValues& gv, const XMLNode& consumable_node); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/XML/include/XMLSpellbookReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLReadableReader.hpp" 3 | #include "Spellbook.hpp" 4 | 5 | class XMLSpellbookReader : public XMLReadableReader 6 | { 7 | public: 8 | XMLSpellbookReader(); 9 | ~XMLSpellbookReader(); 10 | 11 | void parse(SpellbookPtr book, GenerationValues& igv, const XMLNode& book_node); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/XML/include/XMLToolReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLDataStructures.hpp" 3 | #include "XMLItemReader.hpp" 4 | #include "Tool.hpp" 5 | 6 | class XMLToolReader : public XMLItemReader 7 | { 8 | public: 9 | XMLToolReader(); 10 | ~XMLToolReader(); 11 | 12 | void parse(ToolPtr tool, GenerationValues& gv, const XMLNode& tool_node); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/calculators/source/UntimedStatusCalculator.cpp: -------------------------------------------------------------------------------- 1 | #include "UntimedStatusCalculator.hpp" 2 | 3 | int UntimedStatusCalculator::calculate_duration_in_minutes(CreaturePtr /*creature*/) const 4 | { 5 | return std::numeric_limits::max(); 6 | } 7 | 8 | int UntimedStatusCalculator::calculate_pct_chance_effect(CreaturePtr /*creature*/) const 9 | { 10 | return 100; 11 | } -------------------------------------------------------------------------------- /engine/decision_strategies/magic/include/AttackNPCMagicDecision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "INPCMagicDecision.hpp" 3 | 4 | class AttackNPCMagicDecision : public INPCMagicDecision 5 | { 6 | public: 7 | std::pair decide(CreaturePtr caster, MapPtr map, const Spell& spell, const std::set& creature_threats) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/decision_strategies/magic/include/NullNPCMagicDecision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "INPCMagicDecision.hpp" 3 | 4 | class NullNPCMagicDecision : public INPCMagicDecision 5 | { 6 | public: 7 | std::pair decide(CreaturePtr caster, MapPtr view_map, const Spell& spell, const std::set& creature_threats) const override; 8 | }; 9 | 10 | -------------------------------------------------------------------------------- /engine/description/include/BlindFeatureDescriber.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "FeatureDescriber.hpp" 3 | #include "Feature.hpp" 4 | 5 | class BlindFeatureDescriber : public FeatureDescriber 6 | { 7 | public: 8 | BlindFeatureDescriber(); 9 | virtual ~BlindFeatureDescriber() = default; 10 | 11 | virtual std::string describe() const override; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/generators/fortresses/include/CastleGeneratorStrategy.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Map.hpp" 3 | 4 | class CastleGeneratorStrategy 5 | { 6 | public: 7 | virtual void generate(MapPtr generate_map) = 0; 8 | virtual ~CastleGeneratorStrategy() = default; 9 | }; 10 | 11 | using CastleGeneratorStrategyPtr = std::unique_ptr; 12 | 13 | -------------------------------------------------------------------------------- /engine/generators/include/PillarGeneratorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IPillarGenerator.hpp" 3 | #include "PillarTypes.hpp" 4 | 5 | // Factory class that generates IPillarGeneratorPtrs based on the type 6 | // provided. 7 | class PillarGeneratorFactory 8 | { 9 | public: 10 | static IPillarGeneratorPtr create_generator(const PillarType pt); 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/generators/include/SkyGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Generator.hpp" 3 | 4 | class SkyGenerator : public SOTW::Generator 5 | { 6 | public: 7 | SkyGenerator(const std::string& map_exit_id); 8 | virtual ~SkyGenerator() = default; 9 | 10 | virtual MapPtr generate(const Dimensions& dim) override; 11 | virtual MapType get_map_type() const override; 12 | }; -------------------------------------------------------------------------------- /engine/generators/rooms/include/RoomTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct RoomType 4 | { 5 | ROOM_TYPE_BASIC = 0, 6 | ROOM_TYPE_SPECIAL_FIRST = 1, 7 | ROOM_TYPE_X = 1, 8 | ROOM_TYPE_WET = 2, 9 | ROOM_TYPE_DANK = 3, 10 | ROOM_TYPE_CAVE_IN = 4, 11 | ROOM_TYPE_MUSH_ROOM = 5, 12 | ROOM_TYPE_SPECIAL_LAST_INC = 5, 13 | ROOM_TYPE_LAST = 6 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /engine/generators/settlements/sector/include/CitySectorGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CitySectorTypes.hpp" 3 | #include "Map.hpp" 4 | 5 | class CitySectorGenerator 6 | { 7 | public: 8 | bool generate_feature(MapPtr map, const Coordinate& start, const Coordinate& end, const CitySectorType sector_type, const int sector_feature_type); 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /scripts/level/ogre.lua: -------------------------------------------------------------------------------- 1 | require('level') 2 | 3 | local function ogre_stat_gain_fn(creature_id, level) 4 | local is_pl = is_player(creature_id) 5 | 6 | if level % 7 == 0 then 7 | incr_str(creature_id, is_pl) 8 | end 9 | end 10 | 11 | local ogre_race_stat_fn = ogre_stat_gain_fn 12 | 13 | level.set_race_stat_gain_level_fn("08_ogre", ogre_race_stat_fn) 14 | 15 | -------------------------------------------------------------------------------- /scripts/quests/carcassia/gambler.lua: -------------------------------------------------------------------------------- 1 | local speech_sids = {"GAMBLER_SPEECH_TEXT_SID", 2 | "GAMBLER_SPEECH_TEXT2_SID", 3 | "GAMBLER_SPEECH_TEXT3_SID", 4 | "GAMBLER_SPEECH_TEXT4_SID", 5 | "GAMBLER_SPEECH_TEXT5_SID"} 6 | 7 | clear_and_add_message(speech_sids[RNG_range(1, #speech_sids)]) 8 | 9 | -------------------------------------------------------------------------------- /texts/titlepoem8_en.txt: -------------------------------------------------------------------------------- 1 | This World is not Conclusion. %b 2 | A Species stands beyond - %b 3 | Invisible, as Music - %b 4 | But positive, as Sound - %b 5 | It beckons, and it baffles - %b 6 | Philosophy, dont know - %b 7 | And through a Riddle, at the last - %b 8 | Sagacity, must go - 9 | %p 10 | - From "This World is not Conclusion", Emily Dickinson 11 | %p 12 | -------------------------------------------------------------------------------- /world/include/StatisticTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct PrimaryStatisticType 4 | { 5 | PRIMARY_STATISTIC_STRENGTH = 0, 6 | PRIMARY_STATISTIC_DEXTERITY = 1, 7 | PRIMARY_STATISTIC_AGILITY = 2, 8 | PRIMARY_STATISTIC_HEALTH = 3, 9 | PRIMARY_STATISTIC_INTELLIGENCE = 4, 10 | PRIMARY_STATISTIC_WILLPOWER = 5, 11 | PRIMARY_STATISTIC_CHARISMA = 6 12 | }; 13 | -------------------------------------------------------------------------------- /engine/XML/include/XMLAmuletReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLWearableReader.hpp" 3 | #include "Amulet.hpp" 4 | 5 | class XMLAmuletReader : public XMLWearableReader 6 | { 7 | public: 8 | XMLAmuletReader(); 9 | ~XMLAmuletReader(); 10 | 11 | void parse(AmuletPtr amulet, GenerationValues& igv, const XMLNode& amulet_node); 12 | 13 | protected: 14 | }; 15 | -------------------------------------------------------------------------------- /engine/XML/include/XMLBaseFeatureReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLReader.hpp" 3 | #include "Feature.hpp" 4 | 5 | class XMLBaseFeatureReader : public XMLReader 6 | { 7 | public: 8 | FeatureSymbolMap get_feature_symbols(const XMLNode& config_features_node); 9 | 10 | protected: 11 | Symbol get_feature_symbol(const XMLNode& base_feature_node); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/XML/include/XMLWandReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLDataStructures.hpp" 3 | #include "XMLItemReader.hpp" 4 | #include "Wand.hpp" 5 | 6 | class XMLWandReader : public XMLItemReader 7 | { 8 | public: 9 | XMLWandReader(); 10 | ~XMLWandReader(); 11 | 12 | void parse(WandPtr wand, GenerationValues& igv, const XMLNode& wand_node); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/calculators/include/SmithingCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Creature.hpp" 4 | 5 | // Calculator used when improving items at a forge with Smithing. 6 | class SmithingCalculator 7 | { 8 | public: 9 | std::vector calculate_pct_chances_extra_point(CreaturePtr creature, const SkillType primary_crafting_skill); 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/combat/include/HitTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct HitTypeEnum 4 | { 5 | HIT_TYPE_REGULAR = 0, 6 | HIT_TYPE_MIGHTY = 1, 7 | HIT_TYPE_CRITICAL = 2 8 | }; 9 | 10 | class HitTypeEnumConverter 11 | { 12 | public: 13 | static HitTypeEnum from_successful_to_hit_roll(const int to_hit); 14 | 15 | protected: 16 | HitTypeEnumConverter(); 17 | }; 18 | -------------------------------------------------------------------------------- /engine/maps/include/MapTypeQueries.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IMapTypeQuery.hpp" 3 | 4 | class DepthlessMapTypeQuery : public IMapTypeQuery 5 | { 6 | public: 7 | virtual bool should_update_depth() const override; 8 | }; 9 | 10 | class DepthMapTypeQuery : public IMapTypeQuery 11 | { 12 | public: 13 | virtual bool should_update_depth() const override; 14 | }; 15 | -------------------------------------------------------------------------------- /engine/maps/tiles/features/include/IFeatureManipulatorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "FeatureManipulator.hpp" 3 | 4 | class IFeatureManipulatorFactory 5 | { 6 | public: 7 | FeatureManipulatorPtr static create_manipulator(FeaturePtr feature); 8 | 9 | protected: 10 | IFeatureManipulatorFactory() {}; 11 | ~IFeatureManipulatorFactory() {}; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/screens/include/EyeSelectionScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Screen.hpp" 3 | #include "Display.hpp" 4 | 5 | class EyeSelectionScreen : public Screen 6 | { 7 | public: 8 | EyeSelectionScreen(DisplayPtr display, const std::string& synopsis); 9 | 10 | protected: 11 | void initialize() override; 12 | 13 | const std::string creature_synopsis; 14 | }; 15 | -------------------------------------------------------------------------------- /engine/screens/include/WornLocationScreenFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WornLocationSelectionScreen.hpp" 3 | #include "Display.hpp" 4 | 5 | class WornLocationScreenFactory 6 | { 7 | public: 8 | WornLocationSelectionScreenPtr create_skin_screen(DisplayPtr display); 9 | WornLocationSelectionScreenPtr create_weaving_screen(DisplayPtr display); 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/skills/include/DetectionSkillProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | #include "Map.hpp" 4 | #include "SkillProcessor.hpp" 5 | 6 | class DetectionSkillProcessor : public SkillProcessor 7 | { 8 | public: 9 | virtual ActionCostValue process(CreaturePtr player, MapPtr map) override; 10 | virtual SkillProcessorPtr clone() override; 11 | 12 | }; 13 | -------------------------------------------------------------------------------- /scripts/level/giant.lua: -------------------------------------------------------------------------------- 1 | require('level') 2 | 3 | local function giant_stat_gain_fn(creature_id, level) 4 | local is_pl = is_player(creature_id) 5 | 6 | if level % 7 == 0 then 7 | incr_str(creature_id, is_pl) 8 | end 9 | end 10 | 11 | local giant_race_stat_fn = giant_stat_gain_fn 12 | 13 | level.set_race_stat_gain_level_fn("09_giant", giant_race_stat_fn) 14 | 15 | -------------------------------------------------------------------------------- /world/include/GenerationProperties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class GenerationProperties 5 | { 6 | public: 7 | static const std::string GENERATION_PROPERTIES_ITEM_TYPE; 8 | static const std::string GENERATION_PROPERTIES_VALUE; 9 | 10 | protected: 11 | GenerationProperties(); 12 | ~GenerationProperties(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /world/include/WaterTypes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum struct WaterType 4 | { 5 | WATER_TYPE_UNDEFINED, 6 | WATER_TYPE_FRESH, 7 | WATER_TYPE_SALT 8 | }; 9 | 10 | enum struct FishingOutcomeType 11 | { 12 | FISHING_OUTCOME_UNDEFINED, 13 | FISHING_OUTCOME_NO_CATCH, 14 | FISHING_OUTCOME_NIBBLE, 15 | FISHING_OUTCOME_ESCAPE, 16 | FISHING_OUTCOME_CATCH 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /display/source/DisplayProperties.cpp: -------------------------------------------------------------------------------- 1 | #include "DisplayProperties.hpp" 2 | 3 | using namespace std; 4 | 5 | DisplayProperties::DisplayProperties() 6 | { 7 | } 8 | 9 | DisplayProperties::~DisplayProperties() 10 | { 11 | } 12 | 13 | const string DisplayProperties::DISPLAY_PROPERTIES_ID = "display_id"; 14 | const string DisplayProperties::DISPLAY_PROPERTIES_NAME_SID = "display_name_sid"; -------------------------------------------------------------------------------- /engine/calculators/include/FishingCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | #include "WaterTypes.hpp" 4 | 5 | class FishingCalculator 6 | { 7 | public: 8 | std::vector> calculate_fishing_outcomes(CreaturePtr creature) const; 9 | 10 | int get_item_status_outcome_modifier(const ItemPtr wielded_item) const; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/creatures/include/WaterSafetyCondition.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileSafetyCondition.hpp" 3 | 4 | // A class used to determine if a tile is safe, given that it has a super 5 | // type of water. 6 | class WaterSafetyCondition : public TileSafetyCondition 7 | { 8 | protected: 9 | bool is_tile_safe(CreaturePtr creature, TilePtr tile) const override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/decision_strategies/magic/source/NullNPCMagicDecision.cpp: -------------------------------------------------------------------------------- 1 | #include "NullNPCMagicDecision.hpp" 2 | 3 | using namespace std; 4 | 5 | pair NullNPCMagicDecision::decide(CreaturePtr /*caster*/, MapPtr /*view_map*/, const Spell& /*spell*/, const set& /*creature_threats*/) const 6 | { 7 | return make_pair(false, Direction::DIRECTION_NULL); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/screens/include/HairSelectionScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Screen.hpp" 3 | #include "Display.hpp" 4 | 5 | class HairSelectionScreen : public Screen 6 | { 7 | public: 8 | HairSelectionScreen(DisplayPtr display, const std::string& synopsis); 9 | 10 | protected: 11 | void initialize() override; 12 | 13 | const std::string creature_synopsis; 14 | }; 15 | -------------------------------------------------------------------------------- /engine/screens/source/TextComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "TextComponent.hpp" 2 | 3 | TextComponent::TextComponent(const std::string& str, const std::vector& symbols) : ScreenComponent(str, symbols) 4 | { 5 | } 6 | 7 | TextComponent::TextComponent(const std::string& str, const Colour colour, const std::vector& symbols) : ScreenComponent(str, colour, symbols) 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /scripts/level/goblin.lua: -------------------------------------------------------------------------------- 1 | require('level') 2 | 3 | local function goblin_stat_gain_fn(creature_id, level) 4 | local is_pl = is_player(creature_id) 5 | 6 | if level % 7 == 0 then 7 | incr_agi(creature_id, is_pl) 8 | end 9 | end 10 | 11 | local goblin_race_stat_fn = goblin_stat_gain_fn 12 | 13 | level.set_race_stat_gain_level_fn("07_goblin", goblin_race_stat_fn) 14 | 15 | -------------------------------------------------------------------------------- /texts/titlepoem9_en.txt: -------------------------------------------------------------------------------- 1 | Over hill, over dale, %b 2 | thorough brush, thorough brier, %b 3 | Over park, over pale, %b 4 | Thorough flood, thorough fire, %b 5 | I do wander everywhere, %b 6 | Swifter than the moon's sphere; %b 7 | And I serve the fairy queen, %b 8 | to dew her orbs upon the green. 9 | %p 10 | - From "A Midsummer Night's Dream", William Shakespeare 11 | %p 12 | -------------------------------------------------------------------------------- /world/include/IntelligenceConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class IntelligenceConstants 4 | { 5 | public: 6 | static const int MIN_INTELLIGENCE_UNDERSTAND_SAFETY; 7 | static const int MIN_INTELLIGENCE_OPEN_DOORS; 8 | static const int MIN_INTELLIGENCE_UNDERSTAND_CORPSES; 9 | 10 | private: 11 | IntelligenceConstants(); 12 | ~IntelligenceConstants(); 13 | }; 14 | -------------------------------------------------------------------------------- /world/include/MiscItem.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.hpp" 3 | 4 | class MiscItem : public Item 5 | { 6 | public: 7 | MiscItem(); 8 | ~MiscItem(); 9 | 10 | bool additional_item_attributes_match(ItemPtr item) const override; 11 | 12 | Item* clone() override; 13 | 14 | private: 15 | ClassIdentifier internal_class_identifier() const override; 16 | }; 17 | -------------------------------------------------------------------------------- /display/animation/include/DefaultDrawAnimationInstruction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DrawAnimationInstruction.hpp" 3 | 4 | class DefaultDrawAnimationInstruction : public DrawAnimationInstruction 5 | { 6 | public: 7 | DefaultDrawAnimationInstruction(const Coordinate& c, const DisplayTile& disp); 8 | 9 | virtual void execute(Display* const display) override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/XML/source/XMLBoatReader.cpp: -------------------------------------------------------------------------------- 1 | #include "XMLBoatReader.hpp" 2 | 3 | XMLBoatReader::XMLBoatReader() 4 | { 5 | } 6 | 7 | XMLBoatReader::~XMLBoatReader() 8 | { 9 | } 10 | 11 | void XMLBoatReader::parse(BoatPtr boat, GenerationValues& gv, const XMLNode& boat_node) 12 | { 13 | if (!boat_node.is_null()) 14 | { 15 | XMLItemReader::parse(boat, gv, boat_node); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /engine/actions/include/MovementAccumulationUpdater.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | #include "MovementTypes.hpp" 4 | #include "Tile.hpp" 5 | 6 | class MovementAccumulationUpdater 7 | { 8 | public: 9 | void update(CreaturePtr creature, TilePtr new_tile); 10 | 11 | protected: 12 | MovementType get_movement_type(CreaturePtr creature, TilePtr tile); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/actions/include/VersionAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IActionManager.hpp" 3 | 4 | class VersionAction : public IActionManager 5 | { 6 | public: 7 | ActionCostValue version() const; 8 | 9 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 10 | 11 | protected: 12 | friend class ActionManager; 13 | VersionAction(); 14 | }; 15 | -------------------------------------------------------------------------------- /engine/actions/read/include/ScrollReadStrategy.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ReadStrategy.hpp" 3 | 4 | class ScrollReadStrategy : public ReadStrategy 5 | { 6 | public: 7 | ActionCostValue read(CreaturePtr creature, ReadablePtr readable) override; 8 | 9 | protected: 10 | virtual std::pair get_player_and_monster_read_sids() const override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/calculators/include/ScribingCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class ScribingCalculator 5 | { 6 | public: 7 | int calc_castings_per_scroll(CreaturePtr creature); 8 | 9 | protected: 10 | static const int MAX_CASTINGS_PER_SCROLL; 11 | static const int MIN_CASTINGS_PER_SCROLL; 12 | static const int SCRIBING_DIVISOR; 13 | }; -------------------------------------------------------------------------------- /engine/description/include/QuestDescriber.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IDescriber.hpp" 3 | #include "Quests.hpp" 4 | 5 | class QuestDescriber : public IDescriber 6 | { 7 | public: 8 | QuestDescriber(const Quest& new_quest); 9 | virtual ~QuestDescriber() = default; 10 | 11 | std::string describe() const override; 12 | 13 | protected: 14 | Quest quest; 15 | }; 16 | -------------------------------------------------------------------------------- /engine/generators/tile_config/include/EvergreenTreeTileConfiguration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TreeTileConfiguration.hpp" 3 | 4 | class EvergreenTreeTileConfiguration : public TreeTileConfiguration 5 | { 6 | public: 7 | virtual ~EvergreenTreeTileConfiguration() = default; 8 | 9 | protected: 10 | virtual void initialize_tree_species_details() override; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/generators/tile_config/source/WheatTileConfiguration.cpp: -------------------------------------------------------------------------------- 1 | #include "WheatTileConfiguration.hpp" 2 | #include "ItemManager.hpp" 3 | 4 | void WheatTileConfiguration::configure(TilePtr tile, const Season /*season*/) const 5 | { 6 | IInventoryPtr tile_items = tile->get_items(); 7 | ItemManager::create_item_with_probability(1, 5, tile_items, ItemIdKeys::ITEM_ID_WHEAT); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /engine/items/source/unit_tests/NullItemFilter_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "Amulet.hpp" 3 | 4 | TEST(SW_Engine_Items_NullItemFilter, passes_test) 5 | { 6 | NullItemFilter nif; 7 | 8 | ItemPtr no_item; 9 | ItemPtr amulet = std::make_shared(); 10 | 11 | EXPECT_TRUE(nif.passes_filter(no_item)); 12 | EXPECT_TRUE(nif.passes_filter(amulet)); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /scripts/quests/magici_merchant.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('merchant_common') 3 | 4 | -- Magici merchants sell the stuff at hugely inflated prices. 5 | local magici_cost = 500 6 | 7 | merchant_common.chat(PLAYER_ID, MAGICI_SHARD_ID, magici_cost, "MAGICI_MERCHANT_OFFER_SID", "MAGICI_MERCHANT_ACCEPT_SID", "MAGICI_MERCHANT_DECLINE_SID", "MAGICI_MERCHANT_INSUFFICIENT_FUNDS_SID") 8 | -------------------------------------------------------------------------------- /world/source/BrandConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "BrandConstants.hpp" 2 | 3 | const double BrandConstants::BRAND_RESISTANCE_AMOUNT = 0.20; 4 | const int BrandConstants::BRAND_ADDITIONAL_WEAPON_DICE = 1; 5 | const int BrandConstants::BRAND_DAMAGE_MODIFIER = 1; 6 | 7 | BrandConstants::BrandConstants() 8 | { 9 | } 10 | 11 | BrandConstants::~BrandConstants() 12 | { 13 | } 14 | 15 | -------------------------------------------------------------------------------- /world/source/unit_tests/Race_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Race, operator_less_than) 4 | { 5 | Race first; 6 | Race second; 7 | 8 | first.set_race_id("aaa"); 9 | second.set_race_id("aab"); 10 | 11 | EXPECT_TRUE( first < second ); 12 | 13 | first.set_race_id("3"); 14 | second.set_race_id("2"); 15 | 16 | EXPECT_FALSE( first < second ); 17 | } 18 | -------------------------------------------------------------------------------- /engine/XML/include/XMLBoatReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Boat.hpp" 3 | #include "XMLItemReader.hpp" 4 | 5 | class XMLBoatReader : public XMLItemReader 6 | { 7 | public: 8 | XMLBoatReader(); 9 | ~XMLBoatReader(); 10 | 11 | protected: 12 | friend class XMLItemsReader; 13 | void parse(BoatPtr boat, GenerationValues& gv, const XMLNode& boat_node); 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /engine/commands/screens/source/ScreenCommandKeys.cpp: -------------------------------------------------------------------------------- 1 | #include "ScreenCommandKeys.hpp" 2 | 3 | using std::string; 4 | 5 | ScreenCommandKeys::ScreenCommandKeys() 6 | { 7 | } 8 | 9 | ScreenCommandKeys::~ScreenCommandKeys() 10 | { 11 | } 12 | 13 | const string ScreenCommandKeys::NEXT_PAGE = "SCREEN_NEXT_PAGE"; 14 | const string ScreenCommandKeys::PREVIOUS_PAGE = "SCREEN_PREVIOUS_PAGE"; 15 | -------------------------------------------------------------------------------- /engine/generators/settlements/sector/include/ShopSectorFeature.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SectorFeature.hpp" 3 | 4 | class ShopSectorFeature : public SectorFeature 5 | { 6 | public: 7 | virtual ~ShopSectorFeature() = default; 8 | 9 | protected: 10 | bool generate_feature(MapPtr map, const Coordinate& start_coord, const Coordinate& end_coord) override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/magic/include/TileMagicChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Spell.hpp" 3 | #include "Tile.hpp" 4 | 5 | // Class to check whether a tile blocks a spell. If a tile is a wall, etc, 6 | // then the tile should not be included in the spell's calculations. 7 | class TileMagicChecker 8 | { 9 | public: 10 | bool does_tile_block_spell(TilePtr tile, const Spell& spell) const; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/maps/include/IMapTypeQuery.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // A class for querying whether certain things should be done, given the 5 | // type of map. 6 | class IMapTypeQuery 7 | { 8 | public: 9 | virtual bool should_update_depth() const = 0; 10 | virtual ~IMapTypeQuery() {}; 11 | }; 12 | 13 | using IMapTypeQueryPtr = std::unique_ptr; 14 | 15 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/AcidTileDamageProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileDamageProcessor.hpp" 3 | 4 | class AcidTileDamageProcessor : public TileDamageProcessor 5 | { 6 | protected: 7 | virtual std::string get_message_sid() const override; 8 | virtual int get_pct_chance() const override; 9 | virtual bool affects_item(ItemPtr item) override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/ColdTileDamageProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileDamageProcessor.hpp" 3 | 4 | class ColdTileDamageProcessor : public TileDamageProcessor 5 | { 6 | protected: 7 | virtual std::string get_message_sid() const override; 8 | virtual int get_pct_chance() const override; 9 | virtual bool affects_item(ItemPtr item) override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/HeatTileDamageProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileDamageProcessor.hpp" 3 | 4 | class HeatTileDamageProcessor : public TileDamageProcessor 5 | { 6 | protected: 7 | virtual std::string get_message_sid() const override; 8 | virtual int get_pct_chance() const override; 9 | virtual bool affects_item(ItemPtr item) override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/screens/include/EquipmentScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Creature.hpp" 4 | #include "Screen.hpp" 5 | #include "Display.hpp" 6 | 7 | class EquipmentScreen : public Screen 8 | { 9 | public: 10 | EquipmentScreen(DisplayPtr display, CreaturePtr creature); 11 | 12 | protected: 13 | void initialize() override; 14 | CreaturePtr creature; 15 | }; 16 | -------------------------------------------------------------------------------- /engine/time/include/DefaultMovementAccumulationChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ITerrainMovementAccumulationChecker.hpp" 3 | 4 | class DefaultMovementAccumulationChecker : public ITerrainMovementAccumulationChecker 5 | { 6 | public: 7 | void check(CreaturePtr creature) override; 8 | 9 | protected: 10 | void mark_skills(CreaturePtr creature, TilePtr tile); 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/time/source/BoatingMovementAccumulationChecker.cpp: -------------------------------------------------------------------------------- 1 | #include "BoatingMovementAccumulationChecker.hpp" 2 | #include "RNG.hpp" 3 | 4 | void BoatingMovementAccumulationChecker::check(CreaturePtr creature) 5 | { 6 | if (creature) 7 | { 8 | if (RNG::x_in_y_chance(1, 500)) 9 | { 10 | sm.check_skill(creature, SkillType::SKILL_GENERAL_BOATING); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /display/animation/include/PauseAnimationInstruction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AnimationInstruction.hpp" 3 | #include "Display.hpp" 4 | 5 | class PauseAnimationInstruction : public AnimationInstruction 6 | { 7 | public: 8 | virtual ~PauseAnimationInstruction() = default; 9 | 10 | void execute(Display* const) override; 11 | virtual Coordinate get_coords() const; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /display/include/PromptProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "common.hpp" 4 | #include "Prompt.hpp" 5 | 6 | class PromptProcessor 7 | { 8 | public: 9 | virtual ~PromptProcessor() = default; 10 | 11 | Coordinate get_prompt_coords(const PromptLocation pl, const std::string& prompt_text, const int row, const int col, const int max_rows, const int max_cols); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/XML/include/XMLPotionReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLDataStructures.hpp" 3 | #include "XMLConsumableReader.hpp" 4 | #include "Potion.hpp" 5 | 6 | class XMLPotionReader : public XMLConsumableReader 7 | { 8 | public: 9 | XMLPotionReader(); 10 | ~XMLPotionReader(); 11 | 12 | void parse(PotionPtr potion, GenerationValues& igv, const XMLNode& potion_node); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/XML/include/XMLReadableReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "XMLDataStructures.hpp" 3 | #include "XMLItemReader.hpp" 4 | #include "Readable.hpp" 5 | 6 | class XMLReadableReader : public XMLItemReader 7 | { 8 | public: 9 | XMLReadableReader(); 10 | ~XMLReadableReader(); 11 | 12 | void parse(ReadablePtr readable, GenerationValues& gv, const XMLNode& readable_node); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/calculators/include/CreatureToHitCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | // Class that calculates the base to-hit for a creature (based on 5 | // equipment, current ongoing spells, etc). 6 | class CreatureToHitCalculator 7 | { 8 | public: 9 | int calculate_to_hit(CreaturePtr c); 10 | 11 | protected: 12 | int get_equipment_bonus(CreaturePtr c); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/calculators/include/WandsToHitCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ToHitCalculator.hpp" 3 | 4 | class WandsToHitCalculator : public ToHitCalculator 5 | { 6 | public: 7 | WandsToHitCalculator(); 8 | virtual ~WandsToHitCalculator() = default; 9 | 10 | int calculate(CreaturePtr creature) override; 11 | Statistic& get_statistic(CreaturePtr creature) override; 12 | }; 13 | -------------------------------------------------------------------------------- /engine/commands/order/include/OrderCommandProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ActionCost.hpp" 3 | #include "Creature.hpp" 4 | 5 | class OrderCommandProcessor 6 | { 7 | public: 8 | static ActionCostValue process(CreaturePtr creature, Command* command, const std::string& follower_ids); 9 | 10 | protected: 11 | OrderCommandProcessor(); 12 | ~OrderCommandProcessor(); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/commands/skills/include/ShowSkillsCommandProcessor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ISkillsCommandProcessor.hpp" 3 | 4 | class ShowSkillsCommandProcessor : public ISkillsCommandProcessor 5 | { 6 | public: 7 | bool can_process(CreaturePtr creature) override; 8 | ActionCostValue process(CreaturePtr creature, Command* command, MapPtr map, const SkillType st) override; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/conversion/include/AttackDumper.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | #include "StringConverter.hpp" 4 | 5 | class AttackDumper : public StringConverter 6 | { 7 | public: 8 | AttackDumper(CreaturePtr new_creature, const uint new_num_cols); 9 | 10 | std::string str() const override; 11 | 12 | protected: 13 | CreaturePtr creature; 14 | uint num_cols; 15 | }; 16 | -------------------------------------------------------------------------------- /engine/decision_strategies/search/include/BreadthFirstSearchStrategy.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Search.hpp" 3 | 4 | class BreadthFirstSearchStrategy : public Search 5 | { 6 | public: 7 | protected: 8 | // Queue at end 9 | virtual std::list queueing_fn(const std::list& explored_search_nodes, const std::list& new_search_nodes) override; 10 | }; 11 | -------------------------------------------------------------------------------- /engine/generators/tile_config/include/AquaticVegetationTileConfiguration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DefaultTileConfiguration.hpp" 3 | 4 | class AquaticVegetationTileConfiguration : public DefaultTileConfiguration 5 | { 6 | public: 7 | virtual void configure(TilePtr tile, const Season season) const override; 8 | virtual ~AquaticVegetationTileConfiguration() = default; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/scripting/include/MapScript.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Map.hpp" 4 | 5 | class ScriptEngine; 6 | 7 | class MapScript 8 | { 9 | public: 10 | bool execute(ScriptEngine& se, const std::string& map_script, MapPtr map); 11 | 12 | protected: 13 | static const std::string MAP_MODULE_NAME; 14 | static const std::string MAP_FUNCTION_NAME; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /engine/strings/source/PlayerTextKeys.cpp: -------------------------------------------------------------------------------- 1 | #include "PlayerTextKeys.hpp" 2 | 3 | using namespace std; 4 | 5 | const string PlayerTextKeys::PLAYER_TEXT_DETAILS_SID = "PLAYER_TEXT_DETAILS_SID"; 6 | const string PlayerTextKeys::PLAYER_SPEECH_TEXT_SID = "PLAYER_SPEECH_TEXT_SID"; 7 | 8 | PlayerTextKeys::PlayerTextKeys() 9 | { 10 | } 11 | 12 | PlayerTextKeys::~PlayerTextKeys() 13 | { 14 | } -------------------------------------------------------------------------------- /engine/translators/include/EquipmentTranslator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | #include "DisplayItem.hpp" 4 | #include "EquipmentTypes.hpp" 5 | 6 | class EquipmentTranslator 7 | { 8 | public: 9 | static DisplayEquipmentMap create_display_equipment(const CreaturePtr& creature); 10 | 11 | protected: 12 | EquipmentTranslator(); 13 | ~EquipmentTranslator(); 14 | }; 15 | -------------------------------------------------------------------------------- /world/tiles/include/CairnTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class CairnTile : public Tile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | -------------------------------------------------------------------------------- /world/tiles/include/WheatTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class WheatTile : public Tile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | -------------------------------------------------------------------------------- /engine/calculators/include/CreatureCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class CreatureCalculator 5 | { 6 | public: 7 | static void update_calculated_values(const CreaturePtr& c); 8 | static int get_combat_assist_pct(CreaturePtr c); 9 | static int get_pct_chance_pack(CreaturePtr c); 10 | 11 | protected: 12 | static const int BASE_PCT_CHANCE_PACK; 13 | }; 14 | -------------------------------------------------------------------------------- /engine/calculators/include/KilnCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class KilnCalculator 5 | { 6 | public: 7 | int calc_pct_chance_brand() const; 8 | 9 | int calc_min_free_enchants(CreaturePtr creature) const; 10 | int calc_max_free_enchants(CreaturePtr creature) const; 11 | 12 | protected: 13 | static const int ENCHANTS_CRAFTING_DIVISOR; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /scripts/create/cat.lua: -------------------------------------------------------------------------------- 1 | require('create') 2 | 3 | local function create_cat(creature_id, map_id) 4 | -- Cats can be brown, grey, black, or white. 5 | local cat_colours = {3, 7, 8, 15} 6 | local colour = cat_colours[RNG_range(1, #cat_colours)] 7 | 8 | set_creature_colour(creature_id, colour, map_id) 9 | end 10 | 11 | local cat_fn = create_cat 12 | create.set_create_fn("cat", cat_fn) 13 | 14 | -------------------------------------------------------------------------------- /world/tiles/include/PierTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class PierTile : public Tile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /world/tiles/include/ReedsTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class ReedsTile : public Tile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /world/tiles/include/RoadTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class RoadTile : public Tile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /world/tiles/source/TreeSpecies.cpp: -------------------------------------------------------------------------------- 1 | #include "TreeSpecies.hpp" 2 | 3 | TreeSpecies::TreeSpecies() 4 | : species_id(TreeSpeciesID::TREE_SPECIES_CYPRESS), tile_type(TileType::TILE_TYPE_EVERGREEN_TREE) 5 | { 6 | } 7 | 8 | TreeSpeciesID TreeSpecies::get_tree_species() const 9 | { 10 | return species_id; 11 | } 12 | 13 | TileType TreeSpecies::get_tile_type() const 14 | { 15 | return tile_type; 16 | } 17 | -------------------------------------------------------------------------------- /engine/XML/custom_maps/features/source/XMLSignReader.cpp: -------------------------------------------------------------------------------- 1 | #include "FeatureGenerator.hpp" 2 | #include "XMLSignReader.hpp" 3 | 4 | using namespace std; 5 | 6 | FeaturePtr XMLSignReader::create(const XMLNode& sign_node) const 7 | { 8 | string text_sid = XMLUtils::get_child_node_value(sign_node, "TextSID"); 9 | FeaturePtr sign = FeatureGenerator::generate_sign(text_sid); 10 | return sign; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /engine/XML/include/XMLScriptsReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "XMLReader.hpp" 5 | #include "ScriptDetails.hpp" 6 | 7 | class XMLScriptsReader : public XMLReader 8 | { 9 | public: 10 | std::map get_scripts(const XMLNode& scripts_node); 11 | ScriptDetails get_script_details(const XMLNode& script_details_node); 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/actions/include/BreedAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IActionManager.hpp" 3 | 4 | class BreedAction : public IActionManager 5 | { 6 | public: 7 | ActionCostValue breed(CreaturePtr creature, MapPtr map) const; 8 | 9 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 10 | 11 | protected: 12 | friend class ActionManager; 13 | BreedAction(); 14 | }; 15 | -------------------------------------------------------------------------------- /engine/decision_strategies/deity/include/DeityDecisionStrategyFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IDeityDecisionStrategy.hpp" 3 | 4 | class DeityDecisionStrategyFactory 5 | { 6 | public: 7 | static IDeityDecisionStrategyPtr create_deity_decision_strategy(const std::string& deity_id); 8 | 9 | protected: 10 | DeityDecisionStrategyFactory(); 11 | ~DeityDecisionStrategyFactory(); 12 | }; 13 | -------------------------------------------------------------------------------- /engine/generators/settlements/include/SettlementRuinsGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Map.hpp" 3 | #include "SettlementGenerator.hpp" 4 | 5 | class SettlementRuinsGenerator : public SettlementGenerator 6 | { 7 | public: 8 | SettlementRuinsGenerator(MapPtr new_base_map); 9 | 10 | virtual MapPtr generate() override; 11 | virtual MapPtr generate(const Dimensions& dim) override; 12 | }; 13 | -------------------------------------------------------------------------------- /engine/generators/settlements/sector/include/GraveyardSectorFeature.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SectorFeature.hpp" 3 | 4 | class GraveyardSectorFeature : public SectorFeature 5 | { 6 | public: 7 | virtual ~GraveyardSectorFeature() = default; 8 | 9 | protected: 10 | bool generate_feature(MapPtr map, const Coordinate& start_coord, const Coordinate& end_coord) override; 11 | }; 12 | -------------------------------------------------------------------------------- /engine/generators/tile_config/include/DefaultTileConfiguration.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ITileConfiguration.hpp" 3 | 4 | class DefaultTileConfiguration : public ITileConfiguration 5 | { 6 | public: 7 | virtual ~DefaultTileConfiguration() = default; 8 | 9 | virtual void configure(TilePtr tile, const Season season) const override; 10 | virtual void initialize() override; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/items/include/ReadableItemFilter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IItemFilter.hpp" 3 | 4 | // A filter that includes only items whose "readable" flag is set 5 | // to true. This should only be books and scrolls. 6 | class ReadableItemFilter : public IItemFilter 7 | { 8 | public: 9 | virtual ~ReadableItemFilter() = default; 10 | bool passes_filter(ItemPtr item) const override; 11 | }; 12 | 13 | -------------------------------------------------------------------------------- /engine/items/include/UnidentifiedItemFilter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IItemFilter.hpp" 3 | 4 | // Used to determine whether an item has been identified, using its 5 | // base identifier to check. 6 | class UnidentifiedItemFilter : public IItemFilter 7 | { 8 | public: 9 | virtual ~UnidentifiedItemFilter() = default; 10 | 11 | bool passes_filter(ItemPtr item) const override; 12 | }; 13 | 14 | -------------------------------------------------------------------------------- /engine/source/unit_tests/Game_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | class SW_Engine_Game : public ::testing::Test 4 | { 5 | protected: 6 | ClassIdentifier get_class_identifier() { return game.get_class_identifier(); } 7 | 8 | Game game; 9 | }; 10 | 11 | TEST_F(SW_Engine_Game, serialization_id) 12 | { 13 | EXPECT_EQ(ClassIdentifier::CLASS_ID_GAME, get_class_identifier()); 14 | } 15 | 16 | -------------------------------------------------------------------------------- /engine/time/include/SwimmingMovementAccumulationChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ITerrainMovementAccumulationChecker.hpp" 3 | #include "SwimmingSkillProcessor.hpp" 4 | 5 | class SwimmingMovementAccumulationChecker : public ITerrainMovementAccumulationChecker 6 | { 7 | public: 8 | void check(CreaturePtr creature) override; 9 | 10 | protected: 11 | SwimmingSkillProcessor swim; 12 | }; 13 | -------------------------------------------------------------------------------- /scripts/level/fae.lua: -------------------------------------------------------------------------------- 1 | require('level') 2 | 3 | local function fae_stat_gain_fn(creature_id, level) 4 | local is_pl = is_player(creature_id) 5 | 6 | if level % 7 == 0 then 7 | incr_int(creature_id, is_pl) 8 | incr_wil(creature_id, is_pl) 9 | end 10 | end 11 | 12 | local fae_race_stat_fn = fae_stat_gain_fn 13 | 14 | level.set_race_stat_gain_level_fn("05_fae", fae_race_stat_fn) 15 | 16 | -------------------------------------------------------------------------------- /world/tiles/include/RockyEarthTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class RockyEarthTile : public Tile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | -------------------------------------------------------------------------------- /engine/commands/select_tile/include/TileSelectionRangeChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackTypes.hpp" 3 | #include "Creature.hpp" 4 | 5 | // This class checks to see if the targetted tile is in range for the 6 | // creature, given the attack type. 7 | class TileSelectionRangeChecker 8 | { 9 | public: 10 | bool is_selected_tile_in_range(CreaturePtr creature, const AttackType attack_type); 11 | }; 12 | -------------------------------------------------------------------------------- /engine/generators/crypts/include/EmptyCryptLayoutStrategy.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ICryptLayoutStrategy.hpp" 3 | 4 | class EmptyCryptLayoutStrategy : public ICryptLayoutStrategy 5 | { 6 | public: 7 | virtual void create_layout(MapPtr map, const std::tuple& stair_loc_and_room_boundary) override; 8 | virtual ~EmptyCryptLayoutStrategy() = default; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/generators/rooms/include/IRoomGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Map.hpp" 4 | 5 | class IRoomGenerator 6 | { 7 | public: 8 | virtual void generate(MapPtr map, const int start_row, const int end_row, const int start_col, const int end_col) = 0; 9 | virtual ~IRoomGenerator() = default; 10 | }; 11 | 12 | using IRoomGeneratorPtr = std::unique_ptr; 13 | 14 | -------------------------------------------------------------------------------- /engine/include/FileWriter.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | class FileWriter 6 | { 7 | public: 8 | FileWriter(const std::string& filename); 9 | ~FileWriter(); 10 | 11 | void set_file_name(const std::string& filename); 12 | bool write(const std::string& str); 13 | 14 | protected: 15 | std::string filename; 16 | std::ofstream file; 17 | }; 18 | -------------------------------------------------------------------------------- /engine/strings/include/VictoryTextKeys.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class VictoryTextKeys 5 | { 6 | public: 7 | static const std::string VICTORY; 8 | static const std::string VICTORY_1; 9 | static const std::string VICTORY_2; 10 | static const std::string VICTORY_3; 11 | 12 | protected: 13 | VictoryTextKeys(); 14 | ~VictoryTextKeys(); 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /scripts/quests/fae_caravan/eakauri.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | 3 | -- Monologue. 4 | add_message_with_pause("EAKAURI_SPEECH_TEXT_SID") 5 | add_message_with_pause("EAKAURI_SPEECH_TEXT2_SID") 6 | clear_and_add_message("EAKAURI_SPEECH_TEXT3_SID") 7 | 8 | -- Apparently, tens of thousands of years beneath the sea make an undying 9 | -- astral creature a little cranky. 10 | set_hostility("super_boss", PLAYER_ID) 11 | -------------------------------------------------------------------------------- /world/tiles/include/ScrubTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorldMapTile.hpp" 3 | 4 | class ScrubTile : public WorldMapTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | -------------------------------------------------------------------------------- /engine/generators/crypts/include/PillarCryptLayoutStrategy.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ICryptLayoutStrategy.hpp" 3 | 4 | class PillarCryptLayoutStrategy : public ICryptLayoutStrategy 5 | { 6 | public: 7 | virtual void create_layout(MapPtr map, const std::tuple& stair_loc_and_room_boundary) override; 8 | virtual ~PillarCryptLayoutStrategy() = default; 9 | }; 10 | 11 | -------------------------------------------------------------------------------- /engine/screens/include/OrderScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Screen.hpp" 3 | #include "Display.hpp" 4 | 5 | class OrderScreen : public Screen 6 | { 7 | public: 8 | OrderScreen(DisplayPtr display, const bool new_followers_exist_in_fov, const bool new_can_summon); 9 | 10 | protected: 11 | void initialize() override; 12 | 13 | bool followers_exist_in_fov; 14 | bool can_summon; 15 | }; 16 | -------------------------------------------------------------------------------- /engine/strings/include/FileConstants.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | // Constant filenames, patterns, etc. 5 | class FileConstants 6 | { 7 | public: 8 | static const std::string SAVEFILE_PATTERN; 9 | static const std::string CUSTOM_MAPS_DIRECTORY; 10 | static const std::string CUSTOM_MAPS_PATTERN; 11 | 12 | protected: 13 | FileConstants(); 14 | ~FileConstants(); 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /engine/strings/source/MembershipTextKeys.cpp: -------------------------------------------------------------------------------- 1 | #include "MembershipTextKeys.hpp" 2 | 3 | using namespace std; 4 | 5 | MembershipTextKeys::MembershipTextKeys() 6 | { 7 | } 8 | 9 | MembershipTextKeys::~MembershipTextKeys() 10 | { 11 | } 12 | 13 | const string MembershipTextKeys::MEMBERSHIP_CHAMPION = "MEMBERSHIP_CHAMPION"; 14 | const string MembershipTextKeys::MEMBERSHIP_FALLEN_CHAMPION = "MEMBERSHIP_FALLEN_CHAMPION"; -------------------------------------------------------------------------------- /scripts/areas/events/forest_of_yew.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('fn') 3 | require('map_events') 4 | 5 | local map_id = "forest_of_yew" 6 | 7 | local function init_community_garden(map_id) 8 | generate_vegetable_garden(map_id, 1, 4, 57, 62, false, 1, 1) 9 | end 10 | 11 | local function init_yew(map_id) 12 | init_community_garden(map_id) 13 | end 14 | 15 | map_events.set_map_fn(map_id, init_yew) 16 | 17 | -------------------------------------------------------------------------------- /scripts/areas/events/whalings_end.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | require('fn') 3 | require('map_events') 4 | 5 | local map_id = "whalings_end" 6 | 7 | local function init_community_garden(map_id) 8 | generate_vegetable_garden(map_id, 16, 18, 11, 13, false, 1, 1) 9 | end 10 | 11 | local function init_yew(map_id) 12 | init_community_garden(map_id) 13 | end 14 | 15 | map_events.set_map_fn(map_id, init_yew) 16 | 17 | -------------------------------------------------------------------------------- /texts/titlepoem3_en.txt: -------------------------------------------------------------------------------- 1 | The faery beam upon you! %b 2 | The stars to glisten on you! %b 3 | A moon of light %b 4 | In the noon of night %b 5 | Till the fire-drake hath o'ergone you! %b 6 | The wheel of Fortune guide you! %b 7 | The Boy with the bow beside you %b 8 | Run aye in the way %b 9 | Till the bird of day %b 10 | And the luckier lot betide you! 11 | %p 12 | - Ben Jonson, "Gypsy Songs", I 13 | %p 14 | -------------------------------------------------------------------------------- /world/tiles/include/BeachTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorldMapTile.hpp" 3 | 4 | class BeachTile : public WorldMapTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /world/tiles/include/HillsTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorldMapTile.hpp" 3 | 4 | class HillsTile : public WorldMapTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /engine/actions/include/DateTimeWeatherAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IActionManager.hpp" 3 | 4 | class DateTimeWeatherAction : public IActionManager 5 | { 6 | public: 7 | ActionCostValue date_and_time_and_weather(); 8 | 9 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 10 | 11 | protected: 12 | friend class ActionManager; 13 | DateTimeWeatherAction(); 14 | }; 15 | -------------------------------------------------------------------------------- /engine/calculators/include/AttackSpeedCalculatorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackTypes.hpp" 3 | #include "AttackSpeedCalculator.hpp" 4 | 5 | class AttackSpeedCalculatorFactory 6 | { 7 | public: 8 | static AttackSpeedCalculatorPtr create_speed_calculator(const AttackType attack_type); 9 | 10 | protected: 11 | AttackSpeedCalculatorFactory(); 12 | ~AttackSpeedCalculatorFactory(); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/calculators/include/WandsAttackSpeedCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackSpeedCalculator.hpp" 3 | 4 | class WandsAttackSpeedCalculator : public AttackSpeedCalculator 5 | { 6 | public: 7 | virtual ~WandsAttackSpeedCalculator() = default; 8 | 9 | ActionCostValue calculate(CreaturePtr creature) override; 10 | 11 | protected: 12 | static const int WANDCRAFT_SPEED_DIVISOR; 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/generators/settlements/sector/include/StorehouseSectorFeature.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SectorFeature.hpp" 3 | 4 | class StorehouseSectorFeature : public SectorFeature 5 | { 6 | public: 7 | StorehouseSectorFeature(); 8 | virtual ~StorehouseSectorFeature() = default; 9 | 10 | protected: 11 | bool generate_feature(MapPtr map, const Coordinate& start_coord, const Coordinate& end_coord); 12 | }; 13 | -------------------------------------------------------------------------------- /scripts/quests/yew/advisor.lua: -------------------------------------------------------------------------------- 1 | require('constants') 2 | 3 | if player_has_item(ISEN_DUN_WHISKY_ID) and creature_has_humanoid_followers(PLAYER_ID) then 4 | clear_and_add_message("YEW_ADVISOR_WHISKY_SID") 5 | 6 | remove_object_from_player(ISEN_DUN_WHISKY_ID) 7 | set_creature_additional_property(PLAYER_ID, QUEST_ISEN_DUN_YEW_COMPLETE, "1") 8 | else 9 | clear_and_add_message("YEW_ADVISOR_SPEECH_TEXT_SID") 10 | end 11 | -------------------------------------------------------------------------------- /texts/titlepoem11_en.txt: -------------------------------------------------------------------------------- 1 | I saw pale kings and princes too, %b 2 | Pale warriors, death-pale were they all; %b 3 | They cried - "La Belle Dame sans Merci %b 4 | Hath thee in thrall!" 5 | %p 6 | I saw their starved lips in the gloam, %b 7 | With horrid warning gaped wide, %b 8 | And I awoke and found me here, %b 9 | On the cold hill's side. 10 | %p 11 | - From "La Belle Dame sans Merci", John Keats 12 | %p 13 | -------------------------------------------------------------------------------- /world/tiles/include/GraveTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class GraveTile : public Tile 5 | { 6 | public: 7 | GraveTile(); 8 | TileType get_tile_type() const override; 9 | 10 | std::string get_tile_description_sid() const override; 11 | 12 | virtual Tile* clone() override; 13 | 14 | private: 15 | ClassIdentifier internal_class_identifier() const override; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /world/tiles/include/GraveyardTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorldMapTile.hpp" 3 | 4 | class GraveyardTile : public WorldMapLandmarkTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | -------------------------------------------------------------------------------- /world/tiles/source/WeatherProperties.cpp: -------------------------------------------------------------------------------- 1 | #include "WeatherProperties.hpp" 2 | 3 | // Keeping in mind that each world tile will have associated weather info, 4 | // keep the properties shorter to save space. 5 | const std::string WeatherProperties::WEATHER_PROPERTIES_WIND_SPEED = "weather_wind"; 6 | 7 | WeatherProperties::WeatherProperties() 8 | { 9 | } 10 | 11 | WeatherProperties::~WeatherProperties() 12 | { 13 | } 14 | -------------------------------------------------------------------------------- /engine/XML/source/XMLRingReader.cpp: -------------------------------------------------------------------------------- 1 | #include "XMLRingReader.hpp" 2 | 3 | XMLRingReader::XMLRingReader() 4 | { 5 | } 6 | 7 | XMLRingReader::~XMLRingReader() 8 | { 9 | } 10 | 11 | // Methods for reading in ring details from an XML node conformant to the Ring type. 12 | void XMLRingReader::parse(RingPtr ring, GenerationValues& igv, const XMLNode& ring_node) 13 | { 14 | XMLWearableReader::parse(ring, igv, ring_node); 15 | } 16 | -------------------------------------------------------------------------------- /engine/actions/include/ExperienceAction.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IActionManager.hpp" 3 | 4 | class ExperienceAction : public IActionManager 5 | { 6 | public: 7 | ActionCostValue experience(CreaturePtr creature) const; 8 | 9 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 10 | 11 | protected: 12 | friend class ActionManager; 13 | ExperienceAction(); 14 | }; 15 | -------------------------------------------------------------------------------- /engine/items/source/UnidentifiedItemFilter.cpp: -------------------------------------------------------------------------------- 1 | #include "UnidentifiedItemFilter.hpp" 2 | #include "ItemIdentifier.hpp" 3 | 4 | using namespace std; 5 | 6 | // Using the item's base ID, check to see whether the item has been 7 | // identified. 8 | bool UnidentifiedItemFilter::passes_filter(ItemPtr item) const 9 | { 10 | ItemIdentifier iid; 11 | return (iid.get_item_identified(item->get_base_id()) == false); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /world/include/Boat.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.hpp" 3 | 4 | class Boat : public Item 5 | { 6 | public: 7 | Boat(); 8 | ~Boat(); 9 | 10 | bool additional_item_attributes_match(ItemPtr item) const override; 11 | 12 | Item* clone() override; 13 | 14 | private: 15 | virtual ClassIdentifier internal_class_identifier() const override; 16 | }; 17 | 18 | using BoatPtr = std::shared_ptr; 19 | -------------------------------------------------------------------------------- /world/source/SmithingConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "SmithingConstants.hpp" 2 | 3 | using namespace std; 4 | 5 | SmithingConstants::SmithingConstants() 6 | { 7 | } 8 | 9 | SmithingConstants::~SmithingConstants() 10 | { 11 | } 12 | 13 | const string SmithingConstants::SMITHING_CONSTANTS_MATERIAL_TYPE = "sm_con_mat_type"; 14 | const string SmithingConstants::SMITHING_CONSTANTS_JEWELRY_MATERIAL_TYPE = "jewel_con_mat_type"; 15 | 16 | -------------------------------------------------------------------------------- /world/source/ThreatConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "ThreatConstants.hpp" 2 | 3 | ThreatConstants::ThreatConstants() 4 | { 5 | } 6 | 7 | ThreatConstants::~ThreatConstants() 8 | { 9 | } 10 | 11 | const int ThreatConstants::DISLIKE_THREAT_RATING = 10; 12 | const int ThreatConstants::INITIAL_THREAT_RATING = 100; 13 | const int ThreatConstants::THREAT_RATING_INCREMENT = 25; 14 | const int ThreatConstants::ACTIVE_THREAT_RATING = 300; 15 | -------------------------------------------------------------------------------- /world/tiles/include/BarrowTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class BarrowTile : public Tile 5 | { 6 | public: 7 | BarrowTile(); 8 | TileType get_tile_type() const override; 9 | 10 | std::string get_tile_description_sid() const override; 11 | 12 | virtual Tile* clone() override; 13 | 14 | private: 15 | ClassIdentifier internal_class_identifier() const override; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /world/tiles/include/WellTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class WellTile : public Tile 5 | { 6 | public: 7 | WellTile(); 8 | 9 | TileType get_tile_type() const override; 10 | 11 | std::string get_tile_description_sid() const override; 12 | 13 | virtual Tile* clone() override; 14 | 15 | private: 16 | ClassIdentifier internal_class_identifier() const override; 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /engine/calculators/include/CowardiceCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | class CowardiceCalculator 5 | { 6 | public: 7 | int get_pct_chance_turn_to_fight(CreaturePtr creature) const; 8 | int get_pct_chance_rage_fight(CreaturePtr creature) const; 9 | 10 | protected: 11 | static const int BASE_PCT_CHANCE_TURN_TO_FIGHT; 12 | static const int BASE_PCT_CHANCE_RAGE_FIGHT; 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/description/codex/include/WandCodexDescriber.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "CodexDescriber.hpp" 3 | #include "Wand.hpp" 4 | 5 | class WandCodexDescriber : public CodexDescriber 6 | { 7 | public: 8 | WandCodexDescriber(WandPtr wand); 9 | virtual ~WandCodexDescriber() = default; 10 | 11 | std::string describe_details() const override; 12 | 13 | protected: 14 | WandPtr wand; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /engine/strings/include/TileDangerConfirmationKeys.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class TileDangerConfirmationKeys 5 | { 6 | public: 7 | static const std::string TILE_DANGER_MOUNTAINS; 8 | static const std::string TILE_DANGER_AIR; 9 | static const std::string TILE_DANGER_DEATHLY; 10 | 11 | protected: 12 | TileDangerConfirmationKeys(); 13 | ~TileDangerConfirmationKeys(); 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /scripts/level/warrior.lua: -------------------------------------------------------------------------------- 1 | require('level') 2 | 3 | -- Weak warriors don't live long. 4 | local function warrior_stat_gain_fn(creature_id, level) 5 | if level % 5 == 0 then 6 | incr_str(creature_id, is_player(creature_id)) 7 | end 8 | end 9 | 10 | -- Set up the warrior functions. 11 | local warrior_class_stat_fn = warrior_stat_gain_fn 12 | 13 | level.set_class_stat_gain_level_fn("warrior", warrior_class_stat_fn) 14 | 15 | -------------------------------------------------------------------------------- /world/include/Staff.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.hpp" 3 | 4 | class Staff : public Item 5 | { 6 | public: 7 | Staff(); 8 | ~Staff(); 9 | 10 | bool additional_item_attributes_match(ItemPtr item) const override; 11 | 12 | Item* clone() override; 13 | 14 | private: 15 | ClassIdentifier internal_class_identifier() const override; 16 | }; 17 | 18 | using StaffPtr = std::shared_ptr; 19 | -------------------------------------------------------------------------------- /world/tiles/features/include/FeatureProperties.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class FeatureProperties 5 | { 6 | public: 7 | static const std::string FEATURE_PROPERTIES_OPEN; 8 | static const std::string FEATURE_PROPERTIES_TRAP_EFFECT_STATUS; 9 | static const std::string FEATURE_PROPERTIES_SLAT_REMOVED; 10 | 11 | protected: 12 | FeatureProperties(); 13 | ~FeatureProperties(); 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /world/tiles/include/FruitTreeTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TreeTile.hpp" 3 | 4 | class FruitTreeTile : public TreeTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | virtual Tile* clone() override; 10 | 11 | private: 12 | virtual std::string get_default_tree_tile_description_sid() const override; 13 | ClassIdentifier internal_class_identifier() const override; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /world/tiles/include/WildOrchardTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorldMapTile.hpp" 3 | 4 | class WildOrchardTile : public WorldMapTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | 11 | virtual Tile* clone() override; 12 | 13 | private: 14 | ClassIdentifier internal_class_identifier() const override; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /engine/calculators/include/CreatureAdditionalDamageCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | 4 | // Class that calculates the additional damage for a creature, for example, 5 | // based on equipment and spells. 6 | class CreatureAdditionalDamageCalculator 7 | { 8 | public: 9 | int calculate_additional_damage(CreaturePtr c); 10 | 11 | protected: 12 | int get_equipment_bonus(CreaturePtr c); 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/calculators/source/WandsCombatTargetNumberCalculator.cpp: -------------------------------------------------------------------------------- 1 | #include "WandsCombatTargetNumberCalculator.hpp" 2 | 3 | WandsCombatTargetNumberCalculator::WandsCombatTargetNumberCalculator() 4 | : MagicalCombatTargetNumberCalculator(AttackType::ATTACK_TYPE_MAGICAL_WANDS) 5 | { 6 | } 7 | 8 | SkillType WandsCombatTargetNumberCalculator::get_attacker_skill() const 9 | { 10 | return SkillType::SKILL_GENERAL_WANDCRAFT; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /engine/decision_strategies/search/include/SearchStrategyFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | #include "Search.hpp" 4 | #include "SearchTypes.hpp" 5 | 6 | class SearchStrategyFactory 7 | { 8 | public: 9 | static SearchStrategyPtr create_search_strategy(const SearchType st, CreaturePtr perspective_creature); 10 | 11 | protected: 12 | SearchStrategyFactory(); 13 | ~SearchStrategyFactory(); 14 | }; 15 | -------------------------------------------------------------------------------- /engine/generators/source/unit_tests/PillarGeneratorFactory_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_Engine_Generators_PillarGeneratorFactory, all_types_non_null) 4 | { 5 | for (int i = 0; i < static_cast(PillarType::PILLAR_TYPE_LAST); i++) 6 | { 7 | IPillarGeneratorPtr p_gen = PillarGeneratorFactory::create_generator(static_cast(i)); 8 | 9 | EXPECT_TRUE(p_gen != nullptr); 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /engine/include/SettingKeybindings.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | // Class that parses keybindings from the ini file. 6 | // Keybindings are separated by || 7 | // So: 8 | // 9 | // key_SEARCH=s||S 10 | // 11 | // would return a vector {"s", "S"} 12 | class SettingKeybindings 13 | { 14 | public: 15 | std::vector get_keybindings(const std::string& setting) const; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /engine/skills/include/SkillProcessorFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "SkillProcessor.hpp" 3 | 4 | class SkillProcessorFactory 5 | { 6 | public: 7 | static SkillProcessorPtr create(const SkillType st); 8 | 9 | protected: 10 | SkillProcessorFactory(); 11 | ~SkillProcessorFactory(); 12 | 13 | static void populate_skill_map(); 14 | 15 | static std::map skill_map; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /scripts/quests/atuaelar/mountain_elf_scholar.lua: -------------------------------------------------------------------------------- 1 | local speeches = {{"MOUNTAIN_ELF_SCHOLAR_SPEECH_TEXT_SID"}, {"MOUNTAIN_ELF_SCHOLAR_CARCASSIA_SID", "MOUNTAIN_ELF_SCHOLAR_CARCASSIA2_SID"}} 2 | 3 | local speech = speeches[RNG_range(1, #speeches)] 4 | 5 | for i = 1, #speech do 6 | local fn = add_message_with_pause 7 | 8 | if i == #speech then 9 | fn = clear_and_add_message 10 | end 11 | 12 | fn(speech[i]) 13 | end 14 | 15 | -------------------------------------------------------------------------------- /world/include/DamageFlag.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "DamageTypes.hpp" 4 | 5 | class DamageFlag 6 | { 7 | public: 8 | DamageFlag(const DamageFlagType dft, const std::string& desc_sid); 9 | 10 | DamageFlagType get_flag() const; 11 | std::string get_description_sid() const; 12 | 13 | protected: 14 | DamageFlagType flag; 15 | std::string description_sid; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /world/magic/include/SpellShapeFactory.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "common.hpp" 3 | #include "SpellTypes.hpp" 4 | 5 | class SpellShape; 6 | 7 | // A factory class responsible for creating and configuring spell shapes 8 | // properly. 9 | class SpellShapeFactory 10 | { 11 | public: 12 | static SpellShape create_spell_shape(const SpellShapeType st, const uint radius); 13 | 14 | protected: 15 | SpellShapeFactory(); 16 | }; 17 | -------------------------------------------------------------------------------- /world/tiles/include/MagicalTreeTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TreeTile.hpp" 3 | 4 | class MagicalTreeTile : public TreeTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | virtual Tile* clone() override; 10 | 11 | private: 12 | virtual std::string get_default_tree_tile_description_sid() const override; 13 | ClassIdentifier internal_class_identifier() const override; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /world/tiles/source/unit_tests/BushTile_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_BushTile, type_is_TILE_TYPE_BUSH) 4 | { 5 | BushTile bush_tile; 6 | 7 | EXPECT_EQ(TileType::TILE_TYPE_BUSH, bush_tile.get_tile_type()); 8 | } 9 | 10 | TEST(SW_World_Tiles_BushTile, decomposes_to_field) 11 | { 12 | BushTile bush_tile; 13 | 14 | EXPECT_EQ(TileType::TILE_TYPE_FIELD, bush_tile.get_decomposition_tile_type()); 15 | } -------------------------------------------------------------------------------- /engine/XML/include/XMLCalendarReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Calendar.hpp" 4 | #include "XMLDataStructures.hpp" 5 | #include "XMLReader.hpp" 6 | 7 | class XMLCalendarReader : public XMLReader 8 | { 9 | public: 10 | std::map get_calendar_days(const XMLNode& calendar_node); 11 | 12 | protected: 13 | void parse_calendar_day(CalendarDay& cd, const XMLNode& calendar_day_node); 14 | }; 15 | -------------------------------------------------------------------------------- /engine/XML/include/XMLTrapsReader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Features.hpp" 4 | #include "XMLReader.hpp" 5 | #include "XMLDataStructures.hpp" 6 | 7 | class DisplayTile; 8 | 9 | class XMLTrapsReader : public XMLReader 10 | { 11 | public: 12 | std::vector get_traps(const XMLNode& xml_config_traps_node); 13 | 14 | protected: 15 | void parse_trap(const XMLNode& trap_node, TrapPtr trap); 16 | }; 17 | -------------------------------------------------------------------------------- /engine/XML/source/XMLFoodReader.cpp: -------------------------------------------------------------------------------- 1 | #include "XMLFoodReader.hpp" 2 | 3 | // Methods for reading in food 4 | XMLFoodReader::XMLFoodReader() 5 | { 6 | } 7 | 8 | XMLFoodReader::~XMLFoodReader() 9 | { 10 | } 11 | 12 | void XMLFoodReader::parse(FoodPtr food, GenerationValues& gv, const XMLNode& food_node) 13 | { 14 | if (food && !food_node.is_null()) 15 | { 16 | XMLConsumableReader::parse(food, gv, food_node); 17 | } 18 | } 19 | 20 | -------------------------------------------------------------------------------- /engine/calculators/include/UnarmedCombatCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "AttackTypes.hpp" 3 | #include "Creature.hpp" 4 | 5 | class UnarmedCombatCalculator 6 | { 7 | public: 8 | bool is_attack_unarmed(CreaturePtr creature, const AttackType attack_type) const; 9 | int calculate_pct_chance_free_kick(CreaturePtr creature) const; 10 | 11 | protected: 12 | static const int UNARMED_SKILL_KICK_SUBTRAHEND; 13 | }; 14 | 15 | -------------------------------------------------------------------------------- /engine/calculators/include/WandsCombatTargetNumberCalculator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "MagicalCombatTargetNumberCalculator.hpp" 3 | 4 | class WandsCombatTargetNumberCalculator : public MagicalCombatTargetNumberCalculator 5 | { 6 | public: 7 | WandsCombatTargetNumberCalculator(); 8 | virtual ~WandsCombatTargetNumberCalculator() = default; 9 | 10 | protected: 11 | SkillType get_attacker_skill() const override; 12 | }; 13 | -------------------------------------------------------------------------------- /engine/conversion/include/StatsDumper.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Creature.hpp" 3 | #include "StringConverter.hpp" 4 | 5 | class StatsDumper : public StringConverter 6 | { 7 | public: 8 | StatsDumper(CreaturePtr new_creature, const uint new_max_cols); 9 | 10 | std::string str() const override; 11 | 12 | protected: 13 | std::string get_stats() const; 14 | 15 | CreaturePtr creature; 16 | uint num_cols; 17 | }; 18 | -------------------------------------------------------------------------------- /engine/creatures/include/GroundSafetyCondition.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TileSafetyCondition.hpp" 3 | 4 | // A class used to determine if a tile is safe, given that it has a super 5 | // type of ground. Basically, the creature just has to be an air-breather. 6 | class GroundSafetyCondition : public TileSafetyCondition 7 | { 8 | protected: 9 | bool is_tile_safe(CreaturePtr creature, TilePtr tile) const override; 10 | }; 11 | 12 | -------------------------------------------------------------------------------- /engine/generators/worship_sites/include/WorshipSiteGenerator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorshipSiteTypes.hpp" 3 | #include "ChurchGenerator.hpp" 4 | 5 | class WorshipSiteGenerator 6 | { 7 | public: 8 | static ChurchGeneratorPtr generate_worship_site(const WorshipSiteType site_type, const std::string& deity_id, const MapPtr base_map); 9 | 10 | protected: 11 | WorshipSiteGenerator(); 12 | ~WorshipSiteGenerator(); 13 | }; 14 | -------------------------------------------------------------------------------- /engine/include/Messages.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Message.hpp" 5 | 6 | using MessageId = boost::uuids::uuid; 7 | 8 | class Messages 9 | { 10 | public: 11 | void add(const Message& message); 12 | std::vector get_messages() const; 13 | std::vector& get_messages_ref(); 14 | void clear(); 15 | bool empty() const; 16 | 17 | protected: 18 | std::vector messages; 19 | }; 20 | -------------------------------------------------------------------------------- /engine/maps/tiles/include/ITileManipulator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Map.hpp" 4 | 5 | // Interface for a general tile manipulator: allows digging, etc. 6 | class ITileManipulator 7 | { 8 | public: 9 | virtual ~ITileManipulator() = default; 10 | 11 | virtual bool dig(CreaturePtr creature, MapPtr map, TilePtr tile) = 0; 12 | }; 13 | 14 | using ITileManipulatorPtr = std::unique_ptr; 15 | -------------------------------------------------------------------------------- /engine/screens/include/LoadGameScreen.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Screen.hpp" 4 | 5 | class LoadGameScreen : public Screen 6 | { 7 | public: 8 | LoadGameScreen(DisplayPtr display); 9 | 10 | std::string get_file_name(const std::string& option) const; 11 | 12 | protected: 13 | void initialize() override; 14 | 15 | std::map screen_selection_to_filename_map; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /world/source/IntelligenceConstants.cpp: -------------------------------------------------------------------------------- 1 | #include "IntelligenceConstants.hpp" 2 | 3 | const int IntelligenceConstants::MIN_INTELLIGENCE_UNDERSTAND_SAFETY = 2; 4 | const int IntelligenceConstants::MIN_INTELLIGENCE_OPEN_DOORS = 2; 5 | const int IntelligenceConstants::MIN_INTELLIGENCE_UNDERSTAND_CORPSES = 3; 6 | 7 | IntelligenceConstants::IntelligenceConstants() 8 | { 9 | } 10 | 11 | IntelligenceConstants::~IntelligenceConstants() 12 | { 13 | } -------------------------------------------------------------------------------- /world/tiles/include/EvergreenTreeTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TreeTile.hpp" 3 | 4 | class EvergreenTreeTile : public TreeTile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | virtual Tile* clone() override; 10 | 11 | private: 12 | virtual std::string get_default_tree_tile_description_sid() const override; 13 | ClassIdentifier internal_class_identifier() const override; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /world/tiles/include/FieldTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "WorldMapTile.hpp" 3 | 4 | class FieldTile : public WorldMapTile 5 | { 6 | public: 7 | FieldTile(); 8 | TileType get_tile_type() const override; 9 | 10 | std::string get_tile_description_sid() const override; 11 | 12 | virtual Tile* clone() override; 13 | 14 | private: 15 | ClassIdentifier internal_class_identifier() const override; 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /world/tiles/include/SewerTile.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Tile.hpp" 3 | 4 | class SewerTile : public Tile 5 | { 6 | public: 7 | TileType get_tile_type() const override; 8 | 9 | std::string get_tile_description_sid() const override; 10 | bool is_interior() const override; 11 | 12 | virtual Tile* clone() override; 13 | 14 | private: 15 | ClassIdentifier internal_class_identifier() const override; 16 | }; 17 | -------------------------------------------------------------------------------- /world/tiles/source/unit_tests/RoadTile_test.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | 3 | TEST(SW_World_Tiles_RoadTile, type_is_TILE_TYPE_ROAD) 4 | { 5 | RoadTile road_tile; 6 | 7 | EXPECT_EQ(TileType::TILE_TYPE_ROAD, road_tile.get_tile_type()); 8 | } 9 | 10 | TEST(SW_World_Tiles_RoadTile, serialization_id) 11 | { 12 | RoadTile road_tile; 13 | 14 | EXPECT_EQ(ClassIdentifier::CLASS_ID_ROAD_TILE, road_tile.get_class_identifier()); 15 | } 16 | -------------------------------------------------------------------------------- /display/animation/source/DefaultAnimationFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "DefaultAnimationFactory.hpp" 2 | #include "DefaultDrawAnimationInstruction.hpp" 3 | 4 | AnimationInstructionPtr DefaultAnimationFactory::create_draw_instruction(const Coordinate& c, const DisplayTile& display_tile) const 5 | { 6 | AnimationInstructionPtr draw_instruction = std::make_unique(c, display_tile); 7 | 8 | return draw_instruction; 9 | } 10 | -------------------------------------------------------------------------------- /engine/actions/include/KeyManager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IActionManager.hpp" 3 | #include "Creature.hpp" 4 | #include "Feature.hpp" 5 | 6 | class KeyManager : public IActionManager 7 | { 8 | public: 9 | bool has_key(CreaturePtr creature, LockPtr lock); 10 | 11 | ActionCostValue get_action_cost_value(CreaturePtr creature) const override; 12 | 13 | protected: 14 | static const std::string SKELETON_KEY_ID; 15 | }; 16 | 17 | -------------------------------------------------------------------------------- /engine/calculators/source/SeedCalculator.cpp: -------------------------------------------------------------------------------- 1 | #include "SeedCalculator.hpp" 2 | #include "Calendar.hpp" 3 | 4 | double SeedCalculator::calculate_sprouting_seconds(const Date& date) 5 | { 6 | Date sprouting_date(date.get_seconds(), date.get_minutes(), date.get_hours(), 1, 1, date.get_day_of_year(), static_cast(Months::MONTH_5), date.get_year() + 1); 7 | Calendar c; 8 | 9 | return c.get_seconds_from_date(sprouting_date); 10 | } 11 | 12 | --------------------------------------------------------------------------------