I am new to this Forum, so I hope I created this thread in the right board.
Shortly I became a member of an online group of "Arcane Codex" that uses MapTools. Some days ago I decided to redo our macros, since they seemed to be quiet chaotic and did not use their full potential
The following macro executes a magical spell.
I have two problems with it, I could not solve on my own...
The first line after the block that defines the variables should stop the macro. (assert) It does so, but the text it gives out is not impersonated. ("zu wenige Kraftpunkte") I tried to add "/self" or "/im name" and checked, whether the Token was impersonated, but it did not help.
I think the problem is, that it is some kind of "alarm message", but no usual text. Do you have any idea, what I could do to change this?
Now to my second question: I would like to shorten the moloch at the end of the macro. Can I somehow only once define the span and use it for every case of the switch?
Code: Select all
[h: skillname = "Mit Pflanzen & Tieren sprechen"]
[h: skill = 4]
[h: MW = 13]
[h: WW = "-"]
[h: Kosten = 2]
[h: assert(Kosten <= Kraftpunkte, ""+skillname+": zu wenige Kraftpunkte", 0)]
[h: status = input("value|0|Modifikatoren eingeben")]
[h: abort(status)]
[h, if(isNumber(value)): modifier = value; modifier = eval(value)]
[h: dicepool = 2d10]
[h: valueEvaluated = dicepool + skill + ChaB + modifier - Belastung]
[h: result = 0]
[h, if(dicepool == 2): result=1]
[h, if(dicepool == 3): result=2]
[h, if(dicepool == 19): result=3]
[h, if(dicepool == 20): result=4]
[h, if(valueEvaluated > MW): result=5]
[r, switch(result):
case1: ""+skillname+": <span bgcolor='#FFFFFF' title='Wurf: "+dicepool+", FW: "+skill+"+"+ChaB+", Bel: "+Belastung+", Mod: "+modifier+"'> Kritischer Patzer </span>";
case2: ""+skillname+": <span bgcolor='#FFFFFF' title='Wurf: "+dicepool+", FW: "+skill+"+"+ChaB+", Bel: "+Belastung+", Mod: "+modifier+"'> Automatischer Fehlschlag </span>";
case3: ""+skillname+": <span bgcolor='#FFFFFF' title='Wurf: "+dicepool+", FW: "+skill+"+"+ChaB+", Bel: "+Belastung+", Mod: "+modifier+"'> Automatischer Erfolg </span>";
case4: ""+skillname+": <span bgcolor='#FFFFFF' title='Wurf: "+dicepool+", FW: "+skill+"+"+ChaB+", Bel: "+Belastung+", Mod: "+modifier+"'> Kritischer Erfolg </span>";
case5: ""+skillname+": Mindestwert "+MW+" mit <span bgcolor='#FFFFFF' title='Wurf: "+dicepool+", FW: "+skill+"+"+ChaB+", Bel: "+Belastung+", Mod: "+modifier+"'> "+valueEvaluated+" </span> erreicht.";
default: ""+skillname+": Mindestwert "+MW+" mit <span bgcolor='#FFFFFF' title='Wurf: "+dicepool+", FW: "+skill+"+"+ChaB+", Bel: "+Belastung+", Mod: "+modifier+"'> "+valueEvaluated+" </span> nicht erreicht.";]
[h: Kraftpunkte = min(Kraftpunkte - Kosten, KraftpunkteMax)]
[h: bar.Kraftpunkte = Kraftpunkte / KraftpunkteMax]