browser icon
You are using an insecure version of your web browser. Please update your browser!
Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.

Add a New Shield Macro

Posted by on August 13, 2010

Quick macro based on the add new weapon macro.  Shields will be classified in the weapon list as they are held in the hand and can be used to bash.  They get another property, “DB,” which will be used to check for Block defense options during defense macros (if the left hand weapon doesn’t have a DB, the character can’t block).  Also, I added the skill “Shield (Buckler)” to the SkillsMelee array, and added the “none” option under the parry dropdown list, which is good since I forgot there are other melee weapons that can’t parry.

<!– Add_New_Shield –>

<!– Adding a new shield. –>

[h: weaponList2 = getLibProperty(“WeaponList”, “Lib:Weapons”)]

<!– The property SkillsMelee on the library token must be defined as a JSON array containing all melee skill names to be used in the campaign. –>

[h: SkillList= json.toList(SkillsMelee)]

<!– Define the shield’d basic parameters and the primary attack mode (bash).  Additional modes to be added after weapon creation in a different macro. –>

[h: newWeapon =
input(
“wName|No Weapon|Weapon Name|TEXT”,
“wWeight||Weight|TEXT”,
“wDR||DR (for breakage)|TEXT”,
“wMaxHP||Maximum HP|TEXT”,
“wDB|1,2,3|DB|RADIO|ORIENT=H SELECT=0 VALUE=STRING”,

“wAttackLabel|Shield Bash|Attack Label|TEXT”,
“wSkill1|”+SkillList+”|Skill Used|LIST|SELECT=19 VALUE=STRING”,
“wDamBase1|none,thrust,swing,static|Damage Base 1|LIST|SELECT=1 VALUE=STRING”,
“wDamMod1|0|Damage Modifier 1 (0/+#/-#/dice expression)|TEXT”,
“wDamType1|crushing,cutting,impaling,pi-,pi,pi+,pi++|Damage Type 1|LIST|SELECT=0 VALUE=STRING”,
“wReach1|0,0-1,1,1-2,1-3,1-4,1-7,2,2-3,4|Reaches (C = 0)|LIST|SELECT=2 VALUE=STRING”,
“wGripChange1|0|Ready Maneuver to Change Grip?|CHECK”,
“wParry1|0,0U,0F,-1,-2U,+2,none|Parry|LIST|SELECT=6 VALUE=STRING”,
“wMinST1||Minimum Strength|TEXT”,
“wHand1|1H,2H,2H Unready|Hands|RADIO|ORIENT=H SELECT=0 VALUE=STRING”,
“wStuck1|0|Can get stuck?|CHECK”

)]

<!– Create the new weapon JSON object and the first attack sub-object to store to the master WeaponList array.  If the OK button is clicked without changing the No Weapon default, do not execute. –>

[r, if (wName != “No Weapon”), code:
{
[h: weaponStats = “{}”]
[h: attackStats = “{}”]
[h: attacks = “{}”]

[h: weaponStats = json.set(weaponStats, “Name”, wName)]
[h: weaponStats = json.set(weaponStats, “Weight”, wWeight)]
[h: weaponStats = json.set(weaponStats, “DR”, wDR)]
[h: weaponStats = json.set(weaponStats, “MaxHP”, wMaxHP)]

[h: weaponStats = json.set(weaponStats, “DB”, wDB)]

[h: attackStats = json.set(attackStats, “Label”, wAttackLabel)]
[h: attackStats = json.set(attackStats, “Skill”, wSkill1)]
[h: attackStats = json.set(attackStats, “DamBase”, wDamBase1)]
[h: attackStats = json.set(attackStats, “DamMod”, wDamMod1)]
[h: attackStats = json.set(attackStats, “DamType”, wDamType1)]
[h: attackStats = json.set(attackStats, “Reach”, wReach1)]
[h: attackStats = json.set(attackStats, “GripChange”, wGripChange1)]
[h: attackStats = json.set(attackStats, “Parry”, wParry1)]
[h: attackStats = json.set(attackStats, “MinST”, wMinST1)]
[h: attackStats = json.set(attackStats, “Hand”, wHand1)]
[h: attackStats = json.set(attackStats, “Stuck”, wStuck1)]

<!– Add the Attacks sub-object to hold all attacks for easy sorting –>

[h: attacks = json.set(attacks, wAttackLabel, attackStats)]
[h: weaponStats = json.set(weaponStats, “Attacks”, attacks)]

[h: weaponList2 = json.set(weaponList2, wName, weaponStats)]

[h: setLibProperty(“WeaponList”, weaponList2, “Lib:Weapons”)]

Weapon ‘[r: wName]’ added to WeaponList.
};
{ No shield added. }]

One Response to Add a New Shield Macro

  1. Max Longstreet

    I enjoy reading all these macros and code almost as much as I enjoy spending time in Frog!

Leave a Reply

Your email address will not be published. Required fields are marked *