128 |
128 |
129 procedure chScript(var s: shortstring); |
129 procedure chScript(var s: shortstring); |
130 begin |
130 begin |
131 if s[1]='"' then Delete(s, 1, 1); |
131 if s[1]='"' then Delete(s, 1, 1); |
132 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); |
132 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1); |
|
133 cScriptName:= s; |
133 ScriptLoad(s) |
134 ScriptLoad(s) |
134 end; |
135 end; |
135 |
136 |
136 procedure chSetHat(var s: shortstring); |
137 procedure chSetHat(var s: shortstring); |
137 begin |
138 begin |
455 UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; |
456 UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s; |
456 Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; |
457 Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s; |
457 InitStepsFlags:= InitStepsFlags or cifMap |
458 InitStepsFlags:= InitStepsFlags or cifMap |
458 end; |
459 end; |
459 |
460 |
460 ScriptLoad(s) |
461 ScriptLoad('Maps/' + s + '/map.lua') |
461 end; |
462 end; |
462 |
463 |
463 procedure chSetTheme(var s: shortstring); |
464 procedure chSetTheme(var s: shortstring); |
464 begin |
465 begin |
465 if isDeveloperMode then |
466 if isDeveloperMode then |
612 RegisterVariable('map' , vtCommand, @chSetMap , false); |
613 RegisterVariable('map' , vtCommand, @chSetMap , false); |
613 RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
614 RegisterVariable('theme' , vtCommand, @chSetTheme , false); |
614 RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
615 RegisterVariable('seed' , vtCommand, @chSetSeed , false); |
615 RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
616 RegisterVariable('template_filter', vtLongInt, @cTemplateFilter, false); |
616 RegisterVariable('mapgen' , vtLongInt, @cMapGen , false); |
617 RegisterVariable('mapgen' , vtLongInt, @cMapGen , false); |
617 RegisterVariable('maze_size',vtLongInt, @cMazeSize , false); |
618 RegisterVariable('maze_size',vtLongInt, @cTemplateFilter, false); |
618 RegisterVariable('delay' , vtLongInt, @cInactDelay , false); |
619 RegisterVariable('delay' , vtLongInt, @cInactDelay , false); |
619 RegisterVariable('ready' , vtLongInt, @cReadyDelay , false); |
620 RegisterVariable('ready' , vtLongInt, @cReadyDelay , false); |
620 RegisterVariable('casefreq', vtLongInt, @cCaseFactor , false); |
621 RegisterVariable('casefreq', vtLongInt, @cCaseFactor , false); |
621 RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false); |
622 RegisterVariable('healthprob', vtLongInt, @cHealthCaseProb, false); |
622 RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false); |
623 RegisterVariable('hcaseamount', vtLongInt, @cHealthCaseAmount, false); |