Created
February 2, 2010 15:15
-
-
Save masterzen/292733 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule "Captain" | |
when | |
// does the achievement has already been granted to player | |
p : MMPlayerImpl() | |
a : Achievement() from achievementList.get("CPT") | |
not ( PlayerAchievement( achievement.id == a.id ) from achievementRepository.getPlayerAchievements( p.getWebsiteID() ) ) | |
// player should be First Lieutenant | |
PlayerAchievement( achievement.tag == "1LT" ) from achievementRepository.getPlayerAchievements( p.getWebsiteID() ) | |
PlayerAchievement( achievement.tag == "WonOmaha" || achievement.tag == "WonArnhem" ) from achievementRepository.getPlayerAchievements( p.getWebsiteID() ) | |
Number( intValue >= 24 )from accumulate ( $s: ServiceRecord() from playerRepository.getGameHistory( p ), count( $s ) ) | |
Number( intValue >= 8 ) from accumulate ( $s: ServiceRecord( victory == true && side == "AXIS" ) from playerRepository.getGameHistory( p ), count($s) ) | |
Number( intValue >= 8 ) from accumulate ( $s: ServiceRecord( victory == true && side == "ALLIES" ) from playerRepository.getGameHistory( p ), count($s) ) | |
then | |
achievementRepository.award(p, a, tableID); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment