STAR TREK 2d20
Page 2 of 2 First 12
  1. #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..

    -pete
    Forge 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.

  2. #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

  3. #13
    A 3rd suggestion I use in AWD is

    <includefile ruleset="3.5E" source="3.5E/3.5E.xml" />
    With a folder for ruleset specific files. ie 3.5e.xml has this type of thing,

    <script name="Ruleset_awd" file="3.5E/scripts/ruleset_awd.lua" />
    Each ruleset has a 'Ruleset_awd' module name and matching functions like,

    (3.5e function )
    function onDamageRoll()
    return "%[TYPE: ([^(]*) %(([^)]*)%) %(([^)]*)%) %(([^)]*)%) %(([^)]*)%) %(([^)]*)%)%]";
    end
    (5e function )
    function onDamageRoll()
    return "%[TYPE: ([^(]*) %(([^)]*)%)%(([^)]*)%)%(([^)]*)%)%(([^)]*)%)%]";
    end
    That selects the difference between rulesets, so the main code can just use 'Ruleset_awd.onDamageRoll()' to grab the parsing differences between the rulesets.

    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.

    -pete
    Forge 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in