Commit Graph

667 Commits

Author SHA1 Message Date
ff5a8cb4c2 Allow specials to trigger while in a boat. 2014-12-11 01:36:31 -05:00
75b4dfa9e6 Expand If Text Response node to allow specifying a prompt in the text respose dialog itself 2014-12-11 01:36:31 -05:00
2a458450b5 Expand if race/trait to allow for richer comparisons
(Adapted from Windows code)
2014-12-11 01:36:31 -05:00
a780119030 Expand If Statistic node to allow checking hp, sp, xp, skill points, etc
(Adapted from Windows code)
2014-12-11 01:36:30 -05:00
c0110adb40 New special nodes:
- Town set attitude for affecting single creature, adapted from Windows code; technically redundant, but maybe handy
- If numeric response
- Print nums (for debugging)
- SDF arithmetic - add, subtract, multiply, divide, exponentiate
- Store random to SDF (adapted from Windows code)
- Display picture (inspired by Windows code, but the implementation is completely different and totally incompatible)
2014-12-11 01:36:22 -05:00
76ccb66786 Beep beep 2014-12-11 00:47:04 -05:00
252d6818ee Clear out some unneeded casts 2014-12-11 00:47:03 -05:00
004b6d1ace Various field/belt related stuff
- Remove all field booleans except quickfire and belt, which have been moved to cCurTown
- Alter and extend place_spell_pattern, to allow arbitrary damage types and to make it more clear in the code what's happening when it's called
- Delete fields.cpp file; a few things moved to locutils.cpp, but most are now part of cCurTown
- set_terrain function automatically updates belt present boolean if setting to a conveyor.
2014-12-11 00:46:28 -05:00
eb2fb485ac Don't create a new texture every time tiling is requested, though sadly this introduces a new issue 2014-12-11 00:15:26 -05:00
869ca7b2d7 Clean up, fix, and tweak the spellcasting dialog
- Includes new status effect images for the forcecage and for hypothetical inverses of dumbfound and magic resistance, as well as icons for the whole-party statuses.
2014-12-11 00:15:05 -05:00
34be9a0233 Bring up Get Items dialog when retrieving stored items from the next scenario, so that you can pick and choose which items to keep.
Also some bugfixes and stuff:
- Fix specials sometimes being run twice in a row
- Holding Control while clicking Create also makes a debug party (as an alternative to holding Command)
- Fix "How Many" popup being non-dismissible
- Reduce loading time spent on checking for missing opcodes
2014-12-08 02:37:15 -05:00
5249c6eef7 Add a lot of stuff scraped from *i's version of the code, plus a couple of additional bits.
Adapted from *i:
- Show a confirm dialog when interrupting a special node sequence
- New monster special ability: call global special node (as an action, not on death)
- New item special ability: call global special node
- Check there's a monster death special before calling it (wasn't necessary before, might be now with the special queue changes)
- Queue specials that are triggered while another special is in progress, instead of ignoring them; they will be run after the current special in progress finishes.
- *i's version of petrification touch is currently active only for monster-on-monster combat; need to merge with my version for monster-on-pc combat.
- Pass party location to special in use special item context
- Fix set town visibility node (was checking wrong field and thus could not hide towns)
Special nodes:
- Town Hostile: change to Set Town Attitude
- Select PC node: option to select random PC
- Affect special nodes can now affect monsters
- Fix affect death node reviving non-existent PCs
- Affect Spells: Can remove spells, and can affect level 1-3 spells
- If Objects: Merged from If Barrels and If Crates
- If Species: Replaces If Cave Lore
- If Trait: Replaces If Woodsman
- If Statistic: Replaces If Enough Mage Lore
- Change Lighting: Can affect town's global lighting setting, player's light level, or both at once.
- Pointers! Actually, I'd already implemented the callbacks for setting and getting them, but they're now actually used, and the implementation has been tweaked a little.
- Campaign flags! Again, I'd already implemented them sorta, but I tweaked things and they ended up sort of halfway between the two implementations. Plus there's now a special node to set them.

