diff --git a/TemplePlus/condition.cpp b/TemplePlus/condition.cpp index 38bd8b3f0..13d99db23 100644 --- a/TemplePlus/condition.cpp +++ b/TemplePlus/condition.cpp @@ -1905,6 +1905,7 @@ void _FeatConditionsRegister() conds.hashmethods.CondStructAddToHashtable(conds.ConditionFightDefensively); conds.hashmethods.CondStructAddToHashtable(conds.ConditionAnimalCompanionAnimal); conds.hashmethods.CondStructAddToHashtable(conds.ConditionAutoendTurn); + conds.hashmethods.CondStructAddToHashtable(conds.ConditionTurnUndead); // Craft Wand @@ -2243,7 +2244,7 @@ void ConditionSystem::RegisterNewConditions() DispatcherHookInit((CondStructNew*)ConditionTurnUndead, 6, dispTypeD20ActionPerform, DK_D20A_DIVINE_MIGHT, CondArgDecrement, 1, 0); // decrement the number of turn charges remaining; DispatcherHookInit((CondStructNew*)ConditionGreaterTurning, 6, dispTypeD20ActionPerform, DK_D20A_DIVINE_MIGHT, CondArgDecrement, 1, 0); // decrement the number of turn charges remaining - + // Divine Might Bonus (gets activated when you choose the action from the Radial Menu) mCondDivineMightBonus = &condDivineMightBonus; cond = mCondDivineMightBonus; condName = mCondDivineMightBonusName; diff --git a/TemplePlus/d20_defs.h b/TemplePlus/d20_defs.h index 43eca5683..24a0d5710 100644 --- a/TemplePlus/d20_defs.h +++ b/TemplePlus/d20_defs.h @@ -334,7 +334,7 @@ static const char *d20ActionNames[] = { "D20A_OPEN_CONTAINER", "D20A_THROW", "D20A_THROW_GRENADE", - "D20A_FEINT," + "D20A_FEINT", "D20A_READY_SPELL", "D20A_READY_COUNTERSPELL", "D20A_READY_ENTER", diff --git a/TemplePlus/d20_status.cpp b/TemplePlus/d20_status.cpp index 9fb325e27..35f57e924 100644 --- a/TemplePlus/d20_status.cpp +++ b/TemplePlus/d20_status.cpp @@ -75,13 +75,14 @@ void D20StatusSystem::initClass(objHndl objHnd){ _D20StatusInitDomains(objHnd); } - if (feats.HasFeatCountByClass(objHnd, FEAT_REBUKE_UNDEAD)){ + if (feats.HasFeatCountByClass(objHnd, FEAT_REBUKE_UNDEAD)) { _ConditionAddToAttribs_NumArgs2(dispatcher, conds.GetByName("Turn Undead"), 1, 0); + } else if (feats.HasFeatCountByClass(objHnd, FEAT_TURN_UNDEAD)) { + _ConditionAddToAttribs_NumArgs2(dispatcher, conds.GetByName("Turn Undead"), 0, 0); } - if (objects.StatLevelGet(objHnd, stat_level_paladin) >= 3) - { - _ConditionAddToAttribs_NumArgs0(dispatcher, conds.GetByName("Turn Undead")); + if (feats.HasFeatCountByClass(objHnd, FEAT_BARBARIAN_RAGE)) { + _ConditionAddToAttribs_NumArgs2(dispatcher, conds.GetByName("Barbarian_Rage"), 0, 0); } if (objects.StatLevelGet(objHnd, stat_level_bard) >= 1){ @@ -211,7 +212,7 @@ void D20StatusSystem::initDomains(objHndl objHnd) uint32_t arg2 = *(conds.ConditionArrayDomainsArg2 + 3 * domain_1); if (condStructDomain1 != nullptr) { - _ConditionAddToAttribs_NumArgs2(dispatcher, condStructDomain1, arg1, arg2); + _ConditionAddToAttribs_NumArgs2(dispatcher, condStructDomain1, arg1, arg2); } } @@ -222,19 +223,9 @@ void D20StatusSystem::initDomains(objHndl objHnd) uint32_t arg2 = *(conds.ConditionArrayDomainsArg2 + 3 * domain_2); if (condStructDomain2 != nullptr) { - _ConditionAddToAttribs_NumArgs2(dispatcher, condStructDomain2, arg1, arg2); + _ConditionAddToAttribs_NumArgs2(dispatcher, condStructDomain2, arg1, arg2); } } - - auto alignmentchoice = objects.getInt32(objHnd, obj_f_critter_alignment_choice); - if (alignmentchoice == 2) - { - _ConditionAddToAttribs_NumArgs2(dispatcher, conds.ConditionTurnUndead, 1, 0); - } - else - { - _ConditionAddToAttribs_NumArgs2(dispatcher, conds.ConditionTurnUndead, 0, 0); - } } void D20StatusSystem::initFeats(objHndl objHnd) diff --git a/TemplePlus/python/python_dispatcher.cpp b/TemplePlus/python/python_dispatcher.cpp index cdc10a2fe..ee1bca5df 100644 --- a/TemplePlus/python/python_dispatcher.cpp +++ b/TemplePlus/python/python_dispatcher.cpp @@ -153,13 +153,15 @@ PYBIND11_EMBEDDED_MODULE(tpdp, m) { .def_readwrite("name", &CondStructNew::condName) .def("extend_existing", [](CondStructNew &condStr, std::string condName){ auto cond = (CondStructNew*)conds.GetByName(condName); - if (cond){ - for (auto i = 0; i < 100 && cond->subDispDefs[i].dispType != 0; i++){ + if (cond) { + for (auto i = 0; i < 100 && cond->subDispDefs[i].dispType != 0; i++) { condStr.subDispDefs[condStr.numHooks++] = cond->subDispDefs[i]; } condStr.numArgs = cond->numArgs; condStr.condName = cond->condName; condStr.Register(); + } else { + logger->info("Extend Existing Error: Condition {} does not exist!", condName); } }) .def("add_item_force_remove_callback", [](CondStructNew &condStr){ diff --git a/TemplePlus/ui/ui_char_editor.cpp b/TemplePlus/ui/ui_char_editor.cpp index a0b3c8525..f37483a27 100644 --- a/TemplePlus/ui/ui_char_editor.cpp +++ b/TemplePlus/ui/ui_char_editor.cpp @@ -1531,7 +1531,10 @@ BOOL UiCharEditor::FinishBtnMsg(int widId, TigMsg * msg){ if ( spellcastCond.size() ){ conds.AddTo(charEdited, spellcastCond, {0,0,0,0, 0,0,0,0}); } - + + // Final refresh once alignment_choice has been set + d20StatusSys.D20StatusRefresh(charEdited); + return 1; } diff --git a/tpdatasrc/tpgamefiles/rules/feats/extend rage.txt b/tpdatasrc/tpgamefiles/rules/feats/extend rage.txt index 162fbb507..1f5f8f6d7 100644 --- a/tpdatasrc/tpgamefiles/rules/feats/extend rage.txt +++ b/tpdatasrc/tpgamefiles/rules/feats/extend rage.txt @@ -1,4 +1,5 @@ name: Extend Rage -flags: 12582912 +flags: 12582913 prereqs: -description: Each of your rages lasts 5 rounds longer than its normal duration. \ No newline at end of file +description: Each of your rages lasts 5 rounds longer than its normal duration. +prereq descr: Barbarian rage ability. \ No newline at end of file diff --git a/tpdatasrc/tpgamefiles/rules/feats/extra rage.txt b/tpdatasrc/tpgamefiles/rules/feats/extra rage.txt new file mode 100644 index 000000000..8526d9607 --- /dev/null +++ b/tpdatasrc/tpgamefiles/rules/feats/extra rage.txt @@ -0,0 +1,5 @@ +name: Extra Rage +flags: 12582913 +prereqs: +description: You rage two more times per day than you otherwise could. +prereq descr: Barbarian rage ability. \ No newline at end of file diff --git a/tpdatasrc/tpgamefiles/scr/feats/feat - Extra Rage.py b/tpdatasrc/tpgamefiles/scr/feats/feat - Extra Rage.py new file mode 100644 index 000000000..a320033f3 --- /dev/null +++ b/tpdatasrc/tpgamefiles/scr/feats/feat - Extra Rage.py @@ -0,0 +1,10 @@ +from toee import * + + +def CheckPrereq(attachee, classLevelled, abilityScoreRaised): + + #Barbarian Rage Check + if not attachee.has_feat(feat_barbarian_rage): + return 0 + + return 1 diff --git a/tpdatasrc/tpgamefiles/scr/tpModifiers/extra_rage.py b/tpdatasrc/tpgamefiles/scr/tpModifiers/extra_rage.py new file mode 100644 index 000000000..ae3dab9f9 --- /dev/null +++ b/tpdatasrc/tpgamefiles/scr/tpModifiers/extra_rage.py @@ -0,0 +1,18 @@ +#Extra Rage: Complete Warrior, p. 98 + +from templeplus.pymod import PythonModifier +from toee import * +import tpdp + +print "Registering Extra Rage" + +def ExtraRageNewDay(attachee, args, evt_obj): + ExtraRageCount = attachee.has_feat("Extra Rage") + + #Extra Rage grands 2 additional uses or rage each time the feat is taken + args.set_arg(0, args.get_arg(0) + 2 * ExtraRageCount) + return 0 + +extendRageFeat = PythonModifier() +extendRageFeat.ExtendExisting("Barbarian_Rage") +extendRageFeat.AddHook(ET_OnNewDay, EK_NEWDAY_REST, ExtraRageNewDay, ())