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:
2014-12-08 00:58:39 -05:00
parent 0d7ad2c718
commit 5249c6eef7
29 changed files with 796 additions and 193 deletions

View File

@@ -1153,50 +1153,71 @@ void poison_monst(cCreature *which_m,short how_much)
return;
}
which_m->status[eStatus::POISON] = min(8, which_m->status[eStatus::POISON] + how_much);
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 4);
if (how_much >= 0)
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 4);
else
monst_spell_note(which_m->number,34);
}
void acid_monst(cCreature *which_m,short how_much)
{
magic_adjust(which_m,&how_much);
which_m->status[eStatus::ACID] = minmax(-8,8, which_m->status[eStatus::ACID] + how_much);
monst_spell_note(which_m->number,31);
if(how_much >= 0)
monst_spell_note(which_m->number,31);
else
monst_spell_note(which_m->number,48);
}
void slow_monst(cCreature *which_m,short how_much)
{
magic_adjust(which_m,&how_much);
which_m->status[eStatus::HASTE_SLOW] = minmax(-8,8, which_m->status[eStatus::HASTE_SLOW] - how_much);
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 2);
if (how_much >= 0)
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 2);
else
monst_spell_note(which_m->number,35);
}
void curse_monst(cCreature *which_m,short how_much)
{
magic_adjust(which_m,&how_much);
which_m->status[eStatus::BLESS_CURSE] = minmax(-8,8, which_m->status[eStatus::BLESS_CURSE] - how_much);
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 5);
if (how_much >= 0)
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 5);
else
monst_spell_note(which_m->number,36);
}
void web_monst(cCreature *which_m,short how_much)
{
magic_adjust(which_m,&how_much);
which_m->status[eStatus::WEBS] = minmax(-8,8, which_m->status[eStatus::WEBS] + how_much);
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 19);
if (how_much >= 0)
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 19);
else
monst_spell_note(which_m->number,37);
}
void scare_monst(cCreature *which_m,short how_much)
{
magic_adjust(which_m,&how_much);
which_m->morale = which_m->morale - how_much;
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 1);
// TODO: I don't think there's currently any way to increase monster morale at the moment - add one!
if(how_much >= 0)
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 1);
else
monst_spell_note(which_m->number,47);
}
void disease_monst(cCreature *which_m,short how_much)
{
magic_adjust(which_m,&how_much);
which_m->status[eStatus::DISEASE] = minmax(-8,8, which_m->status[eStatus::DISEASE] + how_much);
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 25);
if (how_much >= 0)
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 25);
else
monst_spell_note(which_m->number,38);
}
@@ -1204,7 +1225,10 @@ void dumbfound_monst(cCreature *which_m,short how_much)
{
magic_adjust(which_m,&how_much);
which_m->status[eStatus::DUMB] = minmax(-8,8, which_m->status[eStatus::DUMB] + how_much);
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 22);
if (how_much >= 0)
monst_spell_note(which_m->number,(how_much == 0) ? 10 : 22);
else
monst_spell_note(which_m->number,39);
}
@@ -1242,10 +1266,12 @@ void charm_monst(cCreature *which_m,short penalty,eStatus which_status,short amo
}
else {
which_m->status[which_status] = amount;
if (which_status == eStatus::ASLEEP)
if (which_status == eStatus::ASLEEP && (amount >= 0))
monst_spell_note(which_m->number,28);
if (which_status == eStatus::PARALYZED)
if (which_status == eStatus::PARALYZED && (amount >= 0))
monst_spell_note(which_m->number,30);
if (amount < 0)
monst_spell_note(which_m->number,40);
}
//one_sound(53);
}