Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance: Underfloor Blobs #1064

Merged
merged 10 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _maps/cyberiad.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"map_file": "Cyberiad.dmm",
"fluff_name": "ИСН Кибериада",
"welcome_sound_override": "modular_bandastation/aesthetics_sounds/sound/welcome_sounds/welcome_cyberiad.ogg",
"main_floors": 2,
"shuttles": {
"cargo": "cargo_box",
"ferry": "ferry_fancy",
Expand Down
1 change: 1 addition & 0 deletions _maps/icebox.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"space_ruin_levels": 0,
"space_empty_levels": 0,
"planetary": 1,
"main_floors": 3,
"shuttles": {
"cargo": "cargo_box",
"ferry": "ferry_fancy",
Expand Down
1 change: 1 addition & 0 deletions _maps/nebulastation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"map_name": "NebulaStation",
"map_path": "map_files/NebulaStation",
"map_file": "NebulaStation.dmm",
"main_floors": 2,
"shuttles": {
"cargo": "cargo_nebula",
"ferry": "ferry_nebula",
Expand Down
1 change: 1 addition & 0 deletions _maps/tramstation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"map_name": "Tramstation",
"map_path": "map_files/tramstation",
"map_file": "tramstation.dmm",
"main_floors": 2,
"shuttles": {
"cargo": "cargo_box",
"ferry": "ferry_fancy",
Expand Down
1 change: 1 addition & 0 deletions _maps/wawastation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"map_name": "Wawastation",
"map_path": "map_files/wawastation",
"map_file": "wawastation.dmm",
"main_floors": 1,
"shuttles": {
"cargo": "cargo_box",
"ferry": "ferry_fancy",
Expand Down
12 changes: 11 additions & 1 deletion code/datums/map_config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var/space_empty_levels = DEFAULT_SPACE_EMPTY_LEVELS
/// Boolean that tells us if this is a planetary station. (like IceBoxStation)
var/planetary = FALSE

///The type of mining Z-level that should be loaded.
var/minetype = "lavaland"
///If no minetype is set, this will be the blacklist file used
Expand All @@ -49,6 +49,11 @@
/// Boolean that tells SSmapping to load all away missions in the codebase.
var/load_all_away_missions = FALSE

// BANDASTATION ADDITION START - Underfloor Blobs
/// Main floor of the map. Null as default, if not specified in json
var/main_floors = null
// BANDASTATION ADDITION END - Underfloor Blobs

// BANDASTATION ADDITION START - Station Fluff
/// This name will override all other station names, like holiday or randomly generated.
/// Station name change still will work.
Expand Down Expand Up @@ -199,6 +204,11 @@
if ("load_all_away_missions" in json)
load_all_away_missions = json["load_all_away_missions"]

// BANDASTATION ADDITION START - Underfloor Blobs
if ("main_floors" in json)
main_floors = json["main_floors"]
// BANDASTATION ADDITION END - Underfloor Blobs

// BANDASTATION ADDITION START - Station Fluff
if ("fluff_name" in json)
fluff_name = json["fluff_name"]
Expand Down
6 changes: 3 additions & 3 deletions code/modules/antagonists/blob/powers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
to_chat(src, span_warning("There is no blob adjacent to the target tile!"))
return FALSE

if(!can_buy(BLOB_EXPAND_COST))
if(!can_buy(expand_cost)) // BANDASTATION EDIT - Underfloor Blobs
return FALSE

var/attack_success
Expand All @@ -316,7 +316,7 @@
add_points(BLOB_ATTACK_REFUND)
else
to_chat(src, span_warning("There is a blob there!"))
add_points(BLOB_EXPAND_COST) //otherwise, refund all of the cost
add_points(expand_cost) //otherwise, refund all of the cost // BANDASTATION EDIT - Underfloor Blobs
else
directional_attack(tile, possible_blobs, attack_success)

Expand Down Expand Up @@ -349,7 +349,7 @@
playsound(attacker, 'sound/effects/splat.ogg', 50, TRUE)
add_points(BLOB_ATTACK_REFUND)
else
add_points(BLOB_EXPAND_COST) //if we're attacking diagonally and didn't hit anything, refund
add_points(expand_cost) //if we're attacking diagonally and didn't hit anything, refund // BANDASTATION EDIT - Underfloor Blobs
return TRUE

/** Rally spores to a location */
Expand Down
35 changes: 35 additions & 0 deletions modular_bandastation/_helpers220/code/unsorted.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* Checks if the target's Z-level is the "main" station floor for the current map.
*
* This proc compares the Z-level of the target atom with the main station floor Z-level
* specified in the map's JSON configuration. If the target's Z-level matches the main floor,
* it returns TRUE; otherwise, it returns FALSE.
*
* @param target The atom whose Z-level is being checked.
* @return TRUE if the target is on the main station floor, FALSE otherwise.
*/
/proc/main_station_floor(atom/target)
// Access the current map configuration
var/datum/map_config/current_map = SSmapping.current_map

// If main_floors is not specified in the JSON, assume the target is ON the main floor
if(isnull(current_map.main_floors))
return TRUE

// Get the main floor Z-level for the current map
var/main_floor = current_map.main_floors

// Get the Z-level of the target object
var/target_z = target.z

// Get the Z-level associated with the main station floor
var/list/station_levels = SSmapping.levels_by_trait(ZTRAIT_STATION)

// Get the Z-level of the main station floor
var/station_z = station_levels[main_floor]

// Check if the target's Z-level matches the main station floor
if(target_z == station_z)
return TRUE
else
return FALSE
1 change: 1 addition & 0 deletions modular_bandastation/balance/_balance.dme
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "code/cargo/packs/livestock.dm"
#include "code/cargo/packs/science.dm"
#include "code/cargo/packs/security.dm"
#include "code/blob.dm"
#include "code/crew_manifest.dm"
#include "code/dynamic.dm"
#include "code/events.dm"
Expand Down
26 changes: 26 additions & 0 deletions modular_bandastation/balance/code/blob.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/mob/eye/blob
var/expand_cost = BLOB_EXPAND_COST

/mob/eye/blob/Initialize(mapload, starting_points)
. = ..()
check_station_floor()

/mob/eye/blob/Login()
. = ..()
if(!main_station_floor(src))
var/blob_message = "[span_boldwarning("Поскольку Вы находитесь не на основном этаже станции, Вы получаете следующие дебаффы:")]\n"
blob_message += "1. Вам требуется больше тайлов для захвата.\n"
blob_message += "2. Вам требуется больше ресурсов для установки тайла блоба."
to_chat(src, boxed_message(blob_message))
dj-34 marked this conversation as resolved.
Show resolved Hide resolved

/mob/eye/blob/proc/check_station_floor()
if(main_station_floor(src))
return
expand_cost = BLOB_EXPAND_COST * 2
blobwincount = 700

/datum/action/innate/blobpop/Activate(timer_activated = FALSE)
if(!main_station_floor(usr))
if(tgui_alert(usr, "Вы находитесь не на основном этаже станции. Появление приведёт к накладыванию дебаффа. Вы уверены?", "Появление Блоба", list("Да", "Нет")) != "Да")
return
return ..()
Loading