Compare commits

..

2 commits

Author SHA1 Message Date
gfgtdf
d4a07b0148
f 2024-10-24 23:13:44 +02:00
gfgtdf
75be3f0c29
Fix assertion error on [allow_undo] misuse
Previously it could happen that the replay recorder was not at end after redoing if redo() pushed additional user choices to the recorderwhihc were not used by the actual code (this can happen if the game is out of sync)
2024-10-24 23:08:25 +02:00
1520 changed files with 129029 additions and 149990 deletions

View file

@ -1,4 +0,0 @@
---
Checks: '-*,modernize-use-nullptr,performance-unnecessary-value-param'
WarningsAsErrors: true
...

View file

@ -90,15 +90,10 @@ jobs:
scons "$@" build="$CFG" ctool="$CC" cxxtool="$CXX" cxx_std="$CXX_STD" \
extra_flags_config="-pipe" forum_user_handler=true \
nls=false enable_lto="$LTO" system_lua="$SYS_LUA" force_color=true \
jobs=2 --debug=time glibcxx_debug=true glibcxx_assertions=true compile_db=true
jobs=2 --debug=time glibcxx_debug=true glibcxx_assertions=true
}
build strict=true wesnoth boost_unit_tests
build cdb
# disable all warnings since we have coverage on them in a standard build, and clang-tidy
# triggers false positive compiler warnings that clang itself won't
run-clang-tidy -quiet -use-color -j 2 -extra-arg="-w" -warnings-as-errors='*' '^(?!.*src/modules/|.*build/)'
apt remove -y -qq libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
build strict=false wesnothd campaignd
@ -109,7 +104,7 @@ jobs:
cmake "$@" -DCMAKE_BUILD_TYPE="$CFG" -DCXX_STD="$CXX_STD" \
-DEXTRA_FLAGS_CONFIG="-pipe" -DENABLE_MYSQL=true \
-DENABLE_NLS=false -DENABLE_LTO="$LTO" -DFORCE_COLOR_OUTPUT=true -DLTO_JOBS=2 \
-DENABLE_SYSTEM_LUA="$SYS_LUA -DCLANG_TIDY=true" .
-DENABLE_SYSTEM_LUA="$SYS_LUA" .
}
rm -R /usr/local/lib/cmake
rm /usr/local/lib/libboost*
@ -297,7 +292,7 @@ jobs:
path: projectfiles/Xcode/Wesnoth_${{ matrix.cfg }}.dmg
- name: Run WML tests
if: matrix.cfg == 'Release'
run: ./run_wml_tests -g -c -t 30 -bt 350 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth" -a=--userdata-dir="$PWD/ud"
run: ./run_wml_tests -g -c -t 30 -p "projectfiles/Xcode/build/$CFG/The Battle for Wesnoth.app/Contents/MacOS/The Battle for Wesnoth" -a=--userdata-dir="$PWD/ud"
- name: Upload userdata files from WML unit tests (logs, replays)
if: matrix.cfg == 'Release' && (success() || failure())
uses: actions/upload-artifact@v4

View file

@ -50,7 +50,6 @@ jobs:
- name: Install dependencies
if: matrix.language == 'cpp'
run: |
utils/autorevision.sh -t h > src/revision.h
sudo apt update
sudo apt install scons libboost-system1.83-dev libboost-filesystem1.83-dev libboost-iostreams1.83-dev \
libboost-serialization1.83-dev libboost-locale1.83-dev libboost-regex1.83-dev libboost-random1.83-dev \

View file

@ -27,9 +27,9 @@ jobs:
with:
fetch-depth: 0
- name: check image EXIF metadata
- name: check image metadata
run: |
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.(webp|je?pg)$')
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.(webp|png|je?pg)$')
# cycle through the changed image files, make sure they have the right fields
for file in "${image_files[@]}"; do
# check Artist tag, fail if missing
@ -56,33 +56,3 @@ jobs:
;;
esac
done
- name: check png XMP metadata
run: |
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.png$')
# cycle through the changed image files, make sure they have the right fields
for file in "${image_files[@]}"; do
# check Creator tag, fail if missing
artist="$(exiftool -p '$XMP:Creator' "$file")"
if [ "$artist" ]; then
printf 'Creator tag in %s is %s\n' "$file" "$artist"
else
printf 'no Creator XMP tag in %s\n' "$file"
exit 1
fi
# check Rights tag, fail if missing or wrong type
copyright="$(exiftool -p '$XMP:Rights' "$file")"
case $copyright in
'GNU GPL v2+'|'CC BY-SA 4.0'|CC0)
printf 'Rights tag in %s is %s\n' "$file" "$copyright"
;;
'')
printf 'no Rights XMP tag in %s\n' "$file"
exit 1
;;
*)
printf 'Rights tag %s in file %s is not an accepted license! Must be one of: "GNU GPL v2+", "CC BY-SA 4.0", "CC0"\n' "$copyright" "$file"
exit 1
;;
esac
done

1
.gitignore vendored
View file

@ -127,7 +127,6 @@ wesnoth.plg
*.exe
*.dll
*.so
compile_commands.json
# library files
.libs

View file

