https://www.dropbox.com/s/53pya4k68mnvc ... ddly01.htm
Feedback is greatly appreciated.
Notes:
- *2014-03-11: New version, same link.
*2014-03-02: New version, same link.
Moderators: dorpond, trevor, Azhrei
Thanx, Lee.Lee wrote:Very nice!
This is exactly the kind of project I (personally) want to see out of the gates. You're right, what I evaluated was a prior version of TiddlyWiki. The newer one looks interesting.
Let me know if there's any way I can help
Code: Select all
[H: keyList = "weapon.name,weapon.category,weapon.encumbrance,weapon.threat,weapon.cost,weapon.damage,weapon.crit,weapon.range,weapon.weight,weapon.type,weapon.special,weapon.source"]
Code: Select all
@@ @addWeapon
@PROPS@ fontColor=black ; autoExecute=true ; fontSize=11pt ; sortBy= ; color=default ; playerEditable=false ; applyToSelected=false ; group=Weapon ; tooltip= ; minWidth= ;
<!-- addWeapon() -->
[H: weaponList = getLibProperty("weaponList.input")]
[H: weaponNameList = json.fields(weaponList)]
[H: abort(input("tip|<html><font size=6><b><center>Pick Base Weapon</center></b></font></html>|Pick Base Weapon|LABEL|SPAN=TRUE",
strformat("select|%{weaponNameList}||LIST|SPAN=TRUE")))]
[R: json.get(weaponList,listGet(weaponNameList,select))]
!!
@@ @<b>initWeaponData</b>
@PROPS@ fontColor=white ; autoExecute=true ; fontSize=11pt ; sortBy= ; color=red ; playerEditable=true ; applyToSelected=false ; group=~Run at your own risk ; tooltip= ; minWidth=94 ;
[H: rawData = json.append("",
"Aklys Exotic Light Melee 5 1d8 20x2 20 2 Blunt Performance,Trip UC",
"Ammentum Martial Ranged Ranged 0 1d6 20x2 50 1 Pierce Performance UC",
"Axe, Boarding Martial Light Melee 6 1d6 20x3 0 3 Pierce,Slash PoIS",
"Axe, Hooked Exotic OneHand Melee 20 1d8 20x3 0 7 Slash Disarm,Performance,Trip UC",
"Axe, Knuckle Exotic Light Melee 9 1d6 20x3 0 2 Slash Monk,Performance UC",
"Axe, Orc Double Exotic TwoHand Melee 60 1d8/1d8 20x3/20x3 0 15 Slash/Slash Double CRB",
"Axe, Throwing Martial Light Melee 8 1d6 20x2 10 2 Slash CRB",
"Battle Ladder Exotic TwoHand Melee 20 1d6/1d6 20x2/20x2 0 8 Blunt/Blunt Trip GoG",
"Battleaxe Martial OneHand Melee 10 1d8 20x3 0 6 Slash CRB",
"Bayonet Simple TwoHand Melee 5 1d6 20x2 0 1 Pierce APG",
"Blowgun Simple Ranged Ranged 2 1d2 20x2 20 1 Pierce CRB",
"Boarding Gaff Exotic TwoHand Melee 8 1d6/1d6 20x2/20x2 0 8 Slash/Slash Double,Reach,Trip PoIS",
"Boarding Pike Simple TwoHand Melee 8 1d8 20x3 0 9 Pierce Brace,Reach PoIS",
"Bola Exotic Ranged Thrown 5 1d4 20x2 10 2 Blunt Nonlethal,Trip CRB",
"Bola, Brutal Exotic Ranged Thrown 15 1d4 20x2 10 2 Blunt,Pierce Trip ISWG",
"Boomerang Exotic Ranged Thrown 3 1d6 20x2 30 3 Blunt APG",
"Bow, Thorn Exotic Ranged Ranged 50 1d6 20x3 40 2 Pierce AA",
"Brass Knife Simple Light Melee 2 1d4 19x2 10 1 Pierce,Slash Fragile PoIS",
"Brass Knuckles Simple Light Melee 1 1d3 20x2 0 1 Blunt Monk AA,APG",
"Cat-O'-Nine-Tails Martial Light Melee 1 1d4 20x2 0 1 Slash Disarm,Nonlethal PoIS",
"Cestus Simple Light Melee 5 1d4 19x2 0 1 Blunt,Pierce Monk APG",
"Chain, Spiked Exotic TwoHand Melee 25 2d4 20x2 0 10 Pierce Disarm,Trip CRB",
"Chakram Martial Ranged Ranged 1 1d8 20x2 30 1 Slash APG",
"Club Simple OneHand Melee 0 1d6 20x2 10 3 Blunt CRB",
"Club, Mere Simple OneHand Melee 2 1d4 20x2 0 2 Blunt,Pierce Fragile AA",
"Crossbow, Double Exotic Ranged Ranged 300 1d8 19x2 80 18 Pierce APG",
"Crossbow, Hand Exotic Ranged Ranged 100 1d4 19x2 30 2 Pierce CRB",
"Crossbow, Heavy Simple Ranged Ranged 50 1d10 19x2 120 8 Pierce CRB",
"Crossbow, Heavy (Underwater) Simple Ranged Ranged 100 1d10 19x2 120 8 Pierce ARG",
"Crossbow, Light Simple Ranged Ranged 35 1d8 19x2 80 4 Pierce CRB",
"Crossbow, Light (Underwater) Simple Ranged Ranged 70 1d8 19x2 80 4 Pierce ARG",
"Crossbow, Repeating Exotic Ranged Ranged 250 1d8 19x2 80 6 Pierce CRB",
"Crossbow, Repeating Heavy Exotic Ranged Ranged 400 1d10 19x2 120 12 Pierce CRB",
"Curve Blade, Elven Exotic TwoHand Melee 80 1d10 18x2 0 7 Slash CRB",
"Cutlass Martial OneHand Melee 15 1d6 18x2 0 4 Slash PoIS",
"Dagger Simple Light Melee 2 1d4 19x2 10 1 Pierce,Slash CRB",
"Dagger, Punching Simple Light Melee 2 1d4 20x3 0 1 Pierce CRB",
"Dagger, Swordbreaker Exotic Light Melee 10 1d4 20x2 0 3 Slash Disarm,Sunder APG",
"Dart Simple Ranged Thrown 0.5 1d4 20x2 20 0.5 Pierce CRB",
"Dogslicer Martial Light Melee 8 1d6 19x2 0 1 Slash Fragile ARG",
"Dorn Dergar, Dwarven Exotic TwoHand Melee 50 1d10 20x2 0 15 Blunt Reach DoG",
"Earth Breaker Martial TwoHand Melee 40 2d6 20x3 0 14 Blunt ISWG",
"Falcata Exotic OneHand Melee 18 1d8 19x3 0 4 Slash APG",
"Falchion Martial TwoHand Melee 75 2d4 18x2 0 8 Slash CRB",
"Fauchard Exotic TwoHand Melee 14 1d10 18x2 0 10 Slash Reach,Trip CHR",
"Flail Martial OneHand Melee 8 1d8 20x2 0 5 Blunt Disarm,Trip CRB",
"Flail, Dire Exotic TwoHand Melee 90 1d8/1d8 20x2/20x2 0 10 Blunt/Blunt Disarm,Double,Trip CRB",
"Flail, Heavy Martial TwoHand Melee 15 1d10 19x2 0 10 Blunt Disarm,Trip CRB",
"Flailpole Exotic TwoHand Melee 15 1d8 20x2 0 10 Slash Reach,Trip GoG",
"Flambard Exotic TwoHand Melee 50 1d10 19x2 0 6 Slash Sunder AA",
"Flindbar Exotic OneHand Melee 30 2d4 19x2 0 2 Blunt Disarm CMR",
"Flying Blade Exotic TwoHand Melee 40 1d12 20x3 0 12 Slash Performance,Reach UC",
"Flying Talon Exotic Light Melee 15 1d4 20x2 10 5 Pierce Disarm,Trip D1",
"Gauntlet Simple Unarmed Melee 2 1d3 20x2 0 1 Blunt CRB",
"Gauntlet, Spiked Simple Light Melee 5 1d4 20x2 0 1 Pierce CRB",
"Gladius Martial Light Melee 15 1d6 19x2 0 3 Pierce,Slash Performance UC",
"Glaive Martial TwoHand Melee 8 1d10 20x3 0 10 Slash Reach CRB",
"Grappling Hook Exotic Ranged Thrown 6 1d6 20x2 10 14 Pierce Grapple PoIS",
"Greataxe Martial TwoHand Melee 20 1d12 20x3 0 12 Slash CRB",
"Greatclub Martial TwoHand Melee 5 1d10 20x2 0 8 Blunt CRB",
"Greatsword Martial TwoHand Melee 50 2d6 19x2 0 8 Slash CRB",
"Guisarme Martial TwoHand Melee 9 2d4 20x3 0 12 Slash Reach,Trip CRB",
"Halberd Martial TwoHand Melee 10 1d10 20x3 0 12 Pierce,Slash Brace,Trip CRB",
"Hammer, Gnome Hooked Exotic TwoHand Melee 20 1d8/1d6 20x3/20x4 0 6 Blunt/Pierce Double,Trip CRB",
"Hammer, Light Martial Light Melee 1 1d4 20x2 20 2 Blunt CRB",
"Handaxe Martial Light Melee 6 1d6 20x3 0 3 Slash CRB",
"Harpoon Exotic TwoHand Melee 5 1d8 20x3 10 16 Pierce Grapple PoIS",
"Hook Hand Simple Light Melee 10 1d4 20x2 0 1 Slash Disarm PoIS",
"Horsechopper Martial TwoHand Melee 10 1d10 20x3 0 12 Pierce,Slash Reach,Trip ARG",
"Hunga Munga Martial Ranged Melee 4 1d6 20x2 15 3 Pierce AA",
"Javelin Simple Ranged Thrown 1 1d6 20x2 30 2 Pierce CRB",
"Kama Exotic Light Melee 2 1d6 20x2 0 2 Slash Monk,Trip CRB",
"Katar, Tri-Bladed Exotic Light Melee 6 1d4 20x4 0 2 Pierce PCS",
"Khopesh Exotic OneHand Melee 20 1d8 19x2 0 8 Slash Trip APG",
"Klar Martial OneHand Melee 12 1d6 20x2 0 6 Slash ISWG",
"Knife, Butterfly Exotic Light Melee 5 1d4 19x2 0 1 Pierce,Slash AA",
"Knife, Switchblade Martial Light Melee 5 1d4 19x2 10 1 Pierce AA",
"Kobold Tail Attachment, Long Lash Martial Light Melee 15 1d6 20x2 0 1 Slash Reach ARG",
"Kobold Tail Attachment, Pounder Martial Light Melee 1 1d8 20x2 0 4 Blunt ARG",
"Kobold Tail Attachment, Razored Martial Light Melee 3 1d8 19x2 0 2 Slash ARG",
"Kobold Tail Attachment, Spiked Martial Light Melee 3 1d8 20x3 0 2 Pierce ARG",
"Kobold Tail Attachment, Sweeper Martial Light Melee 7 1d6 20x2 0 3 Blunt Trip ARG",
"Kukri Martial Light Melee 8 1d4 18x2 0 2 Slash CRB",
"Lance Martial TwoHand Melee 10 1d8 20x3 0 10 Pierce Reach CRB",
"Longaxe, Dwarven Exotic TwoHand Melee 50 1d12 20x3 0 14 Slash Reach ARG",
"Longbow Martial Ranged Ranged 75 1d8 20x3 100 3 Pierce CRB",
"Longbow, Composite Martial Ranged Ranged 100 1d8 20x3 110 3 Pierce CRB",
"Longhammer, Dwarven Exotic TwoHand Melee 70 2d6 20x3 0 20 Blunt Reach ARG",
"Longspear Simple TwoHand Melee 5 1d8 20x3 0 9 Pierce Brace,Reach CRB",
"Longsword Martial OneHand Melee 15 1d8 19x2 0 4 Slash CRB",
"Mace, Heavy Simple OneHand Melee 12 1d8 20x2 0 8 Blunt CRB",
"Mace, Light Simple Light Melee 5 1d6 20x2 0 4 Blunt CRB",
"Maulaxe, Dwarven Exotic Light Melee 25 1d6 20x3 10 5 Blunt,Slash AA",
"Morningstar Simple OneHand Melee 8 1d8 20x2 0 6 Blunt,Pierce CRB",
"Nunchaku Exotic Light Melee 2 1d6 20x2 0 2 Blunt Disarm,Monk CRB",
"Ogre Hook Martial TwoHand Melee 24 1d10 20x3 0 10 Pierce Trip ISWG",
"Pick, Heavy Martial OneHand Melee 8 1d6 20x4 0 6 Pierce CRB",
"Pick, Light Martial Light Melee 4 1d4 20x4 0 3 Pierce CRB",
"Pickaxe Martial TwoHand Melee 14 1d8 20x4 0 12 Pierce AP14",
"Quadrens Exotic Light Melee 8 1d6 19x2 0 2 Pierce Performance UC",
"Quarterstaff Simple TwoHand Melee 0 1d6/1d6 20x2/20x2 0 4 Blunt/Blunt Double,Monk CRB",
"Ranseur Martial TwoHand Melee 10 2d4 20x3 0 12 Pierce Disarm,Reach CRB",
"Rapier Martial OneHand Melee 20 1d6 18x2 0 2 Pierce CRB",
"Ratfolk Tailblade Martial Light Melee 11 1d3 20x2 0 0.5 Slash ARG",
"Rhoka Exotic OneHand Melee 5 1d8 18x2 0 6 Slash AA",
"Rope Gauntlet Exotic Light Melee 0.2 1d4 20x2 0 2 Blunt,Slash AA",
"Sabre, Sawtooth Exotic OneHand Melee 35 1d8 19x2 0 2 Slash ISWG",
"Sai Exotic Light Melee 1 1d4 20x2 0 1 Blunt Disarm,Monk CRB",
"Sap Martial Light Melee 1 1d6 20x2 0 2 Blunt Nonlethal CRB",
"Scarf, Bladed Exotic TwoHand Melee 12 1d6 20x2 0 2 Slash Disarm,Trip ISWG",
"Scimitar Martial OneHand Melee 15 1d6 18x2 0 4 Slash CRB",
"Scizore Martial OneHand Melee 20 1d10 20x2 0 3 Pierce UC",
"Scythe Martial TwoHand Melee 18 2d4 20x4 0 10 Pierce,Slash Trip CRB",
"Sea-Knife Martial Light Melee 8 1d4 19x2 0 1 Slash ARG",
"Shield, Heavy Steel Martial OneHand Melee 20 1d4 20x2 0 15 Blunt CRB",
"Shield, Light Steel Martial Light Melee 9 1d3 20x2 0 6 Blunt CRB",
"Shortbow Martial Ranged Ranged 30 1d6 20x3 60 2 Pierce CRB",
"Shortbow, Composite Martial Ranged Ranged 75 1d6 20x3 70 2 Pierce CRB",
"Shortspear Simple OneHand Melee 1 1d6 20x2 20 3 Pierce CRB",
"Shotel Exotic OneHand Melee 30 1d8 20x3 0 3 Pierce Performance UC",
"Shuriken Exotic Ranged Thrown 0.2 1d2 20x2 10 0.1 Pierce Monk CRB",
"Siangham Exotic Light Melee 3 1d6 20x2 0 1 Pierce Monk CRB",
"Sica Exotic Light Melee 10 1d6 20x2 0 2 Slash Performance UC",
"Sickle Simple Light Melee 6 1d6 20x2 0 2 Slash Trip CRB",
"Sling Simple Ranged Thrown 0 1d4 20x2 50 0 Blunt CRB",
"Sling Glove Exotic Ranged Thrown 5 1d4 20x2 50 2 Blunt AA",
"Sling Staff, Halfling Exotic Ranged Thrown 20 1d8 20x3 80 3 Blunt CRB",
"Sling, Stitched Exotic Ranged Thrown 0 1d6 20x2 0 1 Blunt Disarm,Trip HoG",
"Spear Simple TwoHand Melee 2 1d8 20x3 20 6 Pierce Brace CRB",
"Starknife Martial Light Melee 24 1d4 20x3 20 3 Pierce CRB",
"Sword, Bastard Exotic OneHand Melee 35 1d10 19x2 0 6 Slash CRB",
"Sword, Dueling Exotic OneHand Melee 20 1d8 19x2 0 3 Slash ISWG",
"Sword, Short Martial Light Melee 10 1d6 19x2 0 2 Pierce CRB",
"Sword, Two-Bladed Exotic TwoHand Melee 100 1d8/1d8 19x2/19x2 0 10 Slash/Slash Double CRB",
"Terbutje Martial OneHand Melee 5 1d8 19x2 0 2 Slash Fragile AA",
"Terbutje, Steel Martial OneHand Melee 20 1d8 19x2 0 4 Slash AA",
"Thorn Bracer Exotic Light Melee 30 1d6 20x2 0 3 Pierce PCS",
"Trident Martial OneHand Melee 15 1d8 20x2 10 4 Pierce Brace CRB",
"Unarmed Strike Simple Unarmed Melee 0 1d3 20x2 0 0 Blunt Nonlethal CRB",
"Urgrosh, Dwarven Exotic TwoHand Melee 50 1d8/1d6 20x3/20x3 0 12 Slash/Pierce Brace,Double CRB",
"War Razor Martial Light Melee 8 1d4 19x2 0 1 Slash ISWG",
"Waraxe, Dwarven Exotic OneHand Melee 30 1d10 20x3 0 8 Slash CRB",
"Warhammer Martial OneHand Melee 12 1d8 20x3 0 5 Blunt CRB",
"Whip Exotic OneHand Melee 1 1d3 20x2 0 2 Slash Disarm,Nonlethal,Reach,Trip CRB",
"Whip, Scorpion Exotic Light Melee 5 1d4 20x2 0 3 Slash Disarm,Performance,Reach,Trip UC",
"Wooden Stake Simple Light Melee 0 1d4 20x2 10 1 Pierce APG"
)]
[H: keyList = "weapon.name,weapon.category,weapon.encumbrance,weapon.threat,weapon.cost,weapon.damage,weapon.crit,weapon.range,weapon.weight,weapon.type,weapon.special,weapon.source"]
[H: TAB = decode("%09")]
[H: weaponList = "{}"]
[H: inputTemplate = "<html><table><td width=350><b>%{input.name}</b> %{input.categories}</td><td width=50><b color=blue>%{input.damage}</b></td><td width=75><b color=red>%{input.critical}</b></td><td width=50><b>%{input.range}</b></td><td width=100><b><i>%{input.special}</i></b></td></table></html>"]
[H: weaponInputList = json.set("{}","<html><table><td width=350><b>Name (Categories)</b></td><td width=50><b>Damage</b></td><td width=75><b>Critical</b></td><td width=50><b>Range</b></td><td width=125><b>Special</b></td></table></html>","")]
[H, foreach(data,rawData), code: {
[H: weaponName = listGet(data,0,TAB)]
[H: propName = "weapon." + am.pf.cleanProp(weaponName)]
[H: obj = "{}"]
[H, foreach(prop,keyList): obj = json.set(obj,prop,listGet(data,roll.count,TAB))]
[H: setLibProperty(propName,obj)]
[H: weaponList = json.set(weaponList,weaponName,propName)]
[H: input.name = replace(weaponName,",",",")]
[H: input.categories = strformat("(%s/%s/%s/%s)",listGet(data,1,TAB),listGet(data,2,TAB),listGet(data,3,TAB),replace(listGet(data,9,TAB),",",","))]
[H: input.damage = listGet(data,5,TAB)]
[H: input.critical = listGet(data,6,TAB)]
[H: input.range = listGet(data,7,TAB)]
[H, if(! input.range): input.range = " "]
[H: input.special = trim(replace(listGet(data,10,TAB),",",","))]
[H, if(json.isEmpty(input.special)): input.special = " "]
[H: inputListName = strformat(inputTemplate)]
[H: weaponInputList = json.set(weaponInputList,inputListName,propName)]
}]
[H: setLibProperty("weaponList",weaponList)]
[H: setLibProperty("weaponList.input",weaponInputList)]
!!