#============================================================================== # LonaCraft - 100_Homes.rb # 1.1.2: Three-bank-house picker for NoerHome, with bought entries hidden; # preserves NoerHome purchase code and LonaCraft save state independently. # What it does: # * Homes, one LOCATIONS row each, bought (:mode :buy, the default) or # rented by the week (:mode :rent). Switch the whole feature off with # ENABLED = false (no door, no offer, no map, no room clearing; furniture # is then allowed nowhere). # * Two kinds of home: # - a house with its own map (:interior): a map file in the mod # (Maps/*.rvdata2, the game's own tiles and tileset), entered through a # door event (:door). Registered at DataManager.load_mod_database the way # the game registers mod maps (DataManager.extra_map_register, # 5_DataManager.rb:390-405, used by RolePlayS 0_CORE.rb:138-139): # $data_mapinfos[] with .name, .filename and a FIXED runtime # map number (MAP_ID_BASE + row) instead of "highest + 1", so placed # furniture (90_Furniture.rb records the map number) stays in its home # whatever other mods are loaded. Game_Map#setup loads # $data_mapinfos[map_id].filename (31_Game_Map.rb:170-172), so the file # path is the map id of the transfer; nothing else is redirected. Also # listed in $data_tag_maps["LonaCraftHome"] / ["LonaCraftHome_"]. # - a room on an existing game map (:map + :room_seed): the room is the # set of floor tiles reached from :room_seed (4 directions, the map's # own passage flags, never through :door_tiles, inside :room_bounds), # plus the :tile_overrides tiles; worked out at every setup of that map. # While owned (or rented), at every setup: :tile_overrides tiles take # the layers of their reference tile, events on :remove_event_tiles go, # every map event standing in the room goes (names in :keep stay; # "-point-" events, which the game's scripts look up by name, stay as # invisible points, moved by :move_points), and decor tiles in the room # take the :floor_ref floor. The map file itself is never changed; once # the rent runs out the next setup shows the room as the game made it. # * Door of a house (Game_Map#setup_event_hack, as the town stations in # 90_Furniture.rb). In this game the city of Noer is the world map # (OvermapMain): every Noer building is a point on it that leads into its # own map, so the shack's door is such a point in the bottom-left corner # of the city. Owned: "Enter" (Homes.enter, the steps of the game's # change_map_enter_tag, 34_Functions_ChangeMap.rb:200-215). Not owned: # "Locked. The bank sells this house." Inside, the map's own BIOS, # -point-StartPoint and -point-ExitPoint (change_map_tag_map_exit) work as # in the game's building maps. # * Sellers: each seller NPC's game script is redirected through # $mod_load_script (102_ScriptImport.rb:63) to HCGframes/