diff --git a/code/game/objects/items/weapons/storage/wallets.dm b/code/game/objects/items/weapons/storage/wallets.dm index d450db15f1a..8e58a93627e 100644 --- a/code/game/objects/items/weapons/storage/wallets.dm +++ b/code/game/objects/items/weapons/storage/wallets.dm @@ -98,3 +98,9 @@ /obj/item/weapon/storage/wallet/trader/New() ..() dispense_cash(rand(150,250),src) + +/obj/item/weapon/storage/wallet/nt + icon_state = "wallet-NT" + +/obj/item/weapon/storage/wallet/nt/update_icon() + return diff --git a/code/modules/Economy/Accounts.dm b/code/modules/Economy/Accounts.dm index eb91a50d5bb..1bfb84693db 100644 --- a/code/modules/Economy/Accounts.dm +++ b/code/modules/Economy/Accounts.dm @@ -15,6 +15,8 @@ var/datum/money_account/trader_account var/station_allowance = 0//This is what Nanotrasen will send to the Station Account after every salary, as provision for the next salary. var/latejoiner_allowance = 0//Added to station_allowance and reset before every wage payout. +var/station_funding = 0 //A bonus to the station allowance that persists between cycles. Admins can set this on the database. +var/station_bonus = 0 //A bonus to station allowance that gets reset after wage payout. Admins can boost this too. /proc/create_station_account() if(!station_account) @@ -245,7 +247,11 @@ var/latejoiner_allowance = 0//Added to station_allowance and reset before every if(access_level > 0 || isAdminGhost(user) || is_malf_owner(user)) dat += {"[activated ? "Disable" : "Enable"] remote access
- Combined department and personnel budget is currently [station_allowance] credits. A total of [global.requested_payroll_amount] credits were requested during the last payroll cycle.
"} + Combined department and personnel budget is currently [station_allowance+station_bonus+station_funding] credits. A total of [global.requested_payroll_amount] credits were requested during the last payroll cycle.
"} + if(station_bonus || isAdminGhost(user)) + dat += "The budget was increased by a bonus of [station_bonus] this cycle. [isAdminGhost(user) ? "Adjust" : ""]
" + if(station_funding || isAdminGhost(user)) + dat += "Central Command has earmarked an additional [station_funding] for the budget. [isAdminGhost(user) ? "Adjust" : ""]
" if(creating_new_account) dat += {"
@@ -404,6 +410,16 @@ var/latejoiner_allowance = 0//Added to station_allowance and reset before every if("view_accounts_list") detailed_account_view = null creating_new_account = 0 + if("addfunding") + if(!isAdminGhost(usr)) + return + var/new_funding = input(usr, "Adjust the budget for ALL cycles", "Adjust by", station_funding) as null|num + station_funding = new_funding + if("addbonus") + if(!isAdminGhost(usr)) + return + var/new_bonus = input(usr, "Adjust the budget for THIS cycles", "Adjust by", station_bonus) as null|num + station_bonus = new_bonus if("toggle_account") if(detailed_account_view) detailed_account_view.disabled = detailed_account_view.disabled ? 0 : 2 diff --git a/code/modules/Economy/Wages.dm b/code/modules/Economy/Wages.dm index 275cff2c0ef..c9ccb3b6df1 100644 --- a/code/modules/Economy/Wages.dm +++ b/code/modules/Economy/Wages.dm @@ -68,7 +68,11 @@ If all wages are decreased bellow 100%, for example due to the AI spending all t if(!station_account) message_admins("Station allowance skipped, no station account found.") return - station_account.money += station_allowance + WageBonuses() + + for(var/obj/machinery/computer/accounting/A in machines) + A.new_cycle() + station_account.money += station_allowance + WageBonuses() + station_funding + station_bonus + station_bonus = 0 new /datum/transaction(station_account,"Nanotrasen station allowance","[station_allowance]","Nanotrasen Payroll Server",send2PDAs=FALSE) diff --git a/code/modules/library/computers/accounting.dm b/code/modules/library/computers/accounting.dm new file mode 100644 index 00000000000..ac091923be7 --- /dev/null +++ b/code/modules/library/computers/accounting.dm @@ -0,0 +1,143 @@ +/obj/machinery/computer/accounting + name = "accounting computer" + desc = "For virtual bookkeeping. This computer is used in the calculation of overages." + pass_flags = PASSTABLE + machine_flags = WRENCHMOVE | FIXED2WORK + icon = 'icons/obj/library.dmi' + icon_state = "computer" + req_access = list(access_library) + var/savings = 0 //Total savings this cycle + var/oldgood = -1 //Was our last calculation correct? -1 indicates no last query this cycle, resets to -1 at cycle end, 0 is bad, 1 is good + var/oldentry = 0 //Our last attempted difference + + var/minuend + var/subtrahend + var/oldquery + var/currentqueryname + var/nextmin + var/nextsub + var/entryinfo = "Accounting Report
" + var/list/contributors = list() + +/obj/machinery/computer/accounting/New() + ..() + generatenext() + readynext() + +/obj/machinery/computer/accounting/Destroy() + contributors.Cut() + ..() + +/obj/machinery/computer/accounting/attack_hand(mob/user as mob) + if(..()) + return + if(stat & (NOPOWER|BROKEN|FORCEDISABLE)) + return + ui_interact(user) + +/obj/machinery/computer/accounting/ui_interact(mob/user, ui_key="main", datum/nanoui/ui=null, var/force_open=NANOUI_FOCUS) + user.set_machine(src) + + var/data[0] + data["src"] = "\ref[src]" + data["savings"] = savings + data["oldgood"] = oldgood + data["oldquery"] = oldquery + data["oldentry"] = oldentry + data["minuend"] = minuend + data["subtrahend"] = subtrahend + data["currentqueryname"] = currentqueryname + data["nextquery"] = "[nextmin] - [nextsub]" + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open) + if (!ui) + ui = new(user, src, ui_key, "accounting.tmpl", src.name, 600, 500) + ui.set_initial_data(data) + ui.open() + +/obj/machinery/computer/accounting/Topic(href, href_list) + if(..()) + return 1 + if(!allowed(usr)) + to_chat(usr, "You do not have accounting clearance.") + return + if(href_list["reg"]) + if(!in_range(src, usr)) + return 1 + var/sol = text2num(href_list["reg"]) + if(isnull(sol)) + visible_message("[src] buzzes rudely.") + playsound(src, 'sound/machines/buzz-two.ogg', 50, 0) + return 1 + solve_query(sol) + if(!(usr.name in contributors)) + contributors += usr.name + nanomanager.update_uis(src) + return 1 + +/obj/machinery/computer/accounting/proc/solve_query(var/sol) + playsound(loc, "sound/effects/typing[pick(1,2,3)].ogg", 50, 1) + var/diff = minuend - subtrahend + if(sol == diff) + oldgood = TRUE + savings += sol + entryinfo += "[currentqueryname]: $[sol] overage saved
" + else + oldgood = FALSE + + spawn(1 SECONDS) + playsound(loc, oldgood ? 'sound/machines/ding2.ogg': 'sound/machines/buzz-sigh.ogg', 50, 1) + + oldquery = "[minuend] - [subtrahend]" + oldentry = sol + readynext() + + +/obj/machinery/computer/accounting/proc/readynext() + currentqueryname = buildname() + minuend = nextmin + subtrahend = nextsub + generatenext() + nanomanager.update_uis(src) + +/obj/machinery/computer/accounting/proc/new_cycle() + if(!savings) + return + var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(loc) + P.name = "accounting report for [worldtime2text()]" + P.info = "[entryinfo]" + "Total savings: $[savings]
Prepared in part by: [english_list(contributors)]
This document is to be verified by Internal Affairs and faxed to Central Command.
" + var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') + stampoverlay.icon_state = "paper_stamp-cent" + if(!P.stamped) + P.stamped = new + P.stamped += /obj/item/weapon/stamp + P.overlays += stampoverlay + P.stamps += "
It has a Central Command accounting stamp: MQAC[round(savings/50)]TRM" + playsound(loc, "sound/effects/dotmatrixprinter.ogg", 40, 1) + station_bonus += round(savings/10) + savings = 0 + oldgood = -1 + oldquery = null + oldentry = null + contributors.Cut() + entryinfo = "Accounting Report
" + nanomanager.update_uis(src) + +/obj/machinery/computer/accounting/proc/buildname() + var/firstpart = pick(list("coordination on", "water resource", "geothermal", "miscellaneous", "programmatic", + "management", "disposition", "flood and storm", "vacuum", "atmospheric", "interagency nonstructural", + "other technical", "planning assistance", "communications stream", "ecosystem", "biosphere", "exoplanet", "xenopology", + "electrical", "culinary", "supply", "genetics", "virology", "command", "horticultural", "human", "fuel", "upgrade", + "cyberinfrastructure", "scientific", "cybersecurity", "redesign of", "biological", "important")) + + var/lastpart = pick(list("research", "logistics", "recycling", "outreach", "appropriations", "endowments", "study", + "planning assistance", "gauging", "interests", "reduction", "oversight", "investments", "modeling", "determinations", + "risk assessment", "inventory", "guidance", "traineeships", "foundations", "repair", "highlights", "splining")) + return firstpart + " " + lastpart + +#define APPROXIMATE_PYTHAG (3/7) +/obj/machinery/computer/accounting/proc/generatenext() + var/greaterval = rand(1001,9999) + var/lesserval = rand(201,1000) + nextmin = round(greaterval + lesserval*APPROXIMATE_PYTHAG) + nextsub = round(sqrt(greaterval**2 + lesserval**2)) //true pythag + //Should generate an inaccuracy of 1% to 8.8% \ No newline at end of file diff --git a/code/modules/paperwork/fax.dm b/code/modules/paperwork/fax.dm index f9056bd091d..c5c40f05f91 100644 --- a/code/modules/paperwork/fax.dm +++ b/code/modules/paperwork/fax.dm @@ -131,6 +131,22 @@ var/list/alldepartments = list("Central Command", "Nanotrasen HR") to_chat(usr, "\The [src] displays a 404 error: Central Command not found.") return if(dpt == "Central Command") + var/locate_acc = findtext(tofax.stamps,"MQAC") + if(locate_acc) + var/reward = copytext(tofax.stamps,locate_acc+4,findtext(tofax.stamps,"TRM")) + if(!text2num(reward)) + message_admins("DEBUG: An accounting fax stamp had an irregular reward amount ([reward]) and could not be parsed.") + return + visible_message("The fax machine destroys the original [tofax] per infosec protocol!") + qdel(tofax) + tofax = null + flick("faxreceive",src) + playsound(loc, "sound/effects/fax.ogg", 50, 1) + var/obj/item/weapon/storage/wallet/nt/wally = new() + dispense_cash(text2num(reward),wally) + spawn(2 SECONDS) + wally.forceMove(loc) + log_game("[usr]/([usr.ckey]) received [reward] cash as an automated fax response.") Centcomm_fax(tofax, tofax.name, usr, dpt) else if(findtext(tofax.stamps,"magnetic")) diff --git a/icons/obj/wallet.dmi b/icons/obj/wallet.dmi index 9fec1c702c9..79eddf3cbd1 100644 Binary files a/icons/obj/wallet.dmi and b/icons/obj/wallet.dmi differ diff --git a/nano/templates/accounting.tmpl b/nano/templates/accounting.tmpl new file mode 100644 index 00000000000..d2bdfbf130f --- /dev/null +++ b/nano/templates/accounting.tmpl @@ -0,0 +1,92 @@ + +
+
+ Record to Present +
+
+
+ Savings (Current Cycle) +
+
+ {{:data.savings}} +
+
+
+
+ Last Query +
+ {{if data.oldgood == -1}} +
+ No queries this cycle +
+ {{else}} +
+ {{:data.oldquery}} +
+
+ Last Entry +
+
+ {{if data.oldgood == 1}} + {{:data.oldentry}} + {{else}} + {{:data.oldentry}} + {{/if}} +
+ {{/if}} +
+
+
+
+

Overages for {{:data.currentqueryname}}

+
+
+
+ Projected Costs +
+
+ {{:data.minuend}} +
+
+
+
+ Actual Costs +
+
+ {{:data.subtrahend}} +
+
+
+
+
+ + + Difference +
+
+ + +
+
+
+
+
+
+

Next

+
+
+ Next Query +
+
+ {{:data.nextquery}} +
+
\ No newline at end of file diff --git a/sound/effects/dotmatrixprinter.ogg b/sound/effects/dotmatrixprinter.ogg new file mode 100644 index 00000000000..1743258e836 Binary files /dev/null and b/sound/effects/dotmatrixprinter.ogg differ diff --git a/sound/effects/typing1.ogg b/sound/effects/typing1.ogg new file mode 100644 index 00000000000..cc64ca89915 Binary files /dev/null and b/sound/effects/typing1.ogg differ diff --git a/sound/effects/typing2.ogg b/sound/effects/typing2.ogg new file mode 100644 index 00000000000..2ffc12b8498 Binary files /dev/null and b/sound/effects/typing2.ogg differ diff --git a/sound/effects/typing3.ogg b/sound/effects/typing3.ogg new file mode 100644 index 00000000000..8d88cf1b420 Binary files /dev/null and b/sound/effects/typing3.ogg differ diff --git a/vgstation13.dme b/vgstation13.dme index fedd226e2f9..c8e9ecb7008 100644 --- a/vgstation13.dme +++ b/vgstation13.dme @@ -1690,6 +1690,7 @@ #include "code\modules\library\lib_items.dm" #include "code\modules\library\lib_machines.dm" #include "code\modules\library\lib_readme.dm" +#include "code\modules\library\computers\accounting.dm" #include "code\modules\library\computers\base.dm" #include "code\modules\library\computers\checkout.dm" #include "code\modules\library\computers\public.dm"