Commit Graph

20 Commits

Author SHA1 Message Date
2a458450b5 Expand if race/trait to allow for richer comparisons
(Adapted from Windows code)
2014-12-11 01:36:31 -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
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
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
5b7649543f Merge race and monster type enums 2014-12-03 18:27:34 -05:00
03c64ebd7b Eliminate use of __attribute__
Ideally this would be standard C++, but here I've settled for things that should be supported by both clang and VS/cl.exe:
- Deprecated attribute retained, but now uses __declspec syntax
- Packed attribute replaced with pragma pack, except one instance where it unnecessary
- Aligned attribute replaced with explicit padding bytes inserted in the structs where needed
- Unused attribute simply removed (though where possible, the unused entities were also removed)
2014-12-02 15:54:50 -05:00
caa461f8e7 Tear out most of the legacy code in the PC editor - see below for details
(Scenario Editor is unaffected by this commit.)

- Menubar converted to a .xib file
- Don't include the Info.plist in "Copy Files" stage
- Several more dialogs converted; as before, the source resources have had their resource name changed to the new filename
- One more converted STR# has been included

There were several functions in the PC Editor code that also existed in the BoE game code. I've moved these into the pc.editors.cpp file, so that there's only one copy of each.
- display_alchemy() functions changed signatures
- moved keyToChar() function into a common file (winutil)
- Several constants and globals moved to pc.editors.cpp

Supporting changes to dialog framework:
- New formatting option to set the frame style; this because the PC editor uses a different frame style in some contexts
- Added global default dialog background setting
--> This was necessary to correctly set the default text colour
--> Will also be needed for the scenario editor, which uses a different default background

Other changes:
- Add option to load_scenario to skip loading the strings
- Fix for crash in soundtool in the event of initialization before playing the first sound
2014-04-16 17:07:08 -04:00
c413d292a9 Tear out most of the legacy code in the game - see below for details
(PC Editor and Scenario Editor are unaffected by this commit.)

Things removed:
- All references to Carbon and QuickDraw are gone.
- No more Resource Manager; the game no longer relies on old resource files at all
- The old dialog framework (from dlogtool.c, functions usually prefixed with cd_) is no longer used.
- Files that weren't being compiled
- Boost libraries that are now in the C++ library (function, shared_ptr)
- Obsolete build settings

Replacement dependencies:
- Boost Filesystem replaces references to things like FSSpec
- SFML replaces all the QuickDraw code and most window management
- Cocoa replaces AppleEvent management, menu management, and some window management
- I wrote a resource manager interface to mimick the important aspects of the behaviour of the Mac Resource Manager
- I had to rewrite some functions that QuickDraw provided natively, such as clipping regions; not all of these are tested

Things added:
- Every referenced dialog has been converted from a DITL resource into the new XML-based dialog format.
- All referenced STR# resources have been extracted into simple text files
- Now compiles against Mac OSX 10.7 SDK and libc++
- The first item in the Help menu opens the docs on Sylae's website
- It seems all the constants for soundtool vanished somewhere, so I added them back from the original Mac source

