mirror of
				https://github.com/Investigamer/cardconjurer.git
				synced 2025-10-30 23:00:43 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			724 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			724 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| var fullAbilityList = new Array()
 | |
| 
 | |
| function loadAbilities() {
 | |
|     var xhttp = new XMLHttpRequest();
 | |
|     xhttp.onreadystatechange = function() {
 | |
|         if (this.readyState == 4) {
 | |
|             fullAbilityList = xhttp.responseText.split("$$$")
 | |
|             for (var i = 0; i < 3; i ++) {
 | |
|                 fullAbilityList[i] = fullAbilityList[i].split(";")
 | |
|             }
 | |
|         }
 | |
|     }
 | |
|     xhttp.open("GET", "/askurza/planeswalkerAbilities.txt", true);
 | |
|     xhttp.send();
 | |
| }
 | |
| 
 | |
| function randomAbility(index) {
 | |
|     possibleAbilities = fullAbilityList[index]
 | |
|     document.getElementById("askUrzaResult").innerHTML = possibleAbilities[Math.floor(Math.random() * (possibleAbilities.length - 1))].replace(/\\"/g, '"')
 | |
| }
 | |
| 
 | |
| loadAbilities()
 | 
