Files
Bloop 183c5af2e4 Adds flag for virtual areas, fixes being able to send funds from virtualspace to real accounts (#94071)
## About The Pull Request

Fixes https://github.com/tgstation/tgstation/issues/90641
Fixes https://github.com/tgstation/tgstation/issues/88366

Eliminates worries over virtualspace currency being sent to real
accounts.

When I was looking into why there were no flags for bitrunning areas.
Then I saw this mess:

<img width="929" height="889" alt="Code_2we2QjDyFp"
src="https://github.com/user-attachments/assets/8a807bfe-b566-4057-a8ea-2b306325687d"
/>

Not having enough space / being too lazy to refactor this is a silly
reason to not include flags for something like these virtual areas where
it can be quite helpful. Fortunately I am not too lazy ~~in this
moment~~ so here we go:

It was fairly logical to move over some of these to a separate flag,
which I've called `area_flags_mapping` since they pertain to maploading
things and terrain generation mostly. `area_flags` stays reserved for
general properties and now has more room than it did before for you
people to fill it with.

In doing this it's also neatened up the code quit a bit, as UNIQUE_AREA
was kind of everywhere and now that it's implied by default less areas
need to have it defined (or explicitly un-defined).

<details> <summary> Working as intended </summary>

<img width="787" height="448" alt="dreamseeker_p0Qts36tG1"
src="https://github.com/user-attachments/assets/25056f34-8d43-4be2-a293-e53df7a7d1db"
/>

<img width="383" height="59" alt="dreamseeker_Ek7TXCcpbA"
src="https://github.com/user-attachments/assets/89622974-9467-4cdb-8345-d684f7c9004b"
/>

</details>

## Why It's Good For The Game

Fixes an exploit, improves the area flags situation slightly.

## Changelog

🆑
fix: you can no longer send money from virtualspace to a real account
code: adds a flag for virtual areas so they can easily be checked, as
well as an easy helper proc, 'is_area_virtual(your_area)'
/🆑
2025-11-22 12:24:41 -07:00

87 lines
2.6 KiB
Plaintext

/// Station side
/area/station/cargo/bitrunning
name = "Bitrunning"
/area/station/cargo/bitrunning/den
name = "Bitrunning Den"
desc = "Office of bitrunners, houses their equipment."
icon_state = "bit_den"
/// VDOM
/area/virtual_domain
name = "Virtual Domain Ruins"
icon_state = "bit_ruin"
icon = 'icons/area/areas_station.dmi'
area_flags = LOCAL_TELEPORT | EVENT_PROTECTED | HIDDEN_AREA | UNLIMITED_FISHING
area_flags_mapping = VIRTUAL_AREA
default_gravity = STANDARD_GRAVITY
requires_power = FALSE
/area/virtual_domain/fullbright
static_lighting = FALSE
base_lighting_alpha = 255
/// Safehouse
/area/virtual_domain/safehouse
name = "Virtual Domain Safehouse"
area_flags = LOCAL_TELEPORT | EVENT_PROTECTED | UNLIMITED_FISHING
area_flags_mapping = UNIQUE_AREA | VIRTUAL_AREA | VIRTUAL_SAFE_AREA
icon_state = "bit_safe"
requires_power = FALSE
sound_environment = SOUND_ENVIRONMENT_ROOM
/// Custom subtypes
/area/lavaland/surface/outdoors/virtual_domain
name = "Virtual Domain Lava Ruins"
icon_state = "bit_ruin"
area_flags = /area/virtual_domain::area_flags
area_flags_mapping = /area/virtual_domain::area_flags_mapping
/area/icemoon/underground/explored/virtual_domain
name = "Virtual Domain Ice Ruins"
icon_state = "bit_ice"
area_flags = /area/virtual_domain::area_flags
area_flags_mapping = /area/virtual_domain::area_flags_mapping
/area/ruin/space/virtual_domain
name = "Virtual Domain Unexplored Location"
icon = 'icons/area/areas_station.dmi'
icon_state = "bit_ruin"
area_flags = /area/virtual_domain::area_flags
area_flags_mapping = /area/virtual_domain::area_flags_mapping
/area/space/virtual_domain
name = "Virtual Domain Space"
icon = 'icons/area/areas_station.dmi'
icon_state = "bit_space"
area_flags = /area/virtual_domain::area_flags
area_flags_mapping = /area/virtual_domain::area_flags_mapping
///Areas that virtual entities should not be in
/area/virtual_domain/protected_space
name = "Virtual Domain Safe Zone"
area_flags = /area/virtual_domain/safehouse::area_flags
area_flags_mapping = /area/virtual_domain/safehouse::area_flags_mapping
icon_state = "bit_safe"
/area/virtual_domain/protected_space/fullbright
static_lighting = FALSE
base_lighting_alpha = 255
/// A hash lookup list of all the virtual area types
GLOBAL_LIST_INIT_TYPED(virtual_areas, /area, populate_virtual_areas())
/// Constructs the list of virtual areas
/proc/populate_virtual_areas()
RETURN_TYPE(/list/area)
var/list/area/virtual_areas = list()
for(var/area/area_type as anything in subtypesof(/area))
if (area_type::area_flags_mapping & VIRTUAL_AREA)
virtual_areas[area_type] = TRUE
return virtual_areas