Coding Class: Map Overlay 1

From LSWiki

Revision as of 22:17, 2 November 2010; Bladestorm (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Jump to: navigation, search
#include <Cimbra.h>
#include <Losthaven.h>
#include <room.h>

inherit Cimbra_Definition("Map_Overlay_Base");

void configure() {

   ::configure();
   set_map_feature_name("Losthaven");

// Since this is an overlay, the summary name appends to the end of how the terrain is summarized.

   set_map_feature_summary("near the City of Losthaven");
   add_map_feature_abstract_item(([
       Abstract_Item_Identity               : ([
           Identity_Nouns                   : ({ "city" }),
       ]),
       Abstract_Item_Descriptions           : ({
           "The city is positioned ideally as a trading station and as a social hub, being accessible by all but the most remote regions of Almeria",
       }),
       Abstract_Item_Attach_Description     : ([
           Description_Type                 : Description_Type_Simple,
           Description_Content              : ({
               ({ 't', 0 }), "of Losthaven, a social for the entire Almerian region, has evolved here from a simple trading post."
           }),
           Description_Order                : Description_Order_Early,
       ]),
   ]));
   add_map_feature_abstract_item(([
       Abstract_Item_Identity               : ([
           Identity_Adjectives              : ({ "wide" }),
           Identity_Nouns                   : ({ "river" }),
       ]),
       Abstract_Item_Descriptions           : ({
           "The river flows directly under the foundation of the city",
       }),
       Abstract_Item_Attach_Description     : ([
           Description_Type                 : Description_Type_Simple,
           Description_Content              : ({
               "Its mighty foundation was built over", ({ 'a', 0 }), "that brings trade from the north and the south."
           }),
           Description_Order                : Description_Order_Early,
       ]),
   ]));
   add_map_feature_abstract_item(([
       Abstract_Item_Identity               : ([
           Identity_Adjectives              : ({ "trade" }),
           Identity_Nouns                   : ({ "roads" }),
       ]),
       Abstract_Item_Descriptions           : ({
           "The roads that bring trade into Losthaven were originally nothing more than simple dirt paths until the Altrian Empire",
           "upgraded them into full-fledged roads.  The flagstones used in these roads have stood the test of time, and continue bearing",
           "many heavily-laden wagons of trade goods into the city",
       }),
       Abstract_Item_Attach_Description     : ([
           Description_Type                 : Description_Type_Simple,
           Description_Content              : ({
               "Leading in from several directions is a set of", ({ 'n', 0 }), "which bring in goods and travelers from all across the realms."
           }),
           Description_Order                : Description_Order_Early,
       ]),
   ]));

// Adds this description when it is night, per the weather daemon.

   add_map_feature_description(([
       Description_Type                     : Description_Type_Object_Condition,
       Description_Index                    : ([
           Condition_Type_Code              : Condition_Type_Daytime,
           Condition_Flags                  : Condition_Flag_Inverse,
       ]),
       Description_Content                  : ({
           "Torches illuminate the gates to either side of the city, as well as providing light to several guard posts along the top of the wall",
       }),
   ]));
   add_map_feature_mapped(([
       Mapped_Item                          : ([
           Abstract_Item_Identity           : ([
               Identity_Nouns               : ({ "city" }),
           ]),
           Abstract_Item_Descriptions       : ({
               ({
                   ({ 't', 0 }), ({ "are", 0 }), "protected by a large wall, revealing only a few colourful rooftops.",
               }),
           }),
           Abstract_Item_Attach_Description : ([
               Description_Type             : Description_Type_Simple,
               Description_Content          : ({
                   "%w", ({ "stand", 0 }), ({ 'a', 0 }), "flying a {{bright blue and bright white}blue and white} banner"
               }),
               Description_Order            : Description_Order_Late,
           ]),
       ]),
       Mapped_Min_Distance                  : 2.0,
       Mapped_Max_Distance                  : 6.0,
       Mapped_Flags                         : Mapped_Flag_Exclude_Self | Mapped_Flag_Same_Feature_Nearest_Only,
   ]));
   set_map_feature_adjacency(
       "%w stands a city flying the {{bright blue and bright white}blue and white banner} of Losthaven."
   );
   add_map_feature_description(([
       Description_Type                     : Description_Type_Viewer_Condition,
       Description_Index                    : Condition_Type_Smell,
       Description_Content                  : ({
           "The",
           Description(Description_Type_Ambient_Medium_Colored_Name),
           "is filled with the scents of cooking and woodsmoke.",
       }),
   ]));

// Added in a light level, which means without any other sources of illumination, there will always be enough light around the city for a basic human to see. This rational comes from just having enough torches at night around the city walls.

   set_map_feature_light(1);

// This feature allows me to attach an area project directly onto the map, and ties it to the landmark descriptions above. To move Losthaven, all I need to do is move the coords of this overlay on the map.conf, change the exits here, and adjust the exits within Losthaven itself. I could put Losthaven in Esartur if I needed to by changing just 3 files (actually 4, because LH has 2 exit rooms), and all of the features within this file automatically apply to the new location.

   add_map_feature_exit(Direction_Westin, Losthaven_Room("east_arch"));
   add_map_feature_exit(Direction_Eastin, Losthaven_Room("west_arch"));
   add_map_feature_terrain(Terrain_Urban);
   set_map_feature_exposure(Exposure_Exposed);
   add_map_feature_realm("Cimbra_Losthaven");

// This allows overlays to show up on map visualization tools or on panoramicons, which is an awesome feature. Unlike set_map_feature(), the visualize does not have to be a unique character. I typically make every point of interest visualize as a bright purple x to draw attention to it.

   set_map_feature_visualize("{{bright purple}X}");

}

Personal tools