Macro time again, this is for all you manifesters out there(some assembly required...)
[h,macro("Max_PP@TOKEN"):""]
[h:max_PP=macro.return]
[h:status=input("spent||points to spend")]
[h:abort(status)]
[r,if(0>defense-spent):"Failed to manifest "]
[t,if(0>defense-spent):spent]
[r,if(0>defense-spent):" Point power, "]
[t,if(0>defense-spent):defense]
[r,if(0>defense-spent):" power points is insufficient for this power.<br>"]
[h,if(0>defense-spent):spent=0]
[h,if(defense-spent>max_PP):spent=0-max_PP+defense]
[h:defense=defense-spent]
Spends [t:spent] power points and has [t:defense] remaining.
Stuff that requires editing from time-to-time, typically upon changing character-level. I put them in the "Traits" group to keep it out of the way.
[h:level=5]
[h:max_overchannel=1]
[h:overchannel=max_overchannel]
[h,for(i,max_overchannel-1,0,-1,""):overchannel=overchannel+","+i]
[h:temp=input("use_overchannel|0|Using overchannel|CHECK",
"overchannel_bonus|"+overchannel+"|Raise M.L. by|LIST|VALUE=STRING",
"use_talented|0|Using talented|CHECK")]
[h:abort(temp)]
[h,if(use_overchannel):level=level+overchannel_bonus]
[r,if(use_overchannel&&use_talented):"Psionic focus has been lost.<br>"]
[e,if(use_overchannel&&use_talented==0),CODE:{
["Overchannel inflicts "]
[t:damage=eval(overchannel_bonus*2-1+"d8")]
["points of damage. "]
[e:HP=HP-damage]
<br>
};{}]
[h:macro.return=level]
[macro.return=40]
[h:number=2]
[h:names="burrowing,widen"]
[h:costs="2,4"]
[h:effects="Burrows through objects,Double area of effect"]
[h:output=json.set("{}","number",number)]
[h,for(n,0,number,1,""),CODE:{
[h:output=json.set(output,"name"+n,listGet(names,n))]
[h:output=json.set(output,"cost"+n,listGet(costs,n))]
[h:output=json.set(output,"effect"+n,listGet(effects,n))]
}]
[h:macro.return=output]
This one can be forgotten, as it shouldn't ever need to change. I put it in the "under" group because they are arranged in alphabetical order...
It uses the defense character variable to track power points.
It has one argument, the number of power points to deduct.
If there are enough power points it reduces the current power points and outputs the remaining power points, otherwise it outputs -1...
There is an obvious and easily corrected error within, however, it works and therefore I am not touching it...
[h:spent=macro.args]
[h,macro("Max_PP@TOKEN"):""]
[h:max_PP=macro.return]
[r,if(0>defense-spent),CODE:{
[h:macro.return=-1]
};{
[h:defense=defense-spent]
[h:macro.return=defense]
}]
This was placed this in a "powers" group. It should be fairly possible to change it to suit many different psionic powers...
/self
[h:power_level=1]
[e,macro("Manifester_Level@TOKEN"):""]
[h:ML=macro.return]
[h:cost=power_level*2-1]
[h:aug1_list=0]
[h:aug1_desc="PP for extra dice"]
[h:augment_rate=1]
[h,for(n,augment_rate,ML-cost+1,augment_rate,""):aug1_list=aug1_list+","+n]
[e,macro("Meta_Feats@TOKEN"):""]
[h:feats=macro.return]
[h:feat_input=""]
[h,for(n,0,json.get(feats,"number"),1,""):feat_input=feat_input+',"feat'+n+'|0|'+json.get(feats,'name'+n)+' for '+json.get(feats,'cost'+n)+'PP'+'|CHECK"']
[h:temp=eval('input("victim|"+getVisibleTokenNames()+"|Target|LIST|VALUE=STRING",
"points1|"+aug1_list+"|"+aug1_desc+"|LIST|VALUE=STRING"
'+feat_input+'
,"temp|"+ML+"|Maximum combined PP cost|LABEL")'
)]
[h:abort(temp)]
[h:cost=cost+points1]
[h,for(n,0,json.get(feats,"number"),1,""),CODE:{
[h,if(eval("feat"+n)):cost=cost+json.get(feats,"cost"+n)]
}]
[e,if(cost>ML),CODE:{
[h:temp=input("temp||Insufficient manifester level.|LABEL|TEXT=FALSE")]
[h:abort(0)]
};{
}]
[h,macro("Spend_Points@TOKEN"):cost]
[e,if(macro.return==-1),CODE:{
[h:temp=input("temp||Insufficient power points.|LABEL|TEXT=FALSE")]
[h:abort(0)]
};{
[h:remaining_points=macro.return]
}]
[h:DC=10+power_level+floor(Intelligence/2-5)+floor(points1/2)]
A power is manifested, [r:Victim] may make a DC [r:DC] reflex save for half of [t:eval(1+points1+"d6")] damage.<br>This will over-come a power resistance of [t:1d20+ML].
[r,for(n,0,json.get(feats,"number"),1,""),CODE:{
[r,if(eval("feat"+n)):"<br>"+json.get(feats,"effect"+n)]
}]
<br>Spent a total of [r:cost] power-points, [remaining_points] remain.
P.S.
creature." I mean, we both made our saves...