Small changes to some card-related debug verbs (#72361)

## About The Pull Request

Test Card Distribution debug verb has been altered slightly to prevent
runtimes. Backing out of any one of the menus would send null as an
argument, and cause a runtime.

The Validate Cards verb now returns a message if no errors are found. I
kept mistakenly clicking this verb thinking it was the Cardpack
Distribution one, and would get confused whenever nothing happened. Now
it returns a message!

Also converts some of the stuff I touch into snake case because pretty
code is nice.

## Why It's Good For The Game

Closes #66987. Feedback for the random debug buttons I accidentally
click is good.
## Changelog
🆑 Rhials
fix: backing out of the Test Card Packs debug menu will no longer cause
a runtime
fix: Validate Cards debug verb now gives feedback if no errors are
detected.
/🆑
This commit is contained in:
Rhials
2023-01-05 20:07:05 -08:00
committed by GitHub
parent ba04c8e978
commit f5bd6027c2
3 changed files with 20 additions and 13 deletions
+12 -7
View File
@@ -647,10 +647,12 @@ GLOBAL_PROTECT(admin_verbs_poll)
if(!SStrading_card_game.loaded)
message_admins("The card subsystem is not currently loaded")
return
var/message = SStrading_card_game.checkCardpacks(SStrading_card_game.card_packs)
message += SStrading_card_game.checkCardDatums()
var/message = SStrading_card_game.check_cardpacks(SStrading_card_game.card_packs)
message += SStrading_card_game.check_card_datums()
if(message)
message_admins(message)
else
message_admins("No errors found in card rarities or overrides.")
/client/proc/test_cardpack_distribution()
set name = "Test Cardpack Distribution"
@@ -660,11 +662,14 @@ GLOBAL_PROTECT(admin_verbs_poll)
if(!SStrading_card_game.loaded)
message_admins("The card subsystem is not currently loaded")
return
var/pack = input("Which pack should we test?", "You fucked it didn't you") as null|anything in sort_list(SStrading_card_game.card_packs)
var/batchCount = input("How many times should we open it?", "Don't worry, I understand") as null|num
var/batchSize = input("How many cards per batch?", "I hope you remember to check the validation") as null|num
var/guar = input("Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system") as null|num
SStrading_card_game.checkCardDistribution(pack, batchSize, batchCount, guar)
var/pack = tgui_input_list(usr, "Which pack should we test?", "You fucked it didn't you", sort_list(SStrading_card_game.card_packs))
if(!pack)
return
var/batch_count = tgui_input_number(usr, "How many times should we open it?", "Don't worry, I understand")
var/batch_size = tgui_input_number(usr, "How many cards per batch?", "I hope you remember to check the validation")
var/guar = tgui_input_number(usr, "Should we use the pack's guaranteed rarity? If so, how many?", "We've all been there. Man you should have seen the old system")
SStrading_card_game.check_card_distribution(pack, batch_size, batch_count, guar)
/client/proc/print_cards()
set name = "Print Cards"