SS1984 - Modules - TypesVar Details - Proc Details

Abandoned Crate

A secure crate that requires a unique code to unlock. Contains randomized loot.

This crate uses a bulls-and-cows guessing game. Incorrect attempts may cause an explosion.

Vars

attemptsRemaining attempts to input the correct code
codeSecret code required to unlock the crate
code_lengthLength of the generated code (number of digits)
possible_lootWeighted list of possible loot items. Format: list(list(typepath = probability) = group_weight). Total probability = ((probability in sublist * group weight) / 100)
previous_attemptsList of previous attempts in format: list("attempt" = "1234", "bulls" = 1, "cows" = 2)
qdel_on_openWhether to delete the crate after opening
spawned_lootWhether loot has already been spawned inside the crate

Procs

bulls_and_cowsImplements bulls and cows algorithm
generate_codeGenerates a random code of specified length with no repeating digits
spawn_lootSpawns loot inside the crate
validate_inputValidates user input for code attempts

Var Details

attempts

Remaining attempts to input the correct code

code

Secret code required to unlock the crate

code_length

Length of the generated code (number of digits)

possible_loot

Weighted list of possible loot items. Format: list(list(typepath = probability) = group_weight). Total probability = ((probability in sublist * group weight) / 100)

previous_attempts

List of previous attempts in format: list("attempt" = "1234", "bulls" = 1, "cows" = 2)

qdel_on_open

Whether to delete the crate after opening

spawned_loot

Whether loot has already been spawned inside the crate

Proc Details

bulls_and_cows

Implements bulls and cows algorithm

Compares the guess against the actual code. Bulls = correct digit in correct position. Cows = correct digit in wrong position.

Arguments:

Returns:

generate_code

Generates a random code of specified length with no repeating digits

spawn_loot

Spawns loot inside the crate

Selects a random loot item from the weighted possible_loot list. Marks the crate as having spawned loot.

validate_input

Validates user input for code attempts

Checks if input is the correct length, contains only digits, and has no repeating digits.

Arguments:

Returns: