Commit Graph

119 Commits

Author SHA1 Message Date
be702fe365 Fix some missing annotations in the button dictionary.
These are mostly errors that were already wrong in the old dictionary.
It's possible that some are things missed in the refactor though.
2025-03-02 19:13:01 -05:00
4174ccd470 Rework the special node button dictionary (#607) 2025-03-02 19:13:01 -05:00
56bbdbc6f8 Implement the inline special node help button
Though this creates the framework, the actual help strings have not been filled in yet.
2025-03-02 19:13:01 -05:00
89dbe98b2b Refactor special node properties struct to isolate the magic characters.
Basically what that means is that the magic characters are only parsed at startup – the scenario editor code doesn't need to understand them, instead using an enum.

This is part of the work for #607
2025-03-02 19:13:01 -05:00
0afed5db59 A feature flag denotes whether a scenario uses the new or old format for its metadata. With the old format (legacy scenarios and openBoE scenarios created prior to this PR) everything displays in the scenario picker as before, and scenario designers get 2 text fields to display however they want, and 2 text fields that are pretty much useless.
With the new format, Author and Contact info are formatted onto the first line in the scenario picker display. The scenario designer gets 1 line to write a teaser.

Fix #593

Also fix a bug where scenario ratings were appearing as integers ingame instead of the correct "G", "PG", etc.
2025-03-02 01:09:03 -05:00
c7ec0e3a85 Debug action: fill active PC's inventory 2025-02-23 19:19:42 -05:00
f80f8a932a Implement a feature flags system.
* Scenarios contain a string map of feature flags. The flag names are the keys, and flag versions are the values, so a typical value might be "fixed" for bug fixes or for evolving features, "V1", "V2", etc.
* The game has a map of flags to lists of supported versions. The game can therefore signal that it supports a legacy behavior for a given feature flag. The last version in the list is considered to be this build version's default behavior.
* When launching a scenario, we check to make sure the game supports the scenario's required versions of its feature flags.
* When launching a replay, we make sure the game supports the feature flags that the version of the game that made the recording did.

Fix #555
Close #591
2025-02-19 22:32:12 -05:00
e81cde113c Fix armor level 0 (#590)
Armor items with item level 0, will have a base defense value of 0 instead of 1, and display their defense value as such in the get items screen.

Fix #245
2025-02-09 10:36:14 -05:00
c24896afa1 clarify more properties of cWandering 2025-01-25 21:46:25 -06:00
68471d99b2 Clarify cWandering and cCreature 2025-01-25 21:46:25 -06:00
611d00ff63 refactor town entrance search into cScenario function 2025-01-21 13:56:47 -06:00
a4231005f6 Add a new "rechargeable" flag to items
A way to set this flag is not yet exposed in the scenario editor.
The flag is intended only for non-stackable items, but this currently isn't enforced.
Items now have a maximum number of charges, which is equal to their default number set in the item record.
Enchanted items with charges are now rechargeable.
2024-09-10 22:18:59 -04:00
753dbbcc59 Add a new dialogue mode to recharge items
This is currently useless, as exhausting an item's charges currently deletes it, but it is part of a work in progress
2024-09-10 22:18:59 -04:00
6965b822dc Gather all enchantment info into a single place
This also resolves several TODO notes about duplicate code and makes cPresetItem::ability an eEnchant
2024-09-10 22:18:59 -04:00
71a9d11cd0 Gather all alchemy info into a single place 2024-09-10 22:18:59 -04:00
ce62ce3878 fix #117: vahnatai robes 2024-09-08 18:41:06 -04:00
4929218929 Resolve a TODO note in load_item_type_info() 2024-08-27 09:35:58 -04:00
a52ce5189b Fix a bunch of undefined behaviour detected by the static analyzer in the saved game format. 2024-08-10 00:16:52 -04:00
cf28d61035 Scenario editor initialize new town bounds/entrances 2023-02-02 23:30:40 -05:00
35050aedc7 Some minor special node fixes 2023-01-30 00:10:56 -05:00
31d83c00f1 rename INFINITE to INFINITE_AMOUNT 2023-01-28 22:05:14 -05:00
ed9a8b035a #include <bitset> so visual studio finds it 2023-01-28 22:05:14 -05:00
d5ea213edd Update swap functions to recommended ADL-friendly format 2023-01-25 23:09:13 -05:00
64c7e4a5a0 Replace C-style 2D arrays with nested std::array 2023-01-25 23:09:13 -05:00
b03c34396d Split quest flags into two separate boolean values 2023-01-22 18:56:50 -05:00
9931ef8ffe const-correctness in scenario classes 2023-01-22 17:25:16 -05:00
cd8f73344f Tiny cleanup, add a bounds check 2023-01-22 17:21:26 -05:00
345b47bbcf Fix import of Make Town Hostile special nodes
Thanks to @fosnola for spotting, and the suggested fix.
2023-01-22 12:51:24 -05:00
ALONSO Laurent
b45f3f66e3 check that picture id are correct... 2023-01-22 12:16:52 -05:00
5bce71d59f Make implicit switch fallthrough an error in the Xcode project and fix all places that do it
Since we can't directly use C++11 attributes, I've chosen BOOST_FALLTHROUGH to annotate intentional fallthroughs.

Thanks to @fosnola for spotting a missing break, which triggered this.
2023-01-21 22:39:33 -05:00
ALONSO Laurent
7685a2e571 special.cpp: retrieve correctly allow/deny enter in legacy scenario, 2023-01-21 20:55:43 -05:00
dc716fa5e6 Don't store inactive timers in the saved game
Thanks to @fosnola for spotting this.
2023-01-21 10:28:16 -05:00
c7c8f3fa77 Sanity pass of saved game format
This adds several fields to the saved game format that were simply missing.
- Monster boolean flags (for summons)
- Some missing monster ability details (for summons)
- Special on talk (for creatures)
- Max SP and morale (for creatures)
- Source scenario (for encounter notes)

It also changes the default resist to 0 instead of 100, meaning that
resistances will be saved almost always, but should be loaded correctly.

The target location is no longer saved for creatures.
There was already code that nulled it out after loading,
so now that just happens during loading instead.

The town active flags (belt_present and quickfire_present)
are now set during loading instead of after loading.

This changes the save format, so there will be minor incompatibilities.
In particular, monster health won't be loaded correctly from older saves.
2023-01-20 23:51:35 -05:00
68ef066dca Some adjustments to item interesting strings
For weapons, negative bonus is now shown as "- 2" instead of as "+ -2".

For armour, the bonus is now accounted for and the numbers should match
what is actually calculated in damage_pc().

Thanks to @fosnola for noticing the armour discrepancy.
2023-01-19 09:52:01 -05:00
2d1bbe0058 Move get_item_interesting_string() into the cItem class 2023-01-19 09:32:07 -05:00
04d079fbaf Clean up cTown::set_up_lights
Thanks to @fosnola for spotting the potential buffer overreach
2023-01-18 21:14:19 -05:00
303b0b8114 Missed an initializer
Thanks to @fosnola for spotting this.
2023-01-18 20:58:13 -05:00
a6196832de Fix item flags not being loaded correctly from saved games 2023-01-18 20:53:07 -05:00
2492610ec7 Reading and writing saved games now uses the new tagfile system.
This should avoid any format inconsistencies, like missing newlines and the like.
Although a basic save and load works, there may still be some issues with the format.
This probably renders older saved games incompatible.
The format is mostly the same, but there are a few small changes
in the name of making the format more uniform.
2023-01-18 00:54:39 -05:00
ALONSO Laurent
26db220f15 special and legacy: check type of monster values in nuke_monsters (to avoid
accidentally all monsters, ...)
2023-01-07 12:37:45 -05:00
cb73719af3 Make item abil_data a bit more readable
A two-element array is an ugly thing to behold
2023-01-06 02:13:46 -05:00
baf8bfd5c7 Make flight ability usable outdoors 2023-01-06 00:55:11 -05:00
5b2561d034 Disable header maps in Xcode 12 2022-07-12 20:35:41 -04:00
7b93726383 Replace 4-character constants with enums
This covers only the places where they were used to indicate
a preset selection in constructors.

The usage in qdpict where they're actually passed to the Resource Manager,
as well as the 4-character constants representing file types and creator
codes, are still present.
2020-02-21 00:16:58 -05:00
02d98db391 Prevent shops from selling unidentified options.
Patch identified by @x-qq

Fixes #65
2020-02-03 20:43:43 -05:00
511b1858a3 Fix Windows build and tests 2020-02-02 22:32:33 -05:00
86d2574aed Some refactor of special node system
- Context type (town/out/scen) is now an enum
- Don't expose internals in the header
- Use a state struct to pass things around through the system
- Fix special AFFECT_DEADNESS case for default party selection
- Maybe other bits and pieces?
2020-02-02 19:12:45 -05:00
68502c8f37 Fix spellcasting item being usable by magically inept characters 2020-02-01 22:17:47 -05:00
488e5a2570 Fix import of legacy Wandering Will Fight special nodes
After checking legacy documentation, I determined that
the meaning of ex1a is reversed in the latest code.
2020-01-19 16:26:15 -05:00
56523f1623 Fix import issue with Can't Enter special nodes 2020-01-19 15:39:42 -05:00