8 Commits

Author SHA1 Message Date
Celtic Minstrel
8d4cf3cf62 Shorten requires where possible 2017-05-03 02:42:25 -04:00
Gregory A Lundberg
874e568e99 Workarround MP work incomplete 2016-10-21 23:09:51 -05:00
Gregory A Lundberg
89aee83bbf 2p_Dark_Forecast Fix bugs 2016-10-21 23:09:51 -05:00
Gregory A Lundberg
edacf922fb Lua upgrade: integer indices
As of version 5.3, Lua converts a number which as an integer value to add ".0" to the end.

Updating mainline to avoid the issue.
2016-10-21 23:09:51 -05:00
gfgtdf
2fa8bc0350 cleanup lua feeding implementation. 2016-05-22 19:41:54 +02:00
gfgtdf
439ded53ee 2p dark forecast: don't store unit pool types in savefiles
instead of storing the poolypesin savefiles we now have them as 'const'
lua array and store only the indexes to this array in the savefiles.
this has some advantages:
1) It makes the savefiles smaller
2) It simplyfies the lua code becasue we don't have to convert the wml
tables to lua tables anymore.

This also changes the scenario so that the spawned unit types are now
calculated at the beginning (they will be the same when reloading from a
savefile.)
2016-02-18 23:34:50 +01:00
gfgtdf
39eb8feaf1 add difficulcy level slider to dark forecast mp scenario
unfortunateley the 'description' (the tooltip of the widget in the mp
configure dialog) doesn't show in current master. This is likeley to be
a bug related to gui internals.
2016-02-18 23:08:44 +01:00
gfgtdf
8ee34c39b2 move most dark forecast code to lua
This has multiple advantages:
1) It makes the code easier to understand because we now can use local
variables and return values.
2) It makes the code easier to debug because we don't have to reload the
wml cache anymore for changes to have an effect
3) It makes loading the multiplayer wml faster, specially dark forecasts
wml codes is now so short that we don't need to guard it inside its own
preprocessor marco anymore.
4) It decreases the save file size.

This commit also does other improvements to the code, for example:
1) We don't create temporary units anymore just to query the costs of
a unittype.
2) We now load the weather maps dynamically at runtime with
wesnoth.read_file, this decreased the prorocessor paring time and savefile
size further.
3) When creating the new spawns we use temporary objects to decrease
the units movement, instead of changing and resetting the unit stats
manually.

This also has a disadvantage:
1) It now requires all players to have this scenario installed, since it
it a mainline scenario i see no problems with that.
2016-02-18 23:08:41 +01:00