Various special node fixes/tweaks

- Fix secret passage nodes (CANT_ENTER with ex1a = 0, ex2a = 1) not working
- Set many flags now sets the entire row of 50 flags
- Division node now accepts either SDF to be null
- New mode for append item to buffer - adds the item's "interesting string" rather than its name
- Affect mage/priest spell inverted the meaning of ex1b relative to other affect nodes; this has been fixed
- Fix affect party status being confused about which fields mean what (the implementation had one idea, and the porting of old scenarios had a different idea, and the scenario editor had yet a different idea). In addition, it now allows removing the statuses.
- Fix some typos in special node information for the editor
This commit is contained in:
2015-01-29 21:16:44 -05:00
parent 28a630d9e7
commit 7a59776189
8 changed files with 67 additions and 48 deletions

View File

@@ -12,6 +12,8 @@
#include "mathutil.hpp"
void iLiving::apply_status(eStatus which, int how_much) {
if(!is_alive()) return;
static const std::set<eStatus> allow_negative = {
// The obvious ones:
eStatus::BLESS_CURSE, eStatus::HASTE_SLOW,
@@ -22,12 +24,17 @@ void iLiving::apply_status(eStatus which, int how_much) {
eStatus::MAGIC_RESISTANCE, eStatus::DUMB,
};
// TODO: Martyr's Shield range seems to be 0..10; Paralyzed seems to range something like 0..1000
int lo = 0, hi = 8;
if(!is_alive()) return;
status[which] = minmax(-8,8,status[which] + how_much);
if(!allow_negative.count(which))
status[which] = max(status[which],0);
if(which == eStatus::MARTYRS_SHIELD)
hi = 10;
else if(which == eStatus::PARALYZED)
hi = 5000;
if(allow_negative.count(which))
lo = -hi;
status[which] = minmax(lo,hi,status[which] + how_much);
}
void iLiving::clear_bad_status() {

View File

@@ -104,7 +104,7 @@ void cSpecial::append(legacy::special_node_type& old){
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
ex1b = 0; // Meaning give spell, not take
break;
case 148: case 149: // if barrels or crates
type = eSpecType::IF_FIELDS;
@@ -201,15 +201,18 @@ void cSpecial::append(legacy::special_node_type& old){
// Party statuses (three nodes collapsed into one)
case 104:
type = eSpecType::AFFECT_STATUS;
ex1c = int(ePartyStatus::STEALTH);
ex1b = 0;
ex2a = int(ePartyStatus::STEALTH);
break;
case 105:
type = eSpecType::AFFECT_STATUS;
ex1c = int(ePartyStatus::FIREWALK);
ex1b = 0;
ex2a = int(ePartyStatus::FIREWALK);
break;
case 106:
type = eSpecType::AFFECT_STATUS;
ex1c = int(ePartyStatus::FLIGHT);
ex1b = 0;
ex2a = int(ePartyStatus::FLIGHT);
break;
// Place fields (twelve individual node types were collapsed into one)
case 200:
@@ -422,9 +425,9 @@ static const char*const button_dict[7][11] = {
" 5", // pic
" s", // pictype
" w q AP a ", // ex1a
" E ", // ex1b
" ", // ex1b
" e Q", // ex1c
" K ", // ex2a
" K E ", // ex2a
" D ", // ex2b
" x ", // ex2c
}, { // if-then nodes