From 715aab7a3c0deb414cbb60aacc06a80c9b1469fc Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 1 Jun 2009 15:38:23 +0000 Subject: [PATCH] - Added simpletypes.h header to hold the enums and typedefs related to the main class headers - Made boom drawing take from the new boom gworld rather than from the field gworld - Added enum for monster abilities (will be used for both of a monster's abilities, but isn't used yet) - Added supporting member functions for the new abilities (not used yet): get ability name and has ability - Added SDF pointer storage to the party structure together with supporting member functions (not used yet) - Deleted the "reserved" fields res1, res2, res3 in the monster struct git-svn-id: http://openexile.googlecode.com/svn/trunk@87 4ebdad44-0ea0-11de-aab3-ff745001d230 --- osx/BoE.xcodeproj/project.pbxproj | 2 + osx/Scenario Editor/Blades of Exile Graphics | Bin 6870097 -> 6836311 bytes osx/Scenario Editor/scen.core.cpp | 3 - osx/boe.consts.h | 55 --- osx/boe.graphics.cpp | 4 +- osx/boe.newgraph.cpp | 6 +- osx/boe.specials.cpp | 2 +- osx/classes.h | 10 +- osx/classes/item.h | 174 ------- osx/classes/monster.cpp | 287 ++++++++++- osx/classes/monster.h | 104 ++-- osx/classes/party.cpp | 19 + osx/classes/party.h | 10 +- osx/classes/pc.h | 43 -- osx/classes/simpletypes.h | 486 +++++++++++++++++++ osx/classes/special.h | 2 - osx/classes/terrain.h | 91 ---- osx/tools/soundtool.h | 4 + 18 files changed, 838 insertions(+), 464 deletions(-) create mode 100644 osx/classes/simpletypes.h diff --git a/osx/BoE.xcodeproj/project.pbxproj b/osx/BoE.xcodeproj/project.pbxproj index d9d05995..a15de534 100644 --- a/osx/BoE.xcodeproj/project.pbxproj +++ b/osx/BoE.xcodeproj/project.pbxproj @@ -365,6 +365,7 @@ 9122832D0FCF6C7200B21642 /* busywork.exs */ = {isa = PBXFileReference; lastKnownFileType = file; path = busywork.exs; sourceTree = ""; }; 912283C70FD0E16B00B21642 /* undo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = undo.h; path = tools/undo.h; sourceTree = ""; }; 912283C80FD0E16C00B21642 /* undo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = undo.cpp; path = tools/undo.cpp; sourceTree = ""; }; + 912287850FD41A2300B21642 /* simpletypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simpletypes.h; path = classes/simpletypes.h; sourceTree = ""; }; 912793480F9C0FE6007B0D52 /* ViewDlog.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ViewDlog.app; sourceTree = BUILT_PRODUCTS_DIR; }; 912798AE0F9CA636007B0D52 /* dlgbtns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dlgbtns.cpp; path = tools/dlgbtns.cpp; sourceTree = ""; }; 91279BAD0F9CFCBA007B0D52 /* boescenario.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = boescenario.icns; sourceTree = ""; }; @@ -671,6 +672,7 @@ 91AC60A60FA26C1B00EEAE67 /* tmpltown.h */, 91AC61C40FA2729900EEAE67 /* universe.h */, 91AC62090FA2853700EEAE67 /* creatlist.h */, + 912287850FD41A2300B21642 /* simpletypes.h */, ); name = headers; sourceTree = ""; diff --git a/osx/Scenario Editor/Blades of Exile Graphics b/osx/Scenario Editor/Blades of Exile Graphics index c077ebcd053c9e4f6231ac39288a2bc74d5908bd..5b0d7d8cd9cfd20096ba9f162874f9d00ef443c7 100644 GIT binary patch delta 2360 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 diff --git a/osx/Scenario Editor/scen.core.cpp b/osx/Scenario Editor/scen.core.cpp index ca8ce412..f3aac6c4 100644 --- a/osx/Scenario Editor/scen.core.cpp +++ b/osx/Scenario Editor/scen.core.cpp @@ -713,9 +713,6 @@ cMonster return_monster_template(m_num_t store) { monst.default_attitude = 0; monst.summon_type = 0; monst.default_facial_pic = 0; - monst.res1 = 0; - monst.res2 = 0; - monst.res3 = 0; monst.immunities = 0; if (m_magic_r[m_num] == 1) diff --git a/osx/boe.consts.h b/osx/boe.consts.h index 3145c016..27c262b8 100644 --- a/osx/boe.consts.h +++ b/osx/boe.consts.h @@ -86,18 +86,6 @@ enum eGameMode { MODE_RESTING = 50, }; -///* adven[i].main_status */ //complete -//#define MAIN_STATUS_ABSENT 0 // absent, empty slot -//#define MAIN_STATUS_ALIVE 1 -//#define MAIN_STATUS_DEAD 2 -//#define MAIN_STATUS_DUST 3 -//#define MAIN_STATUS_STONE 4 -//#define MAIN_STATUS_FLED 5 -//#define MAIN_STATUS_SURFACE 6 // fled to surface? -//#define MAIN_STATUS_WON 7 -///* main status modifiers */ -//#define MAIN_STATUS_SPLIT 10 // split from party - // Directions! enum eDirection { DIR_N = 0, @@ -119,49 +107,6 @@ inline eDirection& operator++ (eDirection& me,int){ else return me = (eDirection) (1 + (int) me); } -/* damage type*/ -/* used as parameter to some functions */ -enum eDamageType { - DAMAGE_WEAPON = 0, - DAMAGE_FIRE = 1, - DAMAGE_POISON = 2, - DAMAGE_MAGIC = 3, - DAMAGE_UNBLOCKABLE = 4, //from the source files - the display is the same as the magic one (damage_monst in SPECIALS.cpp) - DAMAGE_COLD = 5, - DAMAGE_UNDEAD = 6, //from the source files - the display is the same as the weapon one - DAMAGE_DEMON = 7, //from the source files - the display is the same as the weapon one -// 8 and 9 aren't defined : doesn't print any damage. According to the source files the 9 is DAMAGE_MARKED though. Wrong ? - DAMAGE_MARKED = 10, // usage: DAMAGE_MARKED + damage_type - DAMAGE_WEAPON_MARKED = 10, - DAMAGE_FIRE_MARKED = 11, - DAMAGE_POISON_MARKED = 12, - DAMAGE_MAGIC_MARKED = 13, - DAMAGE_UNBLOCKABLE_MARKED = 14, - DAMAGE_COLD_MARKED = 15, - DAMAGE_UNDEAD_MARKED = 16, - DAMAGE_DEMON_MARKED = 17, - DAMAGE_NO_PRINT = 30, // usage: DAMAGE_NO_PRINT + damage_type - DAMAGE_WEAPON_NO_PRINT = 30, - DAMAGE_FIRE_NO_PRINT = 31, - DAMAGE_POISON_NO_PRINT = 32, - DAMAGE_MAGIC_NO_PRINT = 33, - DAMAGE_UNBLOCKABLE_NO_PRINT = 34, - DAMAGE_COLD_NO_PRINT = 35, - DAMAGE_UNDEAD_NO_PRINT = 36, - DAMAGE_DEMON_NO_PRINT = 37, - // What about both NO_PRINT and MARKED? -}; - -inline void operator -= (eDamageType& cur, eDamageType othr){ - if((othr == DAMAGE_MARKED && cur >= DAMAGE_MARKED && cur < DAMAGE_NO_PRINT) || - (othr == DAMAGE_NO_PRINT && cur >= DAMAGE_NO_PRINT)) - cur = (eDamageType) ((int)cur - (int)othr); -} - -inline void operator += (eDamageType& cur, eDamageType othr){ - if((othr == DAMAGE_MARKED || othr == DAMAGE_NO_PRINT) && cur < DAMAGE_MARKED) - cur = (eDamageType) ((int)cur + (int)othr); -} //inline eDamageType operator + (eDamageType lhs, eDamageType rhs){ // if(lhs == DAMAGE_MARKED || lhs == DAMAGE_NO_PRINT){ // if(rhs != DAMAGE_MARKED && rhs != DAMAGE_NO_PRINT) diff --git a/osx/boe.graphics.cpp b/osx/boe.graphics.cpp index 468730be..226aad05 100644 --- a/osx/boe.graphics.cpp +++ b/osx/boe.graphics.cpp @@ -141,6 +141,7 @@ GWorldPtr party_template_gworld; GWorldPtr items_gworld; GWorldPtr tiny_obj_gworld; GWorldPtr fields_gworld; +GWorldPtr boom_gworld; GWorldPtr roads_gworld; GWorldPtr map_gworld; GWorldPtr tiny_map_graphics; @@ -835,6 +836,7 @@ void Set_up_win () tiny_obj_gworld = load_pict(900); fields_gworld = load_pict(821); roads_gworld = load_pict(822); + boom_gworld = load_pict(823); missiles_gworld = load_pict(880); dlogpics_gworld = load_pict(850); @@ -2583,7 +2585,7 @@ void boom_space(location where,short mode,short type,short damage,short sound) else OffsetRect(&dest_rect,store_anim_ul.h,store_anim_ul.v); OffsetRect(&source_rect,-1 * store_rect.left + 28 * type,-1 * store_rect.top); - rect_draw_some_item(fields_gworld,source_rect,terrain_screen_gworld,dest_rect,1,1); + rect_draw_some_item(boom_gworld,source_rect,terrain_screen_gworld,dest_rect,1,1); if ((cartoon_happening == false) && (dest_rect.right - dest_rect.left >= 28) && (dest_rect.bottom - dest_rect.top >= 36)) { diff --git a/osx/boe.newgraph.cpp b/osx/boe.newgraph.cpp index 79f763cd..e8e38c83 100644 --- a/osx/boe.newgraph.cpp +++ b/osx/boe.newgraph.cpp @@ -50,7 +50,7 @@ extern WindowPtr mainPtr; extern short dungeon_font_num,geneva_font_num,town_type,which_combat_type; extern eGameMode overall_mode; extern bool play_sounds,boom_anim_active,cartoon_happening,in_startup_mode; -extern GWorldPtr fields_gworld,mixed_gworld,dlg_buttons_gworld[NUM_BUTTONS][2],terrain_screen_gworld,missiles_gworld; +extern GWorldPtr fields_gworld,boom_gworld,mixed_gworld,dlg_buttons_gworld[NUM_BUTTONS][2],terrain_screen_gworld,missiles_gworld; //extern party_record_type party; extern Rect sbar_rect,item_sbar_rect,shop_sbar_rect; extern ControlHandle text_sbar,item_sbar,shop_sbar; @@ -703,8 +703,8 @@ void do_explosion_anim(short sound_num,short special_draw) if (store_booms[i].boom_type >= 0) { if ((t + store_booms[i].offset >= 0) && (t + store_booms[i].offset <= 7)) { from_rect = base_rect; - OffsetRect(&from_rect,28 * (t + store_booms[i].offset),144 + 36 * (store_booms[i].boom_type)); - rect_draw_some_item(fields_gworld,from_rect, + OffsetRect(&from_rect,28 * (t + store_booms[i].offset),36 * (1 + store_booms[i].boom_type)); + rect_draw_some_item(boom_gworld,from_rect, temp_gworld,explode_place_rect[i],1,0); if (store_booms[i].val_to_place > 0) { diff --git a/osx/boe.specials.cpp b/osx/boe.specials.cpp index 55881519..2901bea5 100644 --- a/osx/boe.specials.cpp +++ b/osx/boe.specials.cpp @@ -2640,7 +2640,7 @@ void townmode_spec(short which_mode,cSpecial cur_node,short cur_spec_type, set_terrain(l,scenario.ter_types[ter].flag1.u); *redraw = 1; break; - case 179: + case 179: // TODO: Add a "random offset" mode if (which_mode == 7) break; run_a_boom(l,spec.ex2a,0,0); diff --git a/osx/classes.h b/osx/classes.h index 9c283564..3e8328a0 100644 --- a/osx/classes.h +++ b/osx/classes.h @@ -8,15 +8,7 @@ * */ -typedef unsigned short str_num_t; - -//class sbyte { -// signed char c; -//public: -// operator int() {return c;} -// sbyte(signed char k) : c(k) {} -//} - +#include "simpletypes.h" #include "location.h" #include "terrain.h" #include "vehicle.h" diff --git a/osx/classes/item.h b/osx/classes/item.h index 9f9f149e..6759f1c7 100644 --- a/osx/classes/item.h +++ b/osx/classes/item.h @@ -15,180 +15,6 @@ namespace legacy { struct item_record_type; }; -/* items[i].type a.k.a type of weapon */ -enum eWeapType { - ITEM_NOT_MELEE = 0, - ITEM_EDGED = 1, - ITEM_BASHING = 2, - ITEM_POLE = 3, -}; - -/* items[i].variety a.k.a item type (in editor) */ -enum eItemType { - ITEM_TYPE_NO_ITEM = 0, - ITEM_TYPE_ONE_HANDED = 1, - ITEM_TYPE_TWO_HANDED = 2, - ITEM_TYPE_GOLD = 3, - ITEM_TYPE_BOW = 4, - ITEM_TYPE_ARROW = 5, - ITEM_TYPE_THROWN_MISSILE = 6, - ITEM_TYPE_POTION = 7, // potion/magic item - ITEM_TYPE_SCROLL = 8, // scroll/magic item - ITEM_TYPE_WAND = 9, - ITEM_TYPE_TOOL = 10, - ITEM_TYPE_FOOD = 11, - ITEM_TYPE_SHIELD = 12, - ITEM_TYPE_ARMOR = 13, - ITEM_TYPE_HELM = 14, - ITEM_TYPE_GLOVES = 15, - ITEM_TYPE_SHIELD_2 = 16, - // don't know why a second type of shield is used ; it is actually checked - // in the armor code (item >= 12 and <= 17) - // and you can't equip another (12) shield while wearing it ... I didn't - // find a single item with this property in the bladbase.exs ... - ITEM_TYPE_BOOTS = 17, - ITEM_TYPE_RING = 18, - ITEM_TYPE_NECKLACE = 19, - ITEM_TYPE_WEAPON_POISON = 20, - ITEM_TYPE_NON_USE_OBJECT = 21, - ITEM_TYPE_PANTS = 22, - ITEM_TYPE_CROSSBOW = 23, - ITEM_TYPE_BOLTS = 24, - ITEM_TYPE_MISSILE_NO_AMMO = 25, //e.g slings - ITEM_TYPE_UNUSED1 = 26, // these are here solely because they are options in the editor - ITEM_TYPE_UNUSED2 = 27, -}; - -/* items[i].ability */ -enum eItemAbil { - // Weapon abilities - ITEM_NO_ABILITY = 0, - ITEM_FLAMING_WEAPON = 1, - ITEM_DEMON_SLAYER = 2, - ITEM_UNDEAD_SLAYER = 3, - ITEM_LIZARD_SLAYER = 4, - ITEM_GIANT_SLAYER = 5, - ITEM_MAGE_SLAYER = 6, - ITEM_PRIEST_SLAYER = 7, - ITEM_BUG_SLAYER = 8, - ITEM_ACIDIC_WEAPON = 9, - ITEM_SOULSUCKER = 10, - ITEM_DRAIN_MISSILES = 11, - ITEM_WEAK_WEAPON = 12, - ITEM_CAUSES_FEAR = 13, - ITEM_POISONED_WEAPON = 14, - // General abilities - ITEM_PROTECTION = 30, - ITEM_FULL_PROTECTION = 31, - ITEM_FIRE_PROTECTION = 32, - ITEM_COLD_PROTECTION = 33, - ITEM_POISON_PROTECTION = 34, - ITEM_MAGIC_PROTECTION = 35, - ITEM_ACID_PROTECTION = 36, - ITEM_SKILL = 37, - ITEM_STRENGTH = 38, - ITEM_DEXTERITY = 39, - ITEM_INTELLIGENCE = 40, - ITEM_ACCURACY = 41, - ITEM_THIEVING = 42, - ITEM_GIANT_STRENGTH = 43, - ITEM_LIGHTER_OBJECT = 44, - ITEM_HEAVIER_OBJECT = 45, - ITEM_OCCASIONAL_BLESS = 46, - ITEM_OCCASIONAL_HASTE = 47, - ITEM_LIFE_SAVING = 48, - ITEM_PROTECT_FROM_PETRIFY = 49, - ITEM_REGENERATE = 50, - ITEM_POISON_AUGMENT = 51, - ITEM_DISEASE_PARTY = 52, - ITEM_WILL = 53, - ITEM_FREE_ACTION = 54, - ITEM_SPEED = 55, - ITEM_SLOW_WEARER = 56, - ITEM_PROTECT_FROM_UNDEAD = 57, - ITEM_PROTECT_FROM_DEMONS = 58, - ITEM_PROTECT_FROM_HUMANOIDS = 59, - ITEM_PROTECT_FROM_REPTILES = 60, - ITEM_PROTECT_FROM_GIANTS = 61, - ITEM_PROTECT_FROM_DISEASE = 62, - // Nonspell Usable - ITEM_POISON_WEAPON = 70, //put poison on weapon - ITEM_BLESS_CURSE = 71, - ITEM_AFFECT_POISON = 72, - ITEM_HASTE_SLOW = 73, - ITEM_AFFECT_INVULN = 74, - ITEM_AFFECT_MAGIC_RES = 75, - ITEM_AFFECT_WEB = 76, - ITEM_AFFECT_DISEASE = 77, - ITEM_AFFECT_SANCTUARY = 78, - ITEM_AFFECT_DUMBFOUND = 79, - ITEM_AFFECT_MARTYRS_SHIELD = 80, - ITEM_AFFECT_SLEEP = 81, - ITEM_AFFECT_PARALYSIS = 82, - ITEM_AFFECT_ACID = 83, - ITEM_BLISS = 84, - ITEM_AFFECT_EXPERIENCE = 85, - ITEM_AFFECT_SKILL_POINTS = 86, - ITEM_AFFECT_HEALTH = 87, - ITEM_AFFECT_SPELL_POINTS = 88, - ITEM_DOOM = 89, - ITEM_LIGHT = 90, - ITEM_STEALTH = 91, - ITEM_FIREWALK = 92, - ITEM_FLYING = 93, - ITEM_MAJOR_HEALING = 94, - // Spell Usable - ITEM_SPELL_FLAME = 110, - ITEM_SPELL_FIREBALL = 111, - ITEM_SPELL_FIRESTORM = 112, - ITEM_SPELL_KILL = 113, - ITEM_SPELL_ICE_BOLT = 114, - ITEM_SPELL_SLOW = 115, - ITEM_SPELL_SHOCKWAVE = 116, - ITEM_SPELL_DISPEL_UNDEAD = 117, - ITEM_SPELL_DISPEL_SPIRIT = 118, - ITEM_SPELL_SUMMONING = 119, - ITEM_SPELL_MASS_SUMMONING = 120, - ITEM_SPELL_ACID_SPRAY = 121, - ITEM_SPELL_STINKING_CLOUD = 122, - ITEM_SPELL_SLEEP_FIELD = 123, - ITEM_SPELL_VENOM = 124, - ITEM_SPELL_SHOCKSTORM = 125, - ITEM_SPELL_PARALYSIS = 126, - ITEM_SPELL_WEB_SPELL = 127, - ITEM_SPELL_STRENGTHEN_TARGET = 128, //wand of carrunos effect - ITEM_SPELL_QUICKFIRE = 129, - ITEM_SPELL_MASS_CHARM = 130, - ITEM_SPELL_MAGIC_MAP = 131, - ITEM_SPELL_DISPEL_BARRIER = 132, - ITEM_SPELL_MAKE_ICE_WALL = 133, - ITEM_SPELL_CHARM_SPELL = 134, - ITEM_SPELL_ANTIMAGIC_CLOUD = 135, - // Reagents - ITEM_HOLLY = 150, // Holly/Toadstool - ITEM_COMFREY_ROOT = 151, - ITEM_GLOWING_NETTLE = 152, - ITEM_WORMGRASS = 153, // Crypt Shroom/Wormgr. - ITEM_ASPTONGUE_MOLD = 154, - ITEM_EMBER_FLOWERS = 155, - ITEM_GRAYMOLD = 156, - ITEM_MANDRAKE = 157, - ITEM_SAPPHIRE = 158, - ITEM_SMOKY_CRYSTAL = 159, - ITEM_RESSURECTION_BALM = 160, - ITEM_LOCKPICKS = 161, - // Missile Abilities - ITEM_MISSILE_RETURNING = 170, - ITEM_MISSILE_LIGHTNING = 171, - ITEM_MISSILE_EXPLODING = 172, - ITEM_MISSILE_ACID = 173, - ITEM_MISSILE_SLAY_UNDEAD = 174, - ITEM_MISSILE_SLAY_DEMON = 175, - ITEM_MISSILE_HEAL_TARGET = 176, -}; - -typedef signed short item_num_t; - class cItemRec { public: eItemType variety; diff --git a/osx/classes/monster.cpp b/osx/classes/monster.cpp index deb567d4..eeff17aa 100644 --- a/osx/classes/monster.cpp +++ b/osx/classes/monster.cpp @@ -53,9 +53,6 @@ cMonster& cMonster::operator = (legacy::monster_record_type& old){ default_attitude = old.default_attitude; summon_type = old.summon_type; default_facial_pic = old.default_facial_pic; - res1 = old.res1; - res2 = old.res2; - res3 = old.res3; picture_num = old.picture_num; if(picture_num == 122) picture_num = 119; return *this; @@ -197,3 +194,287 @@ cCreature& cCreature::operator = (const cCreature& other){ // replaces return_mo target = 6; // No target return *this; } + +cMonster::cAbility::operator std::string(){ + std::ostringstream sout; + short i = 0; + switch(abil){ + case MONST_THROWS_DARTS: + sout << "Throws darts (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_SHOOTS_ARROWS: + sout << "Shoots arrows (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_THROWS_SPEARS: + sout << "Throws spears (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_THROWS_ROCKS: + sout << "Throws rocks (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_THROWS_RAZORDISKS: + sout << "Throws razordisks (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_GOOD_ARCHER: + sout << "Good archer (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_SHOOTS_SPINES: + sout << "Shoots spines (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_THROWS_KNIVES: + sout << "Throws knives (" << extra1 << 'd' << extra2 << ')'; + break; + case MONST_DAMAGE_RAY: + case MONST_DRAIN_XP_DAMAGE_RAY: + case MONST_DAMAGE_TOUCH: + case MONST_DRAIN_XP_DAMAGE_TOUCH: + switch(extra1){ + case DAMAGE_WEAPON: + sout << "Health drain"; + break; + case DAMAGE_FIRE: + sout << "Heat"; + break; + case DAMAGE_POISON: + sout << "Pain"; + break; + case DAMAGE_MAGIC: + sout << "Shock"; + break; + case DAMAGE_UNBLOCKABLE: + sout << "Wounding"; + break; + case DAMAGE_COLD: + sout << "Icy"; + break; + case DAMAGE_UNDEAD: + case DAMAGE_DEMON: + sout << "Unholy"; + break; + default: + sout << "*ERROR INVALID DAMAGE TYPE*"; + } + if(abil == MONST_DRAIN_XP_DAMAGE_RAY || abil == MONST_DRAIN_XP_DAMAGE_TOUCH) + sout << ", draining"; + if(abil == MONST_DAMAGE_RAY || abil == MONST_DRAIN_XP_DAMAGE_RAY) + sout << " ray"; + else sout << " touch"; + break; + case MONST_STATUS_RAY: + case MONST_STATUS_TOUCH: + switch(extra1){ + case STATUS_BLESS_CURSE: + sout << "Curse"; + break; + case STATUS_POISON: + sout << "Poison"; + i = 1; + break; + case STATUS_HASTE_SLOW: + sout << "Slowing"; + break; + case STATUS_WEBS: + sout << "Glue"; + i = 1; + break; + case STATUS_DISEASE: + sout << "Infectious"; + i = 1; + break; + case STATUS_DUMB: + sout << "Dumbfounding"; + break; + case STATUS_ASLEEP: + sout << "Sleep"; + break; + case STATUS_PARALYZED: + sout << "Paralysis"; + break; + case STATUS_ACID: + sout << "Acid"; + i = 1; + break; + default: // Poisoned weapon, invulnerable, magic resistance, sanctuary, martyr's shield, or invalid + sout << "*ERROR BAD OR INVALID STATUS TYPE*"; + } + if(abil == MONST_STATUS_RAY) + if(i == 1) sout << " spit"; + else sout << " ray"; + else sout << " touch"; + break; + case MONST_PETRIFY_RAY: + sout << "Petrification ray"; + break; + case MONST_DRAIN_SP_RAY: + sout << "Spell point drain ray"; + break; + case MONST_DRAIN_XP_RAY: + sout << "Experience draining ray"; + break; + case MONST_KILL_RAY: + sout << "Death ray"; + break; + case MONST_STEAL_FOOD_RAY: + sout << "Steals food from afar"; + break; + case MONST_STEAL_GOLD_RAY: + sout << "Steals gold from afar"; + break; + break; + case MONST_PETRIFY_TOUCH: + sout << "Petrification touch"; + break; + case MONST_DRAIN_SP_TOUCH: + sout << "Spell point draining touch"; + break; + case MONST_DRAIN_XP_TOUCH: + sout << "Experience draining touch"; + break; + break; + case MONST_KILL_TOUCH: + sout << "Death touch"; + break; + case MONST_STEAL_FOOD_TOUCH: + sout << "Steals food when hits"; + break; + case MONST_STEAL_GOLD_TOUCH: + sout << "Steals gold when hits"; + break; + case MONST_SUMMON_ONE: + sout << "Summons " << scenario.scen_monsters[extra1].m_name << "s (" << extra2 <<"% chance)"; + break; + case MONST_SUMMON_TYPE: + sout << "Summons "; + switch(extra1){ + case 0: + sout << "wildlife"; + break; + case 1: + sout << "weak aid"; + break; + case 2: + sout << "strong aid"; + break; + case 3: + sout << "powerful aid"; + break; + case 4: + sout << "friends"; + break; + } + sout << " (" << extra2 << "% chance)"; + break; + case MONST_SUMMON_SPECIES: + sout << "Summons "; + switch(extra1){ + case RACE_HUMAN: + sout << "Humans"; + break; + case RACE_NEPHIL: + sout << "Nephilim"; + break; + case RACE_SLITH: + sout << "Slithzerikai"; + break; + case RACE_VAHNATAI: + sout << "Vahnatai"; + break; + case RACE_REPTILE: + sout << "reptiles"; + break; + case RACE_BEAST: + sout << "beasts"; + break; + case RACE_HUMANOID: + sout << "humanoids"; + break; + case RACE_DEMON: + sout << "demons"; + break; + case RACE_UNDEAD: + sout << "undead"; + break; + case RACE_GIANT: + sout << "giants"; + break; + case RACE_SLIME: + sout << "slimes"; + break; + case RACE_STONE: + sout << "golems"; + break; + case RACE_BUG: + sout << "bugs"; + break; + case RACE_DRAGON: + sout << "Dragons"; + break; + case RACE_MAGICAL: + sout << "magical creatures"; + break; + case RACE_PLANT: + sout << "plants"; + break; + case RACE_BIRD: + sout << "birds"; + break; + default: // Important, Mage, Priest, or invalid + sout << "*ERROR INVALID RACE*"; + } + sout << " (" << extra2 << "% chance)"; + break; + case MONST_SUMMON_RANDOM: + sout << "Summons aid" << " (" << extra2 << "% chance)"; + break; + case MONST_MASS_SUMMON: + sout << "Summons aid" << " (" << extra2 << "% chance)"; + break; + case MONST_SPLITS: + sout << "Splits when hit" << " (" << extra2 << "% chance)"; + break; + case MONST_FIELD_MISSILE: + // TODO: Fill these in + sout << "MONST_FIELD_MISSILE"; + break; + case MONST_MARTYRS_SHIELD: + sout << "Permanent Martyr's shield"; + break; + case MONST_ABSORB_SPELLS: + sout << "Absorbs spells"; + break; + case MONST_INVULNERABLE: + sout << "Invulnerable"; + break; + case MONST_RADIATE: + sout << "Radiates "; + switch(extra1){ // TODO: Fill these in + } + sout << " (" << extra2 << "% chance)"; + break; + case MONST_CALL_LOCAL_SPECIAL: + case MONST_CALL_GLOBAL_SPECIAL: + sout << "Unusual ability"; + break; + } + return "*ERROR INVALID ABILITY*"; +} + +std::string cMonster::getAbil1Name() { + return (std::string) abil1; +} + +std::string cMonster::getAbil2Name() { + return (std::string) abil2; +} + +bool cMonster::hasAbil(eMonstAbil what, unsigned char* x1, unsigned char* x2){ + if(abil1.abil == what){ + if(x1 != NULL) *x1 = abil1.extra1; + if(x2 != NULL) *x2 = abil1.extra2; + return true; + }else if(abil2.abil == what){ + if(x1 != NULL) *x1 = abil2.extra1; + if(x2 != NULL) *x2 = abil2.extra2; + return true; + } + return false; +} diff --git a/osx/classes/monster.h b/osx/classes/monster.h index 55d92b3d..07f2e066 100644 --- a/osx/classes/monster.h +++ b/osx/classes/monster.h @@ -11,6 +11,7 @@ #include #include +#include "soundtool.h" namespace legacy { struct monster_record_type; @@ -18,71 +19,6 @@ namespace legacy { struct creature_start_type; }; -typedef unsigned short m_num_t; - -/* adven[i].race */ //complete -enum eRace { - RACE_UNKNOWN = -1, // for parameters to some functions; not valid in the class - RACE_HUMAN = 0, - RACE_NEPHIL = 1, - RACE_SLITH = 2, - RACE_VAHNATAI = 3, - RACE_REPTILE = 4, - RACE_BEAST = 5, - RACE_IMPORTANT = 6, - RACE_MAGE = 7, - RACE_PRIEST = 8, - RACE_HUMANOID = 9, - RACE_DEMON = 10, - RACE_UNDEAD = 11, - RACE_GIANT = 12, - RACE_SLIME = 13, - RACE_STONE = 14, - RACE_BUG = 15, - RACE_DRAGON = 16, - RACE_MAGICAL = 17, - RACE_PLANT = 18, - RACE_BIRD = 19, -}; // TODO: Expand and merge with eMonsterType - -/* adven[i].status*/ //complete - assign a positive value for a help pc effect, a negative for harm pc -enum eStatus { - STATUS_POISONED_WEAPON = 0, - STATUS_BLESS_CURSE = 1, - STATUS_POISON = 2, - STATUS_HASTE_SLOW = 3, - STATUS_INVULNERABLE = 4, - STATUS_MAGIC_RESISTANCE = 5, - STATUS_WEBS = 6, - STATUS_DISEASE = 7, - STATUS_INVISIBLE = 8, //sanctuary - STATUS_DUMB = 9, - STATUS_MARTYRS_SHIELD = 10, - STATUS_ASLEEP = 11, - STATUS_PARALYZED = 12, - STATUS_ACID = 13, -}; - -/* Monster Type */ -enum eMonsterType { - MONSTER_TYPE_UNKNOWN = -1, // for parameters to some functions; not valid in the class - MONSTER_TYPE_HUMAN = 0, - MONSTER_TYPE_REPTILE = 1, - MONSTER_TYPE_BEAST = 2, - MONSTER_TYPE_IMPORTANT = 3, - MONSTER_TYPE_MAGE = 4, - MONSTER_TYPE_PRIEST = 5, - MONSTER_TYPE_HUMANOID = 6, - MONSTER_TYPE_DEMON = 7, - MONSTER_TYPE_UNDEAD = 8, - MONSTER_TYPE_GIANT = 9, - MONSTER_TYPE_SLIME = 10, - MONSTER_TYPE_STONE = 11, - MONSTER_TYPE_BUG = 12, - MONSTER_TYPE_DRAGON = 13, - MONSTER_TYPE_MAGICAL = 14, -}; - /* Attack Types */ #define MONSTER_ATTACK_SWINGS 0 @@ -96,16 +32,15 @@ enum eMonsterType { #define MONSTER_ATTACK_HARMS 8 #define MONSTER_ATTACK_STABS 9 -/* Special Ability a.k.a spec_skill */ #define MONSTER_NO_SPECIAL_ABILITY 0 -#define MONSTER_THROWS_DARTS 1 -#define MONSTER_SHOOTS_ARROWS 2 -#define MONSTER_THROWS_SPEARS 3 +#define MONSTER_THROWS_DARTS 1 //1-6 +#define MONSTER_SHOOTS_ARROWS 2 //2-12 +#define MONSTER_THROWS_SPEARS 3 //3-18 #define MONSTER_THROWS_ROCKS1 4 //4-24 damages #define MONSTER_THROWS_ROCKS2 5 //5-30 damages #define MONSTER_THROWS_ROCKS3 6 //6-36 damages -#define MONSTER_THROWS_RAZORDISKS 7 +#define MONSTER_THROWS_RAZORDISKS 7 //4-24 #define MONSTER_PETRIFICATION_RAY 8 #define MONSTER_SP_DRAIN_RAY 9 //spell points drain ray #define MONSTER_HEAT_RAY 10 @@ -118,7 +53,7 @@ enum eMonsterType { #define MONSTER_ICY_AND_DRAINING_TOUCH 17 #define MONSTER_SLOWING_TOUCH 18 #define MONSTER_SHOOTS_WEB 19 -#define MONSTER_GOOD_ARCHER 20 +#define MONSTER_GOOD_ARCHER 20 //7-42 #define MONSTER_STEALS_FOOD 21 #define MONSTER_PERMANENT_MARTYRS_SHIELD 22 #define MONSTER_PARALYSIS_RAY 23 @@ -132,7 +67,7 @@ enum eMonsterType { #define MONSTER_ACID_TOUCH 31 #define MONSTER_BREATHES_SLEEP_CLOUDS 32 #define MONSTER_ACID_SPIT 33 -#define MONSTER_SHOOTS_SPINES 34 +#define MONSTER_SHOOTS_SPINES 34 //7-42 #define MONSTER_DEATH_TOUCH 35 #define MONSTER_INVULNERABILITY 36 #define MONSTER_GUARD 37 @@ -161,6 +96,11 @@ public: operator int(); cAttack& operator=(int n); }; + struct cAbility{ + eMonstAbil abil; + unsigned char extra1, extra2; + operator std::string(); + }; m_num_t m_num; // TODO: This probably shouldn't be necessary. Consider why it is, and determine if it can be removed unsigned char level; std::string m_name; @@ -180,7 +120,7 @@ public: unsigned char breath; unsigned char breath_type; unsigned char treasure; - unsigned char spec_skill; + unsigned char spec_skill; // TODO: Delete in favour of cAbility unsigned char poison; short morale,m_morale; // TODO: Move to cCreature (since these are calculated in-game based on the level) item_num_t corpse_item; @@ -189,14 +129,22 @@ public: unsigned char direction; // TODO: Move direction to cCreature unsigned char immunities; unsigned char x_width,y_width; - unsigned char radiate_1; - unsigned short radiate_2; // I THINK this is the extra field for the second ability - unsigned char default_attitude,summon_type,default_facial_pic,res1,res2,res3; + unsigned char radiate_1; // TODO: Delete in favour of cAbility + unsigned short radiate_2; // I THINK this is the extra field for the second ability TODO: Delete in favour of cAbility + unsigned char default_attitude; + unsigned char summon_type; + unsigned char default_facial_pic; short picture_num; str_num_t see_str1, see_str2; - snd_num_t see_sound, ambient_sound; // ambient_sound has a + snd_num_t see_sound, ambient_sound; // ambient_sound has a chance of being played every move spec_num_t see_spec; +private: + cAbility abil1, abil2; +public: + std::string getAbil1Name(); + std::string getAbil2Name(); + bool hasAbil(eMonstAbil what, unsigned char* x1 = NULL, unsigned char* x2 = NULL); cMonster& operator = (legacy::monster_record_type& old); void writeTo(std::ostream& file, std::string prefix); }; @@ -232,4 +180,6 @@ std::ostream& operator << (std::ostream& out, eStatus& e); std::istream& operator >> (std::istream& in, eStatus& e); std::ostream& operator << (std::ostream& out, eRace& e); std::istream& operator >> (std::istream& in, eRace& e); +std::ostream& operator << (std::ostream& out, eMonstAbil& e); +std::istream& operator >> (std::istream& in, eMonstAbil& e); #endif \ No newline at end of file diff --git a/osx/classes/party.cpp b/osx/classes/party.cpp index 47ad0e27..1e83461a 100644 --- a/osx/classes/party.cpp +++ b/osx/classes/party.cpp @@ -464,3 +464,22 @@ cPlayer& cParty::operator[](unsigned short n){ if(n >= 6) throw std::out_of_range("Attempt to access a player that doesn't exist."); return adven[n]; } + +void cParty::set_ptr(short p, unsigned short sdfx, unsigned short sdfy){ // This function is not used for setting the reserved pointers + if(p >= -199 && p <= -100){ // must be a mutable pointer + if(sdfx >= 300) throw std::range_error("SDF x-coordinate out of range (0..299)"); + if(sdfy >= 50) throw std::range_error("SDF y-coordinate out of range (0..49)"); + pointers[p] = std::make_pair(sdfx,sdfy); + } + else throw std::range_error("Pointer out of range (-199 to -100)"); +} + +void cParty::force_ptr(short p, unsigned short sdfx, unsigned short sdfy){ + pointers[p] = std::make_pair(sdfx,sdfy); +} + +unsigned char cParty::get_ptr(short p){ + ptrIter iter = pointers.find(p); + if(iter == pointers.end()) return 0; + return stuff_done[iter->second.first][iter->second.second]; +} diff --git a/osx/classes/party.h b/osx/classes/party.h index e2949c53..ddf7c6cf 100644 --- a/osx/classes/party.h +++ b/osx/classes/party.h @@ -98,7 +98,12 @@ public: cMonster summons; // an array of monsters which can be summoned by the parties items yet don't originate from this scenario bool graphicUsed[250]; // whether each custom graphics slot on the party's sheet is actually used; needed to place new custom graphics on the sheet. unsigned short scen_won, scen_played; // numbers of scenarios won and played respectively by this party - std::map > campaign_flags; + std::map > campaign_flags; + std::map > pointers; + + void set_ptr(short p, unsigned short sdfx, unsigned short sdfy); + void force_ptr(short p, unsigned short sdfx, unsigned short sdfy); + unsigned char get_ptr(short p); cParty& operator = (legacy::party_record_type& old); void append(legacy::big_tr_type& old); @@ -121,7 +126,8 @@ public: typedef std::vector::iterator journalIter; typedef std::vector::iterator talkIter; typedef std::vector::iterator timerIter; - typedef std::map >::iterator campIter; + typedef std::map >::iterator campIter; + typedef std::map >::iterator ptrIter; }; #endif \ No newline at end of file diff --git a/osx/classes/pc.h b/osx/classes/pc.h index 59a9ce4a..a2096923 100644 --- a/osx/classes/pc.h +++ b/osx/classes/pc.h @@ -14,49 +14,6 @@ namespace legacy { struct pc_record_type; }; -/* adven[i].skills */ //complete -enum eSkill { - SKILL_STRENGTH = 0, - SKILL_DEXTERITY = 1, - SKILL_INTELLIGENCE = 2, - SKILL_EDGED_WEAPONS = 3, - SKILL_BASHING_WEAPONS = 4, - SKILL_POLE_WEAPONS = 5, - SKILL_THROWN_MISSILES = 6, - SKILL_ARCHERY = 7, - SKILL_DEFENSE = 8, - SKILL_MAGE_SPELLS = 9, - SKILL_PRIEST_SPELLS = 10, - SKILL_MAGE_LORE = 11, - SKILL_ALCHEMY = 12, - SKILL_ITEM_LORE = 13, - SKILL_DISARM_TRAPS = 14, - SKILL_LOCKPICKING = 15, - SKILL_ASSASSINATION = 16, - SKILL_POISON = 17, - SKILL_LUCK = 18, -}; - -/* adven[i].traits */ //complete -enum eTrait { - TRAIT_TOUGHNESS = 0, - TRAIT_MAGICALLY_APT = 1, - TRAIT_AMBIDEXTROUS = 2, - TRAIT_NIMBLE = 3, - TRAIT_CAVE_LORE = 4, - TRAIT_WOODSMAN = 5, - TRAIT_GOOD_CONST = 6, - TRAIT_HIGHLY_ALERT = 7, - TRAIT_STRENGTH = 8, - TRAIT_RECUPERATION = 9, - TRAIT_SLUGGISH = 10, - TRAIT_MAGICALLY_INEPT = 11, - TRAIT_FRAIL = 12, - TRAIT_CHRONIC_DISEASE = 13, - TRAIT_BAD_BACK = 14, - TRAIT_PACIFIST = 15, -}; - enum eMainStatus { MAIN_STATUS_ABSENT = 0, // absent, empty slot MAIN_STATUS_ALIVE = 1, diff --git a/osx/classes/simpletypes.h b/osx/classes/simpletypes.h new file mode 100644 index 00000000..de478451 --- /dev/null +++ b/osx/classes/simpletypes.h @@ -0,0 +1,486 @@ +/* + * simpletypes.h + * BoE + * + * Created by Celtic Minstrel on 01/06/09. + * + */ + +typedef unsigned short m_num_t; +typedef unsigned short ter_num_t; +typedef signed short spec_num_t; +typedef signed short item_num_t; +typedef unsigned short str_num_t; + +/* adven[i].race */ //complete +enum eRace { + RACE_UNKNOWN = -1, // for parameters to some functions; not valid in the class + RACE_HUMAN = 0, + RACE_NEPHIL = 1, + RACE_SLITH = 2, + RACE_VAHNATAI = 3, + RACE_REPTILE = 4, + RACE_BEAST = 5, + RACE_IMPORTANT = 6, + RACE_MAGE = 7, + RACE_PRIEST = 8, + RACE_HUMANOID = 9, + RACE_DEMON = 10, + RACE_UNDEAD = 11, + RACE_GIANT = 12, + RACE_SLIME = 13, + RACE_STONE = 14, + RACE_BUG = 15, + RACE_DRAGON = 16, + RACE_MAGICAL = 17, + RACE_PLANT = 18, + RACE_BIRD = 19, +}; // TODO: Expand and merge with eMonsterType + +/* adven[i].status*/ //complete - assign a positive value for a help pc effect, a negative for harm pc +enum eStatus { + STATUS_POISONED_WEAPON = 0, + STATUS_BLESS_CURSE = 1, + STATUS_POISON = 2, + STATUS_HASTE_SLOW = 3, + STATUS_INVULNERABLE = 4, + STATUS_MAGIC_RESISTANCE = 5, + STATUS_WEBS = 6, + STATUS_DISEASE = 7, + STATUS_INVISIBLE = 8, //sanctuary + STATUS_DUMB = 9, + STATUS_MARTYRS_SHIELD = 10, + STATUS_ASLEEP = 11, + STATUS_PARALYZED = 12, + STATUS_ACID = 13, +}; + +/* Monster Type */ +enum eMonsterType { + MONSTER_TYPE_UNKNOWN = -1, // for parameters to some functions; not valid in the class + MONSTER_TYPE_HUMAN = 0, + MONSTER_TYPE_REPTILE = 1, + MONSTER_TYPE_BEAST = 2, + MONSTER_TYPE_IMPORTANT = 3, + MONSTER_TYPE_MAGE = 4, + MONSTER_TYPE_PRIEST = 5, + MONSTER_TYPE_HUMANOID = 6, + MONSTER_TYPE_DEMON = 7, + MONSTER_TYPE_UNDEAD = 8, + MONSTER_TYPE_GIANT = 9, + MONSTER_TYPE_SLIME = 10, + MONSTER_TYPE_STONE = 11, + MONSTER_TYPE_BUG = 12, + MONSTER_TYPE_DRAGON = 13, + MONSTER_TYPE_MAGICAL = 14, +}; + + +/* Special Ability a.k.a spec_skill */ + +enum eMonstAbil { + MONST_NO_ABIL = 0, + // Missile abilities (extra1 = number of sided dice; extra2 = number of sides) + MONST_THROWS_DARTS = 10, + MONST_SHOOTS_ARROWS, + MONST_THROWS_SPEARS, + MONST_THROWS_ROCKS, + MONST_THROWS_RAZORDISKS, + MONST_GOOD_ARCHER, + MONST_SHOOTS_SPINES, + MONST_THROWS_KNIVES, + // Ray abilities (extra1 = type of damage / status where applicable) + MONST_DAMAGE_RAY = 20, + MONST_STATUS_RAY, + MONST_PETRIFY_RAY, + MONST_DRAIN_SP_RAY, + MONST_DRAIN_XP_RAY, + MONST_DRAIN_XP_DAMAGE_RAY, + MONST_KILL_RAY, + MONST_STEAL_FOOD_RAY, + MONST_STEAL_GOLD_RAY, + // Touch abilities (extra1 = type of damage / status where applicable) + MONST_DAMAGE_TOUCH = 30, + MONST_STATUS_TOUCH, + MONST_PETRIFY_TOUCH, + MONST_DRAIN_SP_TOUCH, + MONST_DRAIN_XP_TOUCH, + MONST_DRAIN_XP_DAMAGE_TOUCH, + MONST_KILL_TOUCH, + MONST_STEAL_FOOD_TOUCH, + MONST_STEAL_GOLD_TOUCH, + // Summon abilities (extra1 = which monster / type / species; extra2 = % chance) + MONST_SUMMON_ONE = 40, + MONST_SUMMON_TYPE, + MONST_SUMMON_SPECIES, + MONST_SUMMON_RANDOM, + MONST_MASS_SUMMON, + // Misc abilities (extra1 = field / special #; extra2 = % chance for radiate only) + MONST_SPLITS = 50, + MONST_FIELD_MISSILE, + MONST_MARTYRS_SHIELD, + MONST_ABSORB_SPELLS, + MONST_INVULNERABLE, + MONST_RADIATE, + MONST_CALL_LOCAL_SPECIAL, + MONST_CALL_GLOBAL_SPECIAL, +}; + + +/* Terrains Specials Properties : scenario.ter_types[i].special */ //complete + +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 +}; + + +/* items[i].type a.k.a type of weapon */ +enum eWeapType { + ITEM_NOT_MELEE = 0, + ITEM_EDGED = 1, + ITEM_BASHING = 2, + ITEM_POLE = 3, +}; + +/* items[i].variety a.k.a item type (in editor) */ +enum eItemType { + ITEM_TYPE_NO_ITEM = 0, + ITEM_TYPE_ONE_HANDED = 1, + ITEM_TYPE_TWO_HANDED = 2, + ITEM_TYPE_GOLD = 3, + ITEM_TYPE_BOW = 4, + ITEM_TYPE_ARROW = 5, + ITEM_TYPE_THROWN_MISSILE = 6, + ITEM_TYPE_POTION = 7, // potion/magic item + ITEM_TYPE_SCROLL = 8, // scroll/magic item + ITEM_TYPE_WAND = 9, + ITEM_TYPE_TOOL = 10, + ITEM_TYPE_FOOD = 11, + ITEM_TYPE_SHIELD = 12, + ITEM_TYPE_ARMOR = 13, + ITEM_TYPE_HELM = 14, + ITEM_TYPE_GLOVES = 15, + ITEM_TYPE_SHIELD_2 = 16, + // don't know why a second type of shield is used ; it is actually checked + // in the armor code (item >= 12 and <= 17) + // and you can't equip another (12) shield while wearing it ... I didn't + // find a single item with this property in the bladbase.exs ... + ITEM_TYPE_BOOTS = 17, + ITEM_TYPE_RING = 18, + ITEM_TYPE_NECKLACE = 19, + ITEM_TYPE_WEAPON_POISON = 20, + ITEM_TYPE_NON_USE_OBJECT = 21, + ITEM_TYPE_PANTS = 22, + ITEM_TYPE_CROSSBOW = 23, + ITEM_TYPE_BOLTS = 24, + ITEM_TYPE_MISSILE_NO_AMMO = 25, //e.g slings + ITEM_TYPE_UNUSED1 = 26, // these are here solely because they are options in the editor + ITEM_TYPE_UNUSED2 = 27, +}; + +/* items[i].ability */ +enum eItemAbil { + // Weapon abilities + ITEM_NO_ABILITY = 0, + ITEM_FLAMING_WEAPON = 1, + ITEM_DEMON_SLAYER = 2, + ITEM_UNDEAD_SLAYER = 3, + ITEM_LIZARD_SLAYER = 4, + ITEM_GIANT_SLAYER = 5, + ITEM_MAGE_SLAYER = 6, + ITEM_PRIEST_SLAYER = 7, + ITEM_BUG_SLAYER = 8, + ITEM_ACIDIC_WEAPON = 9, + ITEM_SOULSUCKER = 10, + ITEM_DRAIN_MISSILES = 11, + ITEM_WEAK_WEAPON = 12, + ITEM_CAUSES_FEAR = 13, + ITEM_POISONED_WEAPON = 14, + // General abilities + ITEM_PROTECTION = 30, + ITEM_FULL_PROTECTION = 31, + ITEM_FIRE_PROTECTION = 32, + ITEM_COLD_PROTECTION = 33, + ITEM_POISON_PROTECTION = 34, + ITEM_MAGIC_PROTECTION = 35, + ITEM_ACID_PROTECTION = 36, + ITEM_SKILL = 37, + ITEM_STRENGTH = 38, + ITEM_DEXTERITY = 39, + ITEM_INTELLIGENCE = 40, + ITEM_ACCURACY = 41, + ITEM_THIEVING = 42, + ITEM_GIANT_STRENGTH = 43, + ITEM_LIGHTER_OBJECT = 44, + ITEM_HEAVIER_OBJECT = 45, + ITEM_OCCASIONAL_BLESS = 46, + ITEM_OCCASIONAL_HASTE = 47, + ITEM_LIFE_SAVING = 48, + ITEM_PROTECT_FROM_PETRIFY = 49, + ITEM_REGENERATE = 50, + ITEM_POISON_AUGMENT = 51, + ITEM_DISEASE_PARTY = 52, + ITEM_WILL = 53, + ITEM_FREE_ACTION = 54, + ITEM_SPEED = 55, + ITEM_SLOW_WEARER = 56, + ITEM_PROTECT_FROM_UNDEAD = 57, + ITEM_PROTECT_FROM_DEMONS = 58, + ITEM_PROTECT_FROM_HUMANOIDS = 59, + ITEM_PROTECT_FROM_REPTILES = 60, + ITEM_PROTECT_FROM_GIANTS = 61, + ITEM_PROTECT_FROM_DISEASE = 62, + // Nonspell Usable + ITEM_POISON_WEAPON = 70, //put poison on weapon + ITEM_BLESS_CURSE = 71, + ITEM_AFFECT_POISON = 72, + ITEM_HASTE_SLOW = 73, + ITEM_AFFECT_INVULN = 74, + ITEM_AFFECT_MAGIC_RES = 75, + ITEM_AFFECT_WEB = 76, + ITEM_AFFECT_DISEASE = 77, + ITEM_AFFECT_SANCTUARY = 78, + ITEM_AFFECT_DUMBFOUND = 79, + ITEM_AFFECT_MARTYRS_SHIELD = 80, + ITEM_AFFECT_SLEEP = 81, + ITEM_AFFECT_PARALYSIS = 82, + ITEM_AFFECT_ACID = 83, + ITEM_BLISS = 84, + ITEM_AFFECT_EXPERIENCE = 85, + ITEM_AFFECT_SKILL_POINTS = 86, + ITEM_AFFECT_HEALTH = 87, + ITEM_AFFECT_SPELL_POINTS = 88, + ITEM_DOOM = 89, + ITEM_LIGHT = 90, + ITEM_STEALTH = 91, + ITEM_FIREWALK = 92, + ITEM_FLYING = 93, + ITEM_MAJOR_HEALING = 94, + // Spell Usable + ITEM_SPELL_FLAME = 110, + ITEM_SPELL_FIREBALL = 111, + ITEM_SPELL_FIRESTORM = 112, + ITEM_SPELL_KILL = 113, + ITEM_SPELL_ICE_BOLT = 114, + ITEM_SPELL_SLOW = 115, + ITEM_SPELL_SHOCKWAVE = 116, + ITEM_SPELL_DISPEL_UNDEAD = 117, + ITEM_SPELL_DISPEL_SPIRIT = 118, + ITEM_SPELL_SUMMONING = 119, + ITEM_SPELL_MASS_SUMMONING = 120, + ITEM_SPELL_ACID_SPRAY = 121, + ITEM_SPELL_STINKING_CLOUD = 122, + ITEM_SPELL_SLEEP_FIELD = 123, + ITEM_SPELL_VENOM = 124, + ITEM_SPELL_SHOCKSTORM = 125, + ITEM_SPELL_PARALYSIS = 126, + ITEM_SPELL_WEB_SPELL = 127, + ITEM_SPELL_STRENGTHEN_TARGET = 128, //wand of carrunos effect + ITEM_SPELL_QUICKFIRE = 129, + ITEM_SPELL_MASS_CHARM = 130, + ITEM_SPELL_MAGIC_MAP = 131, + ITEM_SPELL_DISPEL_BARRIER = 132, + ITEM_SPELL_MAKE_ICE_WALL = 133, + ITEM_SPELL_CHARM_SPELL = 134, + ITEM_SPELL_ANTIMAGIC_CLOUD = 135, + // Reagents + ITEM_HOLLY = 150, // Holly/Toadstool + ITEM_COMFREY_ROOT = 151, + ITEM_GLOWING_NETTLE = 152, + ITEM_WORMGRASS = 153, // Crypt Shroom/Wormgr. + ITEM_ASPTONGUE_MOLD = 154, + ITEM_EMBER_FLOWERS = 155, + ITEM_GRAYMOLD = 156, + ITEM_MANDRAKE = 157, + ITEM_SAPPHIRE = 158, + ITEM_SMOKY_CRYSTAL = 159, + ITEM_RESSURECTION_BALM = 160, + ITEM_LOCKPICKS = 161, + // Missile Abilities + ITEM_MISSILE_RETURNING = 170, + ITEM_MISSILE_LIGHTNING = 171, + ITEM_MISSILE_EXPLODING = 172, + ITEM_MISSILE_ACID = 173, + ITEM_MISSILE_SLAY_UNDEAD = 174, + ITEM_MISSILE_SLAY_DEMON = 175, + ITEM_MISSILE_HEAL_TARGET = 176, +}; + + +/* adven[i].skills */ //complete +enum eSkill { + SKILL_STRENGTH = 0, + SKILL_DEXTERITY = 1, + SKILL_INTELLIGENCE = 2, + SKILL_EDGED_WEAPONS = 3, + SKILL_BASHING_WEAPONS = 4, + SKILL_POLE_WEAPONS = 5, + SKILL_THROWN_MISSILES = 6, + SKILL_ARCHERY = 7, + SKILL_DEFENSE = 8, + SKILL_MAGE_SPELLS = 9, + SKILL_PRIEST_SPELLS = 10, + SKILL_MAGE_LORE = 11, + SKILL_ALCHEMY = 12, + SKILL_ITEM_LORE = 13, + SKILL_DISARM_TRAPS = 14, + SKILL_LOCKPICKING = 15, + SKILL_ASSASSINATION = 16, + SKILL_POISON = 17, + SKILL_LUCK = 18, +}; + +/* adven[i].traits */ //complete +enum eTrait { + TRAIT_TOUGHNESS = 0, + TRAIT_MAGICALLY_APT = 1, + TRAIT_AMBIDEXTROUS = 2, + TRAIT_NIMBLE = 3, + TRAIT_CAVE_LORE = 4, + TRAIT_WOODSMAN = 5, + TRAIT_GOOD_CONST = 6, + TRAIT_HIGHLY_ALERT = 7, + TRAIT_STRENGTH = 8, + TRAIT_RECUPERATION = 9, + TRAIT_SLUGGISH = 10, + TRAIT_MAGICALLY_INEPT = 11, + TRAIT_FRAIL = 12, + TRAIT_CHRONIC_DISEASE = 13, + TRAIT_BAD_BACK = 14, + TRAIT_PACIFIST = 15, +}; + + +/* damage type*/ +/* used as parameter to some functions */ +enum eDamageType { + DAMAGE_WEAPON = 0, + DAMAGE_FIRE = 1, + DAMAGE_POISON = 2, + DAMAGE_MAGIC = 3, + DAMAGE_UNBLOCKABLE = 4, //from the source files - the display is the same as the magic one (damage_monst in SPECIALS.cpp) + DAMAGE_COLD = 5, + DAMAGE_UNDEAD = 6, //from the source files - the display is the same as the weapon one + DAMAGE_DEMON = 7, //from the source files - the display is the same as the weapon one + // 8 and 9 aren't defined : doesn't print any damage. According to the source files the 9 is DAMAGE_MARKED though. Wrong ? + DAMAGE_MARKED = 10, // usage: DAMAGE_MARKED + damage_type + DAMAGE_WEAPON_MARKED = 10, + DAMAGE_FIRE_MARKED = 11, + DAMAGE_POISON_MARKED = 12, + DAMAGE_MAGIC_MARKED = 13, + DAMAGE_UNBLOCKABLE_MARKED = 14, + DAMAGE_COLD_MARKED = 15, + DAMAGE_UNDEAD_MARKED = 16, + DAMAGE_DEMON_MARKED = 17, + DAMAGE_NO_PRINT = 30, // usage: DAMAGE_NO_PRINT + damage_type + DAMAGE_WEAPON_NO_PRINT = 30, + DAMAGE_FIRE_NO_PRINT = 31, + DAMAGE_POISON_NO_PRINT = 32, + DAMAGE_MAGIC_NO_PRINT = 33, + DAMAGE_UNBLOCKABLE_NO_PRINT = 34, + DAMAGE_COLD_NO_PRINT = 35, + DAMAGE_UNDEAD_NO_PRINT = 36, + DAMAGE_DEMON_NO_PRINT = 37, + // What about both NO_PRINT and MARKED? +}; + +inline void operator -= (eDamageType& cur, eDamageType othr){ + if((othr == DAMAGE_MARKED && cur >= DAMAGE_MARKED && cur < DAMAGE_NO_PRINT) || + (othr == DAMAGE_NO_PRINT && cur >= DAMAGE_NO_PRINT)) + cur = (eDamageType) ((int)cur - (int)othr); +} + +inline void operator += (eDamageType& cur, eDamageType othr){ + if((othr == DAMAGE_MARKED || othr == DAMAGE_NO_PRINT) && cur < DAMAGE_MARKED) + cur = (eDamageType) ((int)cur + (int)othr); +} + +//class sbyte { +// signed char c; +//public: +// operator int() {return c;} +// sbyte(signed char k) : c(k) {} +//} diff --git a/osx/classes/special.h b/osx/classes/special.h index 58dd83c2..cf8e4043 100644 --- a/osx/classes/special.h +++ b/osx/classes/special.h @@ -13,8 +13,6 @@ namespace legacy { struct special_node_type; }; -typedef signed short spec_num_t; - class cSpecial { public: short type; diff --git a/osx/classes/terrain.h b/osx/classes/terrain.h index cdd0adee..d1b2861b 100644 --- a/osx/classes/terrain.h +++ b/osx/classes/terrain.h @@ -14,97 +14,6 @@ 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;}; diff --git a/osx/tools/soundtool.h b/osx/tools/soundtool.h index 46954868..b38bc14f 100644 --- a/osx/tools/soundtool.h +++ b/osx/tools/soundtool.h @@ -6,6 +6,8 @@ * */ +#ifndef _SOUNDTOOL_H +#define _SOUNDTOOL_H #define NUM_SOUNDS 99 typedef unsigned short snd_num_t; @@ -14,3 +16,5 @@ void play_sound(short which, short how_many_times = 1); void one_sound(short which); void clear_sound_memory(); void flip_sound(); + +#endif