Added a new Randomize SDF Special Node (General)

Resolves issue #32
This commit is contained in:
Sylae Corell
2013-09-12 18:47:14 -06:00
parent f27e0e51b6
commit 771af5fafc
4 changed files with 26 additions and 4 deletions

View File

@@ -1613,7 +1613,7 @@ void run_special(short which_mode,short which_type,short start_spec,location spe
special_in_progress = false; special_in_progress = false;
return; return;
} }
if ((cur_node.type >= SPEC_NULL) && (cur_node.type <= SPEC_DISPLAY_PICTURE)) { if ((cur_node.type >= SPEC_NULL) && (cur_node.type <= SPEC_RAND_SDF)) {
general_spec(which_mode,cur_node,cur_spec_type,&next_spec,&next_spec_type,a,b,redraw); general_spec(which_mode,cur_node,cur_spec_type,&next_spec,&next_spec_type,a,b,redraw);
} }
if ((cur_node.type >= SPEC_ONCE_GIVE_ITEM) && (cur_node.type <= SPEC_ONCE_TRAP)) { if ((cur_node.type >= SPEC_ONCE_GIVE_ITEM) && (cur_node.type <= SPEC_ONCE_TRAP)) {
@@ -1884,6 +1884,22 @@ void general_spec(short which_mode,special_node_type cur_node,short cur_spec_typ
cd_kill_dialog(905,0); cd_kill_dialog(905,0);
DeleteObject(displayed_picture); DeleteObject(displayed_picture);
displayed_picture = NULL; displayed_picture = NULL;
break;
case SPEC_RAND_SDF:
check_mess = true;
short rand;
// Automatically fix the range in case some idiot puts it in backwards, or the same (WHY)
if (cur_node.ex1a == cur_node.ex1b) {
rand = cur_node.ex1b;
} else {
rand = get_ran(1,
min(cur_node.ex1a,cur_node.ex1b),
max(cur_node.ex1a,cur_node.ex1b)
);
}
setsd(cur_node.sd1,cur_node.sd2,rand);
//print_nums(rand, cur_node.ex1a, cur_node.ex1b);
break; break;
} }
if (check_mess == true) { if (check_mess == true) {

View File

@@ -735,6 +735,7 @@ enum eSpecNodeType {
SPEC_WANDERING_WILL_FIGHT = 26, SPEC_WANDERING_WILL_FIGHT = 26,
SPEC_END_SCENARIO = 27, SPEC_END_SCENARIO = 27,
SPEC_DISPLAY_PICTURE = 28,//new (Classic Blades of Exile) special SPEC_DISPLAY_PICTURE = 28,//new (Classic Blades of Exile) special
SPEC_RAND_SDF = 29,
SPEC_ONCE_GIVE_ITEM = 50, SPEC_ONCE_GIVE_ITEM = 50,
SPEC_ONCE_GIVE_SPEC_ITEM = 51, SPEC_ONCE_GIVE_SPEC_ITEM = 51,
SPEC_ONCE_NULL = 52, SPEC_ONCE_NULL = 52,

View File

@@ -210,6 +210,7 @@ STRINGTABLE
6627, "Wandering will fight" 6627, "Wandering will fight"
6628, "End Scenario" 6628, "End Scenario"
6629, "Display Picture" 6629, "Display Picture"
6630, "Randomize SDF"
6651, "Give Item" 6651, "Give Item"
6652, "Give Special Item" 6652, "Give Special Item"
6653, "One-Time Do Nothing" 6653, "One-Time Do Nothing"
@@ -482,6 +483,7 @@ STRINGTABLE
9027, "0 - no attack, 1 - attack" 9027, "0 - no attack, 1 - attack"
9028, "Unused" 9028, "Unused"
9029, "Scenario special message with filename" 9029, "Scenario special message with filename"
9030, "Minimum value"
9051, "Item to give" 9051, "Item to give"
9052, "Num. of spec. item to give (0 .. 49)" 9052, "Num. of spec. item to give (0 .. 49)"
9053, "Unused" 9053, "Unused"
@@ -631,6 +633,7 @@ STRINGTABLE
9327, "Unused" 9327, "Unused"
9328, "Unused" 9328, "Unused"
9329, "Unused" 9329, "Unused"
9330, "Maximum value"
9351, "Amount of gold to give" 9351, "Amount of gold to give"
9352, "0 - give item, 1 - take away" 9352, "0 - give item, 1 - take away"
9353, "Unused" 9353, "Unused"
@@ -780,6 +783,7 @@ STRINGTABLE
9627, "Unused" 9627, "Unused"
9628, "Unused" 9628, "Unused"
9629, "Unused" 9629, "Unused"
9630, "Unused"
9651, "Amount of food to give" 9651, "Amount of food to give"
9652, "Unused" 9652, "Unused"
9653, "Unused" 9653, "Unused"
@@ -929,6 +933,7 @@ STRINGTABLE
9927, "Unused" 9927, "Unused"
9928, "Unused" 9928, "Unused"
9929, "Unused" 9929, "Unused"
9930, "Unused"
9951, "Special if item not given" 9951, "Special if item not given"
9952, "Unused" 9952, "Unused"
9953, "Unused" 9953, "Unused"

View File

@@ -58,7 +58,7 @@ short ex2b_choose[20] = {19,50,55,56,57,58,59,60,130,134,135,136,139,144,154,-1,
char edit_spec_stuff_done_mess[256] = { char edit_spec_stuff_done_mess[256] = {
0,1,1,0,0,0,1,0,0,0, 0,1,1,0,0,0,1,0,0,0,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,3,1,0,0,0,0,0,0, 0,0,3,1,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,
1,1,1,1,1,1,1,1,1,1, // 50 1,1,1,1,1,1,1,1,1,1, // 50
@@ -786,7 +786,7 @@ void edit_spec_enc_event_filter (short item_hit)
case 37: // 1st spec type case 37: // 1st spec type
if (save_spec_enc() == TRUE) if (save_spec_enc() == TRUE)
dialog_not_toast = FALSE; dialog_not_toast = FALSE;
i = choose_text_res(22,1,29,store_spec_node.type + 1,822,"Choose General Use Special:"); i = choose_text_res(22,1,30,store_spec_node.type + 1,822,"Choose General Use Special:");
if (i >= 0) { if (i >= 0) {
store_spec_node.type = i - 1; store_spec_node.type = i - 1;
} }