added commander category
commander category
This commit is contained in:
		
							parent
							
								
									58e908dfa6
								
							
						
					
					
						commit
						bbfa56b7e8
					
				| 
						 | 
				
			
			@ -64,6 +64,8 @@ function putIntoMapAndFetch(data) {
 | 
			
		|||
    document.getElementById('guess-type').innerText = 'Finding Fantastic Beasts'
 | 
			
		||||
  } else if (whichGuesser === 'basic') {
 | 
			
		||||
    document.getElementById('guess-type').innerText = 'How Basic'
 | 
			
		||||
  } else if (whichGuesser === 'commander') {
 | 
			
		||||
    document.getElementById('guess-type').innerText = 'General Knowledge'
 | 
			
		||||
  }
 | 
			
		||||
  setUpNewGame()
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ import requests
 | 
			
		|||
import json
 | 
			
		||||
 | 
			
		||||
# add category name here
 | 
			
		||||
allCategories = ['counterspell', 'beast', 'burn'] #, 'terror', 'wrath']
 | 
			
		||||
allCategories = ['counterspell', 'beast', 'burn', 'commander'] #, 'terror', 'wrath']
 | 
			
		||||
specialCategories = ['set', 'basic']
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -23,6 +23,8 @@ def generate_initial_query(category):
 | 
			
		|||
                        '%2Fcontroller%28%5C.%7C+%29%2F%29+or+o%3A%2F~+deals+%28.%7C..%29+damage+to+%28any+target%7C' \
 | 
			
		||||
                        '.*player%28%5C.%7C+or+planeswalker%29%7C.*opponent%28%5C.%7C+or+planeswalker%29%29%2F%29' \
 | 
			
		||||
                        '+%28type%3Ainstant+or+type%3Asorcery%29+not%3Aadventure'
 | 
			
		||||
    elif category == 'commander':
 | 
			
		||||
        string_query += '-banned%3Acommander+is%3Acommander'
 | 
			
		||||
    # add category string query here
 | 
			
		||||
    string_query += '+-%28set%3Asld+%28%28cn>%3D231+cn<%3D233%29+or+%28cn>%3D321+cn<%3D324%29+or+%28cn>%3D185+cn' \
 | 
			
		||||
                '<%3D189%29+or+%28cn>%3D138+cn<%3D142%29+or+%28cn>%3D364+cn<%3D368%29+or+cn%3A669+or+cn%3A670%29' \
 | 
			
		||||
| 
						 | 
				
			
			@ -51,7 +53,7 @@ def fetch_and_write_all(category, query):
 | 
			
		|||
        response = fetch(query, count)
 | 
			
		||||
        will_repeat = response['has_more']
 | 
			
		||||
        count+=1
 | 
			
		||||
        to_compact_write_form(all_cards, art_names, response, category)
 | 
			
		||||
        to_compact_write_form(all_cards, art_names, response)
 | 
			
		||||
    
 | 
			
		||||
    with open('jsons/' + category + '.json', 'w') as f:
 | 
			
		||||
        json.dump(all_cards, f)
 | 
			
		||||
| 
						 | 
				
			
			@ -88,7 +90,7 @@ def fetch_special(query):
 | 
			
		|||
    return response
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def to_compact_write_form(smallJson, art_names, response, category):
 | 
			
		||||
def to_compact_write_form(smallJson, art_names, response):
 | 
			
		||||
    fieldsInCard = ['name', 'image_uris', 'content_warning', 'flavor_name', 'reprint', 'frame_effects', 'digital',
 | 
			
		||||
                    'set_type']
 | 
			
		||||
    data = []
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -17,6 +17,14 @@
 | 
			
		|||
        f.parentNode.insertBefore(j, f)
 | 
			
		||||
      })(window, document, 'script', 'dataLayer', 'GTM-M3MBVGG')
 | 
			
		||||
    </script>
 | 
			
		||||
    <script>
 | 
			
		||||
      function updateSettingDefault(digital, un, original) {
 | 
			
		||||
        window.console.log(digital, un, original)
 | 
			
		||||
        document.getElementById('digital').checked = digital
 | 
			
		||||
        document.getElementById('un').checked = un
 | 
			
		||||
        document.getElementById('original').checked = original
 | 
			
		||||
      }
 | 
			
		||||
    </script>
 | 
			
		||||
    <!-- End Google Tag Manager -->
 | 
			
		||||
    <meta charset="UTF-8" />
 | 
			
		||||
    <style type="text/css">
 | 
			
		||||
