forked from rDrama/rDrama
Merge branches 'master' and 'master' of https://github.com/Aevann1/Drama
commit
1f1e5f3861
|
@ -286,8 +286,8 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def has_award(self, kind):
|
def award_count(self, kind) -> int:
|
||||||
return bool(len([x for x in self.awards if x.kind == kind]))
|
return len([x for x in self.awards if x.kind == kind])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self):
|
def title(self):
|
||||||
|
|
|
@ -29,6 +29,7 @@ ACTIONS = {
|
||||||
|
|
||||||
ALLOW_MULTIPLE = (
|
ALLOW_MULTIPLE = (
|
||||||
"ban",
|
"ban",
|
||||||
|
"shit"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -175,14 +175,16 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% if p.has_award("shit") %}
|
{% if p.award_count("shit") %}
|
||||||
<script src="/assets/js/bug-min.js" type="text/javascript"></script>
|
<script src="/assets/js/bug-min.js" type="text/javascript"></script>
|
||||||
|
{% set minbugs = 10*p.award_count("shit") if p.award_count("shit") <= 5 else 50 %}
|
||||||
|
{% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") <= 5 else 100 %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
new BugController({
|
new BugController({
|
||||||
imageSprite: "/assets/images/fly-sprite.png",
|
imageSprite: "/assets/images/fly-sprite.png",
|
||||||
canDie: false,
|
canDie: false,
|
||||||
minBugs: 10,
|
minBugs: {{ minbugs }},
|
||||||
maxBugs: 20,
|
maxBugs: {{ maxbugs }},
|
||||||
mouseOver: "multiply"
|
mouseOver: "multiply"
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue