#NAME Test Quest
quest files must all be listed in the file questlist

;#STORY
this marks this as a story quest
it has a gold icon and doesn't count against the concurrent quest limit

#RESET
this causes all level progress to reset on entering a new level
AVOIDTILE and AVOIDDAMAGE are always reset no matter what

#INLEVEL
this automatically fails the quest when you leave the level

#REPEAT
this quest can be repeated

#LEVEL FOREST
#DIFFICULTY 0
progress for this quest will only be counted if the player
is in the indicated level/difficulty combination
if these arguments are not supplied, then it is not restricted
(ex: only specifying the forest means the player can be in the 
forest on any difficulty)
if neither are supplied, then the player can be anywhere, including
the hub level

#PREREQUISITE FLAG TEST_FLAG_0 > 6
#PREREQUISITE QUESTITEMEQUIPPED QUEST_APPEARANCE_HOBO_BEARD

PREREQUISITE comes in 4 types:
QUEST
LEVEL
FLAG
QUESTITEM
QUESTITEMEQUIPPED

QUEST accepts the format
QUEST <questname>
<questname> uses the filename for the corresponding quest
this prerequisite is met if this quest has been turned in

LEVEL accepts the format
LEVEL <levelname> <difficulty>
<levelname> accepts FOREST, CASTLE or *
* is wildcard and counts all levels
<difficulty> accepts -1, 0, 1, 2, or 3
0123 indicate the proper difficulty level
-1 is wildcard and counts all difficulties
ex: LEVEL CASTLE 0
means if the castle has been completed on the lowest difficulty
ex: LEVEL FOREST -1
means if the forest has been completed on any difficulty
ex: LEVEL * -1
means if any level has been completed on any difficulty

FLAG accepts the format
FLAG <flagname> <operator> <value>
it behaves similarly to the #CONDITION dialogue tag

QUESTITEM accepts the format
QUESTITEM <quest item>
<quest item> is any of the strings listed in the #GIVEQUESTITEM
tag in TESTNPC

QUESTITEMEQUIPPED accepts the format 
QUESTITEMEQUIPPED <quest item>
this tests to see if <quest item> is equipped

#OBJECTIVE CHESTDROP 5 10 LINGERING_REGRET 
;#OBJECTIVE AVOIDTILE 10 TALLGRASS
;#OBJECTIVE QUESTITEMEQUIPPED QUEST_APPEARANCE_HOBO_BEARD
;#OBJECTIVE REVEALMAP 80
;#OBJECTIVE KILL FIRE_MAT 5   Fairy
;#OBJECTIVEDESCRIPTION brosef i need these fairies to be on fire
objectivedescription replaces the default description
this is pretty important for FLAG objectives because their default is
neither useful or attractive to the player!

currently there are 10 objective types:
KILL
AVOIDDAMAGE
AVOIDTILE
MATERIAL
QUESTITEM
FLAG
GEMS
ENEMYDROP
CHESTDROP
OPENCHEST
QUESTITEMEQUIPPED 

KILL accepts the format
KILL <material> <number> <enemy name>
<material> is any of the material codes, only kills with this
material are counter.  * is wildcard and means all kills are counted
<number> indicates the number of enemies to slay, if a negative value is
given, then all enemies within the level must be slain
<enemy name> indicates what type of enemy to count, it accepts these
strings (* means all enemies are counted):

*
Goblin
Fairy
Turret
Ghost
Skeleton
Target
Heavy Target
Duo Target
Forward Turret
Spider
Forest Boss
Castle Boss

AVOIDDAMAGE accepts the format
AVOIDDAMAGE <number> <enemy name>
<number> is the upper bound
<enemy name> is the same argument from KILL
this objective is satisfied if the amount of damage taken from the specified
enemy since last level switch does not exceed the upper bound 

AVOIDTILE accepts the format
AVOIDTILE <number> <tile name>
<number> is the upper bound
<tile name> is any of the strings in the map editor menu
this objective is satisfied if the player has spent less than <number> seconds
colliding with the specified tile

MATERIAL accepts the format
MATERIAL <number> <material name> <grade>
<number> is the amount to have
<material name> is the material codes or *
<grade> is A,B,C,D,F, or *
this objective is satisied if the player has at least this much of the
specifed materials of the specifed grade

QUESTITEM accepts the format
QUESTITEM <item name>
<item name> is any of the quest item code names
this is satisfied if the player has at least one of the indicated quest item

FLAG accepts the format
FLAG <flagname> <operator> <value>
it behaves similarly to the #CONDITION dialogue tag

GEMS accepts the format
GEMS <number>
it is satisfied if the player has collected the specified number of gems

ENEMYDROP accepts the format
ENEMYDROP <number> <item> <odds> <enemy>
<number> is how many to gather
<item> is what item drops
<odds> is an integer between 0 and 100 for the % chance of the item dropping
<enemy> is what enemy drops it.  * wildcard is an acceptable argument

CHESTDROP accepts the format
CHESTDROP <goal> <maximum> <item>
<goal> is how many to gather
<maximum> is how many times the item appears in one trip to the level
<item> is what item is found in the chest
KNOWN ISSUE: using this tag will cause level generation to take significantly longer

OPENCHEST accepts the format
OPENCHEST <number>
<number> is how many chests to open. using a negative number will make it
so the player has to open all the chests in the level

QUESTITEMEQUIPPED accepts the format 
QUESTITEMEQUIPPED <quest item>
this is identical to the prerequisite of the same name.

#POSTBOSSNPC LIBRARIAN
this tag will spawn an npc with the level end portal if all objectives have
been met.  this will let you do something like cutscenes with the AUTORANGE tag

#START
{
  #TEXT I got a quest for you bro
  #OPTION this assigns you the quest
  {
    #TEXT thanks broblerone
    #STARTQUEST

    this activates the quest

    #OPTION this ends the conversation
    {
      #END
    }
  }
}

#INCOMPLETE
{
  #TEXT dude wtf i gave you a quest
  #OPTION sorry brometheus
  {
    #END
  }
}


#COMPLETE
{
  #TEXT thanks broseden
  #OPTION no problem, broatmeal
  {
    use the give tags here for rewards
    #FINISHQUEST
    this moves the quest from the active list to the completed list
    #END
  }
}