Advertisement
Kovitikus

Untitled

Aug 16th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 12.66 KB | None | 0 0
  1. """
  2. [Success: 16 Roll: 21] Using the center of a quarterstave as a fulcrum, you swat at dum with one end
  3. of the weapon! <built-in method capitalize of str object at 0x00000240E142EEB0> suffers a small
  4. bruise to its head.
  5. """
  6.  
  7. """generic_str MODULE"""
  8. vowels = ['a', 'e', 'i', 'o', 'u']
  9.  
  10. consonant_vowels = ['amazigh', 'euboean', 'eucharist', 'eumenides', 'eurasian', 'euro-american', 'europe',
  11. 'european', 'eusebius', 'oaxaca', 'ouija', 'ucalegon', 'uclaf', 'udale',
  12. 'udall', 'udy', 'ueberroth', 'uganda', 'uinita', 'ukase', 'ukie', 'ukraine', 'ukrainian', 'ullyses', 'unakas',
  13. 'uniate', 'unix', 'uranus', 'usanian', 'usonian', 'utah', 'utahn', 'utonian', 'esclop', 'eucalyptus', 'eucatastrophe',
  14. 'euchologion', 'euchre', 'euclidianness', 'eudaemon', 'eudemonia', 'eugarie', 'eugenesis', 'eugenics', 'eugenist',
  15. 'eugeny', 'euglena', 'eukaryote', 'eulachon', 'eulogy', 'eunoia', 'eunuch', 'euouae', 'euphemism', 'euphoria',
  16. 'euphoriant', 'eureka', 'euro', 'eustasy', 'eustress', 'eutectic', 'euth', 'euthanasia', 'eutripsia', 'ewe', 'ewer',
  17. 'latmul', 'once', 'oncer', 'one', 'onesie', 'ouabain', 'ubac', 'uberty', 'ubication', 'ubicity', 'ubiety', 'ubiquity',
  18. 'udometer', 'uey', 'ufo', 'ufologist', 'ufology', 'uke', 'ukelele', 'ukulele', 'ululate', 'ululation', 'unanimity',
  19. 'unanimous', 'unary', 'uni', 'unicameral', 'unicorn', 'unicycle', 'unidirection', 'unidirectional', 'unidirectionality',
  20. 'uniform', 'uniformitarianism', 'unify', 'unigeniture', 'union', 'unique', 'uniquity', 'unisex', 'unison', 'unit', 'unite',
  21. 'unity', 'univalence', 'univalent', 'universalism', 'universe', 'university', 'univocal', 'upas', 'upsilon', 'uraeus',
  22. 'ural', 'uranism', 'uranist', 'uranium', 'uranophobia', 'urea', 'ureter', 'ureteroureterostomy', 'urethra', 'uridine',
  23. 'urinal', 'urinalysis', 'urine', 'urology', 'uropygium', 'urus', 'usability', 'usage', 'use', 'user', 'using', 'usual',
  24. 'usufruct', 'usufruction', 'usufructuary', 'usurer', 'usuress', 'usurp', 'usurper', 'usurping', 'usury', 'ute', 'utensil',
  25. 'uterus', 'utile', 'utilitarian', 'utility', 'utopia', 'utopographer', 'utricle', 'uvarovite', 'uvas', 'uvea', 'uvula',
  26. 'uvular', 'zzxjoanw']
  27.  
  28. def article(word):
  29.     word.lower()
  30.  
  31.     if word[0] in vowels:
  32.         article = 'an'
  33.     elif word in consonant_vowels:
  34.         article = 'a'
  35.     else:
  36.         article = 'a'
  37.     return article
  38.  
  39. def pronoun(char):
  40.     if not char.attributes.has('figure'):
  41.         possessive = 'its'
  42.         singular_subject = 'it'
  43.         singular_object = 'it'
  44.     elif char.db.figure['gender'] == 'male':
  45.         possessive = 'his'
  46.         singular_subject = 'he'
  47.         singular_object = 'him'
  48.     elif char.db.figure['gender'] == 'female':
  49.         possessive = 'hers'
  50.         singular_subject = 'she'
  51.         singular_object = 'her'
  52.     return possessive, singular_subject, singular_object
  53.  
  54. def proper_name(char):
  55.     if not char.attributes.has('figure'):
  56.         name = char.key
  57.     elif char.db.figure['gender'] == 'male' or 'female':
  58.         name = char.key.capitalize
  59.     return name
  60.  
  61.  
  62.  
  63.  
  64. """build_skill_str MODULE"""
  65. from world import generic_str
  66.  
  67. article = generic_str.article
  68. pronoun = generic_str.pronoun
  69. prop_name = generic_str.proper_name
  70.  
  71. def create_attack_desc(attacker, target, skillset, skill, damage_type, damage_tier, body_part, hit):
  72.     # Temp Values
  73.     weapon = 'quarterstave'
  74.  
  75.     wound_tier = {'slash': ['shallow cut', 'cut', 'deep cut', 'severe cut', 'devastating cut'],
  76.                 'pierce': ['faint wound', 'puncture', 'deep puncture', 'severe puncture', 'gaping wound'],
  77.                 'bruise': ['small bruise', 'bruise', 'ugly bruise', 'major bruise', 'fracture']}
  78.     attack_wound = wound_tier[damage_type][damage_tier]
  79.  
  80.     # Attacker and target pronouns. Possessive (its, his, her), Singular Subject (it, he, she), Singular Object (it, him, her)
  81.     a_poss, a_sin_sub, a_sin_obj = pronoun(attacker)
  82.     t_poss, t_sin_sub, t_sin_obj = pronoun(target)
  83.  
  84.     a_name = prop_name(attacker)
  85.     t_name = prop_name(target)
  86.     c_a_name = attacker.key.capitalize
  87.     c_t_name = target.key.capitalize
  88.  
  89.     # Weapon's article. 'a' or 'an'
  90.     art_weap = article(weapon)
  91.     if hit:
  92.         a_outcome = f"{t_sin_sub.capitalize} suffers {article(attack_wound)} {attack_wound} to {t_poss} {body_part}."
  93.         t_outcome = f"You suffer {article(attack_wound)} {attack_wound} to your {body_part}."
  94.         o_outcome = f"{c_t_name} suffers {article(attack_wound)} {attack_wound} to {t_poss} {body_part}."
  95.     else:
  96.         a_outcome = "You miss!"
  97.         t_outcome = f"{c_a_name} misses!"
  98.         o_outcome = f"{c_a_name} misses!"
  99.  
  100.     skillsets = {'staves':
  101.                     {'leg sweep':
  102.                         {'attack_desc':
  103.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  104.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  105.                         },
  106.                     'feint':
  107.                         {'attack_desc':
  108.                             {'attacker': f"You sweep your {weapon} at {target}\'s legs, {a_outcome}",
  109.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  110.                         },
  111.                     'end jab':
  112.                         {'attack_desc':
  113.                             {'attacker': f"You sweep your {weapon} at {target}\'s legs, {a_outcome}",
  114.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  115.                         },
  116.                     'swat':
  117.                         {'attack_desc':
  118.                             {'attacker': f"Using the center of {art_weap} {weapon} as a fulcrum, you swat at {t_name} with one end of the weapon! {a_outcome}",
  119.                             'target': f"Using the center of {art_weap} {weapon} as a fulcrum, {attacker} swats at you with one end of the weapon! {t_outcome}",
  120.                             'others': f"Using the center of {art_weap} {weapon} as a fulcrum, {attacker} swats at {t_name} with one end of the weapon! {o_outcome}"}
  121.                         },
  122.                     'simple strike':
  123.                         {'attack_desc':
  124.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  125.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  126.                         },
  127.                     'side strike':
  128.                         {'attack_desc':
  129.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  130.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  131.                         },
  132.                     'pivot smash':
  133.                         {'attack_desc':
  134.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  135.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  136.                         },
  137.                     'longarm strike':
  138.                         {'attack_desc':
  139.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  140.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  141.                         },
  142.                     'simple block':
  143.                         {'attack_desc':
  144.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  145.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  146.                         },
  147.                     'cross block':
  148.                         {'attack_desc':
  149.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  150.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  151.                         },
  152.                     'overhead block':
  153.                         {'attack_desc':
  154.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  155.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  156.                         },
  157.                     'parting jab':
  158.                         {'attack_desc':
  159.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  160.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  161.                         },
  162.                     'parting swat':
  163.                         {'attack_desc':
  164.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  165.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  166.                         },
  167.                     'parting smash':
  168.                         {'attack_desc':
  169.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  170.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  171.                         },
  172.                     'defensive sweep':
  173.                         {'attack_desc':
  174.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  175.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  176.                         },
  177.                     'stepping spin':
  178.                         {'attack_desc':
  179.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  180.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  181.                         },
  182.                     'snapstrike':
  183.                         {'attack_desc':
  184.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  185.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  186.                         },
  187.                     'sweep strike':
  188.                         {'attack_desc':
  189.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  190.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  191.                         },
  192.                     'spinstrike':
  193.                         {'attack_desc':
  194.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  195.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  196.                         },        
  197.                     'tbash':
  198.                         {'attack_desc':
  199.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  200.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  201.                         },
  202.                     'whirling block':
  203.                         {'attack_desc':
  204.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  205.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  206.                         },
  207.                     'pivoting longarm':
  208.                         {'attack_desc':
  209.                             {'attacker': f"You sweep your {weapon} at {t_name}\'s legs, {a_outcome}",
  210.                             'others': f"{c_a_name} sweeps {art_weap} {weapon} at {t_name}\'s legs, {o_outcome}"}
  211.                         }
  212.                     },
  213.                                            
  214.                 'rat':
  215.                     {'claw':
  216.                         {'attack_desc':
  217.                             {'attacker': f"You claw at {t_name} with your front paws! {a_outcome}",
  218.                             'target': f"{c_a_name} claws at you with {a_poss} front paws! {t_outcome}",
  219.                             'others': f"{c_a_name} claws at {t_name} with {a_poss} front paws! {o_outcome}"}
  220.                         }
  221.                     }
  222.                 }
  223.  
  224.     attacker_desc = skillsets[skillset][skill]['attack_desc']['attacker']
  225.     target_desc = skillsets[skillset][skill]['attack_desc']['target']
  226.     others_desc = skillsets[skillset][skill]['attack_desc']['others']
  227.  
  228.     return attacker_desc, target_desc, others_desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement