|
2 | 2 |
|
3 | 3 | function ORM.fun.init_adaptive_difficulty() |
4 | 4 | local result = 0 |
5 | | - if wesnoth.game_config.mp_settings.active_mods:find("StealingWeaponsMode") then |
| 5 | + -- another way - f=wesnoth.require "functional", f.find(wesnoth.scenario.modifications, function (e) return e.id=="plan_unit_advance" end) |
| 6 | + local modifications = ORM.fun.map(function(mod) return mod.id end, wesnoth.scenario.modifications) |
| 7 | + if ORM.fun.table_contains(modifications, "StealingWeaponsMode") then |
6 | 8 | result = result + 0.2 |
7 | 9 | end |
8 | | - if wesnoth.game_config.mp_settings.active_mods:find("BonusSpam") then |
| 10 | + if ORM.fun.table_contains(modifications, "BonusSpam") then |
9 | 11 | result = result + 0.5 |
10 | 12 | end |
11 | | - if wesnoth.game_config.mp_settings.active_mods:find("CanBeOnlyOne") then |
| 13 | + if ORM.fun.table_contains(modifications, "CanBeOnlyOne") then |
12 | 14 | result = result + 6.66 |
13 | 15 | end |
14 | | - if wesnoth.game_config.mp_settings.active_mods:find("EXI_Heroic_Mod") then |
| 16 | + if ORM.fun.table_contains(modifications, "EXI_Heroic_Mod") then |
15 | 17 | result = result + 0.1 |
16 | 18 | end |
17 | | - if wesnoth.game_config.mp_settings.active_mods:find("EXI_Rush_Mod") then |
| 19 | + if ORM.fun.table_contains(modifications, "EXI_Rush_Mod") then |
18 | 20 | result = result + 0.1 -- maybe for the future find other solutions like better movecosts |
19 | 21 | end |
20 | | - if wesnoth.game_config.mp_settings.active_mods:find("Xara_Magic_Mod") then |
| 22 | + if ORM.fun.table_contains(modifications, "Xara_Magic_Mod") then |
21 | 23 | result = result + 0.3 |
22 | 24 | end |
23 | 25 |
|
@@ -59,8 +61,8 @@ function ORM.fun.init_adaptive_difficulty() |
59 | 61 | result = result - 0.4 |
60 | 62 | end |
61 | 63 |
|
62 | | - if (wesnoth.game_config.mp_settings.mp_era == "era_default" or wesnoth.game_config.mp_settings.mp_era == "era_heroes" or |
63 | | - wesnoth.game_config.mp_settings.mp_era == "era_dunefolk" or wesnoth.game_config.mp_settings.mp_era == "era_dunefolk_heroes") then |
| 64 | + if (wesnoth.scenario.era.id == "era_default" or wesnoth.scenario.era.id == "era_heroes" or |
| 65 | + wesnoth.scenario.era.id == "era_dunefolk" or wesnoth.scenario.era.id == "era_dunefolk_heroes") then |
64 | 66 | result = result - 0.4 |
65 | 67 | if (V.ORM_random_ageless_waves) then |
66 | 68 | result = result - 0.2 |
|
0 commit comments