<object name="global_data_object">
</object>
<object name="room_3">
<inherit name="room_object_type" />
<attr name="x_coordinate" type="int">0</attr>
<attr name="y_coordinate" type="int">1</attr>
<attr name="z_coordinate" type="int">1</attr>
</object>
<object name="room_6">
<inherit name="room_object_type" />
<attr name="x_coordinate" type="int">2</attr>
<attr name="y_coordinate" type="int">1</attr>
<attr name="z_coordinate" type="int">1</attr>
</object>
<object name="room_9">
<inherit name="room_object_type" />
<attr name="x_coordinate" type="int">1</attr>
<attr name="y_coordinate" type="int">1</attr>
<attr name="z_coordinate" type="int">1</attr>
</object>
<object name="room_4">
<inherit name="room_object_type" />
<attr name="x_coordinate" type="int">3</attr>
<attr name="y_coordinate" type="int">2</attr>
<attr name="z_coordinate" type="int">2</attr>
</object>
<object name="room_8">
<inherit name="room_object_type" />
<attr name="x_coordinate" type="int">5</attr>
<attr name="y_coordinate" type="int">2</attr>
<attr name="z_coordinate" type="int">2</attr>
</object>
<object name="room_12">
<inherit name="room_object_type" />
<attr name="x_coordinate" type="int">4</attr>
<attr name="y_coordinate" type="int">2</attr>
<attr name="z_coordinate" type="int">2</attr>
</object>
<object name="zombie_1">
<inherit name="monster_object_type" />
<attr name="parent" type="object">room_9</attr>
<attr name="alias" type="string">zombie</attr>
<attr name="current_life" type="int">10</attr>
<attr name="maximum_life" type="int">10</attr>
<attr name="experience" type="int">2</attr>
<attr name="cash" type="int">5</attr>
<attr name="undead" type="boolean">true</attr>
<attr name="room_object_list" type="simpleobjectlist">room_3; room_6; room_9</attr>
</object>
<object name="orc_1">
<inherit name="monster_object_type" />
<attr name="parent" type="object">room_12</attr>
<attr name="alias" type="string">orc</attr>
<attr name="current_life" type="int">50</attr>
<attr name="maximum_life" type="int">50</attr>
<attr name="experience" type="int">25</attr>
<attr name="cash" type="int">10</attr>
<attr name="damage" type="int">10</attr>
<attr name="defense" type="int">5</attr>
<attr name="room_object_list" type="simpleobjectlist">room_4; room_8; room_12</attr>
</object>
<type name="monster_object_type">
<attr name="type_of_object" type="string">monster</attr>
<attr name="alias" type="string">monster</attr>
<attr name="current_life" type="int">1</attr>
<attr name="maximum_life" type="int">1</attr>
<attr name="experience" type="int">0</attr>
<attr name="cash" type="int">0</attr>
<attr name="dead" type="boolean">false</attr>
<attr name="undead" type="boolean">false</attr>
<attr name="damage" type="int">1</attr>
<attr name="defense" type="int">0</attr>
</type>
<type name="room_object_type">
<attr name="type_of_object" type="string">room</attr>
<attr name="x_coordinate" type="int">-1</attr>
<attr name="y_coordinate" type="int">-1</attr>
<attr name="z_coordinate" type="int">-1</attr>
<attr name="alias" type="string">room</attr>
</type>
<function name="room_adjacency_function" type="boolean" parameters="room_parameter">
foreach (room_variable, global_data_object.all_rooms_object_list) {
if (room_variable.x_coordinate >= room_parameter.x_coordinate - 1 and room_variable.x_coordinate <= room_parameter.x_coordinate + 1) {
return true
} else if (room_variable.y_coordinate >= room_parameter.y_coordinate - 1 and room_variable.y_coordinate <= room_parameter.y_coordinate + 1) {
return true
} else if (room_variable.z_coordinate >= room_parameter.z_coordinate - 1 and room_variable.z_coordinate <= room_parameter.z_coordinate + 1) {
return true
} else {
return false
}
}
</function>
<function name="populate_room_adjaceny_object_list_function">
if (HasAttribute (global_data_object, "room_adjaceny_object_list")) {
foreach (object_variable, global_data_object.room_adjaceny_object_list) {
list remove (global_data_object.room_adjaceny_object_list, object_variable)
}
} else {
global_data_object.room_adjaceny_object_list = NewObjectList ()
}
foreach (room_variable, global_data_object.all_rooms_object_list) {
if (room_adjacency_function (room_variable) and not ListContains (global_data_object.room_adjaceny_object_list, room_variable)) {
list add (global_data_object.room_adjaceny_object_list, room_variable)
}
}
</function>
<function name="populate_all_rooms_object_list_function">
global_data_object.all_rooms_object_list = NewObjectList ()
foreach (object_variable, AllObjects()) {
if (GetString (object_variable, "type_of_object") = "room") {
list add (global_data_object.all_rooms_object_list, object_variable)
}
}
</function>
<function name="populate_all_monsters_object_list_function">
global_data_object.all_monsters_object_list = NewObjectList ()
foreach (object_variable, AllObjects()) {
if (GetString (object_variable, "type_of_object") = "monster") {
list add (global_data_object.all_monsters_object_list, object_variable)
}
}
</function>
<function name="all_monster_movement_function">
foreach (monster_variable, global_data_object.all_monsters_object_list) {
if (not monster_variable.dead) {
removed_room = monster_variable.parent
list remove (monster_variable.room_object_list, monster_variable.parent)
monster_variable.parent = ObjectListItem (monster_variable.room_object_list, GetRandomInt (0, ListCount (monster_variable.room_object_list) - 1))
list add (monster_variable.room_object_list, removed_room)
}
}
</function>
if (not zombie.parent = player.parent) {
zombie.parent = player.parent
}
if (this.parent = player.parent) {
// If in the same room as the player start following
this.zombiefollowing= true
}
if (this.zombiefollowing) {
// If following just go to the room the player is in
this.parent = player.parent
}
else {
// Get all exits for the current room
l = ScopeExitsForRoom(this.parent)
//pick one at random
ex = ObjectListItem(l, GetRandomInt(0, ListCount(l) - 1)
// move to its destination
this.parent = ex.to
}
foreach (o, AllObjects()) {
if (HasBoolean(o, "zombiefollowing")) {
do(o, "zombiemove")
}
}