Thread: 5E Absorb Effect
-
February 22nd, 2022, 23:53 #11
On a 2nd note... You could use the string manager function 'split', 'trim' and 'contains'..
I'd suggest you use split/trim on your 'ABSORB: <damageType>', ie "ABSORB: fire,slashing" to create a table[]="fire","slashing" etc...
and also the split/trim on the clause <damageType>, ie "lightning,spell,magic" to create a table[]="lightning","spell","magic" etc..
then a for pairs loop on one table, and pass the other table into the 'contains' function and if this ever returns true then apply your heal and break out the loop.
While it sounds like more code, its about the same, and it removes the 'gsub()' for the 'spell' special case. ( Which probably should be more like ",%s*spell" to cope with zero or more spaces between the ',' and 'spell'... )
This would allow your 'ABSORB:' to work more like the 'IMMUNE' style ',' split list.
immune.JPG
[ You could probably borrow the IMMUNE code to even see and allow the !<type> support, but that might be going a bit over the top.. ]
I'd probably also change the 'ABSORB2' to maybe 'HABSORB' or 'ABSORBH' to follow the likes of the [HLVL] type effect system. ( I know effects do not use the like of 'HATK:' or 'ATKH:' as the type.. )
But 'ABSORB2' reads more as double than half. Totally your call on this one. I just like to see a common effects type rules process..
-peteForge Profile
DMsGuild Profile
Forge Modules: B9's Steel Defender.
Forge Extensions: B9's Spell Tokens, B9's Encumbrance Tweak, B9's Damage Per Round, B9's Surprise Round.
DMsGuild Extensions: Advanced Weapon Damage, Advanced Spell Damage, Aspect Of The Bear, Spell Long Rest For NPC, Spell Domain.
-
February 23rd, 2022, 00:31 #12
Appreciate the comments, I'll take a look at making some changes soon.
For support with any of my extensions, visit my #mattekure-stuff channel on Rob2e's discord https://discord.gg/rob2e
-
February 23rd, 2022, 14:27 #13
A 3rd suggestion I use in AWD is
<includefile ruleset="3.5E" source="3.5E/3.5E.xml" />
<script name="Ruleset_awd" file="3.5E/scripts/ruleset_awd.lua" />
(3.5e function )
function onDamageRoll()
return "%[TYPE: ([^(]*) %(([^)]*)%) %(([^)]*)%) %(([^)]*)%) %(([^)]*)%) %(([^)]*)%)%]";
end
function onDamageRoll()
return "%[TYPE: ([^(]*) %(([^)]*)%)%(([^)]*)%)%(([^)]*)%)%(([^)]*)%)%]";
end
I noticed much of your 4e function difference was the small mid section code to do with the 'TYPE' section, you could process this in a ruleset specific file and have the 5e version do nothing so your core can call one replacement function.
With a small change you can have a common code section that is easy to adjust/debug for both ruleset.
-peteForge Profile
DMsGuild Profile
Forge Modules: B9's Steel Defender.
Forge Extensions: B9's Spell Tokens, B9's Encumbrance Tweak, B9's Damage Per Round, B9's Surprise Round.
DMsGuild Extensions: Advanced Weapon Damage, Advanced Spell Damage, Aspect Of The Bear, Spell Long Rest For NPC, Spell Domain.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks