You're moving more and more towards requiring a weapons database. In the meantime you could have different properties on a token. Attack1CriticalRange, Attack2CriticalRange etc so:
[code=php][attack1CriticalRange = "19,20"]
[attack2CriticalRange = "18,19,20"]
[for(attack,0,listLength(meleeAttackList)),Code:{
[currentAttackCriticalRange = getProperty("attack" + attack + "CriticalRange")]
[attackRoll = 1d20+attack]
[if (listContains(currentAttackCriticalRange,attackRoll)): attackRoll = attackRoll + 1d20]
[attackRoll] for [meleeDamage] [if (listContains(currentAttackCriticalRange,attackRoll)): "Critical!"]
}] [/code]
Yes this is messy, and you may need to tweak the code to fit your game, but I can't think of a simpler way off the top of my head. A database is the way to go and the sooner you start on that the easier your life will be.
Iterative Attacks
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
- Bone White
- Great Wyrm
- Posts: 1124
- Joined: Tue Aug 23, 2011 11:41 am
- Location: Cornwall, UK
Re: Iterative Attacks
Why would you use ranges ? It's convoluted and slower. Simply set the crit value eg critRange=18 and then if(roll >= critRange):... Is much simpler.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: Iterative Attacks
Oh...well that makes a lot more sense.
- Bone White
- Great Wyrm
- Posts: 1124
- Joined: Tue Aug 23, 2011 11:41 am
- Location: Cornwall, UK
Re: Iterative Attacks
It's more powerful and allows for ranges which are not simply just greater than or equal. It also teaches the user about lists, which is the current topic of tutoring.wolph42 wrote:Why would you use ranges ? It's convoluted and slower. Simply set the crit value eg critRange=18 and then if(roll >= critRange):... Is much simpler.
Re: Iterative Attacks
true, but I think the lesson to be learned should be: use the most optimal form for the occasion!Bone White wrote:It's more powerful and allows for ranges which are not simply just greater than or equal. It also teaches the user about lists, which is the current topic of tutoring.wolph42 wrote:Why would you use ranges ? It's convoluted and slower. Simply set the crit value eg critRange=18 and then if(roll >= critRange):... Is much simpler.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
-
- Kobold
- Posts: 1
- Joined: Sat Jun 07, 2014 4:18 am
- Location: 123 street
- Contact:
Re: Iterative Attacks
I'm planning a character that has 2 claw attacks and a tail attack as natural weapons, but now I'm a little confused about the mechanics of using them all.