Skip to content

Commit

Permalink
Merge pull request #35 from Yona-TYT/master
Browse files Browse the repository at this point in the history
Fix scenarios with new parameters
  • Loading branch information
Yona-TYT authored Nov 23, 2024
2 parents 7d306c6 + 7939f94 commit 99ccc2a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions pak128.prototype/scenario/new_york/scenario.nut
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,12 @@ function forbid_tools_on_hudson()
{
for(local j=0; j<tools_not_allowed_on_hudson.len(); j++) {
for(local i=0; i<hudson_river.len()-1; i++) {
rules.forbid_way_tool_rect(player_all, tools_not_allowed_on_hudson[j], wt_all, hudson_river[i], hudson_river[i+1], ttext(error_hudson[j]))
rules.forbid_way_tool_rect(player_all, tools_not_allowed_on_hudson[j], wt_all, "", hudson_river[i], hudson_river[i+1], ttext(error_hudson[j]))
}
}
}

function is_work_allowed_here(pl, tool_id, pos, tool)
function is_work_allowed_here(pl, tool_id, name, pos, tool)
{
// headquarter only on governors island
if (tool_id == tool_headquarter) {
Expand Down
2 changes: 1 addition & 1 deletion pak128.prototype/scenario/sell_clothing/scenario.nut
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ function set_rule_bridge_coventry_sound(forbid)

for(local i=0; i<coventry_sound.len()-1; i++) {
foreach(tool in coventry_sound_tools) {
func(player_all, tool, wt_all, coventry_sound[i], coventry_sound[i+1], err_no_bridge)
func(player_all, tool, wt_all, "", coventry_sound[i], coventry_sound[i+1], err_no_bridge)
}
}
}
4 changes: 2 additions & 2 deletions pak128.prototype/scenario/swiss_mountains/scenario.nut
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ function resume_game()
local pl = 0
foreach (tool in forbid_tools)
foreach (cube in forbid_list)
rules.forbid_way_tool_cube(pl, tool, cube.waytyp, cube.a, cube.b, ttext(cube.text) )
rules.forbid_way_tool_cube(pl, tool, cube.waytyp, "", cube.a, cube.b, ttext(cube.text) )
rules.forbid_tool(pl, tool_restoreslope )
rules.forbid_tool(pl, tool_lower_land )
rules.forbid_tool(pl, tool_raise_land )
Expand Down Expand Up @@ -429,7 +429,7 @@ function get_percentage(pl)
}


function is_work_allowed_here(pl, tool_id, pos, tool)
function is_work_allowed_here(pl, tool_id, name, pos, tool)
{
local result = null // null is equivalent to 'allowed'
if (tool_id == tool_setslope) result = terra_forming_allowed(pos)
Expand Down
32 changes: 16 additions & 16 deletions pak128.prototype/scenario/tramadness/scenario.nut
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function get_result_text(pl)
return ttext("There is still no passenger at Cambridge TOP station.")
}

function is_work_allowed_here(pl, tool_id, pos, tool)
function is_work_allowed_here(pl, tool_id, name, pos, tool)
{
// no extension of existing stations
if (tool_id == tool_build_station) {
Expand Down Expand Up @@ -76,32 +76,32 @@ function start()
foreach(wt in all_waytypes) {
if (wt != wt_tram) {
if (wt != wt_road) {
rules.forbid_way_tool(0, tool_build_way, wt)
rules.forbid_way_tool(0, tool_build_bridge, wt)
rules.forbid_way_tool(0, tool_build_tunnel, wt)
rules.forbid_way_tool(0, tool_build_station, wt)
rules.forbid_way_tool(0, tool_build_way, wt, "")
rules.forbid_way_tool(0, tool_build_bridge, wt, "")
rules.forbid_way_tool(0, tool_build_tunnel, wt, "")
rules.forbid_way_tool(0, tool_build_station, wt, "")
if (wt != wt_rail) {
rules.forbid_way_tool(0, tool_remove_way, wt)
rules.forbid_way_tool(0, tool_remove_way, wt, "")
}
}
rules.forbid_way_tool(0, tool_remove_wayobj, wt)
rules.forbid_way_tool(0, tool_build_wayobj, wt)
rules.forbid_way_tool(0, tool_build_depot, wt)
rules.forbid_way_tool(0, tool_remove_wayobj, wt, "")
rules.forbid_way_tool(0, tool_build_wayobj, wt, "")
rules.forbid_way_tool(0, tool_build_depot, wt, "")

if (wt != wt_rail) {
rules.forbid_way_tool(0, tool_build_roadsign, wt)
rules.forbid_way_tool(0, tool_build_roadsign, wt, "")
}
}
}

// protect main stations
rules.forbid_way_tool_rect(0, tool_remover, wt_all, { x=25, y=45, z=5 }, { x=25, y=45, z=5 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remover, wt_all, { x=34, y=39, z=0 }, { x=34, y=39, z=0 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remover, wt_all, { x=18, y=55, z=0 }, { x=18, y=55, z=0 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remover, wt_all, "", { x=25, y=45, z=5 }, { x=25, y=45, z=5 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remover, wt_all, "", { x=34, y=39, z=0 }, { x=34, y=39, z=0 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remover, wt_all, "", { x=18, y=55, z=0 }, { x=18, y=55, z=0 }, ttext(err_station_protected))

rules.forbid_way_tool_rect(0, tool_remove_way, wt_all, { x=25, y=45, z=5 }, { x=25, y=45, z=5 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remove_way, wt_all, { x=34, y=39, z=0 }, { x=34, y=39, z=0 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remove_way, wt_all, { x=18, y=55, z=0 }, { x=18, y=55, z=0 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remove_way, wt_all, "", { x=25, y=45, z=5 }, { x=25, y=45, z=5 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remove_way, wt_all, "", { x=34, y=39, z=0 }, { x=34, y=39, z=0 }, ttext(err_station_protected))
rules.forbid_way_tool_rect(0, tool_remove_way, wt_all, "", { x=18, y=55, z=0 }, { x=18, y=55, z=0 }, ttext(err_station_protected))

// set startmoney of player=0
player_x(0).book_cash( 125000 * 100 - player_x(0).get_cash()[0] )
Expand Down

0 comments on commit 99ccc2a

Please sign in to comment.