remove 'experimental_' of filter_ability/specials tags
now what 1.18 separate of master branch it is time of aiming for that. "experimental_ preffix is depracated now.
This commit is contained in:
parent
a96ce07e35
commit
7665db46af
11 changed files with 77 additions and 51 deletions
2
changelog_entries/remove_experiemental.md
Normal file
2
changelog_entries/remove_experiemental.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
### WML Engine
|
||||
* rechange [experimental_filter_ability/active] and [experimental_filter_specials] to [filter_ability/active] and [filter_specials] and make "experimental_" deprecated.
|
|
@ -252,9 +252,9 @@
|
|||
id=dacyn_no_halo
|
||||
[effect]
|
||||
apply_to=remove_ability
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=illuminates
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/effect]
|
||||
[/object]
|
||||
[/modify_unit]
|
||||
|
@ -419,9 +419,9 @@
|
|||
id=dacyn_no_halo
|
||||
[effect]
|
||||
apply_to=remove_ability
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=illuminates
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/effect]
|
||||
[/object]
|
||||
[/modify_unit]
|
||||
|
|
|
@ -47,7 +47,13 @@
|
|||
{FILTER_TAG "filter_adjacent" adjacent ()}
|
||||
{FILTER_TAG "filter_location" location ()}
|
||||
{FILTER_TAG "filter_side" side ()}
|
||||
{FILTER_TAG "experimental_filter_ability" abilities {SIMPLE_KEY active s_bool}}
|
||||
{FILTER_TAG "filter_ability" abilities {SIMPLE_KEY active s_bool}}
|
||||
[tag]
|
||||
name=experimental_filter_ability
|
||||
super="$filter_abilities"
|
||||
deprecated=yes
|
||||
{SIMPLE_KEY active s_bool}
|
||||
[/tag]
|
||||
{FILTER_BOOLEAN_OPS unit}
|
||||
[/tag]
|
||||
|
||||
|
|
|
@ -147,7 +147,8 @@
|
|||
[case]
|
||||
value=remove_ability
|
||||
{LINK_TAG "units/unit_type/abilities"}
|
||||
{FILTER_TAG "experimental_filter_ability" abilities ()}
|
||||
{FILTER_TAG "experimental_filter_ability" abilities (deprecated=yes)}
|
||||
{FILTER_TAG "filter_ability" abilities ()}
|
||||
[/case]
|
||||
[case]
|
||||
value=new_animation
|
||||
|
|
|
@ -65,7 +65,8 @@
|
|||
{DEFAULT_KEY overwrite_specials ability_overwrite none}
|
||||
[tag]
|
||||
name="overwrite"
|
||||
{FILTER_TAG "experimental_filter_specials" abilities ()}
|
||||
{FILTER_TAG "experimental_filter_specials" abilities (deprecated=yes)}
|
||||
{FILTER_TAG "filter_specials" abilities ()}
|
||||
{SIMPLE_KEY priority real}
|
||||
[/tag]
|
||||
[/tag]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#####
|
||||
# API(s) being tested: [effect]apply_to=remove_ability[experimental_filter_ability]
|
||||
# API(s) being tested: [effect]apply_to=remove_ability[filter_ability]
|
||||
##
|
||||
# Actions:
|
||||
# Two [chance_to_hit] abilities are added, setting the chance to 0 and 100 respectively.
|
||||
|
@ -64,10 +64,10 @@
|
|||
silent=yes
|
||||
[effect]
|
||||
apply_to=remove_ability
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
id=test_cth
|
||||
tag_name=chance_to_hit
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/effect]
|
||||
[/object]
|
||||
[object]
|
||||
|
@ -77,10 +77,10 @@
|
|||
silent=yes
|
||||
[effect]
|
||||
apply_to=remove_ability
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
id=test_cth
|
||||
tag_name=chance_to_hit
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/effect]
|
||||
[/object]
|
||||
[store_unit]
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
#enddef
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]
|
||||
# API(s) being tested: [event][filter][filter_ability]
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
|
@ -99,10 +99,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
value=25
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{ASSERT ({VARIABLE_CONDITIONAL side_number equals 1})}
|
||||
{ASSERT ({VARIABLE_CONDITIONAL triggers equals 0})}
|
||||
|
@ -120,10 +120,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
value=10-30
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{ASSERT ({VARIABLE_CONDITIONAL side_number equals 1})}
|
||||
{ASSERT ({VARIABLE_CONDITIONAL triggers equals 0})}
|
||||
|
@ -135,7 +135,7 @@
|
|||
[/event]
|
||||
)}
|
||||
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]
|
||||
# API(s) being tested: [event][filter][filter_ability]
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
|
@ -151,10 +151,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
value=-25--10
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{ASSERT ({VARIABLE_CONDITIONAL side_number equals 1})}
|
||||
{ASSERT ({VARIABLE_CONDITIONAL triggers equals 0})}
|
||||
|
@ -167,7 +167,7 @@
|
|||
)}
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]
|
||||
# API(s) being tested: [event][filter][filter_ability]
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
|
@ -183,10 +183,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
value=45
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{FAIL}
|
||||
[/event]
|
||||
|
@ -197,7 +197,7 @@
|
|||
)}
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]
|
||||
# API(s) being tested: [event][filter][filter_ability]
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
|
@ -213,10 +213,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
value=-45-10
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{FAIL}
|
||||
[/event]
|
||||
|
@ -241,7 +241,7 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
[filter_wml]
|
||||
[filter]
|
||||
|
@ -250,7 +250,7 @@
|
|||
[/filter_location]
|
||||
[/filter]
|
||||
[/filter_wml]
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{ASSERT ({VARIABLE_CONDITIONAL side_number equals 1})}
|
||||
{ASSERT ({VARIABLE_CONDITIONAL triggers equals 0})}
|
||||
|
@ -277,7 +277,7 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
[filter_wml]
|
||||
[filter]
|
||||
|
@ -286,7 +286,7 @@
|
|||
[/filter_location]
|
||||
[/filter]
|
||||
[/filter_wml]
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{FAIL}
|
||||
[/event]
|
||||
|
@ -297,7 +297,8 @@
|
|||
)}
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]active=yes
|
||||
# API(s) being tested: [event][filter][filter_ability]active=yes
|
||||
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
|
@ -313,11 +314,11 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
active=yes
|
||||
tag_name=drains
|
||||
value=25
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{ASSERT ({VARIABLE_CONDITIONAL side_number equals 1})}
|
||||
{ASSERT ({VARIABLE_CONDITIONAL triggers equals 0})}
|
||||
|
@ -330,7 +331,7 @@
|
|||
)}
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]active=yes
|
||||
# API(s) being tested: [event][filter][filter_ability]active=yes
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST.
|
||||
|
@ -363,11 +364,11 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
active=yes
|
||||
tag_name=drains
|
||||
value=25
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{FAIL}
|
||||
[/event]
|
||||
|
@ -455,7 +456,7 @@
|
|||
#enddef
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]
|
||||
# API(s) being tested: [event][filter][filter_ability]
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST_WITHOUT_VALUE.
|
||||
|
@ -471,10 +472,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
value=50
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{ASSERT ({VARIABLE_CONDITIONAL side_number equals 1})}
|
||||
{VARIABLE_OP triggers add 1}
|
||||
|
@ -486,7 +487,7 @@
|
|||
)}
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]
|
||||
# API(s) being tested: [event][filter][filter_ability]
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_TEST_WITHOUT_VALUE.
|
||||
|
@ -502,10 +503,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=drains
|
||||
value=35
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{FAIL}
|
||||
[/event]
|
||||
|
@ -518,7 +519,7 @@
|
|||
#undef FILTER_ABILITY_TEST_WITHOUT_VALUE
|
||||
|
||||
#####
|
||||
# API(s) being tested: [event][filter][experimental_filter_ability]apply_to= when ability checked is [resistance]
|
||||
# API(s) being tested: [event][filter][filter_ability]apply_to= when ability checked is [resistance]
|
||||
##
|
||||
# Actions:
|
||||
# Use the common setup from FILTER_ABILITY_RESISTANCE_TEST.
|
||||
|
@ -597,10 +598,10 @@
|
|||
name=attack
|
||||
first_time_only=no
|
||||
[filter]
|
||||
[experimental_filter_ability]
|
||||
[filter_ability]
|
||||
tag_name=resistance
|
||||
apply_to=arcane,fire
|
||||
[/experimental_filter_ability]
|
||||
[/filter_ability]
|
||||
[/filter]
|
||||
{ASSERT ({VARIABLE_CONDITIONAL side_number equals 1})}
|
||||
{VARIABLE_OP triggers add 1}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#####
|
||||
# API(s) being tested: [damage]overwrite_specials,[overwrite][experimental_filter_specials]
|
||||
# API(s) being tested: [damage]overwrite_specials,[overwrite][filter_specials]
|
||||
##
|
||||
# Actions:
|
||||
# Three [damage] abilities are added, one with value=5, other with add=11 and the last with multiply=2.
|
||||
# The one with multiply=2 have overwrite_specials=both_sides and [overwrite][experimental_filter_specials] for overwrite [damage] with add=11 but not value=5.
|
||||
# The one with multiply=2 have overwrite_specials=both_sides and [overwrite][filter_specials] for overwrite [damage] with add=11 but not value=5.
|
||||
# Have alice attack bob.
|
||||
##
|
||||
# Expected end state:
|
||||
|
@ -41,9 +41,9 @@
|
|||
multiply=2
|
||||
overwrite_specials=both_sides
|
||||
[overwrite]
|
||||
[experimental_filter_specials]
|
||||
[filter_specials]
|
||||
add=1-14
|
||||
[/experimental_filter_specials]
|
||||
[/filter_specials]
|
||||
[/overwrite]
|
||||
[/damage]
|
||||
[chance_to_hit]
|
||||
|
|
|
@ -1634,7 +1634,13 @@ bool attack_type::overwrite_special_checking(unit_ability_list& overwriters, con
|
|||
// check whether the current overwriter is disabled due to a filter
|
||||
bool special_matches = true;
|
||||
if(overwrite_specials){
|
||||
auto overwrite_filter = (*overwrite_specials).optional_child("experimental_filter_specials");
|
||||
auto overwrite_filter = (*overwrite_specials).optional_child("filter_specials");
|
||||
if(!overwrite_filter){
|
||||
overwrite_filter = (*overwrite_specials).optional_child("experimental_filter_specials");
|
||||
if(overwrite_filter){
|
||||
deprecated_message("experimental_filter_specials", DEP_LEVEL::INDEFINITE, "", "Use filter_specials instead.");
|
||||
}
|
||||
}
|
||||
if(overwrite_filter && is_overwritable && one_side_overwritable){
|
||||
special_matches = special_matches_filter(cfg, tag_name, *overwrite_filter);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "display_context.hpp"
|
||||
#include "config.hpp"
|
||||
#include "game_data.hpp"
|
||||
#include "game_version.hpp" // for version_info
|
||||
#include "map/map.hpp"
|
||||
#include "map/location.hpp"
|
||||
#include "scripting/game_lua_kernel.hpp" //Needed for lua kernel
|
||||
|
@ -35,6 +36,7 @@
|
|||
#include "formula/function_gamestate.hpp"
|
||||
#include "formula/string_utils.hpp"
|
||||
#include "resources.hpp"
|
||||
#include "deprecation.hpp"
|
||||
|
||||
static lg::log_domain log_config("config");
|
||||
#define ERR_CF LOG_STREAM(err, log_config)
|
||||
|
@ -774,7 +776,10 @@ void unit_filter_compound::fill(vconfig cfg)
|
|||
return side_filter(c, args.fc).match(args.u.side());
|
||||
});
|
||||
}
|
||||
else if (child.first == "experimental_filter_ability") {
|
||||
else if ((child.first == "filter_ability") || (child.first == "experimental_filter_ability")) {
|
||||
if(child.first == "experimental_filter_ability"){
|
||||
deprecated_message("experimental_filter_ability", DEP_LEVEL::INDEFINITE, "", "Use filter_ability instead.");
|
||||
}
|
||||
create_child(child.second, [](const vconfig& c, const unit_filter_args& args) {
|
||||
if(!(c.get_parsed_config())["active"].to_bool()){
|
||||
for(const auto [key, cfg] : args.u.abilities().all_children_range()) {
|
||||
|
|
|
@ -2267,7 +2267,11 @@ void unit::apply_builtin_effect(std::string apply_to, const config& effect)
|
|||
remove_ability_by_id(cfg["id"]);
|
||||
}
|
||||
}
|
||||
if(auto fab_effect = effect.optional_child("filter_ability")) {
|
||||
remove_ability_by_attribute(*fab_effect);
|
||||
}
|
||||
if(auto fab_effect = effect.optional_child("experimental_filter_ability")) {
|
||||
deprecated_message("experimental_filter_ability", DEP_LEVEL::INDEFINITE, "", "Use filter_ability instead.");
|
||||
remove_ability_by_attribute(*fab_effect);
|
||||
}
|
||||
} else if(apply_to == "image_mod") {
|
||||
|
|
Loading…
Add table
Reference in a new issue