Advertisement
TorroesPrime

Untitled

Jan 10th, 2022
777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.43 KB | None | 0 0
  1. import json
  2. from character import *
  3.  
  4. def dictMapping(inputData):
  5.     charData = {
  6.         "fName":inputData.get("fName","mapping"),
  7.         "lName":inputData.get("lName","mapping"),
  8.         "WS":inputData.get("WS",0),
  9.         "BS":inputData.get("BS",0),
  10.         "Strength":inputData.get("Stregnth",0),
  11.         "Toughness":inputData.get("Toughness",0),
  12.         "Agility":inputData.get("Agility",0),
  13.         "Intelligence":inputData.get("Intelligence",0),
  14.         "Perception":inputData.get("Perception",0),
  15.         "Intelligence":inputData.get("Intelligence",0),
  16.         "WP":inputData.get("WP",0),
  17.         "Fell":inputData.get("Fell",0),
  18.         "tWounds":inputData.get("tWounds",0),
  19.         "cWounds":inputData.get("cWounds",0),
  20.     }
  21.     return character(fName=charData["fName"],lName=charData["lName"],WS=charData["WS"],\
  22.     BS=charData["BS"],Strength=charData["Strength"],Toughness=charData["Toughness"],\
  23.     Agility=charData["Agility"],Intelligence=charData["Intelligence"],\
  24.     Perception=charData["Perception"],WP=charData["WP"],\
  25.     Fell=charData["Fell"],tWounds=charData["tWounds"],\
  26.     cWounds=charData["cWounds"])
  27.  
  28. testCharData ={"race":'human',
  29. "fName": "Diaz",
  30. "lName":"Lan",
  31. "BS": 38,
  32. "WS": 52,
  33. "Strength": 35,
  34. "Toughness": 41,
  35. "Agility": 44,
  36. "Intelligence": 52,
  37. "Perception": 43,
  38. "WP": 39,
  39. "Fell": 47,
  40. "Home world": "Devo Sierra",
  41. "motivation": "profit",
  42. "Gender": "Male",
  43. "tWounds": 17,
  44. "cWounds":0,
  45. "skills": ["Awareness (perception)","Carouse (toughness)","Charm (fellowship)+20","Command (fellowship) +10","Common Lore (Imperium)","Common Lore (Jericho Reach)","Common Lore (Koronus Expanse)","Common Lore (Rogue Traders)","Deceive (fellowship)","Dodge (Agility)","Evaluate (Intelligence) +10","Forbidden Lore (Xenos)","Literacy (Intelligence) +10","Pilot (Space Craft) +20","Scholastic Lore (Astromancy)","Scrutiny (Perception)","SpeakLanguage(Low Gothic)","SpeakLanguage(High Gothic)","SpeakLanguage(Eldar)","Tactics (Intelligence)","Tech-Use (intelligence)"],
  46. "traits": ["Air of Authority","Ambidextrous","Deadeye Shot","Master Orator","Melee Weapon Training (Universal)","Mighty Shot","Peer (Imperial Navy)","Pistol Weapon Training (Universal)","Nerves of Steel","Quick Draw","Step Aside","Touched by the Fates (2)","Two-Weapon Wielder (Ballistic)"]
  47. }
  48.  
  49.  
  50. testingCharacter = dictMapping(testCharData)
  51.  
  52. testingCharacter.setCharacteristicByName("Will Power",5)
  53. testingCharacter.setCharacteristicByName("SP",5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement