The sailing script now stores particular aliases to manipulate the exits to simulate sailing. Created George, the tinkering dwarf and his project that he needs help completing. Created an adventuring Hobbit who sails the sea. Created a "summarizing script" to limit the amount of chat history each Chatbot needs in order to carry on a conversation. Created a stateful object that changes its appearance based on "who" is looking. This allows a George's project to be seen as a complete bird to those who have given George some feathers.
51 lines
1.7 KiB
Python
Executable file
51 lines
1.7 KiB
Python
Executable file
#!/usr/bin/env python
|
|
|
|
from evennia import CmdSet
|
|
|
|
from commands.command import Command
|
|
from utils.scoring import Scores
|
|
|
|
|
|
class CmdScore(Command):
|
|
"""
|
|
Display your score.
|
|
|
|
Usage:
|
|
|
|
score
|
|
|
|
The more things you do in this game, the better your scorecard.
|
|
"""
|
|
key = "score"
|
|
aliases = ["scorecard"]
|
|
|
|
def func(self):
|
|
"""
|
|
Implements the score command.
|
|
"""
|
|
def checked(tick):
|
|
return " |g✔|n " if score & tick.value else " |r-|n "
|
|
|
|
score = self.caller.attributes.get('score', 0)
|
|
total = len([1 for tick in list(Scores) if score & tick.value])
|
|
|
|
msg = "Your scorecard is:|/" + "|/".join([
|
|
checked(Scores.jump) + "Jumped in a puddle",
|
|
checked(Scores.moss_sit) + "Sat on some moss",
|
|
checked(Scores.throw_stick) + "Thrown a stick",
|
|
checked(Scores.catch_fish) + "Caught a fish",
|
|
checked(Scores.feed_bhb) + "Fed Big Hairy Beast",
|
|
checked(Scores.eat_candy) + "Eaten a candy",
|
|
checked(Scores.get_cocktail) + "Got a cocktail",
|
|
checked(Scores.finish_cocktail) + "Finished a cocktail",
|
|
checked(Scores.make_tea) + "Made a pot of tea",
|
|
checked(Scores.read_a_book) + "Read a book from Dabbler's library",
|
|
checked(Scores.blow_horn) + "Called on the Mist Horn",
|
|
checked(Scores.get_pipe) + "Received a smoking pipe",
|
|
checked(Scores.helped_george) + "Helped George",
|
|
checked(Scores.get_blue_medal) + "Found the Blue Medal",
|
|
checked(Scores.make_potion) + "Made a potion",
|
|
]) + f"|/Total: {total}"
|
|
|
|
self.caller.msg(msg)
|