mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 21:19:44 +01:00
Whitespace Standardization [MDB IGNORE] (#15748)
* Update settings * Whitespace changes * Comment out merger hooks in gitattributes Corrupt maps would have to be resolved in repo before hooks could be updated * Revert "Whitespace changes" This reverts commitafbdd1d844. * Whitespace again minus example * Gitignore example changelog * Restore changelog merge setting * Keep older dmi hook attribute until hooks can be updated * update vscode settings too * Renormalize remaining * Revert "Gitignore example changelog" This reverts commitde22ad375d. * Attempt to normalize example.yml (and another file I guess) * Try again
This commit is contained in:
@@ -1,61 +1,61 @@
|
||||
/datum/event2/meta/manifest_malfunction
|
||||
name = "manifest_malfunction"
|
||||
departments = list(DEPARTMENT_COMMAND, DEPARTMENT_SECURITY, DEPARTMENT_EVERYONE)
|
||||
chaos = 10
|
||||
chaotic_threshold = EVENT_CHAOS_THRESHOLD_LOW_IMPACT
|
||||
event_type = /datum/event2/event/manifest_malfunction
|
||||
|
||||
/datum/event2/meta/manifest_malfunction/get_weight()
|
||||
var/security = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
|
||||
if(!security || !data_core)
|
||||
return 0
|
||||
|
||||
var/command = metric.count_people_with_job(/datum/job/hop) + metric.count_people_with_job(/datum/job/captain)
|
||||
var/synths = metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/everyone = metric.count_people_in_department(DEPARTMENT_EVERYONE) - (synths + security + command) // So they don't get counted twice.
|
||||
|
||||
return (security * 10) + (synths * 20) + (command * 20) + (everyone * 5)
|
||||
|
||||
|
||||
|
||||
/datum/event2/event/manifest_malfunction
|
||||
announce_delay_lower_bound = 5 MINUTES
|
||||
announce_delay_upper_bound = 10 MINUTES
|
||||
var/records_to_delete = 2
|
||||
var/record_class_to_delete = null
|
||||
|
||||
/datum/event2/event/manifest_malfunction/set_up()
|
||||
record_class_to_delete = pickweight(list("medical" = 10, "security" = 30))
|
||||
|
||||
/datum/event2/event/manifest_malfunction/announce()
|
||||
if(prob(30))
|
||||
var/message = null
|
||||
var/author = null
|
||||
var/rng = rand(1, 2)
|
||||
switch(rng)
|
||||
if(1)
|
||||
author = "Data Breach Alert"
|
||||
message = "The [record_class_to_delete] record database has suffered from an attack by one or more hackers. \
|
||||
They appear to have wiped several records, before disconnecting."
|
||||
if(2)
|
||||
author = "Downtime Alert"
|
||||
message = "The [record_class_to_delete] record database server has suffered a hardware failure, and is no longer functional. \
|
||||
A temporary replacement server has been activated, containing recovered data from the main server. \
|
||||
A few records became corrupted, and could not be transferred."
|
||||
command_announcement.Announce(message, author)
|
||||
|
||||
/datum/event2/event/manifest_malfunction/start()
|
||||
for(var/i = 1 to records_to_delete)
|
||||
var/datum/data/record/R
|
||||
|
||||
switch(record_class_to_delete)
|
||||
if("security")
|
||||
R = safepick(data_core.security)
|
||||
|
||||
if("medical")
|
||||
R = safepick(data_core.medical)
|
||||
|
||||
if(R)
|
||||
log_debug("Manifest malfunction event is now deleting [R.fields["name"]]'s [record_class_to_delete] record.")
|
||||
qdel(R)
|
||||
/datum/event2/meta/manifest_malfunction
|
||||
name = "manifest_malfunction"
|
||||
departments = list(DEPARTMENT_COMMAND, DEPARTMENT_SECURITY, DEPARTMENT_EVERYONE)
|
||||
chaos = 10
|
||||
chaotic_threshold = EVENT_CHAOS_THRESHOLD_LOW_IMPACT
|
||||
event_type = /datum/event2/event/manifest_malfunction
|
||||
|
||||
/datum/event2/meta/manifest_malfunction/get_weight()
|
||||
var/security = metric.count_people_in_department(DEPARTMENT_SECURITY)
|
||||
|
||||
if(!security || !data_core)
|
||||
return 0
|
||||
|
||||
var/command = metric.count_people_with_job(/datum/job/hop) + metric.count_people_with_job(/datum/job/captain)
|
||||
var/synths = metric.count_people_in_department(DEPARTMENT_SYNTHETIC)
|
||||
var/everyone = metric.count_people_in_department(DEPARTMENT_EVERYONE) - (synths + security + command) // So they don't get counted twice.
|
||||
|
||||
return (security * 10) + (synths * 20) + (command * 20) + (everyone * 5)
|
||||
|
||||
|
||||
|
||||
/datum/event2/event/manifest_malfunction
|
||||
announce_delay_lower_bound = 5 MINUTES
|
||||
announce_delay_upper_bound = 10 MINUTES
|
||||
var/records_to_delete = 2
|
||||
var/record_class_to_delete = null
|
||||
|
||||
/datum/event2/event/manifest_malfunction/set_up()
|
||||
record_class_to_delete = pickweight(list("medical" = 10, "security" = 30))
|
||||
|
||||
/datum/event2/event/manifest_malfunction/announce()
|
||||
if(prob(30))
|
||||
var/message = null
|
||||
var/author = null
|
||||
var/rng = rand(1, 2)
|
||||
switch(rng)
|
||||
if(1)
|
||||
author = "Data Breach Alert"
|
||||
message = "The [record_class_to_delete] record database has suffered from an attack by one or more hackers. \
|
||||
They appear to have wiped several records, before disconnecting."
|
||||
if(2)
|
||||
author = "Downtime Alert"
|
||||
message = "The [record_class_to_delete] record database server has suffered a hardware failure, and is no longer functional. \
|
||||
A temporary replacement server has been activated, containing recovered data from the main server. \
|
||||
A few records became corrupted, and could not be transferred."
|
||||
command_announcement.Announce(message, author)
|
||||
|
||||
/datum/event2/event/manifest_malfunction/start()
|
||||
for(var/i = 1 to records_to_delete)
|
||||
var/datum/data/record/R
|
||||
|
||||
switch(record_class_to_delete)
|
||||
if("security")
|
||||
R = safepick(data_core.security)
|
||||
|
||||
if("medical")
|
||||
R = safepick(data_core.medical)
|
||||
|
||||
if(R)
|
||||
log_debug("Manifest malfunction event is now deleting [R.fields["name"]]'s [record_class_to_delete] record.")
|
||||
qdel(R)
|
||||
|
||||
@@ -1,110 +1,110 @@
|
||||
/datum/event2/meta/money_hacker
|
||||
name = "money hacker"
|
||||
departments = list(DEPARTMENT_COMMAND)
|
||||
chaos = 10
|
||||
chaotic_threshold = EVENT_CHAOS_THRESHOLD_LOW_IMPACT
|
||||
event_type = /datum/event2/event/money_hacker
|
||||
|
||||
/datum/event2/meta/money_hacker/get_weight()
|
||||
var/command = metric.count_people_with_job(/datum/job/hop) + metric.count_people_with_job(/datum/job/captain)
|
||||
|
||||
if(!command)
|
||||
return 0
|
||||
return 30 + (command * 20) + (all_money_accounts.len * 5)
|
||||
|
||||
|
||||
|
||||
/datum/event2/event/money_hacker
|
||||
length_lower_bound = 8 MINUTES
|
||||
length_upper_bound = 12 MINUTES
|
||||
var/datum/money_account/targeted_account = null
|
||||
|
||||
/datum/event2/event/money_hacker/set_up()
|
||||
if(LAZYLEN(all_money_accounts))
|
||||
targeted_account = pick(all_money_accounts)
|
||||
|
||||
if(!targeted_account)
|
||||
log_debug("Money hacker event could not find an account to hack. Aborting.")
|
||||
abort()
|
||||
return
|
||||
|
||||
/datum/event2/event/money_hacker/announce()
|
||||
var/message = "A brute force hack has been detected (in progress since [stationtime2text()]). The target of the attack is: Financial account #[targeted_account.account_number], \
|
||||
without intervention this attack will succeed in approximately 10 minutes. Required intervention: temporary suspension of affected accounts until the attack has ceased. \
|
||||
Notifications will be sent as updates occur."
|
||||
var/my_department = "[location_name()] Firewall Subroutines"
|
||||
|
||||
for(var/obj/machinery/message_server/MS in machines)
|
||||
if(!MS.active)
|
||||
continue
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, "[message]<br>", "", "", 2)
|
||||
|
||||
// Nobody reads the requests consoles so lets use the radio as well.
|
||||
global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
|
||||
/datum/event2/event/money_hacker/end()
|
||||
var/message = null
|
||||
if(targeted_account && !targeted_account.suspended) // Hacker wins.
|
||||
message = "The hack attempt has succeeded."
|
||||
hack_account(targeted_account)
|
||||
log_debug("Money hacker event managed to hack the targeted account.")
|
||||
|
||||
else // Crew wins.
|
||||
message = "The attack has ceased, the affected accounts can now be brought online."
|
||||
log_debug("Money hacker event failed to hack the targeted account due to intervention by the crew.")
|
||||
|
||||
var/my_department = "[location_name()] Firewall Subroutines"
|
||||
|
||||
for(var/obj/machinery/message_server/MS in machines)
|
||||
if(!MS.active) continue
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
|
||||
|
||||
global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
|
||||
/datum/event2/event/money_hacker/proc/hack_account(datum/money_account/A)
|
||||
// Subtract the money.
|
||||
var/lost = A.money * 0.8 + (rand(2,4) - 2) / 10
|
||||
A.money -= lost
|
||||
|
||||
// Create a taunting log entry.
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = pick(list(
|
||||
"",
|
||||
"yo brotha from anotha motha",
|
||||
"el Presidente",
|
||||
"chieF smackDowN",
|
||||
"Nobody"
|
||||
))
|
||||
|
||||
T.purpose = pick(list(
|
||||
"Ne$ ---ount fu%ds init*&lisat@*n",
|
||||
"PAY BACK YOUR MUM",
|
||||
"Funds withdrawal",
|
||||
"pWnAgE",
|
||||
"l33t hax",
|
||||
"liberationez",
|
||||
"Hit",
|
||||
"Nothing"
|
||||
))
|
||||
|
||||
T.amount = pick(list(
|
||||
"",
|
||||
"([rand(0,99999)])",
|
||||
"alla money",
|
||||
"9001$",
|
||||
"HOLLA HOLLA GET DOLLA",
|
||||
"([lost])",
|
||||
"69,420t"
|
||||
))
|
||||
|
||||
var/date1 = "1 January 1970" // Unix epoch.
|
||||
var/date2 = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [rand(1000,3000)]"
|
||||
T.date = pick("", current_date_string, date1, date2,"Nowhen")
|
||||
|
||||
var/time1 = rand(0, 99999999)
|
||||
var/time2 = "[round(time1 / 36000)+12]:[(time1 / 600 % 60) < 10 ? add_zero(time1 / 600 % 60, 1) : time1 / 600 % 60]"
|
||||
T.time = pick("", stationtime2text(), time2, "Never")
|
||||
|
||||
T.source_terminal = pick("","[pick("Biesel","New Gibson")] GalaxyNet Terminal #[rand(111,999)]","your mums place","nantrasen high CommanD","Angessa's Pearl","Nowhere")
|
||||
|
||||
A.transaction_log.Add(T)
|
||||
/datum/event2/meta/money_hacker
|
||||
name = "money hacker"
|
||||
departments = list(DEPARTMENT_COMMAND)
|
||||
chaos = 10
|
||||
chaotic_threshold = EVENT_CHAOS_THRESHOLD_LOW_IMPACT
|
||||
event_type = /datum/event2/event/money_hacker
|
||||
|
||||
/datum/event2/meta/money_hacker/get_weight()
|
||||
var/command = metric.count_people_with_job(/datum/job/hop) + metric.count_people_with_job(/datum/job/captain)
|
||||
|
||||
if(!command)
|
||||
return 0
|
||||
return 30 + (command * 20) + (all_money_accounts.len * 5)
|
||||
|
||||
|
||||
|
||||
/datum/event2/event/money_hacker
|
||||
length_lower_bound = 8 MINUTES
|
||||
length_upper_bound = 12 MINUTES
|
||||
var/datum/money_account/targeted_account = null
|
||||
|
||||
/datum/event2/event/money_hacker/set_up()
|
||||
if(LAZYLEN(all_money_accounts))
|
||||
targeted_account = pick(all_money_accounts)
|
||||
|
||||
if(!targeted_account)
|
||||
log_debug("Money hacker event could not find an account to hack. Aborting.")
|
||||
abort()
|
||||
return
|
||||
|
||||
/datum/event2/event/money_hacker/announce()
|
||||
var/message = "A brute force hack has been detected (in progress since [stationtime2text()]). The target of the attack is: Financial account #[targeted_account.account_number], \
|
||||
without intervention this attack will succeed in approximately 10 minutes. Required intervention: temporary suspension of affected accounts until the attack has ceased. \
|
||||
Notifications will be sent as updates occur."
|
||||
var/my_department = "[location_name()] Firewall Subroutines"
|
||||
|
||||
for(var/obj/machinery/message_server/MS in machines)
|
||||
if(!MS.active)
|
||||
continue
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, "[message]<br>", "", "", 2)
|
||||
|
||||
// Nobody reads the requests consoles so lets use the radio as well.
|
||||
global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
|
||||
/datum/event2/event/money_hacker/end()
|
||||
var/message = null
|
||||
if(targeted_account && !targeted_account.suspended) // Hacker wins.
|
||||
message = "The hack attempt has succeeded."
|
||||
hack_account(targeted_account)
|
||||
log_debug("Money hacker event managed to hack the targeted account.")
|
||||
|
||||
else // Crew wins.
|
||||
message = "The attack has ceased, the affected accounts can now be brought online."
|
||||
log_debug("Money hacker event failed to hack the targeted account due to intervention by the crew.")
|
||||
|
||||
var/my_department = "[location_name()] Firewall Subroutines"
|
||||
|
||||
for(var/obj/machinery/message_server/MS in machines)
|
||||
if(!MS.active) continue
|
||||
MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2)
|
||||
|
||||
global_announcer.autosay(message, my_department, DEPARTMENT_COMMAND)
|
||||
|
||||
/datum/event2/event/money_hacker/proc/hack_account(datum/money_account/A)
|
||||
// Subtract the money.
|
||||
var/lost = A.money * 0.8 + (rand(2,4) - 2) / 10
|
||||
A.money -= lost
|
||||
|
||||
// Create a taunting log entry.
|
||||
var/datum/transaction/T = new()
|
||||
T.target_name = pick(list(
|
||||
"",
|
||||
"yo brotha from anotha motha",
|
||||
"el Presidente",
|
||||
"chieF smackDowN",
|
||||
"Nobody"
|
||||
))
|
||||
|
||||
T.purpose = pick(list(
|
||||
"Ne$ ---ount fu%ds init*&lisat@*n",
|
||||
"PAY BACK YOUR MUM",
|
||||
"Funds withdrawal",
|
||||
"pWnAgE",
|
||||
"l33t hax",
|
||||
"liberationez",
|
||||
"Hit",
|
||||
"Nothing"
|
||||
))
|
||||
|
||||
T.amount = pick(list(
|
||||
"",
|
||||
"([rand(0,99999)])",
|
||||
"alla money",
|
||||
"9001$",
|
||||
"HOLLA HOLLA GET DOLLA",
|
||||
"([lost])",
|
||||
"69,420t"
|
||||
))
|
||||
|
||||
var/date1 = "1 January 1970" // Unix epoch.
|
||||
var/date2 = "[num2text(rand(1,31))] [pick("January","February","March","April","May","June","July","August","September","October","November","December")], [rand(1000,3000)]"
|
||||
T.date = pick("", current_date_string, date1, date2,"Nowhen")
|
||||
|
||||
var/time1 = rand(0, 99999999)
|
||||
var/time2 = "[round(time1 / 36000)+12]:[(time1 / 600 % 60) < 10 ? add_zero(time1 / 600 % 60, 1) : time1 / 600 % 60]"
|
||||
T.time = pick("", stationtime2text(), time2, "Never")
|
||||
|
||||
T.source_terminal = pick("","[pick("Biesel","New Gibson")] GalaxyNet Terminal #[rand(111,999)]","your mums place","nantrasen high CommanD","Angessa's Pearl","Nowhere")
|
||||
|
||||
A.transaction_log.Add(T)
|
||||
|
||||
@@ -1,96 +1,96 @@
|
||||
/datum/event2/meta/raise_funds
|
||||
name = "local funding drive"
|
||||
enabled = FALSE // There isn't really any suitable way for the crew to generate thalers right now, if that gets fixed feel free to turn this event on.
|
||||
departments = list(DEPARTMENT_COMMAND, DEPARTMENT_CARGO)
|
||||
chaotic_threshold = EVENT_CHAOS_THRESHOLD_LOW_IMPACT
|
||||
event_type = /datum/event2/event/raise_funds
|
||||
|
||||
/datum/event2/meta/raise_funds/get_weight()
|
||||
var/command = metric.count_people_in_department(DEPARTMENT_COMMAND)
|
||||
if(!command) // Need someone to read the centcom message.
|
||||
return 0
|
||||
|
||||
var/cargo = metric.count_people_in_department(DEPARTMENT_CARGO)
|
||||
return (command * 20) + (cargo * 20)
|
||||
|
||||
|
||||
|
||||
/datum/event2/event/raise_funds
|
||||
length_lower_bound = 30 MINUTES
|
||||
length_upper_bound = 45 MINUTES
|
||||
var/money_at_start = 0
|
||||
|
||||
/datum/event2/event/raise_funds/announce()
|
||||
var/message = "Due to [pick("recent", "unfortunate", "possible future")] budget \
|
||||
[pick("changes", "issues")], in-system stations are now advised to increase funding income."
|
||||
|
||||
send_command_report("Budget Advisement", message)
|
||||
|
||||
/datum/event2/event/raise_funds/start()
|
||||
// Note that the event remembers the amount of money when it started. If an issue develops where people try to scam centcom by
|
||||
// taking out loads of money before the event, then depositing it back in after the event fires, feel free to make this check for
|
||||
// roundstart money instead.
|
||||
money_at_start = count_money()
|
||||
log_debug("Funding Drive event logged a sum of [money_at_start] thalers in all station accounts at the start of the event.")
|
||||
|
||||
/datum/event2/event/raise_funds/end()
|
||||
var/money_at_end = count_money()
|
||||
log_debug("Funding Drive event logged a sum of [money_at_end] thalers in all station accounts at the end of the event, compared \
|
||||
to [money_at_start] thalers. A difference of [money_at_end / money_at_start] was calculated.")
|
||||
|
||||
// A number above 1 indicates money was made, while below 1 does the opposite.
|
||||
var/budget_shift = money_at_end / money_at_start
|
||||
|
||||
// Centcom will say different things based on if they gained or lost money.
|
||||
var/message = null
|
||||
switch(budget_shift)
|
||||
if(0 to 0.02) // Abyssmal response.
|
||||
message = "We are very interested in learning where [round(money_at_start, 1000)] thaler went in \
|
||||
just half an hour. We highly recommend rectifying this issue before the end of the shift, otherwise a \
|
||||
discussion regarding your future employment prospects will occur.<br><br>\
|
||||
Your facility's current balance of requisition tokens has been revoked."
|
||||
SSsupply.points = 0
|
||||
log_debug("Funding Drive event ended with an abyssmal response, and the loss of all cargo points.")
|
||||
|
||||
if(0.02 to 0.98) // Bad response.
|
||||
message = "We're very disappointed that \the [location_name()] has ran a deficit since our request. \
|
||||
As such, we will be taking away some requisition tokens to cover the cost of operating your facility."
|
||||
var/points_lost = round(SSsupply.points * rand(0.5, 0.8))
|
||||
SSsupply.points -= points_lost
|
||||
log_debug("Funding Drive event ended with a bad response, and [points_lost] cargo points was taken away.")
|
||||
|
||||
if(0.98 to 1.02) // Neutral response.
|
||||
message = "It is unfortunate that \the [location_name()]'s finances remain at a standstill, however \
|
||||
that is still preferred over having a decicit. We hope that in the future, your facility will be able to be \
|
||||
more profitable."
|
||||
log_debug("Funding Drive event ended with a neutral response.")
|
||||
|
||||
if(1.02 to INFINITY) // Good response.
|
||||
message = "We appreciate the efforts made by \the [location_name()] to run at a surplus. \
|
||||
Together, along with the other facilities present in the [using_map.starsys_name] system, \
|
||||
the company is expected to meet the quota.<br><br>\
|
||||
We will allocate additional requisition tokens for the cargo department as a reward."
|
||||
|
||||
// If cargo is ever made to use station funds instead of cargo points, then a new kind of reward will be needed.
|
||||
// Otherwise it would be weird for centcom to go 'thanks for not spending money, your reward is money to spend'.
|
||||
var/point_reward = rand(100, 200)
|
||||
SSsupply.points += point_reward
|
||||
log_debug("Funding Drive event ended with a good response and a bonus of [point_reward] cargo points.")
|
||||
|
||||
send_command_report("Budget Followup", message)
|
||||
|
||||
|
||||
|
||||
// Returns the sum of the station account and all the departmental accounts.
|
||||
/datum/event2/event/raise_funds/proc/count_money()
|
||||
. = 0
|
||||
. += station_account.money
|
||||
for(var/i = 1 to SSjob.department_datums.len)
|
||||
var/datum/money_account/account = LAZYACCESS(department_accounts, SSjob.department_datums[i])
|
||||
if(istype(account))
|
||||
. += account.money
|
||||
|
||||
/datum/event2/event/raise_funds/proc/send_command_report(title, message)
|
||||
post_comm_message(title, message)
|
||||
to_world(span("danger", "New [using_map.company_name] Update available at all communication consoles."))
|
||||
SEND_SOUND(world, 'sound/AI/commandreport.ogg')
|
||||
/datum/event2/meta/raise_funds
|
||||
name = "local funding drive"
|
||||
enabled = FALSE // There isn't really any suitable way for the crew to generate thalers right now, if that gets fixed feel free to turn this event on.
|
||||
departments = list(DEPARTMENT_COMMAND, DEPARTMENT_CARGO)
|
||||
chaotic_threshold = EVENT_CHAOS_THRESHOLD_LOW_IMPACT
|
||||
event_type = /datum/event2/event/raise_funds
|
||||
|
||||
/datum/event2/meta/raise_funds/get_weight()
|
||||
var/command = metric.count_people_in_department(DEPARTMENT_COMMAND)
|
||||
if(!command) // Need someone to read the centcom message.
|
||||
return 0
|
||||
|
||||
var/cargo = metric.count_people_in_department(DEPARTMENT_CARGO)
|
||||
return (command * 20) + (cargo * 20)
|
||||
|
||||
|
||||
|
||||
/datum/event2/event/raise_funds
|
||||
length_lower_bound = 30 MINUTES
|
||||
length_upper_bound = 45 MINUTES
|
||||
var/money_at_start = 0
|
||||
|
||||
/datum/event2/event/raise_funds/announce()
|
||||
var/message = "Due to [pick("recent", "unfortunate", "possible future")] budget \
|
||||
[pick("changes", "issues")], in-system stations are now advised to increase funding income."
|
||||
|
||||
send_command_report("Budget Advisement", message)
|
||||
|
||||
/datum/event2/event/raise_funds/start()
|
||||
// Note that the event remembers the amount of money when it started. If an issue develops where people try to scam centcom by
|
||||
// taking out loads of money before the event, then depositing it back in after the event fires, feel free to make this check for
|
||||
// roundstart money instead.
|
||||
money_at_start = count_money()
|
||||
log_debug("Funding Drive event logged a sum of [money_at_start] thalers in all station accounts at the start of the event.")
|
||||
|
||||
/datum/event2/event/raise_funds/end()
|
||||
var/money_at_end = count_money()
|
||||
log_debug("Funding Drive event logged a sum of [money_at_end] thalers in all station accounts at the end of the event, compared \
|
||||
to [money_at_start] thalers. A difference of [money_at_end / money_at_start] was calculated.")
|
||||
|
||||
// A number above 1 indicates money was made, while below 1 does the opposite.
|
||||
var/budget_shift = money_at_end / money_at_start
|
||||
|
||||
// Centcom will say different things based on if they gained or lost money.
|
||||
var/message = null
|
||||
switch(budget_shift)
|
||||
if(0 to 0.02) // Abyssmal response.
|
||||
message = "We are very interested in learning where [round(money_at_start, 1000)] thaler went in \
|
||||
just half an hour. We highly recommend rectifying this issue before the end of the shift, otherwise a \
|
||||
discussion regarding your future employment prospects will occur.<br><br>\
|
||||
Your facility's current balance of requisition tokens has been revoked."
|
||||
SSsupply.points = 0
|
||||
log_debug("Funding Drive event ended with an abyssmal response, and the loss of all cargo points.")
|
||||
|
||||
if(0.02 to 0.98) // Bad response.
|
||||
message = "We're very disappointed that \the [location_name()] has ran a deficit since our request. \
|
||||
As such, we will be taking away some requisition tokens to cover the cost of operating your facility."
|
||||
var/points_lost = round(SSsupply.points * rand(0.5, 0.8))
|
||||
SSsupply.points -= points_lost
|
||||
log_debug("Funding Drive event ended with a bad response, and [points_lost] cargo points was taken away.")
|
||||
|
||||
if(0.98 to 1.02) // Neutral response.
|
||||
message = "It is unfortunate that \the [location_name()]'s finances remain at a standstill, however \
|
||||
that is still preferred over having a decicit. We hope that in the future, your facility will be able to be \
|
||||
more profitable."
|
||||
log_debug("Funding Drive event ended with a neutral response.")
|
||||
|
||||
if(1.02 to INFINITY) // Good response.
|
||||
message = "We appreciate the efforts made by \the [location_name()] to run at a surplus. \
|
||||
Together, along with the other facilities present in the [using_map.starsys_name] system, \
|
||||
the company is expected to meet the quota.<br><br>\
|
||||
We will allocate additional requisition tokens for the cargo department as a reward."
|
||||
|
||||
// If cargo is ever made to use station funds instead of cargo points, then a new kind of reward will be needed.
|
||||
// Otherwise it would be weird for centcom to go 'thanks for not spending money, your reward is money to spend'.
|
||||
var/point_reward = rand(100, 200)
|
||||
SSsupply.points += point_reward
|
||||
log_debug("Funding Drive event ended with a good response and a bonus of [point_reward] cargo points.")
|
||||
|
||||
send_command_report("Budget Followup", message)
|
||||
|
||||
|
||||
|
||||
// Returns the sum of the station account and all the departmental accounts.
|
||||
/datum/event2/event/raise_funds/proc/count_money()
|
||||
. = 0
|
||||
. += station_account.money
|
||||
for(var/i = 1 to SSjob.department_datums.len)
|
||||
var/datum/money_account/account = LAZYACCESS(department_accounts, SSjob.department_datums[i])
|
||||
if(istype(account))
|
||||
. += account.money
|
||||
|
||||
/datum/event2/event/raise_funds/proc/send_command_report(title, message)
|
||||
post_comm_message(title, message)
|
||||
to_world(span("danger", "New [using_map.company_name] Update available at all communication consoles."))
|
||||
SEND_SOUND(world, 'sound/AI/commandreport.ogg')
|
||||
|
||||
Reference in New Issue
Block a user