Created
July 9, 2011 03:21
-
-
Save hugueslamy/1073264 to your computer and use it in GitHub Desktop.
Cool Maptool Macro for inspiration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- DIALOG BOX --> | |
[h:screen=input( | |
"tab0|Main||TAB", | |
"power|Power Name|Power", | |
"action|Standard,Move,Minor,Free,Immediate Interupt,Immediate Reaction,Opportunity,No Action|Action Type|LIST|SELECT=0 VALUE=STRING ", | |
"usage|Basic Attack,At-Will,Encounter,Feature,Recharge 2,Recharge 3,Recharge 4,Recharge 5, Recharge 6,Recharge Special,Aura,Other|Usage Type|LIST|SELECT=1 VALUE=STRING ", | |
"blah|----------------|----------------|label", | |
"keywords|--|Keywords||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"flavour|--|Flavour Text||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"rangetype|None,Melee,Ranged,Area Blast,Area Burst,Close Blast,Close Burst,Personal,Aura,Beast|Range Type|LIST| SELECT=0 VALUE=STRING", | |
"range|--|Range||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"requirement|--|Requirement||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"trigger|--|Trigger||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"effect|--|Effect||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"sustainaction|--,Standard,Move,Minor,Free|Sustain Action|LIST| SELECT=0 VALUE=STRING", | |
"sustain|--|Sustain||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"note5|--|Additional Notes||WIDTH=16 ", | |
"note6|--|.||WIDTH=16 ", | |
"tab1|Primary Attack||TAB", | |
"target1|--|Primary Target(s)||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"attackcheck1|0|Use Primary Attack?|CHECK", | |
"attbonus1|0|Attack Bonus||WIDTH=16 ", | |
"vdef1|AC, Fortitude, Reflex, Will|Versus Defense|LIST| SELECT=0 VALUE=STRING", | |
"multiattroll1|0|Multiple Attack Rolls|CHECK", | |
"blah|----------------|----------------|label", | |
"damagecheck1|0|Use Damage?|CHECK", | |
"hidecrit1|0|Hide Critcal Damage?|CHECK", | |
"blah|----------------|----------------|label", | |
"dmgbonus1|0|Damage||WIDTH=16 ", | |
"DmgBonusCrit1|0|Bonus Maximized (on Crit)||WIDTH=16 ", | |
"dmgtype1|Untyped|Damage Type||WIDTH=16 ", | |
"multidmgroll1|0|Multiple Damage Rolls (non-AOE)|CHECK", | |
"blah|----------------|----------------|label", | |
"note1|--|Text before Attack||WIDTH=16 ", | |
"note2|--|Text after Attack||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"attackeffect1|--|Attack Effect||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"onmissnote1|--|Miss Description||WIDTH=16 ", | |
"tab2|Secondary Attack||TAB", | |
"target2|--|Secondary Target(s)||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"attackcheck2|0|Use Secondary Attack?|CHECK", | |
"attbonus2|0|Attack Bonus||WIDTH=16 ", | |
"vdef2|AC, Fortitude, Reflex, Will|Versus Defense|LIST| SELECT=0 VALUE=STRING", | |
"multiattroll2|0|Multiple Attack Rolls|CHECK", | |
"blah|----------------|----------------|label", | |
"damagecheck2|0|Use Damage?|CHECK", | |
"hidecrit2|0|Hide Critcal Damage?|CHECK", | |
"blah|----------------|----------------|label", | |
"dmgbonus2|0|Damage||WIDTH=16 ", | |
"DmgBonusCrit2|0|Bonus Maximized (on Crit)||WIDTH=16 ", | |
"dmgtype2|Untyped|Damage Type||WIDTH=16 ", | |
"multidmgroll2|0|Multiple Damage Rolls (non-AOE)|CHECK", | |
"blah|----------------|----------------|label", | |
"note3|--|Text before Attack||WIDTH=16 ", | |
"note4|--|Text after Attack||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"attackeffect2|--|Attack Effect||WIDTH=16 ", | |
"blah|----------------|----------------|label", | |
"onmissnote2|--|Miss Description||WIDTH=16 " | |
)] | |
[h:abort(screen)] | |
<!-- RETURN STRING BEGINS --> | |
[h:returnStr=""] | |
[h: returnStr = returnStr + '[h:MiscAttackMods = 0]'] | |
<!--PRINT OUT: Dialog Window --> | |
[r,if(attackcheck1!=0 || attackcheck2!=0),code:{ | |
[h: returnStr = returnStr + "[h:screen=input("] | |
[r,if(multiattroll1!=0), | |
code: {[h: returnStr = returnStr + '"rollnum1|1,2,3,4,5,6,7,8,9|Number of Attacks|LIST|SELECT=0 VALUE=STRING", "blah|----------------|----------------|label",']}; {}] | |
[r,if(multiattroll2!=0), | |
code: {[h: returnStr = returnStr + '"rollnum2|1,2,3,4,5,6,7,8,9|Number of Secondary Attacks|LIST|SELECT=0 VALUE=STRING", "blah|----------------|----------------|label",']}; {}] | |
[code: {[h: returnStr = returnStr + '"CACheck|0|Combat Advantage|CHECK",']}] | |
[code: {[h: returnStr = returnStr + '"TargetConcealed1|0|Target has Concealment|CHECK",']}] | |
[code: {[h: returnStr = returnStr + '"TargetConcealed2|0|Target has Total Concealment|CHECK",']}] | |
[code: {[h: returnStr = returnStr + '"MarkPenalty|0|Marked, but not by Target|CHECK",']}] | |
[code: {[h: returnStr = returnStr + '"blah|----------------|----------------|label",']}] | |
[code: {[h: returnStr = returnStr + '"MiscBonus|0|Misc. BONUSES to attack roll",']}] | |
[code: {[h: returnStr = returnStr + '"MiscPenalty|0|Misc. PENALTIES to attack roll",']}] | |
[code: {[h: returnStr = returnStr + '"MiscDmgBonus|0|Misc. BONUS to Damage']}] | |
[h: returnStr = returnStr + '" )]'] | |
[h: returnStr = returnStr + '[h:abort(screen)]'] | |
<!--PRINT OUT: Variables --> | |
[h: returnStr = returnStr + '[h,if(CACheck!=0): CABonus = 2; CABonus = 0]'] | |
[h: returnStr = returnStr + '[h,if(TargetConcealed1!=0): Concealed1 = -2; Concealed1 = 0]'] | |
[h: returnStr = returnStr + '[h,if(TargetConcealed2!=0): Concealed2 = -5; Concealed2 = 0]'] | |
[h: returnStr = returnStr + '[h,if(MarkPenalty!=0): MarkPen = -2; MarkPen = 0]'] | |
[h: returnStr = returnStr + '[h: MiscPenalty = abs(MiscPenalty) * -1]'] | |
[h: returnStr = returnStr + '[h:MiscAttackMods = MiscBonus + MiscPenalty + CABonus + Concealed1 + Concealed2 + MarkPen]'] | |
}; {}] | |
<!--PRINT OUT: POWER DETAILS --> | |
<!--PRINT OUT: HEADER ROW --> | |
[switch(usage),code: | |
case "Basic Attack": {[h: returnStr = returnStr + '<b><span style=color:green>'+usage+' - '+power+'</span>']}; | |
case "At-Will": {[h: returnStr = returnStr + '<b><span style=color:green>'+usage+' - '+power+'</span>']}; | |
case "Encounter": {[h: returnStr = returnStr + '<b><span style=color:990000>'+usage+' - '+power+'</span>']}; | |
case "Daily": {[h: returnStr = returnStr + '<b><span style=color:333333>'+usage+' - '+power+'</span>']} | |
case "Recharge 2": {[h: returnStr = returnStr + '<b><span style=color:FF6600>'+usage+' - '+power+'</span>']} | |
case "Recharge 3": {[h: returnStr = returnStr + '<b><span style=color:FF6600>'+usage+' - '+power+'</span>']} | |
case "Recharge 4": {[h: returnStr = returnStr + '<b><span style=color:FF6600>'+usage+' - '+power+'</span>']} | |
case "Recharge 5": {[h: returnStr = returnStr + '<b><span style=color:FF6600>'+usage+' - '+power+'</span>']} | |
case "Recharge 6": {[h: returnStr = returnStr + '<b><span style=color:FF6600>'+usage+' - '+power+'</span>']} | |
case "Recharge Special": {[h: returnStr = returnStr + '<b><span style=color:FF6600>'+usage+' - '+power+'</span>']} | |
case "Aura": {[h: returnStr = returnStr + '<b><span style=color:330066>'+usage+' - '+power+'</span>']} | |
case "Feature": {[h: returnStr = returnStr + '<b><span style=color:003366>'+usage+' - '+power+'</span>']} | |
default: {[h: returnStr = returnStr + '<b>'+usage+' - '+power+'']} | |
] | |
[r,if(action!="No Action" && rangetype!="None" && range!="--" && keywords!="--"),code: { | |
[h: returnStr = returnStr + ': '] | |
};{}] | |
[r,if(action!="No Action"),code: { | |
[h: returnStr = returnStr + ''+action] | |
};{}] | |
[r,if(rangetype!="None"),code: { | |
[h: returnStr = returnStr + ' - ' +rangetype+] | |
};{}] | |
[r,if(rangetype!="None" && range!="--"),code: { | |
[h: returnStr = returnStr + ' ' + range] | |
};{}] | |
[r,if(keywords!="--"),code: { | |
[h: returnStr = returnStr + ' • ' +keywords + ''] | |
};{ | |
[h: returnStr = returnStr + ''] | |
}] | |
[h: returnStr = returnStr + '</b>'] | |
<!--PRINT OUT: Flavour Text --> | |
[r,if(flavour!="--"),code: { | |
[h: returnStr = returnStr + '<br><i>'+flavour+'</i> '] | |
}] | |
<!--PRINT OUT: Requirements and Trigger --> | |
[r,if(requirement!="--"),code: { | |
[h: returnStr = returnStr + '<br><b>Requirements: </b>' +requirement] | |
};{}] | |
[r,if(trigger!="--"),code: { | |
[h: returnStr = returnStr + '<br><b>Trigger: </b>' +trigger] | |
};{}] | |
<!--PRINT OUT: PRIMARY ATTACK --> | |
<!--PRINT OUT: Attack Target --> | |
[r,if(target1!="--" && attackcheck1!=0 && target2=="--"),code:{ | |
[h: returnStr = returnStr + '<br><b>Target(s): </b>' + target1] | |
};{}] | |
[r,if(target1!="--" && attackcheck1!=0 && target2!="--"),code:{ | |
[h: returnStr = returnStr + '<br><b>Primary Target(s): </b>' + target1] | |
};{}] | |
[h: returnStr = returnStr + '[h:AttBonus_A = ' + attbonus1 +']'] | |
[r,if(note1!="--"),code:{ | |
[h: returnStr = returnStr + '<br>' +note1] | |
};{}] | |
<!--PRINT OUT: Attack --> | |
[r,if(attackcheck1!=0 && multiattroll1!=1),code:{ | |
[h: returnStr = returnStr + '<br><b>Primary Attack: </b>'] | |
[h: returnStr = returnStr + '[t:1d20 + AttBonus_A + MiscAttackMods] vs. ' + vdef1 + '; '] | |
};{}] | |
[r,if(attackcheck1!=0 && multiattroll1!=0),code:{ | |
[h: returnStr = returnStr + '<br><b>Primary Attack: </b>'] | |
[h: returnStr = returnStr + '[c(rollnum1),code:{[t:1d20 + AttBonus_A + MiscAttackMods]}] vs. ' + vdef1 + '; '] | |
};{}] | |
<!--PRINT OUT: Damage --> | |
[r,if(damagecheck1!=0 && attackcheck1==0),code:{ | |
[h: returnStr = returnStr + '<br><b>Hit: </b>'] | |
[h: returnStr = returnStr + '[t:eval(string(' + dmgbonus1 + ')) + eval(string(MiscDmgBonus))] '] | |
};{}] | |
[r,if(damagecheck1!=0 && attackcheck1!=0),code:{ | |
[h: returnStr = returnStr + ' <b>Hit: </b>'] | |
[h: returnStr = returnStr + '[t:eval(string(' + dmgbonus1 + ')) + eval(string(MiscDmgBonus))] '] | |
};{}] | |
[r,if(dmgtype1!="Untyped"),code:{ | |
[h: returnStr = returnStr + dmgtype1] | |
};{}] | |
[r,if(damagecheck1!=0),code:{ | |
[h: returnStr = returnStr + ' Damage'] | |
};{}] | |
[r,if(damagecheck1!=0 && hidecrit1==0),code:{ | |
[h: returnStr = returnStr + '; <b>Critical: </b>'] | |
[h: returnStr = returnStr + '[t:eval(string(MiscDmgBonus)) + eval(string(' + DmgBonusCrit1 + ')) ]'] | |
[h: returnStr = returnStr + ' ' + '[r,if("' + dmgtype1 + '"!="Untyped"),code:{[r:"' + dmgtype1 + '"]};{}]'] | |
[h: returnStr = returnStr + ' Damage '] | |
};{}] | |
[r,if(note2!="--"),code:{ | |
[h: returnStr = returnStr + '<br>' +note2] | |
};{}] | |
[r,if(attackeffect1!="--"),code:{ | |
[h: returnStr = returnStr + '<br><b>Effect: </b>' +attackeffect1] | |
};{}] | |
[r,if(onmissnote1!="--"),code:{ | |
[h: returnStr = returnStr + '<br><b>Miss: </b>' +onmissnote1] | |
};{}] | |
<!--PRINT OUT: SECONDARY ATTACK --> | |
<!--PRINT OUT: Attack Target --> | |
[r,if(target2!="--" && attackcheck2!=0),code:{ | |
[h: returnStr = returnStr + '<br><b>Secondary Target(s): </b>' + target2] | |
};{}] | |
[h: returnStr = returnStr + '[h:AttBonus_B = ' + attbonus2 +']'] | |
[r,if(note3!="--"),code:{ | |
[h: returnStr = returnStr + '<br>' +note3] | |
};{}] | |
<!--PRINT OUT: Attack --> | |
[r,if(attackcheck2!=0 && multiattroll2!=1),code:{ | |
[h: returnStr = returnStr + '<br><b>Secondary Attack: </b>'] | |
[h: returnStr = returnStr + '[t:1d20 + AttBonus_B + MiscAttackMods] vs. ' + vdef2 + '; '] | |
};{}] | |
[r,if(attackcheck2!=0 && multiattroll2!=0),code:{ | |
[h: returnStr = returnStr + '<br><b>Secondary Attack: </b>'] | |
[h: returnStr = returnStr + '[c(rollnum2),code:{[t:1d20 + AttBonus_B + MiscAttackMods]}] vs. ' + vdef2 + '; '] | |
};{}] | |
<!--PRINT OUT: Damage --> | |
[r,if(damagecheck2!=0),code:{ | |
[h: returnStr = returnStr + '<b>Hit: </b>'] | |
[h: returnStr = returnStr + '[t:eval(string(' + dmgbonus2 + ')) + eval(string(MiscDmgBonus))] '] | |
};{}] | |
[r,if(dmgtype2!="Untyped"),code:{ | |
[h: returnStr = returnStr + dmgtype2] | |
};{}] | |
[r,if(damagecheck2!=0),code:{ | |
[h: returnStr = returnStr + ' Damage'] | |
};{}] | |
[r,if(damagecheck2!=0 && hidecrit2==0),code:{ | |
[h: returnStr = returnStr + '; <b>Critical: </b>'] | |
[h: returnStr = returnStr + '[t:eval(string(MiscDmgBonus)) + eval(string(' + DmgBonusCrit2 + ')) ]'] | |
[h: returnStr = returnStr + ' ' + '[r,if("' + dmgtype2 + '"!="Untyped"),code:{[r:"' + dmgtype2 + '"]};{}]'] | |
[h: returnStr = returnStr + ' Damage '] | |
};{}] | |
[r,if(note4!="--"),code:{ | |
[h: returnStr = returnStr + '<br>' +note4] | |
};{}] | |
[r,if(attackeffect2!="--"),code:{ | |
[h: returnStr = returnStr + '<br><b>Effect: </b>' +attackeffect2] | |
};{}] | |
[r,if(onmissnote2!="--"),code:{ | |
[h: returnStr = returnStr + '<br><b>Miss:</b>' +onmissnote2] | |
};{}] | |
<!--PRINT OUT: END NOTES --> | |
[r,if(effect!="--"),code: { | |
[h: returnStr = returnStr + '<br><b>Effect: </b>' +effect] | |
};{}] | |
[r,if(sustainaction!="--"),code: { | |
[h: returnStr = returnStr + '<br><b>Sustain (' +sustainaction+ '): </b>' +sustain] | |
};{}] | |
[r,if(note5!="--"),code: { | |
[h: returnStr = returnStr + '<br>' +note5] | |
};{}] | |
[r,if(note6!="--"),code: { | |
[h: returnStr = returnStr + '<br>' +note6] | |
};{}] | |
[h:macro.return=returnStr] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment