Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Games
trosnoth
Commits
e6b3d593b513
Commit
2e8e04fb
authored
Dec 21, 2020
by
talljosh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Individual game modes now set the winner at end of game.
parent
0471d18d92e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
8 deletions
+5
-8
trosnoth/levels/catpigeon.py
trosnoth/levels/catpigeon.py
+1
-2
trosnoth/levels/elephantking.py
trosnoth/levels/elephantking.py
+1
-1
trosnoth/levels/freeforall.py
trosnoth/levels/freeforall.py
+1
-1
trosnoth/levels/hunted.py
trosnoth/levels/hunted.py
+1
-2
trosnoth/levels/orbchase.py
trosnoth/levels/orbchase.py
+1
-2
No files found.
trosnoth/levels/catpigeon.py
View file @
e6b3d593
...
...
@@ -88,9 +88,8 @@ class CatPigeonLevel(Level):
p
for
p
,
score
in
list
(
playerScores
.
items
())
if
score
==
max_score
and
p
.
team
==
self
.
blue_team
]
self
.
playSound
(
'game-over-whistle.ogg'
)
self
.
set_winners
(
winners
)
for
winner
in
winners
:
self
.
notifyAll
(
'{} wins'
.
format
(
winner
.
nick
))
self
.
world
.
sendServerCommand
(
AwardPlayerCoinMsg
(
winner
.
id
,
BONUS_COINS_FOR_WINNER
))
...
...
trosnoth/levels/elephantking.py
View file @
e6b3d593
...
...
@@ -100,7 +100,7 @@ class ElephantKingLevel(Level):
self
.
world
.
sendServerCommand
(
AwardPlayerCoinMsg
(
winner
.
id
,
BONUS_COINS_FOR_WINNER
))
await
asyncio
.
sleep
(
3
)
await
self
.
world
.
sleep_future
(
3
)
if
__name__
==
'__main__'
:
...
...
trosnoth/levels/freeforall.py
View file @
e6b3d593
...
...
@@ -100,7 +100,7 @@ class FreeForAllLevel(Level):
self
.
world
.
sendServerCommand
(
AwardPlayerCoinMsg
(
winner
.
id
,
BONUS_COINS_FOR_WINNER
))
await
asyncio
.
sleep
(
3
)
await
self
.
world
.
sleep_future
(
3
)
return
any
(
not
p
.
bot
for
p
in
winners
),
max_score
...
...
trosnoth/levels/hunted.py
View file @
e6b3d593
...
...
@@ -94,9 +94,8 @@ class HuntedLevel(Level):
p
for
p
,
score
in
list
(
playerScores
.
items
())
if
score
==
maxScore
and
p
.
team
==
self
.
red_team
]
self
.
playSound
(
'game-over-whistle.ogg'
)
self
.
set_winners
(
winners
)
for
winner
in
winners
:
self
.
notifyAll
(
'{} wins'
.
format
(
winner
.
nick
))
self
.
world
.
sendServerCommand
(
AwardPlayerCoinMsg
(
winner
.
id
,
BONUS_COINS_FOR_WINNER
))
...
...
trosnoth/levels/orbchase.py
View file @
e6b3d593
...
...
@@ -81,9 +81,8 @@ class OrbChaseLevel(Level):
if
score
==
max_score
]
self
.
playSound
(
'game-over-whistle.ogg'
)
self
.
set_winners
(
winners
)
for
winner
in
winners
:
self
.
notifyAll
(
'{} wins'
.
format
(
winner
.
nick
))
self
.
world
.
sendServerCommand
(
AwardPlayerCoinMsg
(
winner
.
id
,
BONUS_COINS_FOR_WINNER
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment