Commit Graph

458 Commits

Author SHA1 Message Date
34ee2b2c29 Introduce enum for monster time flags
- Also, this probably fixes the issues with certain time flags (particularly the "sometimes ones) not working correctly
2015-01-22 21:36:53 -05:00
aa705fac13 Implement writing outdoor sector to XML 2015-01-22 21:36:46 -05:00
952d81ae5a Store rect descriptions together with their rectangle and remove now-unused string-length members 2015-01-22 15:19:26 -05:00
3e0e3d3b8a Implement saving monster definitions to XML 2015-01-22 14:33:28 -05:00
670e35f9d5 Implement writing item definitions to XML 2015-01-22 12:22:40 -05:00
ee27e5341d Implement writing terrain definitions to XML 2015-01-22 11:23:44 -05:00
df4dc3bf21 Extract saving of main scenario data into a subroutine 2015-01-22 10:28:38 -05:00
6a08476d22 Create dialog for editing large terrain object definitions
- Remove keybindings from terrain dialog arrow buttons
- Fix arrow buttons not bound-checking fields

Dialog engine:
- Fix fields crashing after text is set while it has focus
- Trigger focus handler on untoast() to balance that in toast()
2015-01-22 10:22:59 -05:00
5315655bc6 Fix up some minor issues with the special node editing dialog
- Also: merge "nuke monsters" and "destroy monster" nodes, since the action of the "destroy monster" node isn't what it sounds like; now it simply destroys a single monster on a specific space
2015-01-21 22:36:00 -05:00
e689ed93ef Update the in-game item info dialog and restore support for long item descriptions 2015-01-21 21:26:23 -05:00
41fbd73ef9 Get the scenario, town, and outdoor details dialogs updated for new stuff
- Advanced town details now offers edit buttons to edit the specials immediately

Changes to dialog engine:
- Fix tiny buttons stretching to fill label area
- Fix LEDs stretching if label area is higher than LED button
- Fix LEDs ignoring font setting
2015-01-21 15:59:09 -05:00
311a3c0702 Get the item abilities dialog working and updated for new stuff
- Add additional treasure type for "unique" items
- Main item dialog now shows the item ability's display name, and also has more space for the item's full name
- (Game) No-ammo missiles (eg slings) are now counted as weapons by shops
- (Dialog Engine) Fix LED groups being drawn when invisible
2015-01-21 14:04:40 -05:00
74ed88f2f3 Several new item abilities and one new monster ability
- Range augment ability for missiles
- Seeking ability for missiles (can strike an adjacent space if targeted space lacks a target, including chance of hitting invisible monsters)
- Weapon that calls node when attacking with it (works both in range and melee; the cases can be distinguished by the node with IF_CONTEXT)
- Armour that calls node when attacked while wearing (works both in range and melee; the cases can be distinguished by the node with IF_CONTEXT)
- Monster ability that calls node when monster attacked (works both in range and melee; the cases can be distinguished by the node with IF_CONTEXT)
- The above three only apply to non-magical attacks - some things don't trigger it, like spells, monster rays and breath weapons, possible a few others
- Armour that protects from all melee damage (including demon/undead, though less)
- Armour that decreases chance to be hit (both in range and melee, against non-magical attacks only)
- Armour that behaves like to the martyr's shield effect but also has a chance of adding some extra bonus damage
- Armour that's more encumbering than advertised (best for cursed items with concealed ability)
- Multiple items with the accuracy ability now stack
- Fix nephilim not getting their racial bonus to missile weapons
- In specials called as part of an attack, the reserved pointer -20 contains the target in a form ready to pass to a SELECT_TARGET node, while -21 and -22 contain the location of the target. This includes the new cases added in this commit plus the monster ability to call a special node on its turn. It does not include specials called in the spell targeting context (to do so would break legacy scenarios), nor specials called after a targeting node.
- If a PC is carrying more than their max weight, they gain encumbrance equal to one-tenth of the excess.
- Add some missing context cases to IF_CONTEXT node
2015-01-20 21:40:48 -05:00
7837459177 New item variety: Special
- When picked up or purchased, the party gains a special item
2015-01-20 17:45:15 -05:00
bbe8e766ca Update the edit item dialog for new things (missiles, arbitrary key weapon skills)
- Also, missile weapons now use the key skill as well
- Fix guessing of missile types - using the item level didn't work out since the levels weren't what the original code expected, so now it just goes by the name
2015-01-20 17:18:42 -05:00
5450ae1caf Implement editing dialogs for individual monster abilities
Changes to game:
- Permanent martyr's shield is now customizable - extra1 is per-mille chance to activate each time damage is taken, and extra2 is percent of damage taken to apply to attacker
- Absort spells is now customizable - extra1 is per-mille chance to activate each time damage is taken or a magic effect is applied, and extra2 is how much hp to gain from non-damaging magic effects
- Splits ability is now customizable - extra1 is per-mille chance of splitting each time damage is taken
- Special node ability is now called before the monster tries its normal attack, and multiple monsters can use them per round (though each can only use theirs once)
- Fix issue with breath weapons and icy touch abilities conflicting (legacy import issue)
- Add two variations of the summoning ability - summon according to summoning level (like the spells), or summon a random creature of a particular species
- Fix touch abilities using the range as chance to use

Changes to dialog engine:
- Fix tab order handling to exclude fields that are currently hidden
- Add method to retrieve the parameter passed to toast(), as a quick way to distinguish between the user clicking OK or Cancel after run() has exited
- Fix hidden fields being drawn anyway
- Fix setting stack page sometimes crashing if the current page was invalid due to earlier reducing the page count to 0
2015-01-20 17:18:41 -05:00
d614286fec Fix edit event special node using the button as the node number 2015-01-20 17:18:40 -05:00
7084991e55 Get the edit monster abilities dialog all working and updated (except for editing individual abilities)
Game changes:
- Remove support for playing a sound and displaying strings when a monster is first seen, since these behaviours can easily be obtained by using the special node called in the same context.
Dialog engine changes:
- Support for changing the font size of LEDs
- When setting the page, a stack now applies a default value if the map is missing the required data
- Add utility "addPage" method to stacks
- If reducing the page count means the current page is deleted, a stack now switches to the last page
2015-01-20 17:18:39 -05:00
967438ecec Add dialog to the scenario editor to let it know what type of graphics are in the custom sheets
- If you do this, it adds the graphics to all relevant select graphic dialogs, at the end, allowing you to choose custom graphics without having to remember the number schemes
2015-01-20 17:18:37 -05:00
3852ca37cd Make monster resistances a percentage and update monster info dialog
- Fix monster roster menu not working
2015-01-17 18:56:15 -05:00
cdeb02c214 Get the edit monster dialog completely working and updated for new stuff
(Just the main dialog, not the abilities dialog)
2015-01-17 16:56:37 -05:00
3d7fcbd60e New special node to initiate conversation (should even work outdoors) 2015-01-17 15:00:22 -05:00
4e2c0100e8 Strictify and use talk node type enum 2015-01-17 02:41:25 -05:00
544cc80e56 Add special nodes that hook into the spell targeting system
- Node to initiate targeting mode and call a special once targets are chosen
- Nodes to place a spell pattern (one for fields and one for booms)
2015-01-17 02:09:50 -05:00
c5e302e0cc Several new special nodes
- A set of nodes for building complex strings in a string buffer; to reference the string buffer anywhere a string is expected, you can use -8 as the string number
- A node to pause the action for a specified period of time
- Nodes to alter traits, action points (only in combat), and PC/monster names
- Node to create a new level 1 PC with a specified race, name, graphic, hp, sp, basic stats; custom graphics supported too
- Nodes to test for deadness, spells, alchemy, and status effects
- Node to centre the view on an arbitrary space
- Node to lift the "fog of war", which currently means the unseen and light masks (which can actually be disabled in preferences anyway)
- Node to edit maps (ie, specify which areas are explored)
Changes to existing nodes:
- All the rectangle nodes that affect terrain now work outdoors.
- Play sound node now has an asynchronous option
- Fix min and max modes being swapped in the check statistic node
- Select PC now allows restricting to dead PCs or to PCs with free inventory space
- Select PC now calls the "on cancel" node if a non-interactive selection fails
- Affect deadness node now allows: setting/clearing the "fled outdoor combat" flag; setting/clearing the "absent" flag used for splitting the party; (un)deleting a PC
- If context node can now check if the party is in a specific boat/horse as opposed to any boat/horse
2015-01-16 22:57:39 -05:00
d729bcc86b Merge all the status effect special nodes
- It's now possible to affect weapon poison, martyr's shield, acid, and life detection from a special node
- Affect nodes now always take resistances into account when harming, but never when helping
2015-01-16 10:33:57 -05:00
4ae8f7661e Fix scenario editor build
(Was broken with the monster abilities rewrite)
2015-01-16 03:36:20 -05:00
ab03e17cb1 Fix some display update issues 2015-01-15 15:11:39 -05:00
f282c06bfa Write the code to save the general scenario data to a file
- See monster strings are now fetched from the same list as the special encounter strings instead of a list of their own
- There is now a possibility for the scenario intro dialog to have a different icon than the scenario icon
- Remove unused intro_mess_len field
- Add method to the XML printer class to push a simple element with no attributes or child elements
- Automatically close any elements before writing the document to the stream
- Fix scenario editor File menu having an invisible "Close All" option that appeared when the option key was pressed
2015-01-13 20:54:51 -05:00
52c7bc126f Rename m_num_t -> mon_num_t 2015-01-13 13:52:02 -05:00
2a41b68129 Split monster immunities bitfield into more comprehensible chunks.
- Monsters now properly decide whether they can enter damaging terrains
- The possibility of being unusually vulnerable to a damage type is introduce - such monsters would take double damage from that type
2015-01-13 12:33:04 -05:00
84689cacaf Strictify damage type enum 2015-01-13 00:12:47 -05:00
25ef2ed713 Initial reformation of item abilities
- Merge most of the spell usable abilities into a single "cast spell" ability which can take any spell as an additional parameter
- Merge the affect status usable abilities into a single "affect status" ability which can take any status as an additional parameter
- Merge acidic and poisoned weapon into a single "status weapon" ability which can take any status as an additional parameter (though the handling for other statuses isn't yet implemented)
- Fix mass charm spell getting worse as you intelligence bonus increases
- Mass charm item spell is now easier to resist (an unintended side-effect)
- PC versions of Wrack and Unholy Ravaging implemented (for use as item spells)
2015-01-12 21:18:45 -05:00
3a285f47da Eliminate data size members from the scenario record
- Also move town_hidden array to the town record flags
2015-01-12 14:05:46 -05:00
908652d168 Housekeeping
- Rename cItemRec -> cItem and cItemRec::type -> cItem::weap_type
- Clear out a lot of commented code
- Remove the flag_x members in the scenario that used to store the scenario's password hash (or something like that)
2015-01-12 01:01:24 -05:00
43e4bcc048 Fix several more warnings
- As a side-effect, weapons with key skills other than the conventional three (edged, bashing, pole) are now fully supported (though the scenario editor UI doesn't yet support them)
2015-01-11 16:47:32 -05:00
148fa56a14 Fix Mac build 2015-01-11 16:18:27 -05:00
f5db91547c Fix Windows build 2015-01-11 15:18:35 -05:00
1a069b4d71 Fix Mac build by eliminating more sprintf calls 2015-01-11 13:49:11 -05:00
bd531f9ac4 Nuke a lot of MSVC compiler warnings 2015-01-10 21:30:16 -05:00
bd0dc55995 Fix scenario editor build 2015-01-10 20:12:49 -05:00
6b107f8273 Write the code to save special nodes, as well as a skeletal outline of the new scenario format output code 2015-01-10 20:08:35 -05:00
1a7ff2c631 Fix Windows build 2015-01-10 00:29:25 -05:00
9f57f35428 Change .h -> .hpp in tools/ directory 2015-01-09 22:32:47 -05:00
3ef98712d5 Purge all uses of printf, fprintf, perror and most uses of sprintf
Also:
- Print "Target Spell" before the explanatory prompts, instead of after (when fancy targeting)
- Fix sell costs being drawn on top of the button
- String-insensitive comparing for dialogue keys
2015-01-08 22:26:41 -05:00
04b9aec921 Reform PC editor menu -> command mapping so that the non-platform-dependent code doesn't need to know where the menuitem is
- Also disable edit menus when no party loaded and fix item menus not being populated if the party is in a scenario
2015-01-05 17:17:34 -05:00
dfe54fd0a2 Fix Windows scenario editor menus 2015-01-05 13:49:51 -05:00
ec617322d0 Merge branch 'master' from Windows 2015-01-05 13:33:52 -05:00
584baa3f19 Reform scenario editor menu -> command mapping so that the non-platform-dependent code doesn't need to know where the menuitem is 2015-01-05 13:33:38 -05:00
60730702a5 Split PC editor items menus into columns
- And increase columns for scenario editor items menus
2015-01-05 13:25:18 -05:00