From e0218b0526466a44286042167f076a7756b6481b Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 23 Apr 2020 02:46:29 -0300 Subject: I need a random tool... --- npc/maze0/config.txt | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'npc/maze0/config.txt') diff --git a/npc/maze0/config.txt b/npc/maze0/config.txt index 3f59d30fe..d2613a3b3 100644 --- a/npc/maze0/config.txt +++ b/npc/maze0/config.txt @@ -521,7 +521,7 @@ function script GenerateMaze { "↑", "→", "↓", "←", "⮠", "⮡", "⮢", "⮣", "ㅓ", "ㅏ", "ㅗ", "T", - "|", "—", "𐘁"; + "|", "—", "𐘁\ "; debugmes "[STATUS] Finishing..."; for (.@y=0; .@y < MAZE_MY; .@y++) { .@l$=""; @@ -535,8 +535,8 @@ function script GenerateMaze { } // Debug human readable format + a easy to grep-replace RNG // Pseudo-rng example: $@MAZES_12_4 = Random Maze 12, Row 4 - // On the example, replace VAR with "MAZES_12" - debugmes "[REPORT-SA] setarray $@VAR_%d, %s", .@y, .@l$; // SetArray + // On the example, replace VAR_X with "MAZES_12" + debugmes "[REPORT-SA] setarray $@VAR_X_%d%s;", .@y, .@l$; // SetArray debugmes "[REPORT-HR] %s", .@lb$; // HumanReadable } @@ -726,14 +726,29 @@ maze0,30,30,0 script #MazeMaster NPC_MONA,{ mesf "Height (%d-25): ", max(1, @yvar); input .@y, max(1, @yvar), 25; + // Amount of copies + mesf "N. Copies: "; + input .@loop, 1, 100; + // Prevent bugs @xvar=.@x; @yvar=.@y; } - GenerateMaze(.@x, .@y); - if (@menu != 2) { - CreateMaze(); - InitMaze(0, 0); + + if (@menu == 2) { + freeloop(true); + for (.@i=0; .@i < .@loop; .@i++) { + GenerateMaze(.@x, .@y); + debugmes ""; + debugmes ""; + freeloop(true); + } + freeloop(false); + close; } + + GenerateMaze(.@x, .@y); + CreateMaze(); + InitMaze(0, 0); end; } -- cgit v1.2.3-70-g09d2