Well, I finally finished the move and caught up on sleep, and I'm now
back and ready to start quizzing again. Keep in mind that the last
quiz presented (i.e. Food Database) was removed for a rethink, so this
week is again quiz #159.

The three rules of Ruby Quiz 2:

1.  Please do not post any solutions or spoiler discussion for this
quiz until 48 hours have passed from the time on this message.

2.  Support Ruby Quiz 2 by submitting ideas as often as you can! (A
permanent, new website is in the works for Ruby Quiz 2. Until then,
please visit the temporary website at

     <http://matthew.moss.googlepages.com/home>.

3.  Enjoy!

Suggestion:  A [QUIZ] in the subject of emails about the problem
helps everyone on Ruby Talk follow the discussion.  Please reply to
the original quiz message, if you can.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Quiz #159
Guardian of Middle-earth

I'm a Tolkien fan, and I like computer games. So when the Lord of the
Rings MMORPG showed up, I eagerly jumped into a virtual Middle-earth.
My name is Gwalorin, I'm a Dwarf, a Guardian of the weak, and a
drinker of many fine ales.

In an effort to be more effective in combat, I'd like to study my past
combats and learn what I can from them. Perhaps there is something in
the combat log that can show me how to be a more effective Guardian.

*** Your task this week will be to analyze the combat log and provide
some statistics on attack types and creatures fought. ***

What kind of statistics? At the least, you should include average
damage inflicted per creature, and also average damage per attack
type. As an example, your report might look like this:

    Creature Name           Average
    -------------           -------
    Brush Hunter               52
    Brush Prowler              43
    Vile Moor-web              44

    Attack Name             Average
    -----------             -------
    Bash                       84
    Shield-blow                58
    Sting                      40


I'm making two combat logs available (compressed in zip format):
Guardian[1] and Hunter[2]. Unzip these to get the combat logs as text
files.

To give you an idea of the information available, let's take a brief
look at some parts of the combat log.

    The Brush Hunter wounds you with Melee Common Med for
    25 points of Common.

We're interested in my effectiveness, not that of the creatures
fought. You may ignore all lines that show a creature hitting me.

    You wound the Brush Hunter for 30 points of Common damage.
    You wound the Brush Hunter with Bash for 104 points of Common
damage.

Note that there are a couple, similar forms for reporting damage that
I've inflicted. The first form is a simple, non-named attack; the
second form is a special, named attack (in this case, called "Bash").

From both of these forms, four pieces of information can be extracted:

   1. The creature hit (e.g. "Brush Hunter")
   2. The attack type (e.g. "Bash", or "Basic" for non-named)
   3. The amount of damage inflicted
   4. The type of damage inflicted (e.g. "Common")

It is from this information that you should generate your report.

If you want to go beyond basic averages, a few other suggestions
include:

    * Minimums, maximums and frequency of use
    * Counts of creatures killed (based on lines such as "Your mighty
blow defeated the Brush Hunter.")
    * Variation based on damage type (while my Guardian's combat log
shows only Common damage, my Hunter's log has more variety).



Finally, if you really want some extra credit, incorporate the
following information about some of the skills. A fully-featured stats
analyzer would take these into account.

Guardian Skills:

    * Retaliation: Only available after a parry, each use of this
skill may be followed by one of Overwhelm, Whirling Retaliation or
Thrust.
    * Shield-swipe: Only available after a block, each use of this
skill may be followed by Bash. Additionally, each use of Shield-swipe
is potentially reported twice (i.e. swipe left followed by swipe
right). Both swipes are part of a single attack. How do you determine
whether two Shield-swipes count as one attack with two hits, or two
separate attacks (the first with one hit and one miss)? If I inflict
no other damage from other attack types between two Shield-swipes,
then the two count as a single attack.
    * Sweeping Cut: Like Shield-swipe, this is actually two attacks in
one; use the same guidelines as Shield-swipe for determining whether
two cuts are part of the same attack or separate attacks.  In
additionally, Sweeping Cut may hit multiple foes -- any that are in
range and in front of the Guardian.

Hunter Skills:

    * Agile Rejoinder: Only available after a parry.
    * Blindside and Swift Bow: Both skills are like Shield-swipe
above, allowing for two hits in one attack against one opponent.
    * Rain of Arrows: Hits multiple targets in close proximity.
    * Swift Bow: Another two attacks in one, against one opponent.
    * Quick Shot vs. Quick Shot: Elvish Arrow (and similar): These are
both the same skill, the latter with Light Oil applied to the arrows
(inflicts Light damage). A comparison of the same skill with and
without using Light Oil would be interesting.


[1] Guardian's combat log:  http://www.splatbang.com/files/guardian.zip
[2] Hunter's combat log: http://www.splatbang.com/files/hunter.zip