Skip to content

Commit

Permalink
WIP on #607
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Feb 20, 2025
1 parent 3dea009 commit 6bbd7d3
Show file tree
Hide file tree
Showing 6 changed files with 437 additions and 0 deletions.
12 changes: 12 additions & 0 deletions proj/xc12/BoE.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@
919B13A21BBCDF14009905A4 /* monst_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A11BBCDE18009905A4 /* monst_legacy.cpp */; };
919B13A41BBD8854009905A4 /* item_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A31BBD8849009905A4 /* item_legacy.cpp */; };
919B13A61BBDE986009905A4 /* spec_legacy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919B13A51BBDE985009905A4 /* spec_legacy.cpp */; };
919BE86B2D658BC6000C64C6 /* special-general.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919BE86A2D658BBC000C64C6 /* special-general.cpp */; };
919BE8722D66CD1C000C64C6 /* special-oneshot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919BE8712D66CD1C000C64C6 /* special-oneshot.cpp */; };
919BE88D2D66F6E3000C64C6 /* special-affect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 919BE88C2D66F6E2000C64C6 /* special-affect.cpp */; };
919CC2481B3772F300273FDA /* population.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91AC620A0FA2853700EEAE67 /* population.cpp */; };
919CC2491B3772FB00273FDA /* creature.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 914698FE1A747C4500F20F5E /* creature.cpp */; };
919CC24B1B37730300273FDA /* item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91279D3D0F9D1D6A007B0D52 /* item.cpp */; };
Expand Down Expand Up @@ -766,6 +769,9 @@
919B13A51BBDE985009905A4 /* spec_legacy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = spec_legacy.cpp; sourceTree = "<group>"; };
919B13A71BBE297B009905A4 /* scrollpane.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = scrollpane.hpp; sourceTree = "<group>"; };
919B13A81BBE2B54009905A4 /* scrollpane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scrollpane.cpp; sourceTree = "<group>"; };
919BE86A2D658BBC000C64C6 /* special-general.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "special-general.cpp"; sourceTree = "<group>"; };
919BE8712D66CD1C000C64C6 /* special-oneshot.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "special-oneshot.cpp"; sourceTree = "<group>"; };
919BE88C2D66F6E2000C64C6 /* special-affect.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "special-affect.cpp"; sourceTree = "<group>"; wrapsLines = 1; };
919DDBFA19006CC9003E7FED /* libboost_filesystem-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_filesystem-mt.dylib"; path = "/opt/local/libexec/boost/1.76/lib/libboost_filesystem-mt.dylib"; sourceTree = "<absolute>"; };
919DDBFB19006CC9003E7FED /* libboost_system-mt.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = "libboost_system-mt.dylib"; path = "/opt/local/libexec/boost/1.76/lib/libboost_system-mt.dylib"; sourceTree = "<absolute>"; };
919DDC091900750D003E7FED /* freetype.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = freetype.framework; path = /Library/Frameworks/freetype.framework; sourceTree = "<absolute>"; };
Expand Down Expand Up @@ -1248,6 +1254,8 @@
91279CC10F9D19DA007B0D52 /* monster.cpp */,
91E5C79D0F9F60FA00C21460 /* outdoors.cpp */,
91279C580F9D1253007B0D52 /* scenario.cpp */,
919BE86A2D658BBC000C64C6 /* special-general.cpp */,
919BE8712D66CD1C000C64C6 /* special-oneshot.cpp */,
91FDB5791A4E774E00DE5983 /* shop.cpp */,
91279CC60F9D1A02007B0D52 /* special.cpp */,
91E5C7B70F9F619D00C21460 /* talking.cpp */,
Expand All @@ -1271,6 +1279,7 @@
91E5C7970F9F60EC00C21460 /* town.hpp */,
91AC607F0FA26A3B00EEAE67 /* town_import.tpp */,
91279C740F9D15E4007B0D52 /* vehicle.hpp */,
919BE88C2D66F6E2000C64C6 /* special-affect.cpp */,
);
name = scenario;
path = ../../src/scenario;
Expand Down Expand Up @@ -2068,6 +2077,7 @@
files = (
919CC24B1B37730300273FDA /* item.cpp in Sources */,
919CC24D1B37730E00273FDA /* location.cpp in Sources */,
919BE8722D66CD1C000C64C6 /* special-oneshot.cpp in Sources */,
919CC24E1B37731400273FDA /* monster.cpp in Sources */,
919CC24F1B37731800273FDA /* outdoors.cpp in Sources */,
919CC2531B37732C00273FDA /* scenario.cpp in Sources */,
Expand All @@ -2079,6 +2089,7 @@
919CC25A1B37735100273FDA /* terrain.cpp in Sources */,
919CC25C1B37735C00273FDA /* town.cpp in Sources */,
919CC25F1B37736E00273FDA /* vehicle.cpp in Sources */,
919BE88D2D66F6E3000C64C6 /* special-affect.cpp in Sources */,
919CC2601B37737200273FDA /* estreams.cpp in Sources */,
919CC2611B37738100273FDA /* gzstream.cpp in Sources */,
919CC2621B37738A00273FDA /* ticpp.cpp in Sources */,
Expand All @@ -2099,6 +2110,7 @@
415EEEB02D5534A500B47408 /* prefs.cpp in Sources */,
919CC2701B3773EC00273FDA /* scrollbar.cpp in Sources */,
919CC2711B3773F300273FDA /* cursors.mac.mm in Sources */,
919BE86B2D658BC6000C64C6 /* special-general.cpp in Sources */,
919CC2721B3773F800273FDA /* fileio.cpp in Sources */,
919CC2741B37740200273FDA /* fileio_scen.cpp in Sources */,
919CC2751B37740A00273FDA /* render_image.cpp in Sources */,
Expand Down
172 changes: 172 additions & 0 deletions src/scenario/special-affect.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
//
// special-affect.cpp
// Common
//
// Created by Celtic Minstrel on 2025-02-20.
//

#include "special.hpp"

using namespace node_builder_fields;

auto S_SELECT = node_builder_t(eSpecType::SELECT_TARGET)
.msg()
.finish();
auto S_DAMAGE = node_builder_t(eSpecType::DAMAGE)
.msg()
.ex2b(eSpecPicker::DAMAGE_TYPE)
.ex2c(eSpecPicker::SOUND)
.finish();
auto S_HEALTH = node_builder_t(eSpecType::AFFECT_HP)
.msg()
.finish();
auto S_MANA = node_builder_t(eSpecType::AFFECT_SP)
.msg()
.finish();
auto S_EXP = node_builder_t(eSpecType::AFFECT_XP)
.msg()
.finish();
auto S_SKILLPT = node_builder_t(eSpecType::AFFECT_SKILL_PTS)
.msg()
.finish();
auto S_KILL = node_builder_t(eSpecType::AFFECT_DEADNESS)
.msg()
.ex1a(STRT_STATUS)
.finish();
auto S_STATUS = node_builder_t(eSpecType::AFFECT_STATUS)
.msg()
.ex1c(eSpecPicker::STATUS)
.finish();
auto S_TRAIT = node_builder_t(eSpecType::AFFECT_TRAITS)
.msg()
.ex1a(STRT_TRAIT)
.finish();
auto S_ACTIONS = node_builder_t(eSpecType::AFFECT_AP)
.msg()
.finish();
auto S_NAME = node_builder_t(eSpecType::AFFECT_NAME)
.msg()
.msg3(eSpecPicker::MSG_SINGLE)
.finish();
auto S_LEVEL = node_builder_t(eSpecType::AFFECT_LEVEL)
.msg()
.finish();
auto S_MORALE = node_builder_t(eSpecType::AFFECT_MORALE)
.msg()
.finish();
auto S_CRYSTAL = node_builder_t(eSpecType::AFFECT_SOUL_CRYSTAL)
.msg()
.finish();
auto S_EQUIP = node_builder_t(eSpecType::GIVE_ITEM)
.msg()
.pict(eSpecPicker::NODE)
.ex1a(STRT_ITEM)
.ex1b(STRT_ENCHANT)
.finish();
auto S_TARGET = node_builder_t(eSpecType::AFFECT_MONST_TARG)
.msg()
.finish();
auto S_ATTACK = node_builder_t(eSpecType::AFFECT_MONST_ATT)
.msg()
.finish();
auto S_STAT_M = node_builder_t(eSpecType::AFFECT_MONST_STAT)
.msg()
.ex1c(STRT_MONST_STAT)
.finish();
auto S_STAT_P = node_builder_t(eSpecType::AFFECT_STAT)
.msg()
.ex1c(STRT_SKILL)
.finish();
auto S_MAGE = node_builder_t(eSpecType::AFFECT_MAGE_SPELL)
.msg()
.ex1a(STRT_MAGE)
.finish();
auto S_PRIEST = node_builder_t(eSpecType::AFFECT_PRIEST_SPELL)
.msg()
.ex1a(STRT_PRIEST)
.finish();
auto S_GOLD = node_builder_t(eSpecType::AFFECT_GOLD)
.msg()
.finish();
auto S_FOOD = node_builder_t(eSpecType::AFFECT_FOOD)
.msg()
.finish();
auto S_ALCHEMY = node_builder_t(eSpecType::AFFECT_ALCHEMY)
.msg()
.ex1a(STRT_ALCHEMY)
.finish();
auto S_STATUS_PARTY = node_builder_t(eSpecType::AFFECT_PARTY_STATUS)
.msg()
.ex1c(eSpecPicker::STATUS_PARTY)
.finish();
auto S_NEWPC = node_builder_t(eSpecType::CREATE_NEW_PC)
.sdf()
.msg()
.msg3(eSpecPicker::MSG_SINGLE)
.pict(PIC_PC)
.ptyp(eSpecPicker::NODE)
.ex1c(STRT_RACE)
.finish();
auto S_STOREPC = node_builder_t(eSpecType::STORE_PC)
.sdf()
.msg()
.finish();
auto S_UNSTOREPC = node_builder_t(eSpecType::UNSTORE_PC)
.sdf()
.msg()
.ex1b(eSpecPicker::NODE)
.finish();

auto dead_ends = {eSpecType::TOWN_GENERIC_STAIR, eSpecType::TOWN_STAIR};
// Key:
// space - no button
// m - Create/Edit button to edit message pair (covers msg1 and msg2 together)
// M - Create/Edit button to edit single message
// $ - As above, but always a scenario message
// d - Create/Edit button to edit dialog message sequence (covers msg1 and msg2 together)
// b - Choose button to select a button label
// p - Choose button to select a picture (uses pictype for type)
// ? - Choose button to select a picture type
// s - Create/Edit button to edit special node
// S - As above, but always a scenario node
// x - Choose button to select a sound
// X - Choose button to select a trap type
// T - Choose button to select a town
// i - Choose button to select an item
// I - Choose button to select a special item
// t - Choose button to select a terrain type
// c - Choose button to select a monster type
// C - Choose button to select a monster statistic
// a - Choose button to select an alchemy recipe
// A - Choose button to select a mage spell
// P - Choose button to select a priest spell
// k - Choose button to select a skill
// K - As above, but add the special pseudo-skills for the if-statistic node
// f - Choose button to select a field type
// F - As above, but also include Dispel and Smash
// q - Choose button to select a trait
// Q - Choose button to select a species
// = - Choose button to select a comparison method (<=, <, =, >, >=)
// + - Choose button to select stat cumulation mode
// * - Choose button to select a special node context
// @ - Choose button to select a monster attitude
// D - Choose button to select a damage type
// ! - Choose button to select an explosion animation type
// / - Choose button to select generic stairway text
// : - Choose stairway trigger conditions
// L - Choose button to select a town lighting type
// & - Choose button to select a shop
// % - Choose button to select shop cost adjustment
// { - Choose button to select a spell pattern
// } - As above, but allows you to select which version of the rotateable field
// ^ - Choose button to select a positioning mode
// e - Choose button to select a status effect
// E - Choose button to select a party status effect
// w - Choose button to select main party status effect
// j - Choose button to select a quest
// J - Choose button to select a quest status
// < - Choose button to select a cardinal direction
// ~ - Choose button to select a weapon enchantment
// _ - Choose button to select a full sheet
// 0..9 - Choose button to select a specific type of picture
// (terrain, monster, dialog, talk, item, pc, field, boom, missile, status)
59 changes: 59 additions & 0 deletions src/scenario/special-general.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
//
// special-general.cpp
// BoE
//
// Created by Celtic Minstrel on 2025-02-18.
//

#include "special.hpp"

using namespace node_builder_fields;

auto S_NONE = node_builder_t(eSpecType::NONE).finish();
auto S_SETFLAG = node_builder_t(eSpecType::SET_SDF).sdf().msg().finish();
auto S_INCFLAG = node_builder_t(eSpecType::INC_SDF).sdf().msg().finish();
auto S_MSG = node_builder_t(eSpecType::DISPLAY_MSG).msg().finish();
auto S_SHOP = node_builder_t(eSpecType::ENTER_SHOP).msg1(eSpecPicker::MSG_SINGLE).ex1a(STRT_SHOP).ex1b(STRT_COST_ADJ).jump(eSpecPicker::NONE).finish();
auto S_MSG_SM = node_builder_t(eSpecType::DISPLAY_SM_MSG).msg().finish();
auto S_FLIPFLAG = node_builder_t(eSpecType::FLIP_SDF).sdf().msg().finish();
auto S_RANDFLAG = node_builder_t(eSpecType::SDF_RANDOM).sdf().msg().finish();
auto S_ADDFLAG = node_builder_t(eSpecType::SDF_ADD).sdf().msg().finish();
auto S_SUBFLAG = node_builder_t(eSpecType::SDF_DIFF).sdf().msg().finish();
auto S_STORY = node_builder_t(eSpecType::STORY_DIALOG).msg1(eSpecPicker::MSG_SINGLE).pic().finish();
auto S_PREVENT = node_builder_t(eSpecType::CANT_ENTER).msg().finish();
auto S_TIME = node_builder_t(eSpecType::CHANGE_TIME).msg().finish();
auto S_TIMER = node_builder_t(eSpecType::SCEN_TIMER_START).msg().ex1b(+eSpecPicker::NODE).finish();
auto S_SND = node_builder_t(eSpecType::PLAY_SOUND).ex1a(eSpecPicker::SOUND).finish();
auto S_HORSE_OWN = node_builder_t(eSpecType::CHANGE_HORSE_OWNER).msg().finish();
auto S_BOAT_OWN = node_builder_t(eSpecType::CHANGE_BOAT_OWNER).msg().finish();
auto S_TOWN_VIS = node_builder_t(eSpecType::SET_TOWN_VISIBILITY).msg().ex1a(STRT_TOWN).finish();
auto S_EVENT = node_builder_t(eSpecType::MAJOR_EVENT_OCCURRED).msg().finish();
auto S_FORCEGIVE = node_builder_t(eSpecType::FORCED_GIVE).msg().ex1a(STRT_ITEM).ex1b(eSpecPicker::NODE).finish();
auto S_BUYTYPE = node_builder_t(eSpecType::BUY_ITEMS_OF_TYPE).msg().ex1b(eSpecPicker::NODE).finish();
auto S_GLOBAL = node_builder_t(eSpecType::CALL_GLOBAL).jump(+eSpecPicker::NODE).finish();
auto S_SETROW = node_builder_t(eSpecType::SET_SDF_ROW).finish();
auto S_COPYFLAG = node_builder_t(eSpecType::COPY_SDF).sdf().sdf(EX1A, EX1B).finish();
auto S_PICTURE = node_builder_t(eSpecType::DISPLAY_PICTURE).msg1(eSpecPicker::MSG_SINGLE).ex1a(PIC_FULL).finish();
auto S_REST = node_builder_t(eSpecType::REST).msg().finish();
auto S_MSG_TITLE = node_builder_t(eSpecType::TITLED_MSG).msg().msg3(eSpecPicker::MSG_SINGLE).pic().finish();
auto S_END_SCEN = node_builder_t(eSpecType::END_SCENARIO).finish();
auto S_SETPTR = node_builder_t(eSpecType::SET_POINTER).sdf().finish();
auto S_CAMPFLAG = node_builder_t(eSpecType::SET_CAMP_FLAG).sdf().msg1(+eSpecPicker::MSG_SINGLE).finish();
auto S_DEBUG = node_builder_t(eSpecType::PRINT_NUMS).sdf().finish();
auto S_MULFLAG = node_builder_t(eSpecType::SDF_DIFF).sdf().msg().finish();
auto S_DIVFLAG = node_builder_t(eSpecType::SDF_DIFF).sdf().sdf(EX1C, EX2C).msg().finish();
auto S_EXPFLAG = node_builder_t(eSpecType::SDF_DIFF).sdf().msg().finish();
auto S_TERCHANGE = node_builder_t(eSpecType::CHANGE_TER).msg().loc(EX1A, EX1B).ex2a(STRT_TER).finish();
auto S_TERSWAP = node_builder_t(eSpecType::SWAP_TER).msg().loc(EX1A, EX1B).ex2a(STRT_TER).ex2b(STRT_TER).finish();
auto S_TERTRANS = node_builder_t(eSpecType::TRANS_TER).msg().loc(EX1A, EX1B).ex2a(STRT_TER).finish();
auto S_BUF_CLEAR = node_builder_t(eSpecType::CLEAR_BUF).finish();
auto S_BUF_ADDSTR = node_builder_t(eSpecType::APPEND_STRING).ex1a(eSpecPicker::MSG_SINGLE).finish();
auto S_BUF_ADDNUM = node_builder_t(eSpecType::APPEND_NUM).finish();
auto S_BUF_ADDMONST = node_builder_t(eSpecType::APPEND_MONST).ex1a(STRT_MONST).finish();
auto S_BUF_ADDITEM = node_builder_t(eSpecType::APPEND_ITEM).ex1a(STRT_ITEM).finish();
auto S_BUF_ADDTER = node_builder_t(eSpecType::APPEND_TER).ex1a(STRT_TER).finish();
auto S_PAUSE = node_builder_t(eSpecType::PAUSE).finish();
auto S_TALK = node_builder_t(eSpecType::START_TALK).pict(PIC_TALK).ex1b(STRT_MONST).jump(eSpecPicker::NONE).finish();
auto S_QUEST = node_builder_t(eSpecType::UPDATE_QUEST).msg().ex1a(STRT_QUEST).ex1b(STRT_QUEST_STATUS).finish();
auto S_BUF_SWAP = node_builder_t(eSpecType::SWAP_STR_BUF).msg().finish();
auto S_ALTER_SIGN = node_builder_t(eSpecType::STR_BUF_TO_SIGN).msg().finish();
21 changes: 21 additions & 0 deletions src/scenario/special-oneshot.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//
// special-oneshot.cpp
// Common
//
// Created by Celtic Minstrel on 2025-02-19.
//

#include "special.hpp"

using namespace node_builder_fields;

auto S_GIVE_ITEM = node_builder_t(eSpecType::ONCE_GIVE_ITEM).sdf().msg().ex1a(STRT_ITEM).ex1b(eSpecPicker::NODE).finish();
auto S_GIVE_SPECITEM = node_builder_t(eSpecType::ONCE_GIVE_SPEC_ITEM).sdf().msg().ex1a(STRT_SPEC_ITEM).finish();
auto S_NONE = node_builder_t(eSpecType::ONCE_NULL).sdf().finish();
auto S_SETSDF = node_builder_t(eSpecType::ONCE_SET_SDF).sdf().finish();
auto S_MSG = node_builder_t(eSpecType::ONCE_DISPLAY_MSG).sdf().msg().finish();
auto S_DIALOG = node_builder_t(eSpecType::ONCE_DIALOG).sdf().msg1(eSpecPicker::MSG_SEQUENCE).pic().ex1a(STRT_BUTTON).ex2a(STRT_BUTTON).ex1b(eSpecPicker::NODE).ex2b(eSpecPicker::NODE).finish();
auto S_ITEM_DIALOG = node_builder_t(eSpecType::ONCE_GIVE_ITEM_DIALOG).sdf().msg().msg3(STRT_SPEC_ITEM).pic().ex1a(STRT_ITEM).ex2b(eSpecPicker::NODE).finish();
auto S_OUTENC = node_builder_t(eSpecType::ONCE_OUT_ENCOUNTER).sdf().msg().finish();
auto S_TOWNENV = node_builder_t(eSpecType::ONCE_TOWN_ENCOUNTER).sdf().msg().finish();
auto S_TRAP = node_builder_t(eSpecType::ONCE_TRAP).sdf().msg().pic().ex1a(STRT_TRAP).ex2b(+eSpecPicker::NODE).finish();
Loading

0 comments on commit 6bbd7d3

Please sign in to comment.