Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Branden
/
thiccmud
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
26e16c8e
authored
2016-12-20 18:39:55 -0500
by
Branden
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
#First Steps Coding, a new object
1 parent
b440aa07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
thiccMud/typeclasses/wiseobject.py
thiccMud/typeclasses/wiseobject.py
0 → 100644
View file @
26e16c8
'''
Created on Dec 20, 2016
@author: Xorfos
'''
from
random
import
import
choice
from
typeclasses.objects
import
Object
class
WiseObject
(
Object
):
"""
An object speaking when someone looks at it. We
assume it looks like a stone in this example.
"""
def
at_object_creation
(
self
):
"Called when object is first created"
self
.
db
.
wise_texts
=
\
[
"Stones have feelings too."
,
"To live like a stone is to not have lived at all."
"The world is like a rock of chocolate."
]
def
return_appearance
(
self
,
looker
):
"""
Called by the look command. We want to return
a wisdom when we get looked at.
"""
#first get the base string from the
#parent's return_appearance'
string
=
super
(
WiseObject
,
self
)
.
return_appearance
(
looker
)
wisewords
=
"
\n\n
lt grumbles and says: '
%
s'"
wisewords
=
wisewords
%
choice
(
self
.
db
.
wise_texts
)
return
string
+
wisewords
\ No newline at end of file
Please
register
or
sign in
to post a comment