[MIRROR] Prevents abuse of the BEPIS to syphon cash from cargo. (#4224)

* Prevents abuse of the BEPIS to syphon cash from cargo. (#57610)

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* Prevents abuse of the BEPIS to syphon cash from cargo.

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
This commit is contained in:
SkyratBot
2021-03-18 01:50:14 +01:00
committed by GitHub
parent 07331fbd63
commit 5c00d0a56a
2 changed files with 10 additions and 39 deletions

View File

@@ -108,20 +108,6 @@
log_econ("[deposit_value] credits were inserted into [src] by [account.account_holder]")
banked_cash += deposit_value
use_power(1000 * power_saver)
say("Cash deposit successful. There is [banked_cash] in the chamber.")
update_appearance()
return
/obj/machinery/rnd/bepis/proc/withdrawcash()
var/withdraw_value = 0
withdraw_value = banking_amount
if(withdraw_value > banked_cash)
say("Cannot withdraw more than stored funds. Aborting.")
else
banked_cash -= withdraw_value
new /obj/item/holochip(src.loc, withdraw_value)
say("Withdrawing [withdraw_value] credits from the chamber.")
update_appearance()
return
/obj/machinery/rnd/bepis/proc/calcsuccess()
@@ -191,11 +177,14 @@
ui = new(user, src, "Bepis", name)
ui.open()
RefreshParts()
if(isliving(user))
var/mob/living/customer = user
account = customer.get_bank_account()
/obj/machinery/rnd/bepis/ui_data(mob/user)
var/list/data = list()
var/powered = FALSE
var/zvalue = (banked_cash - (major_threshold - positive_cash_offset - negative_cash_offset))/(std)
var/zvalue = ((banking_amount + banked_cash) - (major_threshold - positive_cash_offset - negative_cash_offset))/(std)
var/std_success = 0
var/prob_success = 0
//Admittedly this is messy, but not nearly as messy as the alternative, which is jury-rigging an entire Z-table into the code, or making an adaptive z-table.
@@ -223,7 +212,7 @@
powered = TRUE
data["account_owner"] = account_name
data["amount"] = banking_amount
data["stored_cash"] = banked_cash
data["stored_cash"] = account?.account_balance
data["mean_value"] = (major_threshold - positive_cash_offset - negative_cash_offset)
data["error_name"] = error_cause
data["power_saver"] = power_saver
@@ -240,19 +229,12 @@
if(.)
return
switch(action)
if("deposit_cash")
if(use_power == IDLE_POWER_USE)
return
depositcash()
if("withdraw_cash")
if(use_power == IDLE_POWER_USE)
return
withdrawcash()
if("begin_experiment")
if(use_power == IDLE_POWER_USE)
return
depositcash()
if(banked_cash == 0)
say("Please deposit funds to begin testing.")
say("Please select funds to deposit to begin testing.")
return
calcsuccess()
use_power(MACHINE_OPERATION * power_saver) //This thing should eat your APC battery if you're not careful.

View File

@@ -44,7 +44,7 @@ export const Bepis = (props, context) => {
<Grid.Column size={1.5}>
<Section title="Stored Data and Statistics">
<LabeledList>
<LabeledList.Item label="Deposited Credits">
<LabeledList.Item label="Available Credits">
{data.stored_cash}
</LabeledList.Item>
<LabeledList.Item label="Investment Variability">
@@ -74,16 +74,11 @@ export const Bepis = (props, context) => {
<Box>
<Button
icon="donate"
content="Deposit Credits"
content="Deposit Credits and Start"
disabled={data.manual_power === 1
|| data.silicon_check === 1}
onClick={() => act('deposit_cash')}
onClick={() => act('begin_experiment')}
/>
<Button
icon="eject"
content="Withdraw Credits"
disabled={data.manual_power === 1}
onClick={() => act('withdraw_cash')} />
</Box>
</Grid.Column>
<Grid.Column>
@@ -100,12 +95,6 @@ export const Bepis = (props, context) => {
Please insert more money for future success.
</Box>
)}
<Box m={1} />
<Button
icon="microscope"
disabled={data.manual_power === 1}
onClick={() => act('begin_experiment')}
content="Begin Testing" />
</Section>
</Grid.Column>
</Grid>