Files
oboe/osx/classes/terrain.h
Celtic Minstrel 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

140 lines
4.7 KiB
C++

/*
* terrain.h
* BoE
*
* Created by Celtic Minstrel on 20/04/09.
*
*/
#ifndef TERRAIN_H
#define TERRAIN_H
#include <string>
#include <iosfwd>
namespace legacy { struct terrain_type_type; };
/* Terrains Specials Properties : scenario.ter_types[i].special */ //complete
typedef unsigned short ter_num_t;
enum eTerSpec {
// TER_SPEC_NONE = 0,
// TER_SPEC_CHANGE_WHEN_STEP_ON = 1,
// TER_SPEC_DOES_FIRE_DAMAGE = 2,
// TER_SPEC_DOES_COLD_DAMAGE = 3,
// TER_SPEC_DOES_MAGIC_DAMAGE = 4,
// TER_SPEC_POISON_LAND = 5,
// TER_SPEC_DISEASED_LAND = 6,
// TER_SPEC_CRUMBLING_TERRAIN = 7,
// TER_SPEC_LOCKABLE_TERRAIN = 8,
// TER_SPEC_UNLOCKABLE_TERRAIN = 9,
// TER_SPEC_UNLOCKABLE_BASHABLE = 10,
// TER_SPEC_IS_A_SIGN = 11,
// TER_SPEC_CALL_LOCAL_SPECIAL = 12,
// TER_SPEC_CALL_SCENARIO_SPECIAL = 13,
// TER_SPEC_IS_A_CONTAINER = 14,
// TER_SPEC_WATERFALL = 15,
// TER_SPEC_CONVEYOR_NORTH = 16,
// TER_SPEC_CONVEYOR_EAST = 17,
// TER_SPEC_CONVEYOR_SOUTH = 18,
// TER_SPEC_CONVEYOR_WEST = 19,
// TER_SPEC_BLOCKED_TO_MONSTERS = 20,
// TER_SPEC_TOWN_ENTRANCE = 21,
// TER_SPEC_CHANGE_WHEN_USED = 22,
// TER_SPEC_CALL_SPECIAL_WHEN_USED = 23,
TER_SPEC_NONE = 0,
TER_SPEC_CHANGE_WHEN_STEP_ON = 1,
TER_SPEC_DAMAGING = 2,
TER_SPEC_BRIDGE = 3, // new
TER_SPEC_BED = 4, // new
TER_SPEC_DANGEROUS = 5,
TER_SPEC_UNUSED1 = 6,
TER_SPEC_CRUMBLING = 7,
TER_SPEC_LOCKABLE = 8,
TER_SPEC_UNLOCKABLE = 9,
TER_SPEC_UNUSED2 = 10,
TER_SPEC_IS_A_SIGN = 11,
TER_SPEC_CALL_SPECIAL = 12,
TER_SPEC_UNUSED3 = 13,
TER_SPEC_IS_A_CONTAINER = 14,
TER_SPEC_WATERFALL = 15,
TER_SPEC_CONVEYOR = 16,
TER_SPEC_UNUSED4 = 17,
TER_SPEC_UNUSED5 = 18,
TER_SPEC_UNUSED6 = 19,
TER_SPEC_BLOCKED_TO_MONSTERS = 20,
TER_SPEC_TOWN_ENTRANCE = 21,
TER_SPEC_CHANGE_WHEN_USED = 22,
TER_SPEC_CALL_SPECIAL_WHEN_USED = 23,
// 1. Change when step on (What to change to, number of sound, Unused)
// 2. Damaging terrain; can't rest here (Amount of damage done, multiplier, damage type)
// 3. Reserved
// 4. Reserved
// 5. Dangerous land; can't rest here; percentage chance may be 0 (Strength, Percentage chance, status type)
// 6. Reserved
// 7. Crumbling terrain (Terrain to change to, strength?, destroyed by what - quickfire, shatter/move mountains, or both)
// 8. Lockable terrain (Terrain to change to when locked, Unused, Unused)
// 9. Unlockable terrain (Terrain to change to when locked, Difficulty, can be bashed)
// 10. Reserved
// 11. Sign (Unused, Unused, Unused)
// 12. Call special (Special to call, local or scenario?, Unused)
// 13. Reserved
// 14. Container (Unused, Unused, Unused)
// 15. Waterfall (Direction, Unused, Unused)
// 16. Conveyor Belt (Direction, Unused, Unused)
// 17. Reserved
// 18. Reserved
// 19. Reserved
// 20. Blocked to Monsters (Unused, Unused, Unused)
// 21. Town entrance (Terrain type if hidden, Unused, Unused)
// 22. Change when Used (Terrain to change to when used, Number of sound, Unused)
// 23. Call special when used (Special to call, local or scenario?, Unused)
// 24. Bridge - if the party boats over it, they get the option to land. (Unused, Unused, Unused)
};
enum eTrimType {
TRIM_NONE = 0,
TRIM_WALL = 1, // not a trim, but trims will conform to it as if it's the same ground type (eg stone wall)
TRIM_S, TRIM_SE, TRIM_E, TRIM_NE, TRIM_N, TRIM_NW, TRIM_W, TRIM_SW,
TRIM_NE_INNER, TRIM_SE_INNER, TRIM_SW_INNER, TRIM_NW_INNER,
TRIM_FRILLS = 14, // like on lava and underground water; no trim_ter required
TRIM_ROAD = 15, // the game will treat it like a road space and draw roads; no trim_ter required
TRIM_WALKWAY = 16, // the game will draw walkway corners; trim_ter is base terrain to draw on
TRIM_WATERFALL = 17, // special case for waterfalls
TRIM_CITY = 18, // the game will join roads up to this space but not draw roads on the space
};
// Depending on the special ability, the flags may need to be treated as either signed or unsigned
union ter_flag_t {signed short s; unsigned short u;};
class cTerrain {
public:
std::string name;
short picture;
unsigned char blockage;
ter_flag_t flag1;
ter_flag_t flag2;
ter_flag_t flag3; // new additional flag for special properties
eTerSpec special;
ter_num_t trans_to_what;
unsigned char fly_over;
unsigned char boat_over;
unsigned char block_horse;
unsigned char light_radius;
unsigned char step_sound;
unsigned char shortcut_key; // for editor use only
unsigned char obj_num; // ditto (formerly res1)
unsigned char ground_type; // ditto (formerly res2)
eTrimType trim_type; // ditto, mostly (formerly res3)
unsigned short trim_ter; // ditto
unsigned short combat_arena;
location obj_pos; // editor use only
location obj_size; // editor use only
unsigned short i; // for temporary use in porting
cTerrain& operator = (legacy::terrain_type_type& old);
void writeTo(std::ostream& file);
};
#endif