www.mudconnector.su
https://forum.mudconnector.su/

IPv6
https://forum.mudconnector.su/viewtopic.php?f=14&t=773
Страница 2 из 2

Автор:  Pacifist [ Чт окт 16, 2014 10:04 am ]
Заголовок сообщения:  Re: IPv6

Как я понял, грубо говоря лпмуды состоят из двух частей:
- драйвер (mudos, fluffos и т.д.) - который знает как делать муд, но не знает что делать;
- библиотека (mudlib) - в которой написано, что нужно делать.

Рассмотрим файл комнаты в таком муде:
Код:
#include <learning.h>
#include "path.h"

// This the object that defines all of the functionality of which we're going
// to make use.  All of the code that we use in setup is defined in this
// object.  In this case, it's an outside room... so it gets all the usual
// weather strings and chats.
 
inherit "/std/room/outside";

// This is a function (we'll come back to this topic later).  All you need to
// know for now that the code in setup gets executed automatically by the
// MUD when your room is loaded.
void setup() {
  // The short description is what you see when you 'glance' in a room.
  set_short ("simple village road");
 
  // The determinate is what gets appended to the short description
  // sometimes.  In this case, this room becomes 'a simple village road'. 
  // If we wanted it to be 'the simple village road', we'd change the
  // determinate here to 'the'.
  add_property ("determinate", "a ");
 
  // This is the long, wordy description of the room that you see when you
  // have the MUD output on verbose.   
  set_long ("This is a simple road, leading to a simple village.  There "
    "is very little of any excitement about it, except that it represents "
    "your first steps to becoming a creator!\n");

  // This sets the current light level for the room.  100 equates
  // to 'bright sunlight'
  set_light (100);
 
  // This adds a move zone to the room - only NPCs who have this as a
  // permitted zone will wander here.
  add_zone ("learnville");

  // These are items that people can look at in the room.  The first part is
  // the thing they can look at, and the second is what they see when they do.
  // Add_item is very powerful, and by adding nouns with adjectives (like
  // simple village), we get the possibility for really sophisticated
  // pattern matching.
  add_item ("simple village", "The village is simple, but beautiful because "
    "of it.");
  add_item ("simple road", "You're standing on it, you dolt!");

  // These are random messages that get sent to the room.  The first number
  // here is the minimum time that passes before a chat is sent.  The second
  // is the maximum time.  The bits of text are the chats themselves, each
  // separated by a comma.
  room_chat ( ({ 120, 240, ({
    "It's quiet... a little too quiet.",
    "It's simple... a little too simple.",
    "It's exciting learning to develop rooms!",
  })}));

  // This adds an exit to the room.  Specifically, it adds an exit of
  // the path type to the northeast.  Players going through this door
  // will end up in street_02.
  add_exit ("northeast", ROOMS + "street_02", "path");
  add_exit ("southwest", LEARNVILLE + "access_point", "path");


Все элементы комнаты задаются в виде си-подобных функций, а как эти функции работают прописано в драйвере (mudos). Аналогичным образом в лпмудах прописано все: комнаты, объекты, мобы, игроки, гильдии и т.д. и т.п.

Страница 2 из 2 Часовой пояс: UTC + 3 часа [ Летнее время ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/