< enemy name="fire.element" desc="fire.element" sprite="fire.element" lvl="5" str="15" dex="2" con="15" int="10" fireresist="100" coldresist="-100" >
< drop chance="10" minCount="50" maxCount="100" name="gold" / >
< enchant name="IMMOLATE" / >
< spell name="FIREBOLT" cond="(randomPercent 50) and (inRange self target 2 4)" / >
< / enemy >
A simple condition script determines when they should fire the firebolt. This one is a simple random chance when in range of the player. I can make them more complex if needed.
The immolate spell is also just a simple script:
< enchant name="IMMOLATE" desc="IMMOLATE" longdesc="Inflicts 2 points of fire damage to any nearby enemies per move and increases fire resistance by 10" >
< req name="ruby" / >
< req name="abrusseed" quantity="2" / >
< req name="bloodroot" quantity="3" / >
< event name="OnSecondaryStats" script="addStat fireresist (power * 10)" / >
< event name="OnTick" script="foreachneighbour 2 (doDamage it fire (power * 2) immolate)" / >
< /enchant >
The enchantment increases your fire resist whenever the secondary stats are calculated, and does damage to all neighbouring actors, regardless of friend or foe. I think friendly fire is usually a good thing so I'm letting the fire elements kill other creatures if they go too close. I'm hoping this will create some interesting strategies and dynamics. Creatures will be able to attack other creatures. There will be charisma based spells that can influence creatures into going passive or attacking other creatures.
Firebolts, on the other hand, are still quite hard coded. I'm still conflicted with which way to go with them. Moving them to script would be good, though the visual effects tend to be very specific per spell so I'll need to think it over more to see if it a few generic systems could cover a lot of spells.
I've also added tabs to the universal inventory screen. The number of elements in the menu was always going to be quite large and scrolling through pages of entries is far too tedious. Splitting into 4 groups seems to cover it well for now. Hopefully I can get by with only four, though I think it may be necessary to split them up further when there are a lot more spells, enchants, missions and beasts.