Skip to content

Commit

Permalink
Extends documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vassyli committed Jan 14, 2018
1 parent bd0cd3a commit 7a92697
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
# Module: Dragon Kills
[![Build Status](https://travis-ci.org/lotgd/module-dragon-kills.svg?branch=master)](https://travis-ci.org/lotgd/module-dragon-kills)

A simple way to track dragon kills in your realm. Stores the number of "DK's" on the Character model in `$c->getProperty('lotgd/dragon-kills/dk')`
and also keeps an entry for each DK in a table.
Adds the green dragon to the forest to challenge if the character reached level 15. Additionaly, it
keeps track of the dragon kills in your realm and stores the kill count on the character model.

## Events
`e/lotgd/dragon-kills/kill`: This module responds to this event and stores the dragon kill in the database and increments the count on the Character model.
## API
### Events
- `e/lotgd/dragon-kills/kill` (`Module::DragonKilledEvent`)\
This module publishes this event if a dragon has been slain. It can be used to reset the character and
strip him from his achievements.

## Models
`LotGD\DragonKills\Models\DragonKill`: Database model for each DK event, storing the Character, when it occurred in game time and when it occurred in real time.
### Character Model Extension Methods
- `getDragonKillCount(): int`\
Returns the number of dragon a character has killed.

- `setDragonKillCount(int $killCount)`\
Sets the number of dragons a character has killed. Used internally and does not synchronize with the
dragon kill log.

- `incrementDragonKillCountForCharacter()`\
Increments the number of dragons a character has killed by 1. Used internally and does not synchronize
with the dragon kill log.

### Character Properties
- `int lotgd/module-dragon-kills/dk` (`Module::CharacterPropertyDragonKills`)
The number of dragons a character has killed (use `$c->getDragonKillCount()` to access it)

- `bool lotgd/module-dragon-kills/seenDragon` (`Module::CharacterPropertySeenDragon`)
True if the character has challenged the dragon already and lost. False if not.

0 comments on commit 7a92697

Please sign in to comment.