Python Mud (1): Soul emotes

Saturday 03 March 2012, 02:52:00 | mud / i.f.

Bezig geweest om een zogenaamde "soul" van een oude LPC mudlib om te zetten naar modernere Python implementatie.

Uitgangspunt was ftp://ftp.lysator.liu.se/pub/lpmud/drivers/profezzorn/soul.c maar de code is bijna helemaal opnieuw geschreven. (Beschikbaar in mijn SVN server hier: svn://svn.razorvine.net/Various/Mud/trunk)

Ik ben vrij tevreden over wat er nu mogelijk is met de parser :-) Er zit een behoorlijke hoeveelheid 'emotes' in, waarbij je meestal ook een persoon kunt opgeven op wie het moet slaan. Ook is er een grote lijst met 'adverbs' aanwezig om het wat kleur te geven. Je kunt tenslotte ook nog een aantal speciale woorden gebruiken om aan te geven dat je iets probeert, of iets niet doet, of faalt om iets te doen.

Er zitten nog wat andere grappige dingen in:

Hier is een dump van een interactieve sessie:

C:\Python27\python.exe E:/projects/Mud/testsoul.py
command?> look
YOU ARE Fritz. YOU SEE: attractive Julie and mad Max

command?> hello
PLAYER: You greet everyone.
ROOM: Fritz greets everyone.
TARGETS : Fritz greets everyone.

... rest van de conversatie hieronder....:

command?> pat julie
PLAYER: You pat attractive Julie on the head.
ROOM: Fritz pats attractive Julie on the head.
TARGETS julie: Fritz pats you on the head.

command?> pat julie shoulder
PLAYER: You pat attractive Julie on the shoulder.
ROOM: Fritz pats attractive Julie on the shoulder.
TARGETS julie: Fritz pats you on the shoulder.

command?> pat julie aff shoulder
* What adverb did you mean: affably, affectedly, affectingly, affectionately, or affirmatively?

command?> pat julie affectio shoulder
PLAYER: You pat attractive Julie affectionately on the shoulder.
ROOM: Fritz pats attractive Julie affectionately on the shoulder.
TARGETS julie: Fritz pats you affectionately on the shoulder.

command?> die
PLAYER: You fall down and play dead.
ROOM: Fritz falls to the ground, dead.
TARGETS : Fritz falls to the ground, dead.

command?> watch
PLAYER: You watch the surroundings carefully.
ROOM: Fritz watches the surroundings carefully.
TARGETS : Fritz watches the surroundings carefully.

command?> watch max
PLAYER: You watch mad Max carefully.
ROOM: Fritz watches mad Max carefully.
TARGETS max: Fritz watches you carefully.

command?> search julie
PLAYER: You search attractive Julie thoroughly, where is it?
ROOM: Fritz searches attractive Julie thoroughly, where is it?
TARGETS julie: Fritz searches you thoroughly, where is it?

command?> suddenly search julie
PLAYER: You suddenly search attractive Julie thoroughly, where is it?
ROOM: Fritz suddenly searches attractive Julie thoroughly, where is it?
TARGETS julie: Fritz suddenly searches you thoroughly, where is it?

command?> smile at him
* It is not clear who you mean.

command?> caress
* The verb caress needs a person.

command?> caress ju
* Did you mean julie?

command?> caress julie
PLAYER: You caress attractive Julie on the cheek.
ROOM: Fritz caresses attractive Julie on the cheek.
TARGETS julie: Fritz caresses you on the cheek.

command?> kick max in the nuts
PLAYER: You kick mad Max hard where it hurts.
ROOM: Fritz kicks mad Max hard where it hurts.
TARGETS max: Fritz kicks you hard where it hurts.

command?> whisper max "this is a secret"
PLAYER: You whisper 'this is a secret' to mad Max.
ROOM: Fritz whispers 'this is a secret' to mad Max.
TARGETS max: Fritz whispers 'this is a secret' to you.

command?> nibble 
* The verb nibble needs a person.

command?> nibble julie
PLAYER: You nibble on attractive Julies ear.
ROOM: Fritz nibbles on attractive Julies ear.
TARGETS julie: Fritz nibbles on your ear.

command?> beep
PLAYER: You triumphantly beep yourself on the nose.
ROOM: Fritz triumphantly beeps himself on the nose.
TARGETS : Fritz triumphantly beeps himself on the nose.

command?> beep everyone
PLAYER: You triumphantly beep attractive Julie, yourself, and mad Max on the nose.
ROOM: Fritz triumphantly beeps attractive Julie, himself, and mad Max on the nose.
TARGETS julie, max: Fritz triumphantly beeps you on the nose.

command?> attempt nudge everyone but me
PLAYER: You attempt to nudge attractive Julie and mad Max suggestively, without much success.
ROOM: Fritz attempts to nudge attractive Julie and mad Max suggestively, without much success.
TARGETS julie, max: Fritz attempts to nudge you suggestively, without much success.

command?> hiss "go away" 
PLAYER: You hiss 'go away'.
ROOM: Fritz hisses 'go away'.
TARGETS : Fritz hisses 'go away'.

command?> hiss angrily go away
PLAYER: You hiss 'go away' angrily.
ROOM: Fritz hisses 'go away' angrily.
TARGETS : Fritz hisses 'go away' angrily.

command?> punch max
PLAYER: You punch mad Max in the eye.
ROOM: Fritz punches mad Max in the eye.
TARGETS max: Fritz punches you in the eye.

command?> punch max side
PLAYER: You punch mad Max in the side.
ROOM: Fritz punches mad Max in the side.
TARGETS max: Fritz punches you in the side.

command?> admire hon max
* What adverb did you mean: honestly, honorably, or honorarily?

command?> admire max hones
PLAYER: You admire mad Max honestly.
ROOM: Fritz admires mad Max honestly.
TARGETS max: Fritz admires you honestly.

command?> ayt julie
PLAYER: You wave your hand in front of attractive Julies face, is she there?
ROOM: Fritz waves his hand in front of attractive Julies face, is she there?
TARGETS julie: Fritz waves his hand in front of your face, are you there?

command?> ayt all but me
PLAYER: You wave your hand in front of mad Max' and attractive Julies' face, are they there?
ROOM: Fritz waves his hand in front of mad Max' and attractive Julies' face, are they there?
TARGETS max, julie: Fritz waves his hand in front of your face, are you there?

command?> emote thinks this is all very nice.
PLAYER: You emote: player thinks this is all very nice.
ROOM: Fritz thinks this is all very nice.
TARGETS : Fritz thinks this is all very nice.

Binnenkort uitbouwen tot een mini-Mud met kamers, exits, NPC's, enzovoort!