| 
						 | 
				
			
			@ -132,7 +140,11 @@
 | 
			
		|||
          value="counterspell"
 | 
			
		||||
          checked
 | 
			
		||||
        />
 | 
			
		||||
        <label class="radio-label" for="counterspell">
 | 
			
		||||
        <label
 | 
			
		||||
          class="radio-label"
 | 
			
		||||
          for="counterspell"
 | 
			
		||||
          onchange="updateSettingDefault(true, true, false)"
 | 
			
		||||
        >
 | 
			
		||||
          <img
 | 
			
		||||
            class="thumbnail"
 | 
			
		||||
            src="https://c1.scryfall.com/file/scryfall-cards/art_crop/front/7/1/71cfcba5-1571-48b8-a3db-55dca135506e.jpg?1562843855"
 | 
			
		||||
| 
						 | 
				
			
			@ -140,7 +152,13 @@
 | 
			
		|||
          <h3>Counterspell Guesser</h3></label
 | 
			
		||||
        ><br />
 | 
			
		||||
 | 
			
		||||
        <input type="radio" id="burn" name="whichguesser" value="burn" />
 | 
			
		||||
        <input
 | 
			
		||||
          type="radio"
 | 
			
		||||
          id="burn"
 | 
			
		||||
          name="whichguesser"
 | 
			
		||||
          value="burn"
 | 
			
		||||
          onchange="updateSettingDefault(true, true, false)"
 | 
			
		||||
        />
 | 
			
		||||
        <label class="radio-label" for="burn">
 | 
			
		||||
          <img
 | 
			
		||||
            class="thumbnail"
 | 
			
		||||
| 
						 | 
				
			
			@ -149,7 +167,13 @@
 | 
			
		|||
          <h3>Match With Hot Singles</h3></label
 | 
			
		||||
        ><br />
 | 
			
		||||
 | 
			
		||||
        <input type="radio" id="beast" name="whichguesser" value="beast" />
 | 
			
		||||
        <input
 | 
			
		||||
          type="radio"
 | 
			
		||||
          id="beast"
 | 
			
		||||
          name="whichguesser"
 | 
			
		||||
          value="beast"
 | 
			
		||||
          onchange="updateSettingDefault(true, true, false)"
 | 
			
		||||
        />
 | 
			
		||||
        <label class="radio-label" for="beast">
 | 
			
		||||
          <img
 | 
			
		||||
            class="thumbnail"
 | 
			
		||||
| 
						 | 
				
			
			@ -159,7 +183,13 @@
 | 
			
		|||
        >
 | 
			
		||||
        <br />
 | 
			
		||||
 | 
			
		||||
        <input type="radio" id="basic" name="whichguesser" value="basic" />
 | 
			
		||||
        <input
 | 
			
		||||
          type="radio"
 | 
			
		||||
          id="basic"
 | 
			
		||||
          name="whichguesser"
 | 
			
		||||
          value="basic"
 | 
			
		||||
          onchange="updateSettingDefault(true, true, true)"
 | 
			
		||||
        />
 | 
			
		||||
        <label class="radio-label" for="basic">
 | 
			
		||||
          <img
 | 
			
		||||
            class="thumbnail"
 | 
			
		||||
| 
						 | 
				
			
			@ -169,6 +199,21 @@
 | 
			
		|||
        >
 | 
			
		||||
        <br />
 | 
			
		||||
 | 
			
		||||
        <input
 | 
			
		||||
          type="radio"
 | 
			
		||||
          id="commander"
 | 
			
		||||
          name="whichguesser"
 | 
			
		||||
          value="commander"
 | 
			
		||||
          onchange="updateSettingDefault(false, false, false)"
 | 
			
		||||
        />
 | 
			
		||||
        <label class="radio-label" for="commander">
 | 
			
		||||
          <img
 | 
			
		||||
            class="thumbnail"
 | 
			
		||||
            src="https://c1.scryfall.com/file/scryfall-cards/art_crop/front/d/9/d9631cb2-d53b-4401-b53b-29d27bdefc44.jpg?1562770627"
 | 
			
		||||
          />
 | 
			
		||||
          <h3>General Knowledge</h3></label
 | 
			
		||||
        ><br />
 | 
			
		||||
 | 
			
		||||
        <details id="addl-options">
 | 
			
		||||
          <summary>
 | 
			
		||||
            <img
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1
									
								
								web/public/mtg/jsons/commander.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								web/public/mtg/jsons/commander.json
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Loading…
	
		Reference in New Issue
	
	Block a user