Add intro-menu to tutorial-world
This commit is contained in:
parent
abeace4e9e
commit
a94e723d6b
4 changed files with 68 additions and 25 deletions
|
|
@ -105,21 +105,24 @@ tutorial
|
||||||
#
|
#
|
||||||
@desc
|
@desc
|
||||||
|gWelcome to the Evennia tutorial-world!|n
|
|gWelcome to the Evennia tutorial-world!|n
|
||||||
|
|
||||||
This small quest shows some examples of Evennia usage.
|
This small quest shows some examples of Evennia usage.
|
||||||
|
|
||||||
To get into the mood of this miniature quest, imagine you are an
|
|gDo you want help with how to play? Write |yintro|g to get an introduction to
|
||||||
adventurer out to find fame and fortune. You have heard rumours of an
|
Evennia and the basics of playing!|n
|
||||||
old castle ruin by the coast. In its depth a warrior princess was
|
|
||||||
buried together with her powerful magical weapon - a valuable prize,
|
|
||||||
if it's true. Of course this is a chance to adventure that you
|
|
||||||
cannot turn down!
|
|
||||||
|
|
||||||
You reach the coast in the midst of a raging thunderstorm. With wind
|
To get into the mood of this miniature quest, imagine you are an adventurer
|
||||||
and rain screaming in your face you stand where the moor meet the sea
|
out to find fame and fortune. You have heard rumours of an old castle ruin by
|
||||||
along a high, rocky coast ...
|
the coast. In its depth a warrior princess was buried together with her
|
||||||
|
powerful magical weapon - a valuable prize, if it's true. Of course this is a
|
||||||
|
chance to adventure that you cannot turn down!
|
||||||
|
|
||||||
Try 'tutorial' to get behind-the-scenes help anywhere, and 'give up'
|
You reach the coast in the midst of a raging thunderstorm. With wind and rain
|
||||||
if you want to abort.
|
screaming in your face you stand where the moor meet the sea along a high,
|
||||||
|
rocky coast ...
|
||||||
|
|
||||||
|
Try '|yintro|n' for usage help. During the quest, write '|ytutorial|n' to get
|
||||||
|
behind-the-scenes help anywhere, and '|ygive up|n' to abandon the quest.
|
||||||
|
|
||||||
|gwrite 'begin' to start your quest!|n
|
|gwrite 'begin' to start your quest!|n
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -229,8 +229,11 @@ def _maintain_demo_room(caller, delete=False):
|
||||||
|
|
||||||
# make the linking exits
|
# make the linking exits
|
||||||
door_out = create_object(
|
door_out = create_object(
|
||||||
"evennia.objects.objects.DefaultExit", key="Door", location=room1,
|
"evennia.objects.objects.DefaultExit",
|
||||||
destination=room2, locks=["get:false()"],
|
key="Door",
|
||||||
|
location=room1,
|
||||||
|
destination=room2,
|
||||||
|
locks=["get:false()"],
|
||||||
)
|
)
|
||||||
door_out.db.desc = _DOOR_DESC_OUT.strip()
|
door_out.db.desc = _DOOR_DESC_OUT.strip()
|
||||||
door_in = create_object(
|
door_in = create_object(
|
||||||
|
|
@ -239,7 +242,7 @@ def _maintain_demo_room(caller, delete=False):
|
||||||
aliases=["door", "in", "entrance"],
|
aliases=["door", "in", "entrance"],
|
||||||
location=room2,
|
location=room2,
|
||||||
destination=room1,
|
destination=room1,
|
||||||
locks=["get:false()"]
|
locks=["get:false()"],
|
||||||
)
|
)
|
||||||
door_in.db.desc = _DOOR_DESC_IN.strip()
|
door_in.db.desc = _DOOR_DESC_IN.strip()
|
||||||
|
|
||||||
|
|
@ -574,10 +577,9 @@ If you are alone on the server, put your own name as |w<name>|n to test it and
|
||||||
page yourself. Write just |ypage|n to see your latest pages. This will also show
|
page yourself. Write just |ypage|n to see your latest pages. This will also show
|
||||||
you if anyone paged you while you were offline.
|
you if anyone paged you while you were offline.
|
||||||
|
|
||||||
(By the way - do you think that the use of |y=|n above is strange? This is a
|
(By the way - depending on which games you are used to, you may think that the
|
||||||
MUSH/MUX-style of syntax. If you don't like it, you can change it for your own
|
use of |y=|n above is strange. This is a MUSH/MUX-style of syntax. For your own
|
||||||
game by simply changing how the |wpose|n command parses its input.)
|
game you can change the |wpose|n command to work however you prefer).
|
||||||
|
|
||||||
|
|
||||||
## OPTIONS
|
## OPTIONS
|
||||||
|
|
||||||
|
|
@ -721,7 +723,18 @@ Thanks for trying out the tutorial!
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# EvMenu implementation and access function
|
||||||
|
#
|
||||||
|
# -------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class TutorialEvMenu(EvMenu):
|
class TutorialEvMenu(EvMenu):
|
||||||
|
"""
|
||||||
|
Custom EvMenu for displaying the intro-menu
|
||||||
|
"""
|
||||||
|
|
||||||
def close_menu(self):
|
def close_menu(self):
|
||||||
"""Custom cleanup actions when closing menu"""
|
"""Custom cleanup actions when closing menu"""
|
||||||
self.caller.cmdset.remove(DemoCommandSetHelp)
|
self.caller.cmdset.remove(DemoCommandSetHelp)
|
||||||
|
|
@ -743,16 +756,18 @@ class TutorialEvMenu(EvMenu):
|
||||||
else:
|
else:
|
||||||
other.append((key, desc))
|
other.append((key, desc))
|
||||||
navigation = (
|
navigation = (
|
||||||
(" " + " |W|||n ".join(navigation) + " |W|||n " + "|wQ|Wuit|n")
|
(" " + " |W|||n ".join(navigation) + " |W|||n " + "|wQ|Wuit|n") if navigation else ""
|
||||||
if navigation
|
|
||||||
else ""
|
|
||||||
)
|
)
|
||||||
other = super().options_formatter(other)
|
other = super().options_formatter(other)
|
||||||
sep = "\n\n" if navigation and other else ""
|
sep = "\n\n" if navigation and other else ""
|
||||||
|
|
||||||
return f"{navigation}{sep}{other}"
|
return f"{navigation}{sep}{other}"
|
||||||
|
|
||||||
def testmenu(caller):
|
|
||||||
|
def init_menu(caller):
|
||||||
|
"""
|
||||||
|
Call to initialize the menu.
|
||||||
|
|
||||||
|
"""
|
||||||
menutree = parse_menu_template(caller, MENU_TEMPLATE, GOTO_CALLABLES)
|
menutree = parse_menu_template(caller, MENU_TEMPLATE, GOTO_CALLABLES)
|
||||||
# we'll use a custom EvMenu child later
|
|
||||||
TutorialEvMenu(caller, menutree)
|
TutorialEvMenu(caller, menutree)
|
||||||
|
|
|
||||||
|
|
@ -385,6 +385,31 @@ SUPERUSER_WARNING = (
|
||||||
#
|
#
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
|
|
||||||
|
class CmdEvenniaIntro(Command):
|
||||||
|
"""
|
||||||
|
Start the Evennia intro wizard.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
intro
|
||||||
|
|
||||||
|
"""
|
||||||
|
key = "intro"
|
||||||
|
|
||||||
|
def func(self):
|
||||||
|
from .intro_menu import init_menu
|
||||||
|
# quell also superusers
|
||||||
|
if self.caller.account:
|
||||||
|
self.caller.account.execute_cmd("quell")
|
||||||
|
self.caller.msg("(Auto-quelling)")
|
||||||
|
init_menu(self.caller)
|
||||||
|
|
||||||
|
|
||||||
|
class CmdSetEvenniaIntro(CmdSet):
|
||||||
|
key = "Evennia Intro StartSet"
|
||||||
|
|
||||||
|
def at_cmdset_creation(self):
|
||||||
|
self.add(CmdEvenniaIntro())
|
||||||
|
|
||||||
|
|
||||||
class IntroRoom(TutorialRoom):
|
class IntroRoom(TutorialRoom):
|
||||||
"""
|
"""
|
||||||
|
|
@ -404,6 +429,7 @@ class IntroRoom(TutorialRoom):
|
||||||
"This assigns the health Attribute to "
|
"This assigns the health Attribute to "
|
||||||
"the account."
|
"the account."
|
||||||
)
|
)
|
||||||
|
self.cmdset.add(CmdSetEvenniaIntro, permanent=True)
|
||||||
|
|
||||||
def at_object_receive(self, character, source_location):
|
def at_object_receive(self, character, source_location):
|
||||||
"""
|
"""
|
||||||
|
|
@ -426,7 +452,6 @@ class IntroRoom(TutorialRoom):
|
||||||
character.account.execute_cmd("quell")
|
character.account.execute_cmd("quell")
|
||||||
character.msg("(Auto-quelling while in tutorial-world)")
|
character.msg("(Auto-quelling while in tutorial-world)")
|
||||||
|
|
||||||
|
|
||||||
# -------------------------------------------------------------
|
# -------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# Bridge - unique room
|
# Bridge - unique room
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ LIMBO_DESC = _(
|
||||||
"""
|
"""
|
||||||
Welcome to your new |wEvennia|n-based game! Visit http://www.evennia.com if you need
|
Welcome to your new |wEvennia|n-based game! Visit http://www.evennia.com if you need
|
||||||
help, want to contribute, report issues or just join the community.
|
help, want to contribute, report issues or just join the community.
|
||||||
As Account #1 you can create a demo/tutorial area with |w@batchcommand tutorial_world.build|n.
|
As Account #1 you can create a demo/tutorial area with '|wbatchcommand tutorial_world.build|n'.
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue