Skip to content

Commit

Permalink
Fixed Mystic Theurge cockup
Browse files Browse the repository at this point in the history
  • Loading branch information
DMD authored and DMD committed Mar 12, 2017
1 parent 3a691bf commit f2e7739
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
7 changes: 5 additions & 2 deletions TemplePlus/d20_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,15 @@ bool D20ClassSystem::IsVancianCastingClass(Stat classEnum, objHndl handle )
return classSpec->second.spellMemorizationType == SpellReadyingType::Vancian;
}

bool D20ClassSystem::IsCastingClass(Stat classEnum){
bool D20ClassSystem::IsCastingClass(Stat classEnum, bool includeExtenders){
auto classSpec = classSpecs.find(classEnum);
if (classSpec == classSpecs.end())
return false;

if (classSpec->second.spellListType == SpellListType::None){
if (includeExtenders && classSpec->second.spellListType == SpellListType::Extender)
return true;

else if (classSpec->second.spellListType == SpellListType::None){
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion TemplePlus/d20_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class D20ClassSystem : temple::AddressTable
bool IsNaturalCastingClass(Stat classEnum, objHndl handle = objHndl::null);
bool IsNaturalCastingClass(uint32_t classEnum);
bool IsVancianCastingClass(Stat classEnum, objHndl handle = objHndl::null);
bool IsCastingClass(Stat classEnum);
bool IsCastingClass(Stat classEnum, bool includeExtenders = false);
bool HasSpellList(Stat classEnum); // does this class have its own spell list? (as opposed to extending another's like Mystic Theurge does), e.g. Blackguard, Assassin
bool IsLateCastingClass(Stat classEnum); // for classes like Ranger / Paladin that start casting on level 4
bool IsArcaneCastingClass(Stat stat, objHndl handle = objHndl::null); // classes who list SpellSourceType as Arcane; this is mostly used to retrieve spell properties, so Mystic Theurges need not apply since they don't have an independent spell list
Expand Down
2 changes: 1 addition & 1 deletion TemplePlus/feat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ uint32_t LegacyFeatSystem::FeatPrereqsCheck(objHndl objHnd, feat_enums featIdx,
if (featReqCode == featReqCodeMinCasterLevel){
auto casterLevel = critterSys.GetCasterLevel(objHnd);

if (d20ClassSys.IsCastingClass(classCodeBeingLevelledUp))
if (d20ClassSys.IsCastingClass(classCodeBeingLevelledUp, true))
casterLevel++;

if (casterLevel < featReqCodeArg)
Expand Down
2 changes: 1 addition & 1 deletion TemplePlus/spell_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ enum class SpellListType : int {
Psionic,
Ranger, // subset of divine
Special, // "independent" list
Theurge // adds to both divine and arcane classes!
Extender // extends an existing spell list
};

#pragma pack(push,4)
Expand Down
10 changes: 5 additions & 5 deletions TemplePlus/ui/ui_char_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1526,12 +1526,12 @@ BOOL UiCharEditor::FinishBtnMsg(int widId, TigMsg * msg){
auto charEdited = GetEditedChar();

// add spell casting condition
if (d20ClassSys.IsCastingClass(selPkt.classCode)){
auto spellcastCond = (std::string)d20ClassSys.GetSpellCastingCondition(selPkt.classCode);
if ( spellcastCond.size() ){
conds.AddTo(charEdited, spellcastCond, {0,0,0,0, 0,0,0,0});
}

auto spellcastCond = (std::string)d20ClassSys.GetSpellCastingCondition(selPkt.classCode);
if ( spellcastCond.size() ){
conds.AddTo(charEdited, spellcastCond, {0,0,0,0, 0,0,0,0});
}

return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion tpdata/templeplus/lib/templeplus/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3343,7 +3343,7 @@
spell_list_type_psionic = 8
spell_list_type_ranger = 9
spell_list_type_special = 10
spell_list_type_theurge = 11
spell_list_type_extender = 11

spell_source_type_ability = 0
spell_source_type_arcane = 1
Expand Down
Binary file modified tpdata/tpgamefiles.dat
Binary file not shown.

0 comments on commit f2e7739

Please sign in to comment.