@ -1,4 +1,4 @@
# set minimum version
# set minimum version
cmake_minimum_required(VERSION 3.14)
project(wesnoth)
@ -171,7 +171,6 @@ option(GLIBCXX_ASSERTIONS "Whether to define _GLIBCXX_ASSERTIONS" OFF)
option(GLIBCXX_DEBUG "Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC. Requires a version of Boost's program_options that's compiled with __GLIBCXX_DEBUG too." OFF)
option(ENABLE_POT_UPDATE_TARGET "Enables the tools to update the pot files and manuals. This target has extra dependencies." OFF)
option(FORCE_COLOR_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
option(CLANG_TIDY "Enable clang-tidy linter checks." OFF)
if(UNIX AND NOT APPLE AND NOT CYGWIN)
option(ENABLE_NOTIFICATIONS "Enable Window manager notification messages" ON)
@ -256,11 +255,6 @@ if(NOT MSVC)
endif()
endif()
### Enable clang-tidy linting
if (CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy -Wno-unknown-warning-option")
endif()
### Set the final compiler flags.
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${CXX_FLAGS_USER}")
@ -480,7 +474,7 @@ if(NOT MSVC)
else()
set(CMAKE_CXX_FLAGS "/W3 /WX /wd4503 /wd4351 /wd4250 /wd4244 /wd4267 /we4239 /wd4275 /EHsc /utf-8 /Zc:__cplusplus" CACHE STRING "Global flags used by the CXX compiler during all builds." FORCE)
set(CMAKE_C_FLAGS "/WX" CACHE STRING "Global flags used by the C compiler during all builds." FORCE)
add_definitions(-D_WIN32_WINNT=0x0A00 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)
add_definitions(-D_WIN32_WINNT=0x0601 -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS -DNOMINMAX)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG_LUA")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")

View file

@ -2,7 +2,7 @@
## Prerequisites
Wesnoth requires a compiler with sufficient C++17 support such as GCC 11 and
Wesnoth requires a compiler with sufficient C++17 support such as GCC 8 and
later, or a version of Clang with equivalent support.
You'll need to have these libraries and their development headers installed in
@ -19,7 +19,6 @@ order to build Wesnoth:
* System
* Coroutine
* Graph
* Charconv (This requires boost 1.85 or higher and is optional but reccomended especially for clang builds)
* SDL2 libraries:
* SDL2 >= 2.0.18 (macOS: 2.0.22 due to needing https://github.com/libsdl-org/SDL/commit/3bebdaccb7bff8c40438856081d404a7ce3def30)
* SDL2_image >= 2.0.2 (with PNG, JPEG, and WEBP support)

View file

@ -120,7 +120,6 @@ opts.AddVariables(
BoolVariable("OS_ENV", "Forward the entire OS environment to scons", False),
BoolVariable("history", "Clear to disable GNU history support in lua console", True),
BoolVariable('force_color', 'Always produce ANSI-colored output (GNU/Clang only).', False),
BoolVariable('compile_db', 'Produce a compile_commands.json file.', False),
)
#
@ -190,11 +189,6 @@ if env['distcc']:
if env['ccache']: env.Tool('ccache')
if env['compile_db']:
env.Tool('compilation_db')
cdb = env.CompilationDatabase()
Alias('cdb', cdb)
boost_version = "1.67"
def SortHelpText(a, b):
@ -385,7 +379,6 @@ if env["prereqs"]:
conf.CheckBoost("program_options", require_version = boost_version) & \
conf.CheckBoost("random", require_version = boost_version) & \
conf.CheckBoost("smart_ptr", header_only = True) & \
conf.CheckBoostCharconv() & \
CheckAsio(conf) & \
conf.CheckBoost("thread") & \
conf.CheckBoost("locale") & \
@ -672,7 +665,7 @@ for env in [test_env, client_env, env]:
env[d] = os.path.join(env["prefix"], env[d])
if env["PLATFORM"] == 'win32':
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0A00"])
env.Append(LIBS = ["wsock32", "crypt32", "iconv", "z", "shlwapi", "winmm", "ole32", "uuid"], CCFLAGS = ["-mthreads"], LINKFLAGS = ["-mthreads"], CPPDEFINES = ["_WIN32_WINNT=0x0601"])
if env["PLATFORM"] == 'darwin': # Mac OS X
env.Append(FRAMEWORKS = "Cocoa") # Cocoa GUI

View file

@ -81,7 +81,7 @@ code_blocks_target_translations = {
# XCode #
#=======#
def modify_xcode(filename, targets, remove):
def add_to_xcode(filename, targets):
"""Add the given file to the specified targets.
"""
projectfile = rootdir.joinpath(
@ -121,29 +121,24 @@ def modify_xcode(filename, targets, remove):
raise Exception(f"problem finding '{d}' group in '{groupname}'")
parent_group = found_groups[0]
if remove :
# Remove from all targets if we want to remove
for file in project.get_files_by_name(filename.name, parent=parent_group):
project.remove_file_by_id(file.get_id())
else:
# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return
# if the group already has an entry with the same filename, loudly skip.
# note: this doesn't allow adding to targets one at a time.
# a new file should be added to all targets at once...
# or maybe targets could be checked somehow,
# or maybe the file could simply be completely removed and readded.
if project.get_files_by_name(filename.name, parent=parent_group):
print(" '"+filename.name+"' already found in Xcode project '"+",".join(translated_targets)+"', skipping")
return
# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)
# force is True here because otherwise a duplicate filename in
# a different place will block addition of the new file.
# the rest is just to match existing project file structure.
project.add_file(filename.name,
force=True,
tree="<group>",
parent=parent_group,
target_name=translated_targets,
)
# that's done, save the file
project.save()
@ -153,7 +148,7 @@ def modify_xcode(filename, targets, remove):
# source_lists #
#==============#
def modify_source_list(filename, source_list, remove):
def add_to_source_list(filename, source_list):
source_list_file = rootdir.joinpath("source_lists", source_list)
sl_lines = open(source_list_file).readlines()
file_line = filename.as_posix() + '\n'
@ -162,16 +157,12 @@ def modify_source_list(filename, source_list, remove):
if filename.suffix != ".cpp":
return
if remove:
if file_line in sl_lines: sl_lines.remove(file_line)
else:
# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return
sl_lines.append(file_line)
# if the target already has an entry with the same filename, loudly skip
if file_line in sl_lines:
print(f" '{filename}' already found in '{source_list}', skipping")
return
sl_lines.append(file_line)
sl_lines.sort()
open(source_list_file, 'w').writelines(sl_lines)
@ -179,18 +170,13 @@ def add_to_source_lists(filename, targets):
translated_targets = [source_list_target_translations[t] for t in targets]
print(" source_list targets:", translated_targets)
for t in translated_targets:
modify_source_list(filename, t, False)
def remove_from_source_lists(filename):
# remove from all tagerts if -r was specified.
for t in source_list_target_translations.values():
modify_source_list(filename, t, True)
add_to_source_list(filename, t)
#==============#
# Code::Blocks #
#==============#
def modify_code_blocks_target(filename, target, remove):
def add_to_code_blocks_target(filename, target):
cbp_file = rootdir.joinpath(
"projectfiles",
"CodeBlocks",
@ -204,33 +190,30 @@ def modify_code_blocks_target(filename, target, remove):
elem = f"\t\t<Unit filename=\"{filename_for_cbp}\" />\n"
if remove:
if elem in cbp_lines: cbp_lines.remove(elem)
else:
# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return
# if the target already has an entry with the same filename, loudly skip
if elem in cbp_lines:
print(f" '{filename}' already found in '{target}.cbp', skipping")
return
# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
break
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
# find an appropriate line to add before/after
index = 0
for line in cbp_lines:
if line.startswith("\t\t<Unit "):
if elem < line:
break
index += 1
cbp_lines.insert(index, elem)
elif line.startswith("\t\t<Extensions>"):
# we must be the last entry, as this comes after the Unit section
break
index += 1
cbp_lines.insert(index, elem)
open(cbp_file, 'w').writelines(cbp_lines)
def modify_code_blocks(filename, targets, remove):
translated_targets = code_blocks_target_translations.values() if remove else [code_blocks_target_translations[t] for t in targets]
def add_to_code_blocks(filename, targets):
translated_targets = [code_blocks_target_translations[t] for t in targets]
print(" code::blocks targets:", translated_targets)
for t in translated_targets:
modify_code_blocks_target(filename, t, remove)
add_to_code_blocks_target(filename, t)
def sanity_check_existing_cpp_hpp(filenames):
"""
@ -302,8 +285,6 @@ if __name__ == "__main__":
help="which build targets to add the file to")
ap.add_argument("--no-checks", action="store_true",
help="do not check whether the files exist, etc")
ap.add_argument("-r", "--remove", action="store_true",
help="remove the specified files from projectfiles instead of adding them, --target is then ignored")
# By default, recognise --help too
options = ap.parse_args()
@ -320,13 +301,7 @@ if __name__ == "__main__":
sanity_check_existing_cpp_hpp(filenames)
for filename in filenames:
if options.remove:
print(f"removing '{filename}' from all targets")
modify_xcode(filename, options.target, True)
remove_from_source_lists(filename)
modify_code_blocks(filename, options.target, True)
else:
print(f"adding '{filename}' to targets: {options.target}")
modify_xcode(filename, options.target, False)
add_to_source_lists(filename, options.target)
modify_code_blocks(filename, options.target, False)
print(f"adding '{filename}' to targets: {options.target}")
add_to_xcode(filename, options.target)
add_to_source_lists(filename, options.target)
add_to_code_blocks(filename, options.target)

View file

@ -171,20 +171,20 @@ test_lexical_cast_throw<unsigned long long>
test_lexical_cast_throw<float>
test_lexical_cast_throw<double>
test_lexical_cast_throw<long double>
test_lexical_arethmetic_signed<signed char>
test_lexical_arethmetic_signed<short>
test_lexical_arethmetic_signed<int>
test_lexical_arethmetic_signed<long>
test_lexical_arethmetic_signed<long long>
test_lexical_arethmetic_signed<unsigned char>
test_lexical_arethmetic_signed<unsigned short>
test_lexical_arethmetic_signed<unsigned int>
test_lexical_arethmetic_signed<unsigned long>
test_lexical_arethmetic_signed<unsigned long long>
test_lexical_arethmetic_signed<float>
test_lexical_arethmetic_signed<double>
test_lexical_arethmetic_signed<long double>
test_lexical_cast_signed<signed char>
test_lexical_cast_signed<short>
test_lexical_cast_signed<int>
test_lexical_cast_signed<long>
test_lexical_cast_long_long
test_lexical_cast_unsigned<unsigned char>
test_lexical_cast_unsigned<unsigned short>
test_lexical_cast_unsigned<unsigned int>
test_lexical_cast_unsigned<unsigned long>
test_lexical_cast_unsigned_long_long
test_lexical_cast_bool
test_lexical_cast_floating_point<float>
test_lexical_cast_floating_point<double>
test_lexical_cast_floating_point<long double>
test_lexical_cast_result
test_map_location/map_location_characterization_test_radial_mode
test_map_location/reality_check_vector_negation

13549
changelog.md

File diff suppressed because it is too large Load diff

View file

@ -1,2 +0,0 @@
### Units
* Dune Warmaster: HP 59 -> 61 scimitar damage 9 -> 10

View file

@ -1,5 +0,0 @@
### Campaigns
* Eastern Invasion
* S04c: give Mal-Ravanal gold to recruit more units when their army becomes too small
* forbid all Dunefolk units to take the Plague Staff
* fix minor bugs with dialogues

View file

@ -1,2 +0,0 @@
### Units
* Dwarvish Explorer: physical resists reduced from 20% to 10%, melee damage increased from 10 to 11.

View file

@ -1,3 +0,0 @@
### Units
* Fire Wisps and Guardian - Fire Resistance changed from 50% to 70%
* Fire Wraith - Fire Resistance changed from 50% to 80%

View file

@ -1,2 +0,0 @@
### Units
* Orcish Crossbowman: melee 6-3 -> 4-3, experience to level 43 -> 57

View file

@ -21,14 +21,6 @@
[/option]
[/advanced_preference]
[advanced_preference]
field=addon_icons
name= _ "Whether to show icons in the add-ons list on the add-ons manager"
description= _ "Disabling saves bandwidth by not sending icons for the add-ons list in the add-ons manager"
type=boolean
default=yes
[/advanced_preference]
[advanced_preference]
field=ask_delete
name= _ "Confirm deleting saves"

View file

@ -550,7 +550,7 @@
end
-- level the unit and give it a random amount of experience up to half of max
units[i].experience = units[i].max_experience
units[i]:advance(false)
units[i]:advance( )
units[i].experience = mathx.random ( 0, mathx.round( units[i].max_experience / 2 ) )
end
>>

View file

@ -54,7 +54,7 @@
#po: The River Guard posts had been built in 470 YW; they were abandoned in 544 YW.
#po: The wave of colonization had begun around 530 YW.
#po: This intro starts in 625 YW; the king's forces arrive at the outposts in 626 YW.
story= _ "In the days of King Garard I, two strong points had been built along the far bank of the River Weldyn, south of Soradoc, to stop bandits and orcish raiders out of the Estmarks from entering Wesnoth. In later years, the river guard posts had been abandoned as colonists spread into the Estmarks and the orcs were driven in retreat north of the Great River."
story= _ "In the days of King Garard I, two strong points had been built along the near bank of the River Weldyn, south of Soradoc, to stop bandits and orcish raiders out of the Estmarks from entering Wesnoth. In later years, the river guard posts had been abandoned as colonists spread into the Estmarks and the orcs were driven in retreat north of the Great River."
{EI_BIGMAP}
[/part]
[part]

View file

@ -133,8 +133,6 @@
[/modifications]
[/unit]
#endif
#ifdef NORMAL
{NAMED_NOTRAIT_UNIT 3 (Troll Whelp) 23 8 "Hur" (_"Hur")} {GUARDIAN}
[+unit]
[modifications]

View file

@ -321,6 +321,9 @@
#po: star wars reference
message= _ "We will watch your career with great interest..."
[/message]
[endlevel]
result=defeat
[/endlevel]
[/event]
[event]
name=last breath
@ -332,6 +335,10 @@
speaker=Mal-Tar
message= _ "Wait, please, not like this!"
[/message]
# add in the herodeaths. Don't do these before, since we want special behavior for the achievement
{HERODEATH_GWEDDRY}
{HERODEATH_DACYN}
[/event]
[event]
name=die

View file

@ -485,7 +485,6 @@
[/set_achievement]
[/then]
[/if]
{HERODEATH_ADDOGIN}
[/event]
[event]

View file

@ -801,7 +801,7 @@
[else]
[gold]
side=1
amount=-$gold_cost
amount=-50
[/gold]
[sound]
name=gold.ogg
@ -884,7 +884,7 @@
[else]
[gold]
side=1
amount=-$gold_extra
amount=-150
[/gold]
[sound]
name=gold.ogg
@ -1008,7 +1008,7 @@
[/status]
[/modify_unit]
{CLEAR_VARIABLE gold,gold_cost,gold_extra,herbs_needed,herb_locations}
{CLEAR_VARIABLE gold,gold_cost,herbs_needed,herb_locations}
[/event]
[event]

View file

@ -230,32 +230,31 @@
[/effect]
[/modify_unit]
[/event]
[event]
# if ravanal's low on units and ravanal_no_income is cleared, give him gold
# otherwise, clear Mal-Ravanal's gold so we don't go positive nor negative
[event] # manually set gold to 0
name=side 7 turn refresh
first_time_only=no
[if]
[filter_condition]
{VARIABLE_CONDITIONAL ravanal_no_income equals yes}
[/filter_condition]
[modify_side]
side=7
gold=0
[/modify_side]
[/event]
[event] # manually set gold to 1000
name=side 1
first_time_only=no
[filter_condition]
{VARIABLE_CONDITIONAL ravanal_no_income not_equals yes}
[and]
[have_unit]
side=7
count=0-10
[/have_unit]
[/and]
[then]
[modify_side]
side=7
gold=500
[/modify_side]
[/then]
[else]
[modify_side]
side=7
gold=0
[/modify_side]
[/else]
[/if]
[/filter_condition]
[modify_side]
side=7
gold=9999
[/modify_side]
[/event]
#--------------------
@ -665,12 +664,6 @@
side=4
amount={ON_DIFFICULTY 15 45 75} # otherwise his armies start to feel a little thin around now
[/gold]
[fire_event]
name=dacyn_warning
[/fire_event]
[/event]
[event]
name=dacyn_warning
[message]
speaker=Dacyn
message= _ "Gweddry, we should not be here. They are merely toying with us right now, but all will be lost if Mal-Ravanal finds me amongst you!"
@ -694,9 +687,6 @@
[event]
name=ravanal_gets_serious
[fire_event]
name=dacyn_warning
[/fire_event]
{REPLACE_SCENARIO_MUSIC silence.ogg}
[message] # if you change this, also change 06b_Soradoc
speaker=Mal-Ravanal
@ -924,7 +914,7 @@
[/then]
[else]
{FIND_NEARBY (trait,side=survivor,1) 36 15 99}
{FIND_NEARBY (type,side=Knight,1) 36 15 99}
[/else]
[/if]
[message]
@ -933,6 +923,7 @@
[/message]
{FIND_NEARBY (
type=Knight,Terraent
side=8
) 36 15 99}
[message]

View file

@ -516,38 +516,6 @@
{MODIFY_UNIT id=Dacyn attacks_left 0}
[/event]
[event]
name=owaec_joins
[capture_village]
owner_side=2
side=1
[/capture_village]
[modify_unit]
[filter]
side=2
[/filter]
side=1
moves=$($this_unit.max_moves)
attacks_left=1
{TEAM_COLOR_OVERRIDE () blue}
[/modify_unit]
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "(You may now recruit Horsemen and Cavalrymen!)"
[/message]
[set_extra_recruit] # need to set recruits per-unit (instead of per-side) so we don't mess up the plague staff
id=Gweddry
extra_recruit={REGULAR_RECRUIT_LIST}
[/set_extra_recruit]
[set_extra_recruit]
id=Owaec
extra_recruit={REGULAR_RECRUIT_LIST}
[/set_extra_recruit]
[/event]
[event]
name=capture
first_time_only=no
@ -750,9 +718,34 @@
speaker=Owaec
message= _ "Huzzah!! At last, these villagers are liberated! Gweddry, thank you for your aid. I place my Clansmen and myself at your service."
[/message]
[fire_event]
name=owaec_joins
[/fire_event]
[capture_village]
owner_side=2
side=1
[/capture_village]
[modify_unit]
[filter]
side=2
[/filter]
side=1
moves=$($this_unit.max_moves)
attacks_left=1
{TEAM_COLOR_OVERRIDE () blue}
[/modify_unit]
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "(You may now recruit Horsemen and Cavalrymen!)"
[/message]
[set_extra_recruit] # need to set recruits per-unit (instead of per-side) so we don't mess up the plague staff
id=Gweddry
extra_recruit={REGULAR_RECRUIT_LIST}
[/set_extra_recruit]
[set_extra_recruit]
id=Owaec
extra_recruit={REGULAR_RECRUIT_LIST}
[/set_extra_recruit]
[if]
[not]
[have_unit]
@ -886,9 +879,33 @@
speaker=Owaec
message= _ "Huzzah!! May these be the first of many undead to fall before our hooves! Gweddry, thank you for your aid. I place my Clansmen and myself at your service."
[/message]
[fire_event]
name=owaec_joins
[/fire_event]
[capture_village]
owner_side=2
side=1
[/capture_village]
[modify_unit]
[filter]
side=2
[/filter]
side=1
moves=$($this_unit.max_moves)
attacks_left=1
{TEAM_COLOR_OVERRIDE () blue}
[/modify_unit]
[message]
speaker=narrator
image=wesnoth-icon.png
message= _ "(You may now recruit Horsemen and Cavalrymen!)"
[/message]
[set_extra_recruit] # need to set recruits per-unit (instead of per-side) so we don't mess up the plague staff
id=Gweddry
extra_recruit={REGULAR_RECRUIT_LIST}
[/set_extra_recruit]
[set_extra_recruit]
id=Owaec
extra_recruit={REGULAR_RECRUIT_LIST}
[/set_extra_recruit]
[message]
speaker=Owaec
message= _ "Now let us free these villagers from the outlaws terrorizing them!"

View file

@ -918,6 +918,19 @@
[/message]
[/event]
[event]
name=last breath
[filter]
id=Grug
[/filter]
[message]
speaker=Grug
message= _ "Hurt... grarrgghh..." # wmllint: no spellcheck
[/message]
[/event]
{ENEMYDEATHS_SORADOC}
{FOREIGN_DEFEAT}
@ -927,8 +940,9 @@
{HERODEATH_ADDOGIN}
{HERODEATH_HAHID}
{HERODEATH_TERRAENT}
{HERODEATH_GRUG}
# {HERODEATH_GRUG} # don't have Gweddry say "he was not one of us, yet [...]"
{HERODEATH_DOLBURRAS}
{HERODEATH_HAHID}
[/scenario]
#undef SCENARIO_TURN_LIMIT

View file

@ -1862,6 +1862,5 @@ Your punishment is death."
{HERODEATH_TERRAENT}
{HERODEATH_DOLBURRAS}
{HERODEATH_GRUG}
{HERODEATH_ADDOGIN}
{HERODEATH_HAHID}
[/scenario]

View file

@ -315,30 +315,50 @@
time=750
[/delay]
[message]
speaker=Konrad
image=portraits/konrad_II.webp
message= _ "Dolburras, Owaec has told me of the help you provided his men; both your skill at arms and your tenacious spirit. We wish to offer you this finely crafted shield — an heirloom of my line — and an honor guard as you return to Knalga."
[/message]
[if]
[have_unit]
id=Owaec
[/have_unit]
{VARIABLE_CONDITIONAL plague_staff_wielder_id equals Dolburras}
[then]
[message]
speaker=Dolburras
#po: "Aye, I am honored. You have my sincerest thanks, your Majesty."
message= _ "Aye, I be honored. Ye have my sincerest thanks, yer Majesty."
speaker=Konrad
image=portraits/konrad_II.webp
#po: the player chose to give Dolburras the plague staff
message= _ "Dwarf, <i>necromancer</i>, know that Wesnoth will never tolerate your kind. You shall surrender that accursed stave to be destroyed, you shall foreswear the practice of all magic on penalty of death, and you are hereby exiled from Wesnoth. Be grateful for Our mercy."
[/message]
[message]
speaker=Dolburras
#po: "Yeah, fair enough. I don't think my kinsmen will look kindly upon necromancies either."
message= _ "Aye, fair enough. I dinnae think my kinsmen will look kindly upon necromancies either."
[/message]
{CLEAR_VARIABLE plague_staff_wielder_id}
[/then]
[else]
[message]
speaker=Dolburras
#po: Owaec's dead
message= _ "Aye, I be honored. I only wish he were here to see the Clans avenged."
speaker=Konrad
image=portraits/konrad_II.webp
message= _ "Dolburras, Owaec has told me of the help you provided his men; both your skill at arms and your tenacious spirit. We wish to offer you this finely crafted shield — an heirloom of my line — and an honor guard as you return to Knalga."
[/message]
[if]
[have_unit]
id=Owaec
[/have_unit]
[then]
[message]
speaker=Dolburras
#po: "Aye, I am honored. You have my sincerest thanks, your Majesty."
message= _ "Aye, I be honored. Ye have my sincerest thanks, yer Majesty."
[/message]
[/then]
[else]
[message]
speaker=Dolburras
#po: Owaec's dead
message= _ "Aye, I be honored. I only wish he were here to see the Clans avenged."
[/message]
[/else]
[/if]
[/else]
[/if]
[/then]
@ -403,15 +423,34 @@
time=750
[/delay]
[message]
speaker=Konrad
image=portraits/konrad_II.webp
message= _ "Hahid al-Ali, We know of your far-off people, but great distance has caused little contact between us. May it be thus no longer. If you accept, We would appoint you as ambassador between our two realms."
[/message]
[message]
speaker=Hahid al-Ali
message= _ "Me, ambassador to the barbarian kingdoms, what a thought! I am honored, and would be even more honored to learn that the job comes with... excellent pay I hope?"
[/message]
[if]
{VARIABLE_CONDITIONAL plague_staff_wielder_id equals "Hahid al-Ali"}
[then]
[message]
speaker=Konrad
image=portraits/konrad_II.webp
#po: the player chose to give Hahid the plague staff
message= _ "Southerner, <i>necromancer</i>, know that Wesnoth will never tolerate your kind. You shall surrender that accursed stave to be destroyed, you shall foreswear the practice of all magic on penalty of death, and you are hereby exiled back to the desert wastes. Be grateful for Our mercy."
[/message]
[message]
speaker=Hahid al-Ali
message= _ "Bah, I save you barbarians from an invasion, and this is the thanks I get! What happened to being paid thrice what Im owed? So much for northerner generosity!"
[/message]
{CLEAR_VARIABLE plague_staff_wielder_id}
[/then]
[else]
[message]
speaker=Konrad
image=portraits/konrad_II.webp
message= _ "Hahid al-Ali, We know of your far-off people, but great distance has caused little contact between us. May it be thus no longer. If you accept, We would appoint you as ambassador between our two realms."
[/message]
[message]
speaker=Hahid al-Ali
message= _ "Me, ambassador to the barbarian kingdoms, what a thought! I am honored, and would be even more honored to learn that the job comes with... excellent pay I hope?"
[/message]
[/else]
[/if]
[/then]
[/if]

View file

@ -139,8 +139,7 @@
message= _ "Hurt... grarrgghh..." # wmllint: no spellcheck
[/message]
[message]
id=Gweddry
side=$unit.side
speaker=Gweddry
message= _ "Though he was not one of us, he served bravely alongside Wesnoths best. We must carry on the good fight."
[/message]
[/event]
@ -172,13 +171,11 @@
message= _ "Alas, my long, storied, and exceedingly profitable career has at last come to an end, so far from home! I only... wish I could have died on the soft sands... instead of among these primitive barbarians..."
[/message]
[message]
id=Grug
side=$unit.side
speaker=Grug
message= _ "Bar... ber... bears? Die why?"
[/message]
[message]
id=Dolburras
side=$unit.side
speaker=Dolburras
message= _ "Aye, tis a sad place for one o us foreigners to fall. Well miss ye, thats for sure."
[/message]
[/event]

View file

@ -70,7 +70,10 @@
[/then]
[else]
{INVALID_DESC}
[message]
speaker=unit
message={INVALID_DESC}
[/message]
[/else]
[/if]
[/event]
@ -136,7 +139,7 @@ crystal_quiver #enddef
_"Crystal Quiver"
_"Arrows from this crystalline quiver glimmer with a pale magical light, <i><b>illuminating</b></i> the surrounding area and making your bow or crossbow attacks <i><b>arcane</b></i>."
{NOTE_REUSEABLE}
()
""
(
[effect]
apply_to=new_ability
@ -178,7 +181,7 @@ holy_amulet_3 #enddef
_"Holy Amulet"
_"Engraved with a consecrated symbol, this amulet will bless both your <i><b>melee</b></i> and <i><b>ranged</b></i> attacks with <i><b>arcane</b></i> damage."
{NOTE_REUSEABLE}
()
""
(
[effect]
apply_to=new_ability
@ -213,7 +216,7 @@ sentinel #enddef
_"Shield of the Sentinel"
_"Deep within this shields towering bulk, enchanted machinery whirrs faintly. Whenever an adjacent ally is hit by an attack, <i><b>this shields bearer is hit instead</b></i>."
{NOTE_REUSEABLE}
()
""
(
[effect]
apply_to=overlay
@ -565,7 +568,7 @@ yeti_steak #enddef
_"Yetiburger"
_"Eating this funny tasting meat <i><b>doubles your hitpoints</b></i> and grants <i><b>immunity to cold</b></i>."
{NOTE_SINGLE_USE}
()
""
(
[effect]
apply_to=hitpoints
@ -595,7 +598,7 @@ yeti_steak #enddef
<i><b><span color='#FF0000'>-1</span> damage, <span color='#FF0000'>-1</span> movement, <span color='#00FF00'>+10</span> hitpoints</b></i>."
{NOTE_SINGLE_USE}
()
""
(
[effect]
apply_to=movement
@ -628,7 +631,7 @@ baneblade #enddef
_"This incorporeal sword resembles those wielded by undead wraiths. Any mortal brave enough to wield it becomes <i><b>chaotic</b></i> and lashes out at their foes with reckless abandon.
<i><b>6x4 arcane</b></i> damage, <i><b>drains</b></i>, <i><b>berserk</b></i>."
{NOTE_REUSEABLE}
()
""
(
[effect]
apply_to=attack
@ -693,7 +696,7 @@ potion_of_barkskin #enddef
_"Potion of Barkskin"
_"This potion bubbles as though over an open flame, yet is cool to the touch. Its drinker gains the <i><b>steadfast</b></i> ability and can <i><b>heal 2 hitpoints each turn</b></i>, like dwarves with the healthy trait."
{NOTE_SINGLE_USE}
()
""
(
[effect]
apply_to=new_ability
@ -725,7 +728,7 @@ ring_of_invisibility #enddef
_"Ring of Invisibility"
_"This plain gold ring looks unremarkable, but its wearer gains <i><b>skirmisher</b></i> and <i><b>nightstalk</b></i>, becoming invisible in the dark."
{NOTE_REUSEABLE}
()
""
(
[effect]
apply_to=new_ability
@ -763,16 +766,16 @@ plague_staff #enddef
{PLACE_ITEM
{ID_PLAGUE_STAFF} _"staff" items/plague-staff.png {X} {Y}
(
[not]
race=dunefolk
[/not]
[not]
type_adv_tree=White Mage,Paladin
[not]
id=Dacyn
[/not]
[/not]
[not]
id=Owaec,Gweddry,Dacyn,Terraent,Konrad
id=Owaec,Gweddry,Dacyn,Hahid al-Ali,Terraent,Konrad
[/not]
# messes with existing recruiting, and messes with the S18 cutscene
# if Dacyn gets this, it also breaks his scripted advancements (and his S17a recruitment)
@ -781,83 +784,8 @@ plague_staff #enddef
_"Looted from a dead necromancer, the wielder of this dark staff becomes <i><b>chaotic</b></i>, and can <i><b>recruit and recall</b></i> Walking Corpses and Soulless.
<i><b>6x3 impact</b></i> damage, <i>plague</i>."
{NOTE_REUSEABLE}
(
[switch]
variable=unit.id
[case]
value=Owaec
[message]
speaker=unit
message=_"Do not insult me! No clansman will ever stoop to such black magic."
[/message]
[/case]
[case]
value=Gweddry
[message]
speaker=unit
message=_"I already have an army of human soldiers — living soldiers. Let someone else use this staff."
[/message]
[/case]
[case]
value=Dacyn
[message]
speaker=unit
message=_"Tempting! Most tempting... but I fear it would be unwise for me to wield such a thing. That privilege passes onto another."
[/message]
[/case]
[case]
value=Hahid al-Ali
[message]
speaker=unit
message=_"Ha! Good joke! Im not about to mess around with any of your foul northerner magic; necromancy was the cause of all this trouble in the first place."
[/message]
[/case]
[case]
value=Terraent
[message]
speaker=unit
message=_"I serve the light, not this staff of foul darkness! We should cast away this thing and be done with it."
[/message]
[/case]
[case]
value=Konrad
[message]
speaker=unit
message=_"...what foul thing is this? Remove it from my presence; necromancy shall not take root in Wesnoth, not under my watch."
[/message]
[/case]
[else]
[switch]
variable=unit.type
[case]
value=White Mage,Mage of Light,Paladin
[message]
speaker=unit
message=_"No. I serve that which is good and light, and will not wield such a dark magical artifact."
[/message]
[/case]
[else]
[switch]
variable=unit.race
[case]
value=dunefolk
[message]
speaker=unit
message=_"Fighting your northerners foul magic is bad enough. Dont expect me to wield that — civilized cultures dont mess around with magic."
[/message]
[/case]
[else]
[message]
speaker=unit
message=_"I will not wield such a dark magical artifact, though I shall not begrudge its use by my companions."
[/message]
[/else]
[/switch]
[/else]
[/switch]
[/else]
[/switch]
)
_"I will not wield such a dark magical artifact, though I shall not begrudge its use by my companions."
# this message makes no sense for Dacyn (his entire quest is to get a dark magical artifact), but I couldn't think of something good and generic that works for everyone.
(
[effect]
apply_to=new_attack

View file

@ -574,13 +574,13 @@ Been a tough few days since we left Elensefar with all them patrols running arou
[event]
name=attack_end
[filter]
side=3
side=2
[/filter]
[filter_second]
side=1
[/filter_second]
{IF_VAR second_unit.hitpoints greater_than 0 (
{IF_VAR $second_unit.hitpoints greater_than 0 (
[then]
[message]
speaker=Baldras

View file

@ -144,8 +144,8 @@
x,y=18,1
side=2
[modifications]
{TRAIT_QUICK}
{TRAIT_DEXTROUS}
{TRAIT_STRONG}
{TRAIT_RESILIENT}
[/modifications]
[/unit]
[unit]
@ -156,8 +156,8 @@
side=2
facing=sw
[modifications]
{TRAIT_STRONG}
{TRAIT_QUICK}
{TRAIT_DEXTROUS}
{TRAIT_RESILIENT}
[/modifications]
[/unit]
[unit]
@ -172,18 +172,6 @@
{TRAIT_RESILIENT}
[/modifications]
[/unit]
[unit]
type=Elvish Outrider
id=Ealin
name= _ "Ealin"
x,y=18,1
side=2
facing=sw
[modifications]
{TRAIT_QUICK}
{TRAIT_RESILIENT}
[/modifications]
[/unit]
[scroll_to]
x,y=18,1
[/scroll_to]

View file

@ -67,8 +67,6 @@
comment = "Sprite animations (defense and magic) of orcish shamans"
[/entry]
[/about]
{ENABLE_SAURIAN_SPEARTHROWER}
[/campaign]
#ifdef CAMPAIGN_SON_OF_THE_BLACK_EYE

View file

@ -1,28 +1 @@
#textdomain wesnoth-thot
[achievement_group]
display_name=_"The Hammer of Thursagan"
content_for=the_hammer_of_thursagan
[achievement]
id="gryphon_hunter"
name=_"Gryphon Hunter"
description=_"Kill the Gryphon leader in High Pass"
hidden=yes
icon="data/core/images/units/monsters/gryphon.png"
icon_completed="data/core/images/units/monsters/gryphon.png~SCALE(72,72)~BLIT("data/core/images/misc/achievement-frames/frame-3-red.png",0,0)"
[/achievement]
[achievement]
id="conqueror_of_the_forest"
name=_"Conqueror of the Forest"
description=_"Defeat an enemy leader in Forbidden Forest"
icon="data/core/images/units/woses/wose-die-fall-5.png"
icon_completed="data/core/images/units/woses/wose-die-fall-5.png~SCALE(72,72)~BLIT("data/core/images/misc/achievement-frames/frame-8-grey.png",0,0)"
[/achievement]
[achievement]
id="new_thursagan"
name=_"New Thursagan"
description=_"Complete The Underlevels on challenging difficulty"
icon="data/core/images/items/hammer-runic.png"
icon_completed="data/core/images/items/hammer-runic.png~SCALE(72,72)~BLIT("data/core/images/misc/achievement-frames/frame-3-red.png",0,0)"
[/achievement]
[/achievement_group]

View file

@ -233,19 +233,6 @@
#endif
[/event]
[event]
name=die
[filter]
id="Kaara"
[/filter]
[set_achievement]
content_for=the_hammer_of_thursagan
id="gryphon_hunter"
[/set_achievement]
[/event]
[event]
{QUANTITY name (turn 16) (turn 14) (turn 9)}

View file

@ -249,25 +249,6 @@
[/move_unit_fake]
[/event]
#Death of an enemy leader
[event]
name=die
[filter]
canrecruit=yes
[not]
side=1
[/not]
[/filter]
[message]
speaker=second_unit
message= _ "We shall pass!"
[/message]
[set_achievement]
content_for=the_hammer_of_thursagan
id="conqueror_of_the_forest"
[/set_achievement]
[/event]
# Angarthing and Aiglondur speak when they reach the signpost.
[event]
name=moveto

View file

@ -1294,13 +1294,6 @@
result=victory
carryover_report=no
[/endlevel]
#ifdef HARD
[set_achievement]
content_for=the_hammer_of_thursagan
id="new_thursagan"
[/set_achievement]
#endif
[/event]
#########################################################################################
######################################## Deaths #########################################

View file

@ -8,12 +8,12 @@
hitpoints=22
movement_type=dwarvishfoot
movement=4
experience=25
experience=50
{AMLA_DEFAULT}
advances_to=null
level=0
level=1
alignment=neutral
cost=12
cost=17
usage=fighter
# wmllint: local spelling Dawarf
description= _ "Dont ask where the Dawarf came from. You really dont want to know. It is a secret well guarded by the great lore-masters of Wesnoth. And it isnt pretty. Hint: it involves lots of sherbet."

View file

@ -1,10 +1,6 @@
--<<
local _ = wesnoth.textdomain 'wesnoth-wc'
local _wesnoth = wesnoth.textdomain "wesnoth"
local wc2_scenario = {}
local on_event = wesnoth.require("on_event")
local carryover = wesnoth.require("carryover_gold.lua")
function wc2_scenario.is_human_side(side_num)
return side_num <= wml.variables.wc2_player_count
@ -46,52 +42,18 @@ function wesnoth.wml_actions.wc2_start_units(cfg)
end
end
function wc2_scenario.average_gold()
local total_gold = 0
local nsides = 0
function wesnoth.wml_actions.wc2_store_carryover(cfg)
local human_sides = wesnoth.sides.find(wml.get_child(cfg, "sides"))
--use an the average amount of villages for this scenario to stay independent of map generator results.
local nvillages = cfg.nvillages
local turns_left = math.max(wesnoth.scenario.turns - wesnoth.current.turn, 0)
local player_gold = 0
for i, s in ipairs(wesnoth.sides) do
if wc2_scenario.is_human_side(i) then
nsides = nsides + 1
total_gold = total_gold + s.gold
end
for side_num, side in ipairs(human_sides) do
player_gold = player_gold + side.gold
end
return math.floor(total_gold / nsides + 0.5)
end
-- overwrite parts of the carryover gold implementation.
function carryover.set_side_carryover_gold(side)
local turns_left = carryover.turns_left()
-- make the carryover bonus independent of the map generation.
local num_villages = wml.variables.wc2_nvillages or carryover.get_num_villages()
local finishing_bonus_per_turn = wml.variables.wc2_early_victory_bonus or num_villages * side.village_gold + side.base_income
local finishing_bonus = finishing_bonus_per_turn * turns_left
local avg_gold = wc2_scenario.average_gold()
side.carryover_gold = math.ceil((avg_gold + finishing_bonus) * side.carryover_percentage / 100)
return {
turns_left = turns_left,
avg_gold = avg_gold,
finishing_bonus = finishing_bonus,
finishing_bonus_per_turn = finishing_bonus_per_turn,
}
end
---@param side side
---@param info table
---@return string
function carryover.remaining_gold_message(side, info)
return "<small>\n" .. _wesnoth("Remaining gold: ") .. carryover.half_signed_value(side.gold) .. "</small>"
.. "<small>\n" .. _("Average remaining gold: ") .. carryover.half_signed_value(info.avg_gold) .. "</small>"
end
---@param side side
---@param info table
---@return string
function carryover.total_gold_message(side, info)
return "<small>" .. _wesnoth("Total gold: ") .. carryover.half_signed_value(info.avg_gold + info.finishing_bonus) .. "</small>"
player_gold = math.max(player_gold / #human_sides, 0)
wml.variables.wc2_carryover = math.ceil( (nvillages*turns_left + player_gold) * 0.15)
end
-- carryover handling: we use a custom carryover machnics that
@ -119,10 +81,11 @@ on_event("wc2_start", function(cx)
end
end
local gold = (wml.variables["wc2_difficulty.extra_gold"] or 0)
local gold = (wml.variables.wc2_carryover or 0) + (wml.variables["wc2_difficulty.extra_gold"] or 0)
for i = 1, wml.variables.wc2_player_count do
wesnoth.sides[i].gold = wesnoth.sides[i].gold + gold
end
wml.variables.wc2_carryover = nil
end)
-- our victory condition
@ -133,7 +96,9 @@ on_event("enemies defeated", function(cx)
wesnoth.audio.play("ambient/ship.ogg")
wesnoth.wml_actions.endlevel {
result = "victory",
carryover_report = true,
carryover_percentage = 0,
carryover_add = false,
carryover_report = false,
}
end)

View file

@ -10,7 +10,7 @@ wesnoth.dofile("./scenario_utils/plot.lua")
wesnoth.dofile("./scenario_utils/side_definitions.lua")
settings = globals.settings or {}
local early_victory_bonus = {27, 40, 53, 63}
local n_villages = {27, 40, 53, 63}
local function get_map_generator(scenario_data)
if globals.settings.default_id then
@ -45,9 +45,7 @@ function wc_ii_generate_scenario(nplayers, gen_args)
std_print("test_nplayers", wml.variables.test_nplayers)
local scenario_data = get_scenario_data(nplayers, scenario_num)
local prestart_event = {
name = "prestart",
}
local prestart_event = { name = "prestart" }
-- our [scenario] skeleton
local scenario = {
event = {
@ -73,7 +71,6 @@ function wc_ii_generate_scenario(nplayers, gen_args)
description="enables the buildin mod to mark units, disable this to be compatible with other mods that do the same thing",
},
},
-- note: in later scenarios these variables will probably be overwritten by whatever is present in the carryover.
variables = {
wc2_scenario = scenario_num,
wc2_player_count = nplayers,
@ -84,8 +81,6 @@ function wc_ii_generate_scenario(nplayers, gen_args)
description = "WC_II_" .. nplayers .. "p_desc",
modify_placing = false,
turns = scenario_data.turns,
carryover_percentage = 15,
carryover_add = true,
}
-- add [side]s to the [scenario]
@ -95,6 +90,21 @@ function wc_ii_generate_scenario(nplayers, gen_args)
-- add plot (that is [event] with [message]s)
add_plot(scenario, scenario_num, nplayers)
-- add the gold carryover event
if scenario_num < #n_villages then
table.insert(scenario.event, {
name = "victory",
wml.tag.wc2_store_carryover {
nvillages = n_villages[scenario_num] + 2 * nplayers,
wml.tag.sides {
side="1,2,3",
wml.tag.has_unit {
}
}
}
})
end
-- add some wc2 specific wml [event]s
for side_num = 1, nplayers do
table.insert(scenario.event, {
@ -107,28 +117,19 @@ function wc_ii_generate_scenario(nplayers, gen_args)
})
end
if early_victory_bonus[scenario_num] then
table.insert(prestart_event,
wml.tag.set_variable {
name = "wc2_early_victory_bonus",
value = early_victory_bonus[scenario_num] + 2 * nplayers,
}
)
end
-- generate the map. (this also adds certain events for example to create [item]s or [sound_source]s)
local mapgen_func = get_map_generator(scenario_data)
mapgen_func(scenario, nplayers)
-- set the correct scenario name.
if scenario_num == 1 then --first map
scenario.name = _"Start"
scenario.name = "WC_II_" .. nplayers .. " - " .. _"Start"
else
local scenario_desc = _ "Scenario " .. scenario_num
local scenario_desc = _ "Scenario" .. scenario_num
if scenario_num == 5 then
scenario_desc = _"Final Battle"
end
scenario.name = scenario_desc
scenario.name = "WC_II_" .. nplayers .. " " .. scenario_desc .. " - "--.. scenario.map_name
end
local res = wc2_convert.lon_to_wml(scenario, "scenario")

View file

@ -13,18 +13,6 @@ _ "World Conquest 3p" #enddef
#define WC_II_CAMPAIGN_NAME_4P
_ "World Conquest 4p" #enddef
#define WC_II_ABBREV_1P
_ "WC1p" #enddef
#define WC_II_ABBREV_2P
_ "WC2p" #enddef
#define WC_II_ABBREV_3P
_ "WC3p" #enddef
#define WC_II_ABBREV_4P
_ "WC4p" #enddef
#define WC_II_CAMPAIGN_DESC_1P
_ "A randomly generated campaign for 1 player. It has 6 levels of difficulty.
(Expert level, 5 scenarios.)" #enddef
@ -113,7 +101,7 @@ _ "WC4p" #enddef
icon = {ICON}
image = {IMAGE_ONE}
type = mp
abbrev = {WC_II_ABBREV_{PLAYERS}P}
abbrev = _ "WC" + {PLAYERS}\
{WC2_CAMPAIGN_DIFFICULTY VERY_EASY {WC2_HUMAN_DIFFICULTY human-peasants/peasant purple} _"Peasant" _"Beginner" 6 2 2 10 yes 0}
{WC2_CAMPAIGN_DIFFICULTY EASY {WC2_HUMAN_DIFFICULTY human-loyalists/sergeant black} _"Sergeant" _"Easy" 7 3 2 7 yes 5}
{WC2_CAMPAIGN_DIFFICULTY NORMAL {WC2_HUMAN_DIFFICULTY human-loyalists/lieutenant brown} _"Lieutenant" _"Medium" 8 4 2 5 yes 10} {DEFAULT_DIFFICULTY}

View file

@ -13,9 +13,9 @@
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "center"
horizontal_alignment = "left"
[label]
definition = "title_script"
definition = "title"
label = _"Select Character"
[/label]
[/column]
@ -25,7 +25,7 @@
grow_factor = 1
border = "all"
border_size = 5
horizontal_alignment = "center"
horizontal_alignment = "left"
[label]
label = _"Who do you want to play as?"
[/label]
@ -39,88 +39,37 @@
grow_factor = 1
border = "all"
border_size = 5
[horizontal_listbox]
id = "characters"
has_minimum = false
[list_definition]
[row]
[column]
horizontal_grow = true
vertical_grow = true
[toggle_panel]
definition = "default"
return_value_id = "ok"
linked_group = "panel"
[grid]
[row]
grow_factor = 0
[column]
grow_factor = 1
horizontal_alignment = "center"
border = "all"
border_size = 5
[image]
id = "image"
definition = "default"
[/image]
[/column]
[/row]
[row]
grow_factor = 1
[column]
grow_factor = 0
border = "all"
border_size = 10
horizontal_grow = true
vertical_alignment = "top"
[label]
id = "name"
use_markup = true
text_alignment = "center"
[/label]
[/column]
[/row]
[/grid]
[/toggle_panel]
[/column]
[/row]
[/list_definition]
[list_data]
[row]
[column]
[widget]
id = "image"
label = "portraits/konrad.webp~SCALE(200,200)"
[/widget]
[widget]
id = "name"
label = "<span size='x-large' face='OldaniaAdfStd'>" + _"Konrad" + "</span>"
[/widget]
[/column]
[/row]
[row]
[column]
[widget]
id = "image"
label = "portraits/lisar.webp~SCALE(200,200)~FL()"
[/widget]
[widget]
id = "name"
label = "<span size='x-large' face='OldaniaAdfStd'>" + _"Lisar" + "</span>"
[/widget]
[/column]
[/row]
[/list_data]
[/horizontal_listbox]
[image]
label = "units/konrad-fighter.png"
[/image]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
[image]
label = "units/human-princess.png~TC(1,magenta)"
[/image]
[/column]
[/row]
[row]
[column]
grow_factor = 1
border = "all"
border_size = 5
[button]
label = _"Konrad"
return_value = 1
[/button]
[/column]
[column]
grow_factor = 1
border = "all"
border_size = 5
[button]
label = _"Lisar"
return_value = 2
[/button]
[/column]
[/row]
[/grid]

View file

@ -7,26 +7,17 @@ local T = wml.tag
local wml_actions = wesnoth.wml_actions
local _ = wesnoth.textdomain "wesnoth-tutorial"
selected = 1
function pre_show(dialog)
local list = dialog:find("characters")
list.on_modified = function()
selected = list.selected_index
dialog:close()
end
end
function wml_actions.select_character()
local character_selection_dialog = wml.load "campaigns/tutorial/gui/character_selection.cfg"
local dialog_wml = wml.get_child(character_selection_dialog, 'resolution')
local result = wesnoth.sync.evaluate_single(function()
return { value = gui.show_dialog(dialog_wml, pre_show, function() end) }
return { value = gui.show_dialog(dialog_wml) }
end)
local character = result.value
local unit = wml.variables.student_store
if selected == 2 then
if character == 2 then
wesnoth.units.to_map({
type = "Fighteress",
side = 1,

View file

@ -14,8 +14,6 @@ function wesnoth.wml_actions.hint_message(cfg)
size = 18,
location = {5,5},
color = {255, 255, 255},
bgcolor = {0, 0, 0},
bgalpha = 85,
duration = "unlimited",
max_width = "40%",
valign = "top",

View file

@ -151,7 +151,6 @@
[select_character][/select_character]
{HIGHLIGHT_IMAGE $student_store.x $student_store.y "misc/unit-marker.png" ()}
{CLEAR_VARIABLE student_store}
{GENDER (
@ -377,17 +376,6 @@
) (
{PRINT ( _ "Move Lisar next to Delfador")}
)}
[store_unit]
[filter]
id=Delfador
[/filter]
variable=mentor
kill=no
[/store_unit]
{HIGHLIGHT_IMAGE $mentor.x $mentor.y "misc/unit-marker.png" ()}
{CLEAR_VARIABLE mentor}
[/event]
[event]

View file

@ -9,7 +9,6 @@ wesnoth.dofile 'lua/wml-tags.lua'
wesnoth.dofile 'lua/feeding.lua'
wesnoth.dofile 'lua/diversion.lua'
wesnoth.dofile 'lua/stun.lua'
wesnoth.dofile 'lua/scenario_end_events.lua'
>>
[/lua]

View file

@ -358,7 +358,7 @@ The map wont look exactly the same in the game as it does in the editor, beca
• Event handlers and scripting
The editor is not a tool to help you with scripting the scenarios event handlers.
The editor is not a tool to help you scripting the scenarios event handlers.
• Infinite Backwards Compatibility
@ -424,7 +424,7 @@ If your add-on will only be used on 1.18 and later, it is instead recommended to
• <span face='monospace'>maps/first.map</span>
◦ this is the .map file created by the scenario editor when saving in scenario mode
• <span face='monospace'>scenarios/other.cfg</span>
◦ this is the .cfg file containing everything that the scenario editor doesnt understand
◦ this is the .cfg file containing everything that the scenario editor doesn't understand
• <span face='monospace'>scenarios/first.cfg</span>
◦ inside the <span face='monospace'>[scenario]</span> element, use <span face='monospace'>map_file=&quot;first.map&quot;</span> to load the map file
◦ inside the <span face='monospace'>[scenario]</span> element, use <span face='monospace'>include_file=&quot;other.cfg&quot;</span> to load the additional cfg file"
@ -436,7 +436,7 @@ If your add-on will only be used on 1.18 and later, it is instead recommended to
[topic]
id=editor_masks
title= _ "Editor Mask Usage"
text= _ "Masks can be applied to a base map for reuse in several scenarios playing at the same locations."
text= _ "Masks can be applied to a base map for reusal in several scenarios playing at the same locations."
[/topic]
# wmllint: markcheck on
@ -463,9 +463,9 @@ In scenario mode, the button accesses an editor for individual schedules for <re
There is a filter function to show only a subset of the available items — this is the leftmost of the four buttons at the top of the palette, and the graphic changes depending on what is selected. Examples:" +
"<table>" +
"<row><col><img src=icons/terrain/terrain_group_all_30.png align=left /></col><col>" + _ "Show all kinds of terrain" + "</col></row>" +
"<row><col><img src=icons/terrain/terrain_group_water_deep_30.png align=left /></col><col>" + _ "Show only water terrains" + "</col></row>" +
"<row><col><img src=icons/terrain/terrain_group_village_30.png align=left /></col><col>" + _ "Show only villages" + "</col></row>" +
"<row><col><img src=icons/terrain/terrain_group_all_30.png align=left /></col><col>" + _ "Show all kinds of terrain</col></row>" +
"<row><col><img src=icons/terrain/terrain_group_water_deep_30.png align=left /></col><col>" + _ "Show only water terrains</col></row>" +
"<row><col><img src=icons/terrain/terrain_group_village_30.png align=left /></col><col>" + _ "Show only villages</col></row>" +
"</table>"
[/topic]
# wmllint: markcheck on
@ -483,7 +483,7 @@ There is a filter function to show only a subset of the available items — this
" + _ "<header>Native</header>
A map file consists of rows with comma-separated terrain code strings. The only non-terrain information provided by the map syntax is the set of locations created by the <ref dst='editor_tool_starting'>Starting Locations Tool</ref>. The files can be edited with a general purpose text editor.
A map file consists of rows with comma separated terrain code strings. The only non-terrain information provided by the map syntax is the set of locations created by the <ref dst='editor_tool_starting'>Starting Locations Tool</ref>. The files can be edited with a general purpose text editor like notepad.
These files can be used directly for multiplayer games, the number of players is automatically determined by the number of starting positions. When saved in the default directory, the map can be found in the “Custom Maps” game type of the multiplayer “Create Game” dialog; you may need to refresh the cache (press F5 on the title screen) before a newly-created map appears.
@ -496,7 +496,7 @@ The <italic>map_file</italic> method is preferred over using a preprocessor incl
" + _ "<header>Embedded</header>
The map data can be stored as part of a scenarios .cfg file, directly in the <italic>map_data</italic> attribute. In other words, in the place that the preprocessor would include it when using the preprocessor-include method.
The map data can stored as part of a scenarios .cfg file, directly in the <italic>map_data</italic> attribute. In other words, in the place that the preprocessor would include it when using the preprocessor-include method.
<header>Using Embedded Format in Terrain Mode</header>

View file

@ -93,7 +93,7 @@
[topic]
id=..introduction
title= _ "Introduction"
text="<img src=misc/logo-bg.png~BLIT(misc/logo.png) align=middle /><br/>" + _ "<italic>Battle for Wesnoth</italic> is a turn-based fantasy strategy game somewhat unusual among modern strategy games. While other games strive for complexity, <italic>Battle for Wesnoth</italic> strives for simplicity of both rules and gameplay. This does not make the game simple, however — from these simple rules arises a wealth of strategy, making the game easy to learn but a challenge to master.
text="<img>src=misc/logo-bg.png~BLIT(misc/logo.png) align=middle</img>" + _ "<br/><italic>text='Battle for Wesnoth'</italic> is a turn-based fantasy strategy game somewhat unusual among modern strategy games. While other games strive for complexity, <italic>text='Battle for Wesnoth'</italic> strives for simplicity of both rules and gameplay. This does not make the game simple, however — from these simple rules arises a wealth of strategy, making the game easy to learn but a challenge to master.
The following pages outline all you need to know to play Wesnoth. As you play, new information is added to the various categories as you come across new aspects of the game. For more detailed information on special situations and exceptions, follow the included links."
[/topic]
@ -575,7 +575,7 @@ Mixed terrain types share the properties of multiple basic terrain types — uni
" + "<img src='terrain/hills/regular.png~BLIT(terrain/forest/pine-tile.png)'/>" + "<img src='terrain/hills/desert.png'/>" + "<img src='terrain/cave/hills-variation.png'/><br/>" + _ "One notable exception is bridge terrains, such as <italic>bridges over shallow water</italic>, <italic>fords</italic>, and <italic>bridges over chasms</italic>. Fords are easily passable to both merfolk and humans — all units moving on a ford enjoy the best defense and best movement out of flat and shallow water, rather than the worse movement of the two. Similarly, bridges over chasms are passable to nonfliers (unsurprisingly).
" + "<img src='terrain/water/coast-tile.png~BLIT(terrain/bridge/wood-se-nw.png)'/>" + "<img src='terrain/water/ford-tile.png'/>" + "<img src='terrain/chasm/regular-tile.png~BLIT(terrain/cave/chasm-stone-bridge-sw-ne-tile.png)'/><br/>" + _ "Land-based villages generally give the best defense and movement as well. These villages are mixed terrains, based on the village terrain type, together with hill, swamp, and cave, respectively.
" + "<img src='terrain/water/coast-tile.png~BLIT(terrain/bridge/wood-se-nw.png)'/>" + "<img src='terrain/water/ford-tile.png'/>" + "<img src='terrain/chasm/regular-tile.png~BLIT(terrain/cave/chasm-stone-bridge-sw-ne-tile.png)'/>" + _ "<br/>Land-based villages generally give the best defense and movement as well. These villages are mixed terrains, based on the village terrain type, together with hill, swamp, and cave, respectively.
" + "<img src='terrain/hills/regular.png~BLIT(terrain/village/human-hills-tile.png)'/>" + "<img src='terrain/swamp/water-tile.png~BLIT(terrain/village/swampwater-tile.png)'/>" + "<img src='terrain/cave/floor6.png~BLIT(terrain/village/cave-tile.png)'/><br/>" + _ "Finally, water villages are generally inhospitable to land units, and do not give defense or movement benefits associated with the village terrain type. Instead, they count only as water tiles.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 14 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 998 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1,023 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 747 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 784 B

Some files were not shown because too many files have changed in this diff Show more