Skip to content

Commit

Permalink
BSH Improvement Fix: Cleaning and Event Prob (#27852)
Browse files Browse the repository at this point in the history
* Fixed cleaning, reduced likelihood of events significantly due to massive number of events at high energy states

* Better and more readable probability
  • Loading branch information
PollardTheDragon authored Jan 6, 2025
1 parent 234cac7 commit 5229d13
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions code/modules/station_goals/bluespace_tap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
radio.follow_target = src
radio.config(list("Engineering" = 0))

/obj/machinery/power/bluespace_tap/post_clean()
/obj/machinery/power/bluespace_tap/cleaning_act(mob/user, atom/cleaner, cleanspeed, text_verb, text_description, text_targetname)
. = ..()
dirty = FALSE

Expand Down Expand Up @@ -507,10 +507,18 @@
flick_overlay_view(image(icon, src, "flash", FLY_LAYER))
log_game("Bluespace harvester product spawned at [turf]")

// Highest possible probabilty of an event
#define PROB_CAP 5
// Higher number means approaching the limit slower
#define PROB_CURVE 250

/obj/machinery/power/bluespace_tap/proc/try_events()
if(!mining_power)
return
if(!prob((mining_power / (10 MW)) + (emagged * 5))) // Calculate prob of event based on mining power. Return if no event.
// Calculate prob of event based on mining power. Return if no event.
var/megawatts = mining_power / 1000000
var/event_prob = (PROB_CAP * megawatts / (megawatts + PROB_CURVE)) + (emagged * 5)
if(!prob(event_prob))
return
var/static/list/event_list = list(
/datum/engi_event/bluespace_tap_event/dirty,
Expand All @@ -529,6 +537,8 @@
return
event.start_event()

#undef PROB_CAP
#undef PROB_CURVE
//UI stuff below

/obj/machinery/power/bluespace_tap/ui_act(action, params)
Expand Down

0 comments on commit 5229d13

Please sign in to comment.