Additional bits:
- Special queue now uses an std::queue instead of a basic array.
- Enum for town lighting levels
- Disease touch ability is now honoured for monster-on-monster combat
- See monster special context now passes the monster's location as the trigger location; also, removed the double-trigger from one circumstance.
- Along with the set town attitude change, there's now the possibility for making the town hostile to trigger a special node, which can cause the party to be slain.
- Select PC special node: option to select specific PC
- Spell IDs for use in shops and Affect Spell nodes have changed so that 0 is now the first level 1 spell, and so forth.
- add_string_to_buf can now auto-split the string over multiple lines, and the special node that uses it takes advantage of this
- Special node parser warns if a node type is missing a corresponding opcode
- Reserved "pointers" to access the special node's trigger location (this was *i's idea, but he never implemented it)
2014-12-08 01:08:30 -05:00
0d7ad2c718 Finish strictifying special node type enum (forgot the scenario editor) 2014-12-07 17:53:30 -05:00
46c3c69bd9 Merge the XXX_BLOCK and SANCTIFY special nodes into a single, more versatile IS_CONTEXT node 2014-12-07 00:36:10 -05:00
5ec983ef32 Strictify special node context enum 2014-12-06 23:22:56 -05:00
bfdcfeab58 Strictify special node type enum 2014-12-06 22:28:09 -05:00
e3af2cce16 Fix inability to walk on swamps 2014-12-06 21:01:31 -05:00
0629a70419 Strictiy terrain special enum 2014-12-06 20:59:50 -05:00
ea435825b7 Some basic documentation of the resource manager. It could probably be improved a lot. 2014-12-06 18:02:41 -05:00
31195c12ea Fix up some invisible dependencies and missing include guards in headers 2014-12-06 17:20:46 -05:00
089c19032b Update doxy ignores 2014-12-06 13:39:27 -05:00
ca23b2f976 Some dialog pict fixes
- Pict choice dialog didn't work for present monster graphics
- Icon control is a little smarter when setting its picnum
2014-12-06 13:37:57 -05:00
8ab9d06199 Animate graphics in dialogs
- Monster graphics are animated too, showing all four of their frames.
- Animated dialog graphics are currently enabled only in the scenario editor.
2014-12-06 13:37:56 -05:00
88cb60fb8d Embark on an epic journey to document the dialog engine in as much detail as possible.
... and the previous commits (from 56f73cb on) were by and large a result of things noticed during this process.
2014-12-06 13:37:43 -05:00
beacf9dadc Remove the need for all cControl subclasses to be friends of cDialog
(Now only cControl itself is a friend.)
2014-12-06 13:35:28 -05:00
edf755c7c9 Fix dialog parser considering XML comments to be illegal in some places. 2014-12-06 13:35:28 -05:00
13a9e6671d Add magic value constant for xBadVal exception 2014-12-06 13:35:27 -05:00
eea1624b0d Fix unfetchability of TXT_FRAMESTYLE in buttons and icons. 2014-12-06 13:35:27 -05:00
da20a7402c Add an operator-> to cStrDlog and cStringChoice, mainly for consistency since cPictChoice and cChoiceDlog already had one. 2014-12-06 13:35:26 -05:00
f904389be8 Move noAction to cLed since its purpose is mainly to prevent the default LED toggle-selected action without introducing any alternate behaviour. 2014-12-06 13:35:26 -05:00
d35b2137be Merge the two "load from file" constructors in cDialog (using defaulted parameter) 2014-12-06 13:35:26 -05:00
9e734d5c47 Remove redundantly duplicated functions in cButton 2014-12-06 13:35:26 -05:00
f9f90473f3 Fix garbled dialog graphics in custom special node dialogs 2014-12-05 23:49:01 -05:00
56f73cb156 Lots of little tweaks and fixes to various things, mostly dialog stuff.
- LED groups now trigger their own click handler in addition to the clicked LED's click handler (provided the latter returns true). If the handler returns false, the click has no effect.
- LED groups now cancel the selection change if their focus handler returns false; this mimics the behaviour when an individual LED's focus handler returns false.
- Move the dialog getResult() definitions inline - since there's only two of them now that I'm using boost::any, having them in a separate file is pointless.
- Changed how the pict choice dialog returns its result - now it returns only whether the user clicked cancel and provides getters to obtain the number and type.
- Pict and string choice dialogs now hide the arrow buttons when there is only one page of options.
- Fix pict choice dialog always returning the initially selected value (similar to how the string choice dialog did before I fixed it)
- When passed an invalid starting selection, the pict choice dialog now always starts with the first icon selected
- Fix wrong bounds for several typs of custom graphics in dialogs
- Fix wrong /source/ bounds for custom 28x36 graphics /everywhere in the game/.
- Fix select PC graphic dialog having a second page with an invalid graphic that can be selected.
2014-12-05 23:48:07 -05:00
4db81f1403 Implementation of parsing for the map format (untested)
- Some stubs inserted for loading new-format scenario data
2014-12-05 00:50:17 -05:00
cec15c1cce Fix an int overflow issue in the boats/horses dialogs 2014-12-04 22:35:03 -05:00
4f6ce11dd9 Convert create scenario dialogs, reimplement part of the scenario creation process, and allow text edit fields to contain default values in the XML definition.
- Note: This does not mean that scenario creation is now possible, since it relies on scenario saving which is still not implemented.
2014-12-04 22:34:37 -05:00
ecd0867b65 Convert scenario details dialog and make numeric fields validate their contents 2014-12-04 16:54:21 -05:00
d45a7d1c1b Clicking a text field now selects it as if you had tabbed into it 2014-12-04 14:18:48 -05:00
04cba387d5 Automatically trigger the focus handler for the active field when toasting the dialog, and don't toast if the handler returns false
- But provide an option to skip this step, for the purpose of cancel buttons
2014-12-04 13:54:23 -05:00
7e07d195f9 Fiddling with the style guide 2014-12-04 12:47:57 -05:00
94d8717a0b Nuke as many warnings as possible, and several globals as well
- Warnings completely suppressed for the included TinyXML and gzstream libraries
- Parentheses warnings are now errors, since there were several that looked like bugs
- Ditto for dangling else warnings

