123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420 |
- # homes_properties
- !!{ All the existing properties should be added here.
- name: Display name
- display: The string to use in the middle of a sentence
- town: The town/city/village the property can be found
- location: The region within the town
- entrance: The location where the charactes enter
- type: The type of the property
- rent: Whether the property can be rented by Sveta or not.
- 1: Can be rented
- internet_enabled: If the value is 1, then Sveta can buy, cancel, transfer an internet subscription here
- Property Types
- !! IMPORTANT:
- !! NOTE: The types are not 100% clear and decided yet, need some more thinking. Also new ones can be added.
- permanent_residence: This is a home that can be used for everything. Certain things don''t allow the more "transient"
- homes, like the dating app in Uni.
- temporary_residence: This is a home that some events/actions won''t consider.
- New ones in the future could be for porperties that Sveta can own, rent, used, is not a home but can be changed/customised, etc.
- For example a music studio/practice room, or a gallery, or a newspaper kiosk
- To make life easier, if is 0 or '' for a property, then I didn''t include it.
- Undefined strings will always evaluate to '' and undefined integers have a value of 0.
- }
- if ARRSIZE('rent') < 2:
- prop_rent['city_apartment'] = 15000
- $prop_rent['city_apartment'] = '15,000'
- prop_rent['old_town_apartment'] = 10000
- $prop_rent['old_town_apartment'] = '10,000'
- end
- if ARRSIZE('price') < 4:
- prop_price['city_apartment'] = 800000
- $prop_price['city_apartment'] = '800,000'
- prop_price['village_cottage'] = 150000
- $prop_price['village_cottage'] = '150,000'
- prop_price['matryona_mansion'] = 1500000
- $prop_price['matryona_mansion'] = '1,500,000'
- prop_price['city_house'] = 100000
- $prop_price['city_house'] = '100,000'
- end
- !! Always call this function with gs and use killvar'property' after finished with the data.
- if $ARGS[0] = 'get_property_attr':
- if $ARGS[1] = 'city_apartment':
- $property['name'] = 'City residential apartment'
- $property['display'] = 'apartment in St. Petersburg''s residential area'
- $property['agency_display'] = 'An apartment in St. Petersburg''s residential area'
- $property['town'] = 'city'
- $property['location'] = 'city_residential'
- $property['entrance'] = 'korr'
- $property['type'] = 'permanent_residence'
- $property['price'] = $prop_price['city_apartment']
- $property['rent'] = $prop_rent['city_apartment']
- property['price'] = prop_price['city_apartment']
- property['rent'] = prop_rent['city_apartment']
- property['id'] = 1
- property['rental'] = 1
- property['internet_enabled'] = 1
- elseif $ARGS[1] = 'parents_home':
- $property['name'] = 'Parent''s home in Pavlovsk'
- $property['display'] = 'your parent''s home in Pavlovsk'
- $property['town'] = 'pavlovsk'
- $property['location'] = 'pav_complex'
- $property['entrance'] = 'korrPar'
- $property['type'] = 'permanent_residence'
- property['id'] = 2
- elseif $ARGS[1] = 'village_cottage':
- $property['name'] = 'My cottage in the cooperative village'
- $property['display'] = 'cottage in the cooperative village'
- $property['agency_display'] = 'A cottage located in the cooperative village'
- $property['town'] = 'city'
- $property['location'] = 'dachamy'
- $property['entrance'] = 'dachamy'
- $property['type'] = 'permanent_residence'
- $property['price'] = $prop_price['village_cottage']
- property['id'] = 3
- property['price'] = prop_price['village_cottage']
- property['internet_enabled'] = 1
- elseif $ARGS[1] = 'old_town_apartment':
- $property['name'] = 'Old town apartment'
- $property['display'] = 'old town apartment'
- $property['angecy-display'] = 'An apartment in the old town of Puskin.'
- $property['town'] = 'oldtown'
- $property['location'] = 'liames'
- $property['entrance'] = 'korr2x'
- $property['type'] = 'permanent_residence'
- $property['rent'] = $prop_rent['old_town_apartment']
- property['price'] = prop_rent['old_town_apartment']
- property['id'] = 4
- property['rental'] = 1
- property['internet_enabled'] = 1
- elseif $ARGS[1] = 'matryona_mansion':
- $property['name'] = 'Matryona mansion'
- $property['display'] = 'the Matryona mansion'
- $property['agency_display'] = 'A plot of land in the St. Petersburg''s suburbs'
- $property['town'] = 'city'
- $property['location'] = 'city_mansion_entrance'
- $property['entrance'] = 'city_mansion_residence_1'
- $property['type'] = 'permanent_residence'
- $property['price'] = $prop_rent['matryona_mansion']
- property['price'] = prop_rent['matryona_mansion']
- property['id'] = 5
- property['internet_enabled'] = 1
- property['contstruction_needed'] = 1
- elseif $ARGS[1] = 'pavlovsk_hotel':
- $property['name'] = 'My hotel room in Pavlovsk'
- $property['display'] = 'your hotel room in Pavlovsk'
- $property['town'] = 'pavlovsk'
- $property['location'] = 'pav_market'
- $property['entrance'] = 'pav_hotel'
- $property['type'] = 'temporary_residence'
- property['id'] = 6
- elseif $ARGS[1] = 'maid_bedroom':
- $property['name'] = 'Nicholas'' Apartment'
- $property['display'] = 'your maid bedroom in Nicholas'' apartment'
- $property['town'] = 'city'
- $property['location'] = 'city_center'
- $property['entrance'] = 'nichBedroomServant'
- $property['type'] = 'permanent_residence'
- property['id'] = 7
- elseif $ARGS[1] = 'nikos_apartment':
- $property['name'] = 'Niko''s apartment'
- $property['display'] = 'Niko''s apartment'
- $property['town'] = 'pavlovsk'
- $property['location'] = 'pav_residential'
- $property['entrance'] = 'pav_residential'
- $property['type'] = 'temporary_residence'
- property['id'] = 8
- elseif $ARGS[1] = 'sergeys_apartment':
- $property['name'] = 'Uncle Sergey''s apartment'
- $property['display'] = 'Uncle Sergey''s apartment'
- $property['town'] = 'pavlovsk'
- $property['location'] = 'pav_complex'
- $property['entrance'] = 'shulgahall'
- $property['type'] = 'temporary_residence'
- property['id'] = 9
- elseif $ARGS[1] = 'lyceum_dorm':
- $property['name'] = 'Lyceum school'
- $property['display'] = 'your room in the Lyceum dorm'
- $property['town'] = 'pavlovsk'
- $property['location'] = 'pav_commercial'
- $property['entrance'] = 'etoexhib'
- $property['type'] = 'permanent_residence'
- property['id'] = 10
- elseif $ARGS[1] = 'university_dorm':
- $property['name'] = 'University halls'
- $property['display'] = 'your room in the university dorm'
- $property['town'] = 'city'
- $property['location'] = 'city_island'
- $property['entrance'] = 'uni_dorm'
- $property['type'] = 'permanent_residence'
- property['id'] = 11
- elseif $ARGS[1] = 'hunters_lodge':
- $property['name'] = 'Hunter''s lodge in Gadukino'
- $property['display'] = 'the hunter''s lodge in Gadukino'
- $property['town'] = 'gadukino'
- $property['location'] = 'swamp_yard'
- $property['entrance'] = 'swamphouse'
- $property['type'] = 'temporary_residence'
- property['id'] = 12
- elseif $ARGS[1] = 'shared_apartment':
- $property['name'] = 'Shared apartment in Pavlovsk'
- $property['display'] = 'the shared apartment in Pavlovsk'
- $property['town'] = 'pavlovsk'
- $property['location'] = 'pav_complex'
- $property['entrance'] = 'pav_shared_apt'
- $property['type'] = 'temporary_residence'
- property['id'] = 13
- elseif $ARGS[1] = 'grandparents_house':
- $property['name'] = 'Grandparent''s house in Gadukino'
- $property['display'] = 'your grandparent''s house in Gadukino'
- $property['town'] = 'gadukino'
- $property['location'] = 'gaddvor'
- $property['entrance'] = 'gaddvor'
- $property['type'] = 'temporary_residence'
- property['id'] = 14
- elseif $ARGS[1] = 'city_house':
- $property['name'] = 'City residential house'
- $property['display'] = 'house in the St. Petersburg''s residential area'
- $property['agency_display'] = 'A house in the St. Petersburg''s residential area'
- $property['town'] = 'city'
- $property['location'] = 'city_residential'
- $property['entrance'] = 'city_house_res_misc'
- $property['type'] = 'permanent_residence'
- $property['price'] = $prop_price['city_house']
- property['price'] = prop_price['city_house']
- property['id'] = 15
- property['internet_enabled'] = 1
- elseif $ARGS[1] = 'meynold_household':
- $property['name'] = 'Meynold Household'
- $property['display'] = 'the Meynold Household'
- $property['town'] = 'pavlovsk'
- $property['location'] = 'pav_residential'
- $property['entrance'] = 'mey_home'
- $property['type'] = 'temporary_residence'
- property['id'] = 16
- else
- !! Nonexisting property. CAn be useful if someone wants to check if something is a property or not. For example the
- !! internet transfer code does this right now.
- gs 'homes_properties', 'mod_property_query_hook'
- if $property = '': $property = 'none'
- end
- end
- if $ARGS[0] = 'mod_property_query_hook':
- !! use this for the redirect
- mod_result = 1
- end
- if $ARGS[0] = 'set_home':
- gs 'homes_properties', 'get_property_attr', $ARGS[1]
- COPYARR 'home','property'
- $home['current'] = $ARGS[1]
- if $owned_property[$ARGS[1]+'-status'] = 0: gs 'homes_properties', 'set_ownership', $ARGS[1], 1
- killvar '$property'
- killvar 'property'
- end
- !! $ARGS[1]: the name of the property (the index name)
- !! ARGS[2]: ownership type
- !! 0: no acces -> 'no access'
- !! 1: rented -> 'rented'
- !! 2: owned -> 'owned'
- !! 3: owned and rented out -> 'tenants'
- !! 4: has acess -> 'has access' / homes that behave like rentals but no rent is tracked
- !! parents home, university dorm, lyceum dorm and the shared apartment, the Shulga and Meynold household, etc.
- !! ARGS[3]: construction status
- !! 0: land only
- !! 1: foundation, frames built, utilities are connected
- !! 2: fully built
- !! ARGS[4]:renovation status
- !! 0: not renovated
- !! 1: fully renovated
- if $ARGS[0] = 'set_ownership':
- gs 'homes_properties', 'get_property_attr', $ARGS[1]
- owned_property[$ARGS[1]] = ARGS[2]
- $owned_property[$ARGS[1]] = $ARGS[1]
- if $property['contstruction_needed'] = 1:
- owned_property[$ARGS[1]+'-construction-status'] = ARGS[3]
- else
- owned_property[$ARGS[1]+'-construction-status'] = 2
- end
- owned_property[$ARGS[1]+'-renovated'] = ARGS[4]
- if ARGS[2] = 1:
- owned_property[$ARGS[1]+'-days-left'] += func( 'homes_properties', 'rent_due')
- elseif ARGS[2] = 0:
- if $home['current'] = $ARGS[1]: killvar '$home'
- owned_property[$ARGS[1]+'-days-left'] = 0
- elseif ARGS[2] = 2 or ARGS[2] = 3:
- owned_property[$ARGS[1]+'-days-left'] = 0
- end
- killvar 'property'
- end
- !! Use it as a func() returns the total count of properties that are homes and are owned (including wiht tenants)
- if $ARGS[0] = 'get_owned_homes':
- i = 0
- count = ARRSIZE('owned_property')
- if count > 0:
- :countloop
- gs 'homes_properties', 'get_property_attr', $owned_property[i]
- if $property['type'] = 'permanent_residence' and (owned_property[i] = 2 or owned_property[i] = 3): counter += 1
- i += 1
- killvar 'property'
- if i < count: jump 'countloop'
- end
- result = counter
- killvar 'counter'
- killvar 'count'
- killvar 'i'
- end
- !! Use it as a func() returns the total count of rented properties that are homes
- if $ARGS[0] = 'get_rented_count':
- i = 0
- count = ARRSIZE('owned_property')
- if count > 0:
- :countloop
- gs 'homes_properties', 'get_property_attr', $owned_property[i]
- if $property['type'] = 'permanent_residence' or $property['type'] = 'temporary_residence' and owned_property[i] = 1: counter += 1
- i += 1
- killvar 'property'
- if i < count: jump 'countloop'
- end
- result = counter
- killvar 'counter'
- killvar 'count'
- killvar 'i'
- end
- !! Use it as a func() returns the total count of properties that are homes and accessible
- if $ARGS[0] = 'get_accessible_count':
- i = 0
- count = ARRSIZE('owned_property')
- if count > 0:
- :countloop
- gs 'homes_properties', 'get_property_attr', $owned_property[i]
- if $property['type'] = 'permanent_residence' or $property['type'] = 'temporary_residence' and owned_property[i] ! 0 and owned_property[i] ! 3: counter += 1
- i += 1
- killvar 'property'
- if i < count: jump 'countloop'
- end
- result = counter
- killvar 'counter'
- killvar 'count'
- killvar 'i'
- end
- !! ARGS[1] = the code name of the property, e.g. 'city_apartment'
- !! ARGS[2] - the number of days to add.
- !! if the value is 0 then the code will add the number of days that is there in the month
- if $ARGS[0] = 'add_rent_days':
- if ARGS[2] = 0:
- owned_property[$ARGS[1]+'-days-left'] += func( 'homes_properties', 'rent_due')
- else
- owned_property[$ARGS[1]+'-days-left'] += ARGS[2]
- end
- end
- !! ARGS[1] = the code name of the property, e.g. 'city_apartment'
- !! ARGS[2] - the number of days to set to.
- if $ARGS[0] = 'set_rent_days':
- owned_property[$ARGS[1]+'-days-left'] = ARGS[2]
- end
- !! Call it as a func()
- !! ARGS[1] = the code name of the property, e.g. 'city_apartment'
- if $ARGS[0] = 'get_rent_days':
- result = owned_property[$ARGS[1]+'-days-left']
- end
- !! Call it as a func()
- !! ARGS[1] = the code name of the property, e.g. 'city_apartment'
- if $ARGS[0] = 'property_construction_status':
- result = owned_property[$ARGS[1]+'-construction-status']
- end
- !! ARGS[1] = the code name of the property, e.g. 'city_apartment'
- if $ARGS[0] = 'progress_construction_status':
- if owned_property[$ARGS[1]+'-construction-status'] < 2: owned_property[$ARGS[1]+'-construction-status'] += 1
- end
- !! Call it as a func()
- !! ARGS[1] = the code name of the property, e.g. 'city_apartment'
- if $ARGS[0] = 'property_renovated':
- result = owned_property[$ARGS[1]+'-renovated']
- end
- !! Returns a simple string representation of the status
- !! ARGS[1]: the code name of the property, e.g. 'city_apartment'
- if $ARGS[0] = 'property_status_to_text':
- if ARGS[1] = 0:
- result = 'no access'
- elseif ARGS[1] = 1:
- result = 'rented'
- elseif ARGS[1] = 2:
- result = 'owned'
- elseif ARGS[1] = 3:
- result = 'tenants'
- elseif ARGS[1] = 4:
- result = 'has access'
- else
- result = 'invalid status'
- end
- end
- !! Returns a string that can be displayed in a longer text.
- !! For example 'You have tenants living in your city apartment.'
- !! ARGS[1]: The ownership type
- if $ARGS[0] = 'property_status_to_display_text':
- if ARGS[1] = 0:
- result = 'You have no access to '
- elseif ARGS[1] = 1:
- result = 'Yo are renting '
- elseif ARGS[1] = 2:
- result = 'You own '
- elseif ARGS[1] = 3:
- result = 'You have tenants living in '
- else
- result = 'invalid status'
- end
- end
- !! Returns the monthly rent the property has - both as a number and as a string (result and $result)
- !! Call as a func()
- !! ARGS[1] - the code (not display) name of the property, e.g. city_apartment
- if $ARGS[0] = 'get_rent':
- result = prop_rent[$ARGS[1]]
- end
- !! Returns the price of the property - both as a number and as a string (result and $result)
- !! Call as a func()
- !! ARGS[1] - the code (not display) name of the property, e.g. city_apartment
- if $ARGS[0] = 'get_price':
- result = prop_price[$ARGS[0]]
- end
- !! Returns the rent due date for the given month. Call as a func()
- if $ARGS[0] = 'rent_due':
- if month = 1 or month = 3 or month = 5 or month = 7 or month = 8 or month = 10 or month = 12:
- result = 31
- elseif month = 2:
- if ((year mod 4 = 0) and (year mod 100 ! 0)) or (year mod 400 = 0):
- result = 29
- else
- result = 28
- end
- else
- result = 30
- end
- end
- --- homes_properties ---------------------------------
|