Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
54ec304
Dragon Disciple WIP
Sagenlicht Sep 16, 2021
0312673
Updated Dragon Disciple
Sagenlicht Sep 17, 2021
b9d12de
Update dragon_disciple.py
Sagenlicht Sep 17, 2021
6e6b68f
Merge branch 'master' into DragonDisciple
Sagenlicht Sep 20, 2021
783606e
Added Ability Boost
Sagenlicht Sep 20, 2021
0cb6e91
Fixed Heritage bug
Sagenlicht Sep 20, 2021
809df43
Fixed Cone Breath Weapon
Sagenlicht Sep 20, 2021
1ad5cfa
Further progress for the DD
Sagenlicht Sep 21, 2021
6e4d1e0
Finished help file for DD
Sagenlicht Sep 22, 2021
7fcad2c
DD: Dropped Blindsense, fixed fire smoke
Sagenlicht Sep 23, 2021
d02b5fb
Added Flying Toggle (Nonfunctional yet)
Sagenlicht Sep 30, 2021
e641ab5
Moved Flying to seperate condtion
Sagenlicht Oct 1, 2021
2ebb5a7
added Darley Wings Mesh as Wings for the DD
Sagenlicht Oct 14, 2021
f77c9dc
Merge branch 'master' into DragonDisciple
Sagenlicht Oct 26, 2021
d8ae0ec
Merge branch 'master' into DragonDisciple
Nov 21, 2021
7ec38ee
String fixes: DD requirements fit inside scroll box; feat descrition …
Nov 22, 2021
b085be2
Added PyObjHndl method anim_goal_throw_spell_w_cast_anim to properly …
Nov 22, 2021
9696b90
DD fixes Breath weapon
Nov 22, 2021
d1daf13
Merge branch 'DragonDisciple' of https://github.com/GrognardsFromHell…
Sagenlicht Nov 22, 2021
1aabeb1
Update to DD Draconic Heritage Handling
Sagenlicht Nov 23, 2021
2d2d8cb
First Draft of Bonus Spells Feature
Sagenlicht Nov 24, 2021
fbbfe61
Merge branch 'master' into DragonDisciple
Sagenlicht Nov 24, 2021
4099c50
Merge branch 'master' into DragonDisciple
Nov 24, 2021
67e6a9e
Merge branch 'DragonDisciple' of https://github.com/GrognardsFromHell…
Nov 24, 2021
a43fa6a
Forgot to merge the draconic_heritage feat to the DD
Sagenlicht Nov 25, 2021
8f9182e
Added new error codes
Sagenlicht Dec 6, 2021
1586499
Condition hashtable init replacement; added log message for when it o…
Dec 22, 2021
96c76ef
Merge branch 'DragonDisciple' of https://github.com/GrognardsFromHell…
Dec 22, 2021
b43a73d
reflex throw will now use SpellSaveThrow when used for spell actions,…
Dec 22, 2021
e21d766
Added get_caster_class method to python EventObjSpellsPerDay
Dec 22, 2021
05c1d8e
Renamed chargeAfterPicker for more accurate meaning
Dec 23, 2021
5fe70c7
Minor magic number cleanup from natural attacks review
Dec 24, 2021
370c30b
Changed Bonus Spells per Day
Sagenlicht Jan 18, 2022
422d1c4
Update dragon_disciple.py
Sagenlicht Jan 18, 2022
16fd20e
admin files setup
Sagenlicht Jan 24, 2022
9b76b85
Update constants.py
Sagenlicht Jan 24, 2022
bca6ad3
added spell Tactical Precision
Sagenlicht Jan 24, 2022
21e1542
added spell_utils to admin files
Sagenlicht Jan 24, 2022
f520e38
Updated helpTag Handling
Sagenlicht Jan 24, 2022
c0ea4ec
Update bonus_description.mes
Sagenlicht Jan 24, 2022
97d14f1
More work on bonus type handling
Sagenlicht Jan 25, 2022
e58d0f2
Update constants.py
Sagenlicht Jan 25, 2022
b48eb2f
Update spell_compendium_partsys.tab
Sagenlicht Jan 26, 2022
3702543
Update spell_compendium_partsys.tab
Sagenlicht Jan 26, 2022
e7e5647
Update constants.py
Sagenlicht Jan 27, 2022
4ef9d82
Update constants.py
Sagenlicht Jan 29, 2022
c0723fc
Added AEC_SILENCED
Sagenlicht Jan 29, 2022
2efd1a9
Update spell_utils.py
Sagenlicht Jan 30, 2022
ac2ac34
Update new_classes_help.tab
Sagenlicht Jan 30, 2022
549396b
Added new orb spells
Sagenlicht Feb 1, 2022
a585198
Fixed Tagging Error in spell_help
Sagenlicht Feb 1, 2022
0aa9680
Update spell_compendium_help.tab
Sagenlicht Feb 2, 2022
f46deb6
Update spell_compendium_partsys.tab
Sagenlicht Feb 2, 2022
b9ff247
Update damage_ext.mes
Sagenlicht Feb 2, 2022
4d8d632
Added Hail of Stone and Blast of Flame to Help and partsys
Sagenlicht Feb 3, 2022
a1311c9
Added Evards Black Tentacles
Sagenlicht Feb 3, 2022
e8e2229
Update constants.py
Sagenlicht Feb 5, 2022
c48cca4
Update constants.py
Sagenlicht Feb 7, 2022
5af23c5
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 7, 2022
4217a3c
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 7, 2022
f64a519
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 7, 2022
8d8f094
Added Black Tentacles spell_object
Sagenlicht Feb 7, 2022
64260da
Fixed Sniper's Shot Description
Sagenlicht Feb 9, 2022
d3d294a
Create combat_ext.mes
Sagenlicht Feb 9, 2022
df61e31
Update spell_compendium_help.tab
Sagenlicht Feb 11, 2022
cc47159
Update spell_compendium_partsys.tab
Sagenlicht Feb 11, 2022
1af2388
fixed combat.mes extender
Sagenlicht Feb 11, 2022
5711c91
Update constants.py
Sagenlicht Feb 13, 2022
de24748
Updated spell_utils
Sagenlicht Feb 13, 2022
158328d
added DR Handling to SpellPythonModifier class
Sagenlicht Feb 13, 2022
fc93857
Update spells_radial_menu_options_ext.mes
Sagenlicht Feb 13, 2022
410227b
Added more functions to SpellPythonModifier
Sagenlicht Feb 14, 2022
deb50a0
Added more functions to SpellPythonModifier
Sagenlicht Feb 14, 2022
208808d
Fixed a few mass spell version handlings
Sagenlicht Feb 14, 2022
4a426e5
Fixed more inconsitencies
Sagenlicht Feb 14, 2022
d2fb36a
Update conviction_mass.txt
Sagenlicht Feb 14, 2022
d122f32
Fixed more inconsistencies
Sagenlicht Feb 14, 2022
b003421
Update spell_utils.py
Sagenlicht Feb 14, 2022
7a9711b
Updated bonus_description.mes
Sagenlicht Feb 14, 2022
801d8df
Added Bonefiddle particles
Sagenlicht Feb 15, 2022
a442e00
Update spell_compendium_spell_enum.mes
Sagenlicht Feb 15, 2022
59dd7fa
Update spell_compendium_partsys.tab
Sagenlicht Feb 16, 2022
9bc744d
Added Rhino's Rush
Sagenlicht Feb 17, 2022
415f068
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 17, 2022
43e9cb1
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 17, 2022
42fb7ac
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 17, 2022
a398753
Fixed Aid, Mass description
Sagenlicht Feb 17, 2022
5a3467e
Update bonus_description.mes
Sagenlicht Feb 17, 2022
a48d7bb
Fixed Sacred bonus in constants.py
Sagenlicht Feb 17, 2022
2c996f9
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 18, 2022
f252713
Added spell Icelance
Sagenlicht Feb 18, 2022
b460a75
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 18, 2022
349499e
Added spell Revivify
Sagenlicht Feb 19, 2022
4bbb015
Update spell_compendium_help.tab
Sagenlicht Feb 19, 2022
cbdded7
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 21, 2022
5edea28
Update spell_compendium_partsys.tab
Sagenlicht Feb 21, 2022
d947737
More work on spell_utils
Sagenlicht Feb 28, 2022
debe857
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Feb 28, 2022
a5c99d9
Update spell_compendium_partsys.tab
Sagenlicht Feb 28, 2022
5c0e384
Update constants.py
Sagenlicht Mar 1, 2022
8724f81
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Mar 1, 2022
db65b7d
Create warlock_spell.mes
Sagenlicht Mar 1, 2022
1185e76
Merge branch 'DragonDisciple' into Warlock
Sagenlicht Mar 4, 2022
463c4b9
Merge branch 'SpellPythonModifier' into Warlock
Sagenlicht Mar 4, 2022
b9e3a4a
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 4, 2022
919e3f1
Update constants.py
Sagenlicht Mar 5, 2022
a474da9
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Mar 5, 2022
d5686bf
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 5, 2022
7e2e6e5
Update class_spell_lists.tab
Sagenlicht Mar 9, 2022
68cd569
Update constants.py
Sagenlicht Mar 9, 2022
1368b4c
Update bonus_description.mes
Sagenlicht Mar 9, 2022
6164bcc
Added isLivingCreature and applyFogConcealment functions
Sagenlicht Mar 9, 2022
8381f9b
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Mar 9, 2022
173f8fe
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 9, 2022
5b2d682
Update spell_structs.h
Sagenlicht Mar 9, 2022
a9fede7
added new spell_radial option; Warlock add to stat_ext.mes
Sagenlicht Mar 9, 2022
6c4734e
Added Warlock class
Sagenlicht Mar 9, 2022
c13d9ca
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 9, 2022
470f325
regenerated .dat files
Sagenlicht Mar 9, 2022
618bb60
Update class_spell_lists.tab
Sagenlicht Mar 10, 2022
acab429
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 10, 2022
0813256
Warlock updates
Sagenlicht Mar 10, 2022
2f426f0
regenerated dat files
Sagenlicht Mar 10, 2022
cf68f07
added more warlock spells to constants.py
Sagenlicht Mar 11, 2022
e3b2ca4
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 11, 2022
6e61565
Warlock Update
Sagenlicht Mar 11, 2022
451a0f1
Update spell_utils.py
Sagenlicht Mar 11, 2022
903a28a
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 11, 2022
a7ee65f
Warlock progress
Sagenlicht Mar 11, 2022
4415c9d
Update tpgamefiles.dat
Sagenlicht Mar 11, 2022
962b111
Update constants.py
Sagenlicht Mar 14, 2022
9f5725d
Update spell_utils.py
Sagenlicht Mar 14, 2022
3a1fb50
Merge branch 'SpellPythonModifier' into admin_files
Sagenlicht Mar 14, 2022
6478612
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 14, 2022
ebb7a6a
Warlock Progress
Sagenlicht Mar 14, 2022
231741e
Update tpgamefiles.dat
Sagenlicht Mar 14, 2022
deb03fd
More Warlock porgress
Sagenlicht Mar 16, 2022
6fd0eb1
Merge branch 'SpellPythonModifier' into new_conditions
Sagenlicht Mar 17, 2022
0450d2f
New Conditions and Removal Handling added
Sagenlicht Mar 17, 2022
c7e4143
Merge branch 'new_conditions' into Warlock
Sagenlicht Mar 17, 2022
e8d1cc4
Update tpgamefiles.dat
Sagenlicht Mar 17, 2022
40a5a07
Fixed Sickened crash
Sagenlicht Mar 17, 2022
2f67e0f
Merge branch 'new_conditions' into Warlock
Sagenlicht Mar 17, 2022
64e4922
Fixed crashing issue
Sagenlicht Mar 17, 2022
3d84109
Merge branch 'alignment_on_creation_fix' into Warlock
Sagenlicht Mar 19, 2022
7f4d8bf
Merge branch 'master' into Warlock
Sagenlicht Mar 20, 2022
d3f4377
Added Invocation Entropic Warding
Sagenlicht Mar 20, 2022
27496a7
Update stat_ext.mes
Sagenlicht Mar 20, 2022
b211a0c
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 20, 2022
966800a
Update tpgamefiles.dat
Sagenlicht Mar 20, 2022
72c4e41
Create feat_utils.py
Sagenlicht Mar 21, 2022
a9210a9
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 21, 2022
7094baf
Added SF + GSF Invocation
Sagenlicht Mar 21, 2022
caceea1
Fixed SF + GSF
Sagenlicht Mar 21, 2022
8974991
Update tpgamefiles.dat
Sagenlicht Mar 21, 2022
e321ba0
Update new_classes_help.tab
Sagenlicht Mar 21, 2022
56e010a
Update constants.py
Sagenlicht Mar 22, 2022
61f51ae
Merge branch 'SpellPythonModifier' into Warlock
Sagenlicht Mar 22, 2022
b22cb1c
Update spell_utils.py
Sagenlicht Mar 22, 2022
730b4bb
Update spell_utils.py
Sagenlicht Mar 22, 2022
0db3b79
Merge branch 'SpellPythonModifier' into Warlock
Sagenlicht Mar 22, 2022
0431645
Added Cold Comfort, fixed Flee the Scene Typo
Sagenlicht Mar 22, 2022
51f7e25
Update spells_radial_menu_options_ext.mes
Sagenlicht Mar 22, 2022
def4e70
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 22, 2022
7f8a75e
Update warlock_help.tab
Sagenlicht Mar 22, 2022
3ee9b91
Update tpgamefiles.dat
Sagenlicht Mar 22, 2022
11e53fb
Fixed .mes inconsistencies
Sagenlicht Mar 23, 2022
f472748
Merge branch 'admin_files' into Warlock
Sagenlicht Mar 23, 2022
a683b78
Fixed .mes inconsistencies
Sagenlicht Mar 23, 2022
9d4866d
Update warlock.py
Sagenlicht Mar 23, 2022
ce0b448
Update tpgamefiles.dat
Sagenlicht Mar 23, 2022
23cf5a5
Added a skip for invocations in radialmenu.cpp
Sagenlicht Mar 23, 2022
9dad093
Fixed spell_eldritch_glaive typo
Sagenlicht Mar 24, 2022
9defe5c
Warlock Updates
Sagenlicht Mar 24, 2022
c69885e
Warlock Fixes
Sagenlicht Mar 25, 2022
cfe5f4c
Finished Eldritch Doom
Sagenlicht Mar 25, 2022
e8c7116
Warlock Updates
Sagenlicht Mar 28, 2022
0ab07e0
Warlock help updated
Sagenlicht Mar 28, 2022
a93ae45
Delete warlock.tab
Sagenlicht Mar 29, 2022
d78f233
Warlock Update
Sagenlicht Mar 29, 2022
9dbbc90
Warlock Update
Sagenlicht Mar 31, 2022
d83ba5d
Warlock clean ups
Sagenlicht Mar 31, 2022
893aea0
Warlock Update
Sagenlicht Mar 31, 2022
1cb1b55
Warlock update
Sagenlicht Apr 1, 2022
133252f
Added Enervating Shadow Invocation
Sagenlicht Apr 4, 2022
45436db
Update class033_warlock.py
Sagenlicht Apr 4, 2022
cf033d1
Update tpgamefiles.dat
Sagenlicht Apr 4, 2022
3ece4be
Enervating Shadow Fixes
Sagenlicht Apr 4, 2022
127e088
Merge with features.
doug1234 Oct 28, 2023
9711e35
Merge fix.
doug1234 Oct 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions TemplePlus/action_sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ int ActionSequenceSystem::TrimPathToRemainingMoveLength(D20Actn* d20a, float rem
uint32_t ActionSequenceSystem::ActionCostNull(D20Actn* d20Actn, TurnBasedStatus* turnBasedStatus, ActionCostPacket* actionCostPacket)
{
actionCostPacket->hourglassCost = 0;
actionCostPacket->chargeAfterPicker = 0;
actionCostPacket->attackCost = 0;
actionCostPacket->moveDistCost = 0;
return 0;
}
Expand Down Expand Up @@ -3388,7 +3388,7 @@ BOOL ActionSequenceSystem::SimulsAdvance()

int ActionSequenceSystem::ActionCostFullAttack(D20Actn* d20, TurnBasedStatus* tbStat, ActionCostPacket* acp)
{
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
acp->hourglassCost = 4;
int flags = d20->d20Caf;
Expand Down Expand Up @@ -3529,13 +3529,13 @@ int ActionSequenceSystem::ActionCostProcess(TurnBasedStatus* tbStat, D20Actn* d2
if (tbStat->surplusMoveDistance >= actCost.moveDistCost)
{
tbStat->surplusMoveDistance -= actCost.moveDistCost;
if ( actCost.chargeAfterPicker <= 0
|| actCost.chargeAfterPicker + tbStat->attackModeCode <= tbStat->baseAttackNumCode + tbStat->numBonusAttacks)
if ( actCost.attackCost <= 0
|| actCost.attackCost + tbStat->attackModeCode <= tbStat->baseAttackNumCode + tbStat->numBonusAttacks)
{
if ((int) tbStat->numBonusAttacks < actCost.chargeAfterPicker)
tbStat->attackModeCode += actCost.chargeAfterPicker;
if (actCost.attackCost > (int) tbStat->numBonusAttacks )
tbStat->attackModeCode += actCost.attackCost;
else
tbStat->numBonusAttacks -= actCost.chargeAfterPicker;
tbStat->numBonusAttacks -= actCost.attackCost;
if (tbStat->attackModeCode == tbStat->baseAttackNumCode && !tbStat->numBonusAttacks)
tbStat->tbsFlags &= ~TBSF_FullAttack;
result = AEC_OK;
Expand Down Expand Up @@ -3799,12 +3799,13 @@ int ActionSequenceSystem::StdAttackTurnBasedStatusCheck(D20Actn* d20a, TurnBased
return AEC_TARGET_INVALID;
}

const int STD_ATK_HG_COST= 2;
if (hgState != -1)
hgState = turnBasedStatusTransitionMatrix[hgState][2];
hgState = turnBasedStatusTransitionMatrix[hgState][STD_ATK_HG_COST];
tbStat->hourglassState = hgState;

if (inventory.ItemWornAt(d20a->d20APerformer, 3) || dispatch.DispatchD20ActionCheck(d20a, tbStat, dispTypeGetCritterNaturalAttacksNum) <= 0)
tbStat->attackModeCode = 0;
if (inventory.ItemWornAt(d20a->d20APerformer, EquipSlot::WeaponPrimary) || dispatch.DispatchD20ActionCheck(d20a, tbStat, dispTypeGetCritterNaturalAttacksNum) <= 0)
tbStat->attackModeCode = ATTACK_CODE_PRIMARY;
else
tbStat->attackModeCode = ATTACK_CODE_NATURAL_ATTACK;
tbStat->baseAttackNumCode = tbStat->attackModeCode + 1;
Expand Down Expand Up @@ -4325,12 +4326,15 @@ const char*actionErrorCodeStrings[] =
"AEC_NEED_A_STRAIGHT_LINE",
"AEC_NO_ACTIONS",
"AEC_NOT_IN_COMBAT",
"AEC_AREA_NOT_SAFE"
"AEC_AREA_NOT_SAFE",
"AEC_ABILITY_ON_COOLDOWN",
"AEC_ALREADY_USED_THIS_TURN",
"AEC_ALREADY_ACTIVE"
};
ostream & operator<<(ostream & str, ActionErrorCode aec)
{
size_t i = (size_t)aec;
if (i <= AEC_AREA_NOT_SAFE) {
if (i <= AEC_ALREADY_ACTIVE) {
str << actionErrorCodeStrings[i];
}
else {
Expand Down
5 changes: 4 additions & 1 deletion TemplePlus/action_sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ enum ActionErrorCode : uint32_t
AEC_NEED_A_STRAIGHT_LINE,
AEC_NO_ACTIONS,
AEC_NOT_IN_COMBAT,
AEC_AREA_NOT_SAFE
AEC_AREA_NOT_SAFE,
AEC_ABILITY_ON_COOLDOWN,
AEC_ALREADY_USED_THIS_TURN,
AEC_ALREADY_ACTIVE
};

// Allows for direct use of ActionErrorCode in format() strings
Expand Down
31 changes: 28 additions & 3 deletions TemplePlus/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ class ConditionFunctionReplacement : public TempleFix {
void apply() override {
logger->info("Replacing Condition-related Functions");

replaceFunction<void()>(0x100E19A0, []() {
conds.hashmethods.ConditionHashtableInit(conds.mCondStructHashtable);
});
//dispTypeConditionAddPre
static int(__cdecl* orgTempAbilityLoss)(DispatcherCallbackArgs) = replaceFunction<int(__cdecl)(DispatcherCallbackArgs)>(0x100EA1F0, [](DispatcherCallbackArgs args) {
Stat statDamaged = (Stat)args.GetCondArg(0);
Expand Down Expand Up @@ -1794,16 +1797,16 @@ int __cdecl GlobalToHitBonus(DispatcherCallbackArgs args)
&& !d20Sys.d20Query(args.objHndCaller, DK_QUE_Polymorphed) )
{
int attackIdx = dispIo->attackPacket.dispKey - (ATTACK_CODE_NATURAL_ATTACK + 1);
int bonValue = 0; // temporarily used as an index value for obj_f_attack_bonus_idx field
int atkBonIdx = 0;
for (int i = 0, j=0; i < 4; i++)
{
j += objects.getArrayFieldInt32(args.objHndCaller, obj_f_critter_attacks_idx, i); // number of attacks
if (attackIdx < j){
bonValue = i;
atkBonIdx = i;
break;
}
}
bonValue = objects.getArrayFieldInt32(args.objHndCaller, obj_f_attack_bonus_idx, bonValue);
int bonValue = objects.getArrayFieldInt32(args.objHndCaller, obj_f_attack_bonus_idx, atkBonIdx);
bonusSys.bonusAddToBonusList(&dispIo->bonlist, bonValue, 1, 118); // base attack
}

Expand Down Expand Up @@ -7410,3 +7413,25 @@ void CondStructNew::AddAoESpellRemover() {
AddHook(dispTypeD20Signal, DK_SIG_Spell_End, spCallbacks.AoeSpellRemove);
}

uint32_t CondHashSystem::ConditionHashtableInit(ToEEHashtable<CondStruct>* hashtable)
{
const int VANILLA_COND_CAP = 1000;
return HashtableInit(hashtable, VANILLA_COND_CAP /*2023*/);
}

uint32_t CondHashSystem::CondStructAddToHashtable(CondStruct* condStruct, bool overriding)
{

uint32_t key = StringHash(condStruct->condName);
CondStruct* condFound;
uint32_t result = HashtableSearch(condHashTable, key, &condFound);
if (result || overriding)
{
result = HashtableOverwriteItem(condHashTable, key, condStruct);
}
if (result == 3) { // over capacity
logger->error("Condition hashtable over capacity ({})! Trying to add {}", condHashTable->capacity, condStruct->condName);
}
return result;

}
19 changes: 3 additions & 16 deletions TemplePlus/condition.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,9 @@ struct CondHashSystem : ToEEHashtableSystem < CondStruct >
temple::Dll::RegisterAddressPtr((void**)&condHashTable);
}

uint32_t ConditionHashtableInit(ToEEHashtable<CondStruct> * hashtable)
{
return HashtableInit(hashtable, 1000);
}

uint32_t CondStructAddToHashtable(CondStruct * condStruct, bool overriding = false)
{
uint32_t key = StringHash(condStruct->condName);
CondStruct * condFound;
uint32_t result = HashtableSearch(condHashTable, key, &condFound);
if (result || overriding)
{
result = HashtableOverwriteItem(condHashTable, key, condStruct);
}
return result;
}
uint32_t ConditionHashtableInit(ToEEHashtable<CondStruct>* hashtable);

uint32_t CondStructAddToHashtable(CondStruct* condStruct, bool overriding = false);

int GetCondStructHashkey(CondStruct* condStruct)
{
Expand Down
1 change: 1 addition & 0 deletions TemplePlus/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ static ConfigSetting configSettings[] = {
CONF_BOOL(antialiasing),
CONF_BOOL(softShadows),
CONF_BOOL(noSound),
//CONF_BOOL(showFps),
CONF_BOOL(featPrereqWarnings),
CONF_BOOL(spellAlreadyKnownWarnings),
CONF_BOOL(NPCsLevelLikePCs),
Expand Down
26 changes: 15 additions & 11 deletions TemplePlus/d20.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2984,7 +2984,7 @@ ActionErrorCode D20ActionCallbacks::ActionCheckTripAttack(D20Actn* d20a, TurnBas

ActionErrorCode D20ActionCallbacks::ActionCostCastSpell(D20Actn * d20a, TurnBasedStatus * tbStat, ActionCostPacket * acp){
acp->hourglassCost = 0;
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0.0f;
auto flags = d20a->d20Caf;
if ( (flags & D20CAF_FREE_ACTION) || !combatSys.isCombatActive()){
Expand Down Expand Up @@ -3048,7 +3048,7 @@ ActionErrorCode D20ActionCallbacks::ActionCostCastSpell(D20Actn * d20a, TurnBase
}

ActionErrorCode D20ActionCallbacks::ActionCostFullRound(D20Actn* d20a, TurnBasedStatus* tbStat, ActionCostPacket* acp){
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
acp->hourglassCost = 4;
if ( (d20a->d20Caf & D20CAF_FREE_ACTION) || !combatSys.isCombatActive())
Expand Down Expand Up @@ -3876,7 +3876,7 @@ ActionErrorCode D20ActionCallbacks::TurnBasedStatusCheckPython(D20Actn* d20a, Tu
}

ActionErrorCode D20ActionCallbacks::ActionCostFullAttack(D20Actn * d20a, TurnBasedStatus * tbStat, ActionCostPacket * acp){
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
acp->hourglassCost = 4;
//int flags = d20a->d20Caf;
Expand All @@ -3893,7 +3893,7 @@ ActionErrorCode D20ActionCallbacks::ActionCostFullAttack(D20Actn * d20a, TurnBas
}

ActionErrorCode D20ActionCallbacks::ActionCostPartialCharge(D20Actn * d20a, TurnBasedStatus * tbStat, ActionCostPacket * acp){
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
acp->hourglassCost = 3;
if ((d20a->d20Caf & D20CAF_FREE_ACTION) || !combatSys.isCombatActive())
Expand All @@ -3907,6 +3907,10 @@ ActionErrorCode D20ActionCallbacks::ActionCostPython(D20Actn* d20a, TurnBasedSta
return (ActionErrorCode) d20Sys.GetPyActionCost(d20a, tbStat, acp);
}

/*
0x100910F0
Used in: Standard attack, Standard Ranged attack, Trip Attack, Touch Attack, Throw Weapon, Throw Grenade
*/
ActionErrorCode D20ActionCallbacks::ActionCostStandardAttack(D20Actn* d20a, TurnBasedStatus* tbStat, ActionCostPacket* acp){

if ( d20Sys.d20Query(d20a->d20APerformer, DK_QUE_HoldingCharge)
Expand All @@ -3917,12 +3921,12 @@ ActionErrorCode D20ActionCallbacks::ActionCostStandardAttack(D20Actn* d20a, Turn
}

acp->hourglassCost = 0;
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;

if (!(d20a->d20Caf & D20CAF_FREE_ACTION) && combatSys.isCombatActive())
{
acp->chargeAfterPicker = 1;
acp->attackCost = 1;

auto retainSurplusMoveDist = false;

Expand All @@ -3945,7 +3949,7 @@ ActionErrorCode D20ActionCallbacks::ActionCostStandardAttack(D20Actn* d20a, Turn
ActionErrorCode D20ActionCallbacks::ActionCostMoveAction(D20Actn *d20, TurnBasedStatus *tbStat, ActionCostPacket *acp)
{
acp->hourglassCost = 0;
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
if (!(d20->d20Caf & D20CAF_FREE_ACTION) && combatSys.isCombatActive())
{
Expand All @@ -3961,7 +3965,7 @@ ActionErrorCode D20ActionCallbacks::ActionCostMoveAction(D20Actn *d20, TurnBased

ActionErrorCode D20ActionCallbacks::ActionCostNull(D20Actn* d20a, TurnBasedStatus* tbStat, ActionCostPacket* acp){
acp->hourglassCost = 0;
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
return AEC_OK;
}
Expand All @@ -3973,21 +3977,21 @@ ActionErrorCode D20ActionCallbacks::ActionCostSwift(D20Actn* d20a, TurnBasedStat
}

acp->hourglassCost = 0;
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
tbStat->tbsFlags |= TBSF_SwiftActionPerformed;
return AEC_OK;
}

ActionErrorCode D20ActionCallbacks::ActionCostStandardAction(D20Actn*, TurnBasedStatus*, ActionCostPacket*acp){
acp->hourglassCost = 2;
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
return AEC_OK;
};

ActionErrorCode D20ActionCallbacks::ActionCostWhirlwindAttack(D20Actn* d20a, TurnBasedStatus* tbStat, ActionCostPacket*acp) {
acp->chargeAfterPicker = 0;
acp->attackCost = 0;
acp->moveDistCost = 0;
acp->hourglassCost = 4;
if ( ( d20a->d20Caf & D20CAF_FREE_ACTION) || !combatSys.isCombatActive()){
Expand Down
15 changes: 12 additions & 3 deletions TemplePlus/d20_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ bool D20ClassSystem::IsCompatibleWithAlignment(Stat classEnum, Alignment al){
return temple::GetRef<BOOL(__cdecl)(Stat, Alignment)>(0x10188170)(classEnum, al);
}

bool D20ClassSystem::IsNaturalCastingClass(Stat classEnum, objHndl handle){
bool D20ClassSystem::IsNaturalCastingClass(Stat classEnum, objHndl handle) {
auto classSpec = classSpecs.find(classEnum);
if (classSpec == classSpecs.end())
return false;
return classSpec->second.spellMemorizationType == SpellReadyingType::Innate;

return classSpec->second.spellMemorizationType == SpellReadyingType::Innate || classSpec->second.spellMemorizationType == SpellReadyingType::AtWill;
}

bool D20ClassSystem::IsNaturalCastingClass(uint32_t classEnum){
Expand All @@ -157,6 +157,15 @@ bool D20ClassSystem::IsVancianCastingClass(Stat classEnum, objHndl handle )
return classSpec->second.spellMemorizationType == SpellReadyingType::Vancian;
}

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

return classSpec->second.spellMemorizationType == SpellReadyingType::AtWill;
}

bool D20ClassSystem::IsCastingClass(Stat classEnum, bool includeExtenders){
auto classSpec = classSpecs.find(classEnum);
if (classSpec == classSpecs.end())
Expand Down
1 change: 1 addition & 0 deletions TemplePlus/d20_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,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 IsAtWillCastingClass(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
Expand Down
4 changes: 2 additions & 2 deletions TemplePlus/d20_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ enum class ActionCostType : int {
struct ActionCostPacket
{
int hourglassCost;
int chargeAfterPicker; // flag I think; is only set at stuff that requires using the picker it seems
int attackCost; // how many attacks does this consume when doing Full Attack? (0 if not relevant; haven't seen a value > 1)
float moveDistCost;

ActionCostPacket() { hourglassCost = 0; chargeAfterPicker = 0; moveDistCost = 0.0f; }
ActionCostPacket() { hourglassCost = 0; attackCost = 0; moveDistCost = 0.0f; }
};
//const auto TestSizeOfActionCostPacket = sizeof(ActionCostPacket); // should be 12 (0xC)

Expand Down
Loading