Skip to content

Commit

Permalink
Only allow spike growth outside with stricter rules for GrognardsFrom…
Browse files Browse the repository at this point in the history
  • Loading branch information
doug1234 committed Jan 6, 2025
1 parent e3f64a9 commit 107a539
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions tpdatasrc/co8infra/scr/Spell455 - Spike Growth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from toee import *
import tpdp

def OnBeginSpellCast( spell ):
print "Spike Growth OnBeginSpellCast"
Expand All @@ -10,20 +11,37 @@ def OnSpellEffect( spell ):
print "Spike Growth OnSpellEffect"

spell.duration = 600 * spell.caster_level

# 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 )

# add to d20initiative
caster_init_value = spell.caster.get_initiative()
spell_obj.d20_status_init()
spell_obj.set_initiative( caster_init_value )

# put sp-Spike Growth condition on obj
spell_obj_partsys_id = game.particles( 'sp-Spike Growth', spell_obj )
spell_obj.condition_add_with_args( 'sp-Spike Growth', spell.id, spell.duration, 0, spell_obj_partsys_id )
#spell_obj.condition_add_arg_x( 3, spell_obj_partsys_id )
#objectevent_id = spell_obj.condition_get_arg_x( 2 )

#Using the same areas as entangle. From the SRD:
#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):

# 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 )

# add to d20initiative
caster_init_value = spell.caster.get_initiative()
spell_obj.d20_status_init()
spell_obj.set_initiative( caster_init_value )

# put sp-Spike Growth condition on obj
spell_obj_partsys_id = game.particles( 'sp-Spike Growth', spell_obj )
spell_obj.condition_add_with_args( 'sp-Spike Growth', spell.id, spell.duration, 0, spell_obj_partsys_id )
#spell_obj.condition_add_arg_x( 3, spell_obj_partsys_id )
#objectevent_id = spell_obj.condition_get_arg_x( 2 )

else:
# No plants to entangle with
game.particles( 'Fizzle', spell.caster )
spell.caster.float_mesfile_line( 'mes\\spell.mes', 30000 )
spell.caster.float_mesfile_line( 'mes\\spell.mes', 16014 )

def OnBeginRound( spell ):
print "Spike Growth OnBeginRound"
Expand Down

0 comments on commit 107a539

Please sign in to comment.