Some of these warnings were actually bugs:
- Town wandering monsters would have never spawned, because the code to do so was accidentally nested within a check for overall_mode == MODE_OUTDOORS
---> boe.monster.cpp, lines 105-137
- Monster's behaviour with respect to elemental fields did not correctly depend on their immunities (this is the same precedence issue Sylae messed up fixing in the Windows code)
---> boe.monsters.cpp, lines 345-359
- Display of damage blocked by armour appeared to be incorrect (needs verification)
---> boe.newgraph.cpp, line 1079
- Three-choice dialogs probably weren't dealing with unusual button types correctly, though that's a minor point since they aren't expected to use such buttons
2014-12-04 12:44:17 -05:00
e7d8a6d848 Fix PC editor not showing curse and slow status effects 2014-12-03 23:20:28 -05:00
47fc23928c Strictify status types enum 2014-12-03 23:18:12 -05:00
13116980fb Strictify race enum
- This incidentally fixes a lot of things that were broken in the previous commit due to the magic values changing
2014-12-03 20:21:24 -05:00
5b7649543f Merge race and monster type enums 2014-12-03 18:27:34 -05:00
efa552a366 Don't use CoreFoundation to check machine's endianness 2014-12-03 18:04:33 -05:00
7a2a0f93d3 Finally, a working parser!
--> At least, it parses the sample file correctly

- I reverted the choice of using a skip parser, because it was failing and I couldn't figure out why. This means there's a lot of *ws where whitespace can go.
- Grammar rearranged a little
2014-12-03 05:03:10 -05:00
62f2259fb9 Hacked at it until the parser stopped crashing.
It now seems even uglier than before.
And it still doesn't actually work.
2014-12-03 05:01:06 -05:00
c119ffc242 More little grammar simplifications 2014-12-02 22:23:31 -05:00