User talk:Habreno/Wizardry

Python Version
def main:
 * Wiz = input("Wizardry Value: ")
 * try:
 * wiz = int(Wiz)
 * except:
 * wiz = romantodec(Wiz)
 * wiz = wiz*25
 * if wiz == 1:
 * print("This item grants the wearer", wiz ,"spellpoint. Favored Souls and Sorcerers gain up to double spellpoints from items.")
 * else:
 * print("This item grants the wearer", wiz ,"spellpoints. Favored Souls and Sorcerers gain up to double spellpoints from items.")

Note: The romantodec function isn't copied here for space reasons; it basically converts the roman numeral to an integer.

For those unfamiliar with Python, if/else statements (actually if/elif/else statements, but if/else is a simpler form) check the condition on the if- if it's true, then the code under the if is executed. If it's not true, the else is executed. (in if/elif/else, if the initial if fails, elifs are then checked in the order they're listed, top to bottom, and if all those fail, then the else is executed)

In the case of try/except statements, they have the try be executed, and if an error happens, then the excepts are tried. You can have multiple excepts with various conditions (similar to elifs), which each do various different things. A generic except acts as an else- if the try and the specific excepts fail, then the generic except is carried out. Try/excepts are basically another form of if/elif/else statements.

So the main thing I don't know of in Wikicode are if/else and try/except statements, and I'm not sure what a good resource to look for them is. Habreno (Contribs • Message • Email ) 17:26, February 15, 2016 (EST)

Insightful Wizardry
Should this be added to the template? If it was added, it would have to be a second parameter (string type denoting the type of bonus seems the most likely and allows for future expansion) which might cause some issues with old gear. Thoughts? Habreno (Contribs • Message • Email ) 02:51, February 29, 2016 (EST)
 * Yes, we need support for insightful wizardry and possibly quality wizardry; LGS might have additional types. One way would be to introduce another parameter for bonus type. Another option would be to call to create a T:Sp, similar to Template:Hp. It could use the following syntax: Sp|Wizardry|I or Sp|Magi or Sp|Wizardry|137 or Sp|Insightful Wizardry|66 or Sp|Power Drain or Sp|Elemental Spell Power, etc. -- Cru121 (Contribs • Message • Email ) 04:46, February 29, 2016 (EST)
 * I'll work on it. Once again, will be trying to keep compatibility with most of the current pages so the default will have to accept a blank. This part may be harder. Habreno (Contribs • Message • Email ) 06:34, February 29, 2016 (EST)
 * It's "sorta" working. It just looks bad and the conversions aren't working properly. Others are welcome to fix it if it's an easy fix I'm just missing. Going to sleep. As a note, there's a more basic version clearly marked in the revisions if you simply want the simpler version. Habreno (Contribs • Message • Email ) 07:11, February 29, 2016 (EST)