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)
This commit is contained in:
@@ -66,6 +66,27 @@ cSpecial& cSpecial::operator = (legacy::special_node_type& old){
|
||||
ex1a = (int) eSpecCtx::TARGET;
|
||||
ex1b = 108; // Spell ID for ritual of sanctification, as seen in cast_town_spell()
|
||||
break;
|
||||
case 99: case 100: // Add mage/priest spell TODO: Merge these by adding 100 if it's a priest spell
|
||||
ex1a += 30;
|
||||
ex1b = 1; // Meaning give spell, not take
|
||||
break;
|
||||
case 148: case 149: // if barrels or crates
|
||||
type = eSpecType::IF_OBJECTS;
|
||||
ex1a = old.type - 148;
|
||||
break;
|
||||
case 151: case 152: // if has cave lore or woodsman
|
||||
type = eSpecType::IF_TRAIT;
|
||||
ex1a = old.type - 147;
|
||||
break;
|
||||
case 153: // if enough mage lore
|
||||
type = eSpecType::IF_STATISTIC;
|
||||
ex2a = 11;
|
||||
ex2b = 0;
|
||||
break;
|
||||
case 229: // Outdoor store - fix spell IDs
|
||||
if(ex1b == 1 || ex1b == 2)
|
||||
ex1a += 30;
|
||||
break;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
@@ -208,12 +229,11 @@ const std::map<eSpecType, node_properties_t> allNodeProps = {
|
||||
{eSpecType::IF_HAVE_ITEM_CLASS_AND_TAKE, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_EQUIP_ITEM_CLASS_AND_TAKE, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_DAY_REACHED, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_BARRELS, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_CRATES, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_OBJECTS, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_EVENT_OCCURRED, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_HAS_CAVE_LORE, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_HAS_WOODSMAN, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_ENOUGH_MAGE_LORE, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_SPECIES, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_TRAIT, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_STATISTIC, {ex1b_ch = true,jmp_lbl = 3}},
|
||||
{eSpecType::IF_TEXT_RESPONSE, {ex1b_ch = true,ex2b_ch = true,pic_lbl = 5,jmp_lbl = 3}},
|
||||
{eSpecType::IF_SDF_EQ, {ex1b_ch = true,sdf_lbl = 1,jmp_lbl = 3}},
|
||||
{eSpecType::IF_CONTEXT, {}},
|
||||
|
Reference in New Issue
Block a user