Other changes:
- Updated to XCode 4(?) project format
- Added the xcschemes created by XCode 4; I'm not sure how important these are, but they seem like they might be important
- Added document on converting dialogs to the XML format.
- Make string formatting mismatches into errors instead of warnings
- Disable error limit
- Graphics sheets that previously used masking now have alpha transparency
- Converted all graphics sheets to 8-bit PNG
- Trimmed white border from intro image
- Converted dialogs in the resource file have their resource name set to the name of the XML file of the converted version
- Referenced string resources in the resource file have their resource name set to the name of the text file of the extracted version
- Add the black-and-white patterns from the PAT resources to the pixpats.png; at least one of them is used somewhere in the game
- Recreated the menu.xib as a Cocoa xib file instead of a Carbon xib file
- Disable GNU C++ extensions; maybe this'll make it easier to compile with cl.exe later
- Add marks to the enormous handle_action function to make it easier to navigate\
- A build step to validate the XML dialogs using xmllint (doesn't quite work properly yet but does at least catch dialogs that are not well-formed)- Fix a lot of warnings about assigning string constants to non-const char pointers
- Fixed the file and application icons (which had somehow become corrupted at some point)
- Lots of additional functions in the custom location and rectangle classes, including implicit conversion to and from SFML rects and vectors; also they now store coordinates as int instead of char
- A new enum for encounter note types
- Much tweaking of the encounter note recording mechanisms
- To ease porting, I added a simple function that converts from classic Mac ticks (about 1/60 of a second) to the SFML time type
- Python script to convert STR# resources to txt files, replacing newlines with vertical bars
- Extracted the Mac font (Dungeon Bold) from the resource file and also added the Windows font (MaidenWord)

XML Dialog Framework changes:
- Remove the static initialization object in favour of manually calling cDialog::init()
- {set,get}Format() no longer used for colour; there's a dedicated {set,get}Colour() instead
- draw() methods unprotected in the control classes so that controls can be drawn in the main window
- There's no longer a friend relationship between the dialogs and the controls
- Fixed buttons duplicating the "depressed" boolean
- Buttons now properly offset the label for tiny and push buttons, and for LEDs
- Buttons no longer assume that either none or both of "width" and "height" are given in the XML
- Add {get,set}BtnType() to cButton
- cLedGroup now overrides handleClick(), which has also been made virtual; this was necessary for LEDs within a group to properly hilite while being clicked
- Add addChoice() to cLedGroup to insert additional LED choices
- Moved the key enums and cKey to a separate file
- Add a method to get a control's attached key
- Add methods to get and set a control's rect and position
- Controls can now directly take a window as a parent rather than a dialog
- Add addLabelFor() method to cDialog which adds a static text control as a label for another control
- Remove hack for storing a dialog result of arbitrary type in favour of boost::any
- Add method to get default text colour for a dialog
- Add method to get a dialog's rect
- Add method to add the same event handler to multiple controls in a dialog
- Add concept of default button to dialogs
- Add enum for text field type (currently either number or text)
- Implement the text field without use of native controls, including somewhat decent text input and a flashing insertion point
- cPict no longer stores references to every sheet; it fetches them as needed from the resource manager
- The many draw functions in cPict are no longer static, since they need to access the window containing the pict (before they could only be static due to QuickDraw's global state)
- Add setPict() without a type argument to change the graphic without changing the type, which is a common operation
- Add a scrollbar control; the specifics aren't implemented yet
- Change signature of the record callback for cStrDlog; it will no longer be passed the strings
- Publicize the no-button constructor of cChoiceDlog; it'll assume "okay" is the only button
- Add operator-> to cPictChoice for accessing the underlying dialog
- Add constructor to cPictChoice that takes a starting and ending pic num
- Remove err parameter from giveError
- Many more keys handled, plus support for catching copy, paste, cut, and select all keyboard shortcuts
- Text input fields take priority, overriding any other keyboard shortcuts in the dialog, but they never catch help (F1), escape, or enter
- Some changes to the format itself:
-> keys go in the "def-key" attribute, but modifiers go in "key-mod"
-> "clickable" is no longer a recognized attribute
-> "title" is now a recognized text size (18pt, even larger than "large" at 12pt)
-> "defbtn" attribute on the root element
2014-04-14 13:52:01 -04:00
78cd213972 In no particular order:
- Added some of the most basic dialogs
- Changed C-style <xxx.h> headers to C++-style <cxxx> headers
- Switched graphics to load from the PNG files in graphics.exd rather than from Blades of Exile Graphics (NOTE: Some graphics still don't work, probably because of incorrect source rects)
- Switched cursors to load from GIF files in graphics.exd rather than from Blades of Exile Graphics
- Moved Niemand's tileImage functions from boe.graphics.cpp to graphtool.cpp, so they can be used by all three programs.
- Added some string lists in .txt files
- Made cursors into an enum
- Rewrote the code for displaying the Edit Terrain dialog to use the new engine (not tested yet)
- Fixed some __attribute__((deprecated)) stuff
- Most graphics are now loaded just after the custom graphics. This means they will be overridden by a file of the same name in the scenario's .exr folder.
- Altered modes a little so that when at the startup screen you are in MODE_STARTUP rather than MODE_OUTDOORS.
- Switched from function pointers to boost::function – the Boost libraries are now required.
- Finished off the new dialog engine and made gess necessary
- Added status icons as another type that can be drawn in dialogs
- C Wrappers for Cocoa cursors based on an Apple example. This is tested, and works perfectly.
- Added a switch in the program for using Windows graphics; however, there is no way as yet to set this flag, and in fact there aren't even any Windows graphics to use.
- Added include guards to graphtool.h
- Made separate mac and win directories within sounds.exa, since the Mac and Windows sounds are mostly subtly different (with two completely different!)

git-svn-id: http://openexile.googlecode.com/svn/trunk@90 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-06-07 18:18:24 +00:00
c55948c03f - Removed the ADVEN macro in favour of using the overloaded operatr[] on univ.party
- Removed all referenes to cPopulation::dudes in favour of the overloaded operator[]

git-svn-id: http://openexile.googlecode.com/svn/trunk@84 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-05-30 23:11:47 +00:00
50829034a9 - Added enums for status and player race, traits, and skills.
- The player race enum has been expanded so that it can also be used as monster race; it's not yet used as such though.
- Additional races Vahnatai, Plant, and Bird added.
- Alter the terrain special flags so that they can be used as signed shorts in the few cases that require it, and changed dangerous terrain to combine the curse/bless and slow/haste cases.
- Fixed an unnoticed error which would have probably prevented monsters from being affected by conveyors.
- Refined the dangerous terrain special ability with more messages and also handling all cases except weapon poison.

git-svn-id: http://openexile.googlecode.com/svn/trunk@79 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-05-29 04:47:54 +00:00
eeaa9ca599 Added some typedefs for clarity, and also added a cAttack class.
git-svn-id: http://openexile.googlecode.com/svn/trunk@77 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-05-28 23:48:10 +00:00
bf1487114a - Implemented new-style frill drawing using masking (untested)
- Re-implemented walkway drawing in the same way
- Tried to fix an STL error
- A few other thing, maybe?

git-svn-id: http://openexile.googlecode.com/svn/trunk@60 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-05-18 11:16:46 +00:00
4dc75d51c0 - Merged two classes (cPopulation::cCreature and cTown::cCreature)
- Changes some C-strings to STL-strings
- Fixed the problem where the spiderweb logo would not fully appear if ShowStartupSplash is disabled

git-svn-id: http://openexile.googlecode.com/svn/trunk@54 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-05-07 02:50:16 +00:00
e0115dd668 - Added a setting to skip delay when showing damage to the whole party. It's a hidden preference at the moment, like skip startup splash.
- Replaced all instances of Boolean with bool, TRUE with true, FALSE with false. (Except for a few cases where this resulted in a compile error.)

git-svn-id: http://openexile.googlecode.com/svn/trunk@38 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-04-27 19:41:06 +00:00
fa528023e7 - Added enums for trap type, damage type, and monster type
- Changed something that may have been a bug in which an undead monster attacking another monster would do demonic damage (and vice versa).

git-svn-id: http://openexile.googlecode.com/svn/trunk@35 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-04-27 02:08:58 +00:00
440eb5a765 Starting to turn the constants in boe.consts.h into enums. So far the overall mode and the player main status have been changed.
Also tried in vain to fix the problem with controls not being drawn.

git-svn-id: http://openexile.googlecode.com/svn/trunk@34 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-04-26 22:30:53 +00:00
d3be0c107e Both the game and the scenario editor now properly load a scenario.
This means that the game can in fact be played – though saving is not currently operational.

git-svn-id: http://openexile.googlecode.com/svn/trunk@32 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-04-25 22:50:58 +00:00
3ba7021543 More refactoring. The code is ALMOST able to compile now – all three programs together give a mere 25 errors.
git-svn-id: http://openexile.googlecode.com/svn/trunk@31 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-04-25 05:12:14 +00:00
0794231c20 - Renamed all source files for better consistency and for a cpp extension.
- Added Bandit Busywork and the GPL license.

git-svn-id: http://openexile.googlecode.com/svn/trunk@23 4ebdad44-0ea0-11de-aab3-ff745001d230
2009-04-19 14:25:48 +00:00