Advertisement
D10d3

game_data.py

Nov 13th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.65 KB | None | 0 0
  1.  
  2.  
  3. class items():
  4.    
  5.     #Gear items: anything that can be equipped
  6.         # gear classes
  7.         # gear size is the amount of space gear take up in player inventory when NOT equipped
  8.         # equipped gear takes no bag space
  9.         # all armor and damage values for equipped gear are tallied to determine player stats
  10.         # Add a routine to the equipment swap function that will check is a gear slot of empty
  11.         # if a slot is empty it will place the default gear there.
  12.        
  13.     default_head = {
  14.         "name" : "bare-head",
  15.         "desc" : "You aren't wearing anything on your head",
  16.         "type" : "head",
  17.         "damage" : 0,
  18.         "armor" : 0,
  19.         "size" : 0,
  20.         "bag_space" : 0,
  21.         "placed" : "Need to define placed for item"
  22.         }
  23.     default_hand = {
  24.         "name" : "empty-hands",
  25.         "desc" : "You don't have anything readied in your hands.",
  26.         "type" : "hand",
  27.         "damage" : 1, #fist
  28.         "armor" : 0,
  29.         "size" : 0,
  30.         "bag_space" : 1, #held in off hand
  31.         "placed" : "Need to define placed for item"
  32.         }
  33.     default_body = {
  34.         "name" : "loin-cloth",
  35.         "desc" : "While it lacks in protection it at least protects your modesty",
  36.         "type" : "body",
  37.         "damage" : 0,
  38.         "armor" : 0,
  39.         "size" : 0,
  40.         "bag_space" : 0,
  41.         "placed" : "Need to define placed for item"
  42.         }
  43.     default_bag = {
  44.         "name" : "No-bag",
  45.         "desc" : "No-bag",
  46.         "type" : "bag",
  47.         "damage" : 0,
  48.         "armor" : 0,
  49.         "size" : 0,
  50.         "bag_space" : 0,
  51.         "placed" : "Need to define placed for item"
  52.         }
  53.     default_special = {
  54.         "name" : "quick-wit",
  55.         "desc" : "Mom always said you were smart",
  56.         "type": "special",
  57.         "damage": 0,
  58.         "armor": 0,
  59.         "size": 0,
  60.         "bag_space" : 0,
  61.         "placed" : "Need to define placed for item"
  62.         }
  63.        
  64.     wizard_hat = {
  65.         "name" : "wizard-hat",
  66.         "desc" : "This enchanted blue hat is embroidered with stars",
  67.         "type": "head",
  68.         "damage": 1, #+1 "damage"from enchantment
  69.         "size" : 1,
  70.         "placed" : "There's a wizard-hat here.",
  71.         "container":False,
  72.         }
  73.     wand = {
  74.         "name" : "wand",
  75.         "desc" : "This wand is finely carved from a dark wood and inscribed with runes",
  76.         "type" : "hand",
  77.         "size" : 1,
  78.         "damage": 4,
  79.         "placed" : "Need to define placed for item",
  80.         "container":False,
  81.         }
  82.     robes = {
  83.         "name" : "robes",
  84.         "desc" : "While somewhat travel worn, these blue robes are quite comfy.",
  85.         "type": "body",
  86.         "size": 1,
  87.         "armor": 1,
  88.         "placed" : "Need to define placed for item"
  89.         }
  90.     satchel = {
  91.         "name" : "satchel",
  92.         "desc" : "This is a brown leather satchel with a shoulder strap.",
  93.         "type": "bag",
  94.         "size": 2,
  95.         "bag_space" : 6,
  96.         "inventory":[],
  97.         "placed" : "Need to define placed for item",
  98.         "container":True,
  99.         }
  100.     ring_protection = {
  101.             "name" : "ring-protection",
  102.             "desc" : "An old wizard gave you this ring, it's enchantment helps deflect blows",
  103.             "type": "special",
  104.             "damage": 0,
  105.             "armor": 1,
  106.             "size": 0, #small objects don't effect bag space
  107.             "placed" : "Need to define placed for item",
  108.             "container":False,
  109.             }
  110.     #Inventory Items:   : anything that can be carried
  111.     # item = {
  112.         # "name":"",
  113.         # "desc":"",
  114.         # "placed":"",
  115.         # "event":""
  116.         # }
  117.     record = {
  118.         "name":"record",
  119.         "desc":"This is a resin platter record in a sleeve labeled 'Blue Danube'",
  120.         "placed":"There is a record here",
  121.         "event":None,
  122.         "container":False,
  123.         }
  124.     Emma = {
  125.         "name":"emma",
  126.         "desc":"This fat grey tabby cat has a tag that reads 'Emma'",
  127.         "placed":"There is a cat curled up here named Emma",
  128.         "event":None,
  129.         "container":False,
  130.         }
  131.     Tidbit= {
  132.         "name":"tidbit",
  133.         "desc":"This is black and white cat who loves cheese",
  134.         "placed":"There is a cat named Tidbit here.",
  135.         "event":None,
  136.         "container":False,
  137.         }
  138.     guitar = {
  139.         "name":"guitar",
  140.         "desc":"It's a 1968 Harmoy Rocket hollow body guitar",
  141.         "placed":"A guitar leans against the sofa.",
  142.         "event":None,
  143.         "container":False,
  144.         }
  145.     pledge = {
  146.         "name":"pledge",
  147.         "desc":"It's can of a lemony all purpose surface cleaner",
  148.         "placed":"There's a can of pledge sitting on the floor",
  149.         "event":None,
  150.         "container":False,
  151.         }
  152.     Noosa = {
  153.             "name":"noosa",
  154.             "desc":"Noosa is a fluffy white cat with blue eyes.",
  155.             "placed":"A white cat is sitting here, her tag reads 'Noosa'.",
  156.             "event":None,
  157.             "container":False,
  158.             }
  159.     crate = {
  160.         "name":"crate",
  161.         "desc":"This is a small wooden open topped crate.",
  162.         "placed":"there is a crate here",
  163.         "event":None,
  164.         "container":True,
  165.         "inventory":[],
  166.         "space":1,
  167.         }
  168.        
  169.            
  170. #STATIC Items: things that can't move but can be interacted with
  171.         #the eventual layout of static objects will be determined by the event
  172.         #handler. For now they just have a name and a description.
  173.         #The event variable is just a place holder for future formatting.
  174.     # static = {
  175.         # "name":"",
  176.         # "desc":"",
  177.         # "event":None,
  178.         # "container":False,
  179.         # "inventory":"",
  180.         # "space":0
  181.         # }
  182.     chair = {
  183.         "name":"chair",
  184.         "desc":"This is a large wingback style chair upholstered in red velvet.",
  185.         "event":None,
  186.         "container":False,
  187.         "inventory":[],
  188.         "space":1
  189.         }
  190.     phonograph = {
  191.         "name":"phonograph",
  192.         "desc":"This is a cabinet style phonograph with a large hand-crank.",
  193.         "event":None,
  194.         "container":True,
  195.         "inventory":[record],
  196.         "space":1,
  197.         }
  198.     sofa = {
  199.         "name":"sofa",
  200.         "desc":"It's a Victorian style sofa with grey and dark grey vertical stripes",
  201.         "event":None,
  202.         "container":False,
  203.         "inventory":"",
  204.         "space":0,
  205.         }
  206.     rug = {
  207.         "name":"rug",
  208.         "desc":"This oriental rug has excellent knot work and patterns",
  209.         "event":None,
  210.         "container":False,
  211.         "inventory":"",
  212.         "space":0,
  213.         }
  214.     fireplace = {
  215.         "name":"fireplace",
  216.         "desc":"The brick hearth fireplace has several logs burning in it",
  217.         "event":None,
  218.         "container":False,
  219.         "inventory":"",
  220.         "space":0
  221.         }
  222.     piano = {
  223.         "name":"piano",
  224.         "desc":"It is a black baby grand piano",
  225.         "event":None,
  226.         "container":False,
  227.         "inventory":"",
  228.         "space":0
  229.         }
  230.     tardis = {
  231.         "name":"tardis",
  232.         "desc":"It's a blue policebox, it may travel in time and space",
  233.         "event":None,
  234.         "container":False,
  235.         "inventory":"",
  236.         "space":0
  237.         }
  238.     policebox = {
  239.         "name":"tardis",
  240.         "desc":"It's a blue policebox, it may travel in time and space",
  241.         "event":None,
  242.         "container":False,
  243.         "inventory":"",
  244.         "space":0
  245.         }
  246.     police = {
  247.         "name":"tardis",
  248.         "desc":"It's a blue policebox, it may travel in time and space",
  249.         "event":None,
  250.         "container":False,
  251.         "inventory":"",
  252.         "space":0
  253.         }
  254.     gear = [
  255.         default_head,
  256.         default_hand,
  257.         default_body,
  258.         default_bag,
  259.         default_special,
  260.         wizard_hat,
  261.         wand,
  262.         robes,
  263.         satchel,
  264.         ring_protection]
  265.     inventory = [
  266.         record,
  267.         Emma,
  268.         Tidbit,
  269.         guitar,
  270.         pledge,
  271.         Noosa]
  272.     static = [
  273.         chair,
  274.         phonograph,
  275.         sofa,
  276.         rug,
  277.         fireplace,
  278.         piano,
  279.         tardis,
  280.         policebox,
  281.         police]
  282.    
  283.  
  284.    
  285. #       *** Room Classes        ***
  286. class map():
  287.    
  288.     class default_room(object): #parent for room classes, fills in missing info with place holders
  289.         title = "Undefined Room"
  290.         short_description = "A white empty room"
  291.         long_description = [
  292.             "This is a white nondescript space awaiting data to describe it, ",
  293.             "Like the 'Construct' in The Matrix"
  294.             "You don't see any obvious exits, but you think 'up' will work"
  295.             ]
  296.         inventory = []
  297.         static = []
  298.         exits = {
  299.             'up' : "Study"
  300.             }
  301.            
  302.     class Study(default_room):
  303.         #def __inti__():
  304.         items = items()
  305.         title = "Study"
  306.         short_description = "A small Study"
  307.         long_description = [
  308.             "This is a small but cozy Study with book shelves,",
  309.             "a wingback chair and a phonograph. Doors lead north and east"
  310.             ]
  311.         inventory = [items.crate,items.Emma]
  312.         static = [items.chair,items.phonograph]
  313.         exits = {
  314.             'north' : "Parlor",
  315.             'east' : "Ballroom"
  316.             }
  317.            
  318.     class Parlor(default_room):
  319.         title = "Parlor"
  320.         short_description = "It is warm and inviting here"
  321.         long_description = [
  322.             "This is a parlor with polished hardwood floors, an",
  323.             "oriental rug, and a sofa facing a fireplace. Doors lead south and east"
  324.             ]
  325.         inventory = [items.guitar,items.Tidbit]
  326.         static = [items.sofa,items.rug,items.fireplace]
  327.         exits = {
  328.             'south' : "Study",
  329.             'east' : "Ballroom"
  330.             }
  331.            
  332.     class Ballroom(default_room):
  333.         title = "Ballroom"
  334.         short_description = "This is the Ballroom, it smells like lemons"
  335.         long_description = [
  336.             "This is a large ballroom with parquet flooring, crystal chandeliers",
  337.             "and a vaulted ceiling. Sunlight streams in through a domed skylight." ,
  338.             "There is A wooden blue box in one corner, about the size of a",
  339.             "phonebooth. it has a sign on it that says 'Police Box'.",
  340.             "Doors lead north and south"]
  341.         inventory = [items.Noosa,items.pledge]
  342.         static = [items.piano,items.tardis,items.policebox,items.police]
  343.         exits = {
  344.             'north' : "Parlor",
  345.             'south' : "Study"
  346.             }
  347.    
  348.     room_list = {
  349.         "Study":Study(),
  350.         "Parlor":Parlor(),
  351.         "Ballroom":Ballroom()
  352.         }
  353.     starting_room = Study()
  354.  
  355. #       *** Word Lists      ***
  356.  
  357. class words(object):
  358.        
  359.     system_commands = [
  360.         "load",
  361.         "save",
  362.         "quit",
  363.         "restart",
  364.         "help",
  365.         "?",
  366.         "verbose",
  367.         "brief",
  368.         "score",
  369.         "inv?",
  370.         "q",
  371.         "clear",
  372.         ]
  373.        
  374.     inventory_commands = [
  375.         "inventory",
  376.         "i",
  377.         "get",
  378.         "take",
  379.         "equip",
  380.         "put",
  381.         "wear",
  382.         "drop",
  383.         "throw",
  384.         "from",
  385.         ]
  386.  
  387.     nav_commands = [
  388.         "north",
  389.         "south",
  390.         "east",
  391.         "west",
  392.         "northeast",
  393.         "northwest",
  394.         "southeast",
  395.         "southwest",
  396.         "n",
  397.         "e",
  398.         "s",
  399.         "w",
  400.         "ne",
  401.         "nw",
  402.         "se",
  403.         "sw",
  404.         "fore",
  405.         "aft",
  406.         "starboard",
  407.         "port",
  408.         "up",
  409.         "down",
  410.         "u",
  411.         "d",
  412.         "f",
  413.         "a",
  414.         "s",
  415.         "p",
  416.         "climb",
  417.         "enter",
  418.         "exit",
  419.         "enter",
  420.         "go"
  421.         ]
  422.    
  423.     verbs = [
  424.         "g",
  425.         "put",
  426.         "turn",
  427.         "turn on",
  428.         "turn off",
  429.         "move",
  430.         "attack",
  431.         "kill",
  432.         "break",
  433.         "eat",
  434.         "drink",
  435.         "shout",
  436.         "read",
  437.         "open",
  438.         "close",
  439.         "tie",
  440.         "pray"
  441.         ]
  442.  
  443.     describers = [
  444.         "look",
  445.         "examine",
  446.         "describe",
  447.         "scan",
  448.         "what",
  449.         "l",
  450.         ]
  451.        
  452.     profanity = [
  453.         "fuck",
  454.         "fucker",
  455.         "motherfucker",
  456.         "shit",
  457.         "damn",
  458.         "bitch",
  459.         "crap",
  460.         "piss",
  461.         "dick",
  462.         "darn",
  463.         "cock",
  464.         "pussy",
  465.         "asshole",
  466.         "fag",
  467.         "bastard",
  468.         "slut",
  469.         "douche"
  470.         ]
  471.  
  472.     current_place_words = [
  473.         "here",
  474.         "room",
  475.         "place",
  476.         "location"
  477.         ]
  478.  
  479.    
  480.     wordlists = [
  481.         inventory_commands,
  482.         system_commands,
  483.         nav_commands,
  484.         verbs,
  485.         describers,
  486.         profanity,
  487.         current_place_words
  488.         ]
  489.    
  490.     convert_direction = {
  491.         "north":"n",
  492.         "south":"s",
  493.         "east":"e",
  494.         "west":"w",
  495.         "northeast":"ne",
  496.         "southeast":"se",
  497.         "northwest":"nw",
  498.         "southwest":"sw",
  499.         "up":"u",
  500.         "down":"d"
  501.         }
  502.  
  503. #       *** Game States     ***
  504. class system():
  505.     brief = True #True = brief description, False = Verbose
  506.    
  507.     rooms_visited = []
  508.    
  509.     settings = [brief,rooms_visited]
  510. class player():
  511.     items = items()
  512.     inventory = [items.wand]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement