Minor adjustement to the last patch : replaced the "prog make version" fields in the scenario editor with a switch that controls legacy compatibility (as "prog make version" is to be handled by the editor itself).

Chokboyz

git-svn-id: http://openexile.googlecode.com/svn/trunk@158 4ebdad44-0ea0-11de-aab3-ff745001d230
This commit is contained in:
Chokboyz
2010-09-28 20:44:44 +00:00
parent 3e7412d2e4
commit 8dcea3eddf
3 changed files with 39 additions and 36 deletions

View File

@@ -48,7 +48,7 @@ void init_party(short mode)
for (i = 0; i < 310; i++)
for (j = 0; j < 10; j++)
party.stuff_done[i][j] = 0;
if(scenario.prog_make_ver[0] < 2) PSD[SDF_LEGACY_SCENARIO] = 1; //old scenario format ? so, no resurrection balm needed
if(scenario.prog_make_ver[0] < 2) PSD[SDF_LEGACY_SCENARIO] = 1; //old scenario format ?
else PSD[SDF_LEGACY_SCENARIO] = 0;
PSD[SDF_NO_INSTANT_HELP] = store_help;
@@ -152,7 +152,7 @@ void init_party_scen_data()
for (j = 0; j < 10; j++)
party.stuff_done[i][j] = 0;
PSD[SDF_NO_INSTANT_HELP] = store_help;
if(scenario.prog_make_ver[0] < 2) PSD[SDF_LEGACY_SCENARIO] = 1; //old scenario format ? so, no resurrection balm needed
if(scenario.prog_make_ver[0] < 2) PSD[SDF_LEGACY_SCENARIO] = 1; //old scenario format ?
else PSD[SDF_LEGACY_SCENARIO] = 0;
party.light_level = 0;
@@ -1467,10 +1467,10 @@ void do_priest_spell(short pc_num,short spell_num)
}
}
play_sound(52);
sprintf ((char *) c_line," Your items glow. ");
sprintf ( c_line," Your items glow. ");
}
if (PSD[SDF_LEGACY_SCENARIO] == 0 && ((spell_num == 40) || (spell_num == 56))){
if ((item = adven[pc_num].hasAbil(160)) == 24) {
if ((item = adven[pc_num].hasAbil(ITEM_RESSURECTION_BALM)) == 24) {
sprintf(c_line," Need resurrection balm. ");
spell_num = 500;
}
@@ -1479,8 +1479,8 @@ void do_priest_spell(short pc_num,short spell_num)
if (spell_num == 40) {
if (adven[target].main_status == MAIN_STATUS_DEAD)
if (get_ran(1,1,adven[pc_num].level / 2) == 1) {
sprintf ((char *) c_line, " %s now dust. ",
(char *) adven[target].name);
sprintf (c_line, " %s now dust. ",
adven[target].name);
play_sound(5);
adven[target].main_status = MAIN_STATUS_DUST;
}
@@ -1490,11 +1490,11 @@ void do_priest_spell(short pc_num,short spell_num)
if (get_ran(1,0,2) < 2)
adven[target].skills[i] -= (adven[target].skills[i] > 1) ? 1 : 0;
adven[target].cur_health = 1;
sprintf ((char *) c_line, " %s raised. ",
(char *) adven[target].name);
sprintf (c_line, " %s raised. ",
adven[target].name);
play_sound(52);
}
else sprintf ((char *) c_line," Didn't work. ");
else sprintf ( c_line," Didn't work. ");
}
if (spell_num == 56) {
@@ -1504,13 +1504,13 @@ void do_priest_spell(short pc_num,short spell_num)
if (get_ran(1,0,2) < 1)
adven[target].skills[i] -= (adven[target].skills[i] > 1) ? 1 : 0;
adven[target].cur_health = 1;
sprintf ((char *) c_line, " %s raised.",
(char *) adven[target].name);
sprintf (c_line, " %s raised.",
adven[target].name);
play_sound(52);
}
else sprintf ((char *) c_line," Was OK. ");
else sprintf (c_line," Was OK. ");
}
add_string_to_buf((char *) c_line);
add_string_to_buf(c_line);
put_pc_screen();
}
break;

View File

@@ -51,17 +51,17 @@
LTEXT "2_0", 26, 257, 414, 38, 15
}
803 DIALOG 10, 10, 505, 520
803 DIALOG 10, 10, 505, 455
STYLE WS_POPUP | WS_DLGFRAME
{
DEFPUSHBUTTON "", 1, 279, 470, 31, 10
DEFPUSHBUTTON "", 1, 279, 427, 31, 10
LTEXT "6_0", 2, 181, 85, 43, 16
LTEXT "6_0", 3, 234, 85, 43, 16
LTEXT "6_0", 4, 287, 85, 43, 16
LTEXT "6_0", 5, 181, 109, 243, 47
LTEXT "6_0", 6, 181, 164, 243, 47
LTEXT "6_0", 7, 181, 219, 243, 65
LTEXT "1_63", 8, 395, 487, 54, 16
LTEXT "1_63", 8, 395, 407, 54, 16
LTEXT "5_716", 9, 8, 8, 36, 36
LTEXT "This is where you can define the various pieces of information the user will see when deciding whether or not to play your scenario. The meanings of all these fields are given in the documentation.", 10, 50, 23, 372, 53
LTEXT "~Scenario Details", 11, 50, 6, 256, 17
@@ -89,14 +89,9 @@
LTEXT "2_0", 33, 423, 344, 26, 15
LTEXT "*Don't automatically adjust difficulty", 34, 50, 367, 50, 15
LTEXT "2_0", 35, 260, 371, 32, 15
LTEXT "6_0", 36, 201,397, 43, 16
LTEXT "6_0", 37, 201,424, 43, 16
LTEXT "6_0", 38, 254,424, 43, 16
LTEXT "6_0", 39, 307,424, 43, 16
LTEXT "*Minimum Version:", 40, 50,397, 120, 14
LTEXT "*Program Make Version:", 41, 50,424, 120, 14
LTEXT "N.B: setting the major _program make version_ number (the first one) to 1 force the legacy compatibility. Therefore, legacy scenarii _program make version_ should always be of the form 1.x.x", 42, 50,444, 320, 53
}
LTEXT "*Enable legacy compatibility", 36, 50, 387, 50, 15
LTEXT "2_0", 37, 260, 391, 32, 15
}
804 DIALOG 10, 10, 639, 391
STYLE WS_POPUP | WS_DLGFRAME

View File

@@ -2323,14 +2323,10 @@ Boolean save_scen_details()
scenario.adjust_diff = cd_get_led(803,35);
scenario.ver[0] = CDGN(803,2);
scenario.ver[1] = CDGN(803,3);
scenario.ver[2] = CDGN(803,4);
scenario.min_run_ver = CDGN(803,36);
scenario.prog_make_ver[0] = CDGN(803,37);
scenario.prog_make_ver[1] = CDGN(803,38);
scenario.prog_make_ver[2] = CDGN(803,39);
scenario.ver[2] = CDGN(803,4);
for (i = 0; i < 3; i++)
if (cre(scenario.ver[i],
0,9,"The digits in the version number must be in the 0 to 9 range.","",803) == TRUE) return FALSE;
0,9,"The digits in the version number must be in the 0 to 9 range.","",803) == true) return false;
CDGT(803,5,(char *) str);
str[59] = 0;
strcpy(scen_strs[1],(char *) str);
@@ -2338,25 +2334,34 @@ Boolean save_scen_details()
str[59] = 0;
strcpy(scen_strs[2],(char *) str);
CDGT(803,7,scen_strs[3]);
//enable legacy compatibility switch
if(cd_get_led(803,37) == 1)
scenario.prog_make_ver[0]=1;
else
scenario.prog_make_ver[0]=2;
return TRUE;
return true;
}
void put_scen_details_in_dlog()
{
cd_set_led_range(803,30,33,scenario.difficulty);
cd_set_led_range(803,21,24,scenario.rating);
cd_set_led(803,35,scenario.adjust_diff);
cd_set_led(803,35,scenario.adjust_diff);
CDSN(803,2,scenario.ver[0]);
CDSN(803,3,scenario.ver[1]);
CDSN(803,4,scenario.ver[2]);
CDST(803,5,scen_strs[1]);
CDST(803,6,scen_strs[2]);
CDST(803,7,scen_strs[3]);
CDSN(803,36,scenario.min_run_ver);
CDSN(803,37,scenario.prog_make_ver[0]);
CDSN(803,38,scenario.prog_make_ver[1]);
CDSN(803,39,scenario.prog_make_ver[2]);
//enable legacy compatibility switch
if(scenario.prog_make_ver[0]==1)
cd_set_led(803,37,1);
else
cd_set_led(803,37,0);
}
void edit_scen_details_event_filter (short item_hit)
@@ -2368,6 +2373,9 @@ void edit_scen_details_event_filter (short item_hit)
break;
case 35:
cd_set_led(803,35,1 - cd_get_led(803,35));
break;
case 37://enable legacy compatibility switch
cd_set_led(803,37,1 - cd_get_led(803,37));
break;
default:
cd_hit_led_range(803,21,24,item_hit);