diff --git a/code/modules/merchant/merchant_programs.dm b/code/modules/merchant/merchant_programs.dm index b0a17e3ead1..1d374a7b4f3 100644 --- a/code/modules/merchant/merchant_programs.dm +++ b/code/modules/merchant/merchant_programs.dm @@ -81,6 +81,26 @@ bank -= response return last_comms = "PAD NOT CONNECTED" + +/datum/computer_file/program/merchant/proc/bulk_offer(var/datum/trader/T, var/num) + var/BulkAmount = input("How many items? (Buy 1-50 items. 0 to cancel.)") as num + if(istext(BulkAmount)) + last_comms = "ERROR: NUMBER EXPECTED" + return + if(BulkAmount < 0 || BulkAmount > 50) + last_comms = "ERROR: POSITIVE NUMBER UP TO 50 EXPECTED" + return + if(pad) + for(var/BulkCounter = 0, BulkCounter < BulkAmount, BulkCounter++) + var/response = T.offer_money_for_trade(num, bank) + if(istext(response)) + last_comms = T.get_response(response, "No thank you.") + else + last_comms = T.get_response("trade_complete", "Thank you!") + T.trade(null,num, get_turf(pad)) + bank -= response + return + last_comms = "PAD NOT CONNECTED" /datum/computer_file/program/merchant/proc/bribe(var/datum/trader/T, var/amt) if(bank < amt) @@ -216,6 +236,9 @@ if(href_list["PRG_offer_money_for_item"]) . = 1 offer_money(T, text2num(href_list["PRG_offer_money_for_item"])+1) + if (href_list["PRG_bulk_money_for_item"]) + . = 1 + bulk_offer(T, text2num(href_list["PRG_bulk_money_for_item"])+1) if(href_list["PRG_what_do_you_want"]) . = 1 last_comms = T.what_do_you_want() @@ -224,4 +247,4 @@ sell_items(T) if(href_list["PRG_bribe"]) . = 1 - bribe(T, text2num(href_list["PRG_bribe"])) \ No newline at end of file + bribe(T, text2num(href_list["PRG_bribe"])) diff --git a/html/changelogs/MerchantBulkBuy.yml b/html/changelogs/MerchantBulkBuy.yml new file mode 100644 index 00000000000..65c14a61390 --- /dev/null +++ b/html/changelogs/MerchantBulkBuy.yml @@ -0,0 +1,41 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: Naelynn + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added bulk-buy function to the merchant. Less spamming click to buy things!" diff --git a/nano/templates/merchant.tmpl b/nano/templates/merchant.tmpl index 5b2ef1f0bb8..686883ecaad 100644 --- a/nano/templates/merchant.tmpl +++ b/nano/templates/merchant.tmpl @@ -29,7 +29,8 @@ {{for data.trades}}