Skip to content

Commit

Permalink
Make the outdoor map lists for entangle and spike growth only for the…
Browse files Browse the repository at this point in the history
… standard toee module.
  • Loading branch information
doug1234 committed Jan 7, 2025
1 parent 107a539 commit 087c11a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 4 additions & 0 deletions TemplePlus/python/python_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ PYBIND11_EMBEDDED_MODULE(tpdp, m) {
return py::bytes(d20Stats.GetStatShortName((Stat)stat));
});

m.def("is_temple_module", []() {
return !modSupport.IsZMOD() && !modSupport.IsKotB() && !modSupport.IsPalCove() && !modSupport.IsIWD();
});

m.def("config_set_string", [](std::string& configItem, std::string& value) {
auto configItemLower(tolower(configItem));
if (configItemLower == "hpfornpchd") {
Expand Down
3 changes: 2 additions & 1 deletion tpdatasrc/co8infra/scr/Spell153 - Entangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from co8Util import size
from co8Util.PersistentData import *
from co8Util.ObjHandling import *
import tpdp

ENTANGLE_KEY = "Sp153_Entangle_Activelist"

Expand All @@ -18,7 +19,7 @@ def OnSpellEffect( spell ):
spell.duration = 10 * spell.caster_level
outdoor_map_list = [5001, 5002, 5009, 5042, 5043, 5051, 5062, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5091, 5093, 5094, 5095, 5096, 5097, 5099, 5100, 5108, 5110, 5111, 5112, 5113, 5119, 5120, 5121, 5132, 5142, 5189]

if (game.leader.map in outdoor_map_list) or (game.global_vars[451] & 2**0 == 0):
if (tpdp.config_get_bool("StricterRulesEnforcement") and tpdp.is_temple_module()) or (game.leader.map in outdoor_map_list):

# spawn one Entangle scenery object
entangle_obj = game.obj_create( OBJECT_SPELL_GENERIC, spell.target_loc, spell.target_loc_off_x, spell.target_loc_off_y )
Expand Down
7 changes: 1 addition & 6 deletions tpdatasrc/co8infra/scr/Spell455 - Spike Growth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ def OnSpellEffect( spell ):
#In areas of bare earth, roots and rootlets act in the same way. Typically, spike growth can be cast in any outdoor setting except open water, ice, heavy snow, sandy desert, or bare stone.
outdoor_map_list = [5001, 5002, 5009, 5042, 5043, 5051, 5062, 5068, 5069, 5070, 5071, 5072, 5073, 5074, 5075, 5076, 5077, 5078, 5091, 5093, 5094, 5095, 5096, 5097, 5099, 5100, 5108, 5110, 5111, 5112, 5113, 5119, 5120, 5121, 5132, 5142, 5189]

print "Spike Growth!!"
print tpdp.config_get_bool("StricterRulesEnforcement")
print (game.leader.map in outdoor_map_list)
print (game.global_vars[451] & 2**0 == 0)

if not tpdp.config_get_bool("StricterRulesEnforcement") or (game.leader.map in outdoor_map_list):
if (tpdp.config_get_bool("StricterRulesEnforcement") and tpdp.is_temple_module()) or (game.leader.map in outdoor_map_list):

# spawn one spell_object object
spell_obj = game.obj_create( OBJECT_SPELL_GENERIC, spell.target_loc, spell.target_loc_off_x, spell.target_loc_off_y )
Expand Down

0 comments on commit 087c11a

Please sign in to comment.