-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
827 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from collections.abc import Iterable | ||
from datetime import timedelta | ||
|
||
from trcustoms.awards.requirements.impl import ( | ||
AuthoredLevelsFarApartRequirement, | ||
) | ||
from trcustoms.awards.specs import AwardSpec | ||
|
||
|
||
def chirugai() -> Iterable[AwardSpec]: | ||
min_time_apart = timedelta(days=10 * 365) | ||
|
||
yield AwardSpec( | ||
code="Chirugai", | ||
title="Chirugai", | ||
description="You have returned after years of inactivity.", | ||
requirement=AuthoredLevelsFarApartRequirement( | ||
min_time_apart=min_time_apart | ||
), | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from collections.abc import Iterable | ||
|
||
from trcustoms.awards.requirements.impl import ( | ||
PlayedLevelsWithRatingAwardRequirement, | ||
) | ||
from trcustoms.awards.specs.base import AwardSpec | ||
|
||
|
||
def demons_heart() -> Iterable[AwardSpec]: | ||
min_levels = 50 | ||
|
||
yield AwardSpec( | ||
code="demons_heart", | ||
title="Demon's Heart", | ||
description=( | ||
f"You finished {min_levels} levels with a negative rating." | ||
), | ||
requirement=PlayedLevelsWithRatingAwardRequirement( | ||
min_levels=min_levels, | ||
max_rating=-1, | ||
), | ||
) | ||
|
||
|
||
def spear_of_destiny() -> Iterable[AwardSpec]: | ||
min_levels = 50 | ||
|
||
yield AwardSpec( | ||
code="spear_of_destiny", | ||
title="Spear of Destiny", | ||
description=( | ||
f"You finished {min_levels} levels with a positive rating." | ||
), | ||
requirement=PlayedLevelsWithRatingAwardRequirement( | ||
min_levels=min_levels, | ||
min_rating=1, | ||
), | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from collections.abc import Iterable | ||
|
||
from trcustoms.awards.requirements.impl import ( | ||
AuthoredLevelPlayersAwardRequirement, | ||
) | ||
from trcustoms.awards.specs.base import AwardSpec | ||
|
||
|
||
def gate_key() -> Iterable[AwardSpec]: | ||
min_players = 50 | ||
|
||
yield AwardSpec( | ||
code="gate_key", | ||
title="Gate Key", | ||
description=( | ||
f"{min_players} users have added one of your levels " | ||
"to their playlist." | ||
), | ||
can_be_removed=True, | ||
requirement=AuthoredLevelPlayersAwardRequirement( | ||
min_players=min_players | ||
), | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from collections.abc import Iterable | ||
|
||
from django.conf import settings | ||
|
||
from trcustoms.awards.requirements.impl import ( | ||
AuthoredLevelsTagCountRequirement, | ||
) | ||
from trcustoms.awards.specs.base import AwardSpec | ||
|
||
|
||
def magic_stones() -> Iterable[AwardSpec]: | ||
min_levels = 3 | ||
min_tags = settings.MAX_TAGS | ||
|
||
yield AwardSpec( | ||
code="magic_stones", | ||
title="Magic Stones", | ||
description="You topped up {min_levels} of your levels with tags!", | ||
can_be_removed=True, | ||
requirement=AuthoredLevelsTagCountRequirement( | ||
min_levels=min_levels, | ||
min_tags=min_tags, | ||
), | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from collections.abc import Iterable | ||
|
||
from trcustoms.awards.requirements.impl import ( | ||
AuthoredLevelsTagCountRequirement, | ||
) | ||
from trcustoms.awards.specs.base import AwardSpec | ||
|
||
|
||
def nightmare_stone() -> Iterable[AwardSpec]: | ||
min_levels = 3 | ||
min_tags = 1 | ||
|
||
yield AwardSpec( | ||
code="nightmare_stone", | ||
title="Nightmare Stone", | ||
description=( | ||
f"{min_levels} of your levels have " f"at least {min_tags} tag." | ||
), | ||
can_be_removed=True, | ||
requirement=AuthoredLevelsTagCountRequirement( | ||
min_levels=min_levels, | ||
min_tags=min_tags, | ||
), | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from collections.abc import Iterable | ||
|
||
from trcustoms.awards.requirements.impl import ( | ||
AuthoredReviewsPositionAwardRequirement, | ||
) | ||
from trcustoms.awards.specs import AwardSpec | ||
|
||
|
||
def obscura_paintings() -> Iterable[AwardSpec]: | ||
positions: list[tuple[int, int]] = [ | ||
(20, 1, 5, "First Obscura Painting"), | ||
(20, 6, 10, "Second Obscura Painting"), | ||
(20, 11, 15, "Thrid Obscura Painting"), | ||
(20, 16, 20, "Fourth Obscura Painting"), | ||
(20, 21, 25, "Fifth Obscura Painting"), | ||
] | ||
|
||
for tier, (min_reviews, min_position, max_position, title) in enumerate( | ||
positions, 1 | ||
): | ||
yield AwardSpec( | ||
code=f"obscura_painting_{tier}", | ||
title=title, | ||
description=( | ||
f"You reviewed {min_reviews} levels with a review amount " | ||
f"between {min_position} and {max_position}!" | ||
), | ||
requirement=AuthoredReviewsPositionAwardRequirement( | ||
min_reviews=min_reviews, | ||
min_position=min_position, | ||
max_position=max_position, | ||
), | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from collections.abc import Iterable | ||
|
||
from trcustoms.awards.requirements.impl import PlayedLevelsAwardRequirement | ||
from trcustoms.awards.specs.base import AwardSpec | ||
|
||
|
||
def playlist_artefacts() -> Iterable[AwardSpec]: | ||
yield AwardSpec( | ||
code="wraith_stone", | ||
title="Wraith Stone", | ||
description="You completed 20 levels in your playlist.", | ||
requirement=PlayedLevelsAwardRequirement(min_levels=20), | ||
can_be_removed=True, | ||
) | ||
|
||
yield AwardSpec( | ||
code="excalibur", | ||
title="Excalibur", | ||
description="You completed 100 levels in your playlist.", | ||
requirement=PlayedLevelsAwardRequirement(min_levels=100), | ||
can_be_removed=True, | ||
) | ||
|
||
yield AwardSpec( | ||
code="mjolnir", | ||
title="Mjölnir", | ||
description="You completed 250 levels in your playlist.", | ||
requirement=PlayedLevelsAwardRequirement(min_levels=250), | ||
can_be_removed=True, | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from collections.abc import Iterable | ||
from datetime import timedelta | ||
|
||
from trcustoms.awards.requirements.impl import ( | ||
AuthoredReviewsTimingAwardRequirement, | ||
) | ||
from trcustoms.awards.specs.base import AwardSpec | ||
|
||
|
||
def smugglers_key() -> Iterable[AwardSpec]: | ||
min_levels = 50 | ||
max_review_age = timedelta(hours=24) | ||
|
||
yield AwardSpec( | ||
code="smugglers_key", | ||
title="Smuggler's Key", | ||
description=( | ||
f"You reviewed {min_levels} levels on the same " | ||
"or next day of release." | ||
), | ||
requirement=AuthoredReviewsTimingAwardRequirement( | ||
min_levels=min_levels, | ||
max_review_age=max_review_age, | ||
), | ||
) |
Oops, something went wrong.