Action Points

Discussion concerning lmarkus' campaign framework for D&D3.x and Pathfinder.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice, lmarkus001

Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)
Post Reply
neofax
Great Wyrm
Posts: 1694
Joined: Tue May 26, 2009 8:51 pm
Location: Philadelphia, PA
Contact:

Action Points

Post by neofax »

lmarkus wrote:There are several answers to this question.

First, if you are using Plothos or Wrathgon's Spell Manager, you can just create at Special Ability (Action Point). This is fairly clean and has you and your players looking in the same place for spells and abilities.

Way back when, I implemented a token based Action Point mechanism. This requires a macro on each token that has action points, and the macro changes color (green = available, red=all out). The token macro also reports the number of APs available in the macro name. The Rest macro works with this to restore the token to 1 action point. The Action Point token macro does work if the number of available points is > 1, but I don't have anything that directly increases the quantity (but it should be straight forward as it is stored as a JSON:

Code:

Code: Select all

"ActionPoint":{
   "Type":"Daily",
   "Quantity":1,
   "Used":0,
   "ButtonLabel":"Action Point (1 left)"
}

The Rest macro calls subResetDaily which is a nice base towards modifying the AP count:

Code: Select all

[H: tToken = getStrProp(macro.args, "Token")]

[H: switchToken(tToken)]

[H, IF(json.type(PrivateJSON) == "UNKNOWN" || json.isEmpty(PrivateJSON)), CODE: { };{
    [H, FOREACH(prop, json.fields(PrivateJSON)), CODE: {
      [H: jO = json.get(PrivateJSON, prop)]
      [H: act = 0]
      [H, IF(json.contains(jO, "Type")): act = if(json.get(jO, "Type") == "Daily", 1, 0)]
      [H, IF(act): jO = json.set(jO, "Used", 0)]

      [H: act2 = if(prop == "ActionPoint", 1, 0)]
      [H, IF(act && act2): btnLbl = "Action Point (" + json.get(jO, "Quantity") + " left)"]
      [H, IF(act && act2): macroP = json.set("{}", "label", btnLbl, "color", "green")]
      [H, IF(act && act2): setMacroProps(json.get(jO, "ButtonLabel"), macroP)]
      [H, IF(act && act2): jO = json.set(jO, "ButtonLabel", btnLbl)]

      [H, IF(act): PrivateJSON = json.set(PrivateJSON, prop, jO)]

    }]
}] 
Here is the way I handled it using the foundation lmarkus built:
GiveActionPointJSON

Code: Select all

[H: assert( isGM(), "<b>" + getMacroName() + "</b> is a GM only macro.", 0 )]
[H: jO = "{}"]
[H, IF(json.type(PrivateJSON) == "UNKNOWN" || json.isEmpty(PrivateJSON)), CODE: {
  [H: tAPq = 0]
  [H: jO = json.set(jO, "Type", "Daily")]
  [H: jO = json.set(jO, "Quantity", tAPq)]
  [H: jO = json.set(jO, "Used", tAPq)]
  [H: butLab = if(tAPq > 0, "Action Point (0 left)", "Action Point (USED)")]
  [H: macroP = json.set("{}", "label", butLab)]
  [H: jO = json.set(jO, "ButtonLabel", butLab)]
  [H: PrivateJSON = json.set(PrivateJSON, "ActionPoint", jO)]
  [H: butC = if(tAPq > 0, "green", "red")]
  [H: macroP = json.set(macroP, "color", butC)]
};{
  [H, IF(json.contains(PrivateJSON, "ActionPoint")), CODE: {
	  [H: jO = json.get(PrivateJSON, "ActionPoint")]
	};{
	  [H: tAPq = 0]
	  [H: jO = json.set(jO, "Type", "Daily")]
	  [H: jO = json.set(jO, "Quantity", tAPq)]
	  [H: jO = json.set(jO, "Used", tAPq)]
	  [H: butLab = if(tAPq > 0, "Action Point (0 left)", "Action Point (USED)")]
	  [H: macroP = json.set("{}", "label", butLab)]
	  [H: jO = json.set(jO, "ButtonLabel", butLab)]
	  [H: PrivateJSON = json.set(PrivateJSON, "ActionPoint", jO)]
	  [H: butC = if(tAPq > 0, "green", "red")]
	  [H: macroP = json.set(macroP, "color", butC)]
	}]
}]
[H, IF(json.contains(PrivateJSON, "ActionPoint")): jO = json.get(PrivateJSON, "ActionPoint")]
[H: tAPq = json.get(jO, "Quantity")]
[H: tAPu = json.get(jO, "Used")]
[IF(tAPq > 4), CODE: {
  [G: "Player already at max Action Points!"]
};{
  [H: tAPq = (tAPq +1)]
  [H: jO = json.set(jO, "Quantity", tAPq)]
  [H: butLab = if(tAPq > 0, "Action Point (" + (tAPq - tAPu) + " left)", "Action Point (USED)")]
  [H: macroP = json.set("{}", "label", butLab)]
  [H: jO = json.set(jO, "ButtonLabel", butLab)]
  [H: PrivateJSON = json.set(PrivateJSON, "ActionPoint", jO)]
  [H: butC = if(tAPq > 0, "green", "red")]
  [H: macroP = json.set(macroP, "color", butC)]
  [G: "Action Point received. Total Action Points:" + tAPq]
}]
This will allow the GM to give out 5 Action Points and the players to spend them as they see fit. Just need to test if the reset daily sets the quantity back to 1. If so, I will fix that as well.

**Tested and works fine now.

Post Reply

Return to “D&D 3.5/Pathfinder 1e Campaign Macros”