Skip to content

Commit

Permalink
Added a new Randomize SDF Special Node (General)
Browse files Browse the repository at this point in the history
Resolves issue #32
  • Loading branch information
sylae committed Sep 13, 2013
1 parent f27e0e5 commit 771af5f
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
18 changes: 17 additions & 1 deletion Win32/Blades of Exile/boe.specials.cpp
Expand Up @@ -1613,7 +1613,7 @@ void run_special(short which_mode,short which_type,short start_spec,location spe
special_in_progress = false;
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);
}
if ((cur_node.type >= SPEC_ONCE_GIVE_ITEM) && (cur_node.type <= SPEC_ONCE_TRAP)) {
Expand Down Expand Up @@ -1885,6 +1885,22 @@ void general_spec(short which_mode,special_node_type cur_node,short cur_spec_typ
DeleteObject(displayed_picture);
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;
}
if (check_mess == true) {
handle_message(which_mode,cur_spec_type,cur_node.m1,cur_node.m2,a,b);
Expand Down
1 change: 1 addition & 0 deletions Win32/Blades of Exile/classes/consts.h
Expand Up @@ -735,6 +735,7 @@ enum eSpecNodeType {
SPEC_WANDERING_WILL_FIGHT = 26,
SPEC_END_SCENARIO = 27,
SPEC_DISPLAY_PICTURE = 28,//new (Classic Blades of Exile) special
SPEC_RAND_SDF = 29,
SPEC_ONCE_GIVE_ITEM = 50,
SPEC_ONCE_GIVE_SPEC_ITEM = 51,
SPEC_ONCE_NULL = 52,
Expand Down
5 changes: 5 additions & 0 deletions Win32/Scenario Editor/STRINGS.RC
Expand Up @@ -210,6 +210,7 @@ STRINGTABLE
6627, "Wandering will fight"
6628, "End Scenario"
6629, "Display Picture"
6630, "Randomize SDF"
6651, "Give Item"
6652, "Give Special Item"
6653, "One-Time Do Nothing"
Expand Down Expand Up @@ -482,6 +483,7 @@ STRINGTABLE
9027, "0 - no attack, 1 - attack"
9028, "Unused"
9029, "Scenario special message with filename"
9030, "Minimum value"
9051, "Item to give"
9052, "Num. of spec. item to give (0 .. 49)"
9053, "Unused"
Expand Down Expand Up @@ -631,6 +633,7 @@ STRINGTABLE
9327, "Unused"
9328, "Unused"
9329, "Unused"
9330, "Maximum value"
9351, "Amount of gold to give"
9352, "0 - give item, 1 - take away"
9353, "Unused"
Expand Down Expand Up @@ -780,6 +783,7 @@ STRINGTABLE
9627, "Unused"
9628, "Unused"
9629, "Unused"
9630, "Unused"
9651, "Amount of food to give"
9652, "Unused"
9653, "Unused"
Expand Down Expand Up @@ -929,6 +933,7 @@ STRINGTABLE
9927, "Unused"
9928, "Unused"
9929, "Unused"
9930, "Unused"
9951, "Special if item not given"
9952, "Unused"
9953, "Unused"
Expand Down
6 changes: 3 additions & 3 deletions Win32/Scenario Editor/keydlgs.cpp
Expand Up @@ -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] = {
0,1,1,0,0,0,1,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,
1,1,1,1,1,1,1,1,1,1, // 50
Expand Down Expand Up @@ -786,7 +786,7 @@ void edit_spec_enc_event_filter (short item_hit)
case 37: // 1st spec type
if (save_spec_enc() == TRUE)
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) {
store_spec_node.type = i - 1;
}
Expand Down Expand Up @@ -1246,7 +1246,7 @@ void edit_scen_intro_event_filter (short item_hit)
void edit_scen_intro()
{
short i;


cd_create_dialog_parent_num(804,0);

CDSN(804,8,scenario.intro_pic);
Expand Down

1 comment on commit 771af5f

@sylae
Copy link
Contributor Author

@sylae sylae commented on 771af5f Sep 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fuck, put the wrong issue number in. This resolves #33 instead :|

Please sign in to comment.