Commit Graph

17738 Commits

Author SHA1 Message Date
elexis 0c9205e5b8 Fix missing [] to undefined replacement in b4503bb61e that was never noticeable because Terrain.place overwrites it on every tile of every map.
Fix wrong variable name in 45bb3d2a43.

This was SVN commit r20335.
2017-10-23 14:45:26 +00:00
fatherbushido 0ddfe51b55 Tweak a bit Scipio's aura radius. Patch by temple. Reviewed by Grugnas.
Differential Revision: https://code.wildfiregames.com/D737
This was SVN commit r20334.
2017-10-23 14:05:07 +00:00
bb f55aac2521 Make the biome setting visible for mp clients.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D979
This was SVN commit r20333.
2017-10-23 12:34:13 +00:00
elexis 1a896f531a Add diskArea rmgen helper function and use it instead of Math.PI * Math.pow(radius, 2).
Use getMapArea instead of mapSize*mapSize.

This was SVN commit r20332.
2017-10-23 10:39:32 +00:00
elexis 1dee1eced9 Remove rmgen euclidian distance helper function, refs 6590f301c2 / D969.
Use Math.square(x) instead of Math.pow(x, 2) in places that don't
multiply it with Math.PI.

This was SVN commit r20331.
2017-10-23 10:13:49 +00:00
fatherbushido 32812f0974 Add unit tests to the EntityLimits component.
Differential Revision: https://code.wildfiregames.com/D970
This was SVN commit r20329.
2017-10-23 06:27:00 +00:00
elexis 6590f301c2 Add Math.square to compute the square of a number without the need to repeat the term, without using the slower Math.pow.
Start unifying the euclidian distance functions instead of adding yet
another helper function to the random map script library after this
diff.

Differential Revision: https://code.wildfiregames.com/D969
Math.square accepted by mimo
Includes changes proposed by bb, fatherbushido

This was SVN commit r20328.
2017-10-22 20:46:41 +00:00
vladislavbelov 67e27ed7ea Atlas: Cleanup horizontal alignment flags being ignored, fix warnings on a start.
Fix #3824
Patch by: Clockwork-Muse.
Reviewed by: vladislavbelov.
Differential Revision: https://code.wildfiregames.com/D824
This was SVN commit r20327.
2017-10-22 20:09:28 +00:00
fatherbushido ad7d7ec1e9 Fix a disabled template manager test.
Fix #4522
Patch by: Sandarac.
Reviewed by: elexis.
Differential Revision: https://code.wildfiregames.com/D968
This was SVN commit r20326.
2017-10-22 15:39:50 +00:00
LordGood aeaf3d1f43 Persian range and Stan's Iberian stables. Template edited for Iberian range.
This was SVN commit r20325.
2017-10-21 21:12:23 +00:00
elexis 56ba3e4416 Show stacktrace too in case custom JS exceptions are thrown.
This was SVN commit r20324.
2017-10-21 20:38:10 +00:00
mimo 3c2f5ca5a6 rework a bit D964
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D967
This was SVN commit r20323.
2017-10-21 19:05:52 +00:00
Imarok 6c5a8269f3 Fix some style issues noticed by our linter
Reviewed By: bb
Differential Revision: https://code.wildfiregames.com/D585
This was SVN commit r20322.
2017-10-21 17:31:05 +00:00
Imarok 5f0a0fbbef Add id for IQ stanzas
Patch by: Dunedan
Differential Revision: https://code.wildfiregames.com/D899
This was SVN commit r20321.
2017-10-21 14:11:25 +00:00
mimo 23893415d1 Unify trade gain computation between simulation and ai
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D964
This was SVN commit r20320.
2017-10-21 08:40:11 +00:00
mimo e5ec6d0bff petra: allow gatherers to switch to a nearer resource when slots become available
This was SVN commit r20319.
2017-10-20 18:06:12 +00:00
Imarok 00ce80a1b8 Gamesetup unification variable renaming
Reviewed by: bb
Differential Revision: https://code.wildfiregames.com/D429
This was SVN commit r20318.
2017-10-20 16:04:24 +00:00
elexis 7e0b54a36b Fix collisions of random resources and starting base resources on the Corinthian Isthmus random map script, refs #4600.
This was SVN commit r20316.
2017-10-19 22:52:23 +00:00
LordGood 11c52a255f few minor edits to the spartan range and workshop, added template tree for future ranges, stables, and workshops and assigned new actors to them
This was SVN commit r20315.
2017-10-19 21:41:25 +00:00
fatherbushido 2beea46de7 Revert a naked fanatic armor nerf done in 2e5138bad9. It has now the same armor as other champions but don't have the armor bonus of spearmen. Requested by Feldfeld, borg-, Grugnas.
This was SVN commit r20314.
2017-10-19 18:04:07 +00:00
LordGood b389c9f846 whoops! coulda sworn i had these checked. missing .dae files restored
This was SVN commit r20313.
2017-10-18 19:32:39 +00:00
LordGood fe1401ec3d Last of the Spartan buildings, wow's normal fix, and Stan's archery range
This was SVN commit r20312.
2017-10-18 18:34:11 +00:00
mimo a37d8807f6 petra: some performance optimizations
This was SVN commit r20311.
2017-10-18 17:45:04 +00:00
mimo dc40f711db ai: remove some unused filter stuff + cleanup
This was SVN commit r20310.
2017-10-18 17:00:38 +00:00
elexis 99066df0c5 Unify beyond ridiculous Snowflake Searocks duplication gore, refs a9b963c3a5.
The island generation code was copied once for
 * the small mapsize and 2 players
 * the small mapsize and 3 players
 * the small mapsize and 4 players
 * the small mapsize and more than 4 players
 * the medium mapsize and up to 4 players
 * the medium mapsize and more than 4 players
 * the normal mapsize and up to 5 players
 * the normal mapsize and up to 7 players
 * the normal mapsize and 8 players
 * the large mapsize and up to 5 players
 * the large mapsize and more than 5 players

Within each of these copies there were three copies of the island
createArea+placer+painters call and
about 10 unreadable island connection setter copies.

Support mapgenerations with only one player.
Cleanup createAreas calls as in 376d8b3d1e and broken indentation.
Fix missing forests due to a missing parentheses in the forest count of
that commit.

This was SVN commit r20308.
2017-10-17 10:23:54 +00:00
elexis d79fdd75df Unify duplicate Corsica & Sardinia island generation, refs 9016b8d866.
The code for the other island was copied in a varying order with only
the values changed to 1 - x.
Unite the island, subisland, creeks, beaches, main relief, first
plateau, second plateau and passagess code under a single loop to
display the logical relation
instead of scattering many paragraphs and executing unrelated (starting
base) code in between.

Cleanup affected createArea calls as in 376d8b3d1e.

This was SVN commit r20306.
2017-10-17 00:21:38 +00:00
bb 5b72870745 Enlarge default sidebar size, so everything is visible by default
Accepted By: elexis
Differential Revision: https://code.wildfiregames.com/D855
This was SVN commit r20305.
2017-10-16 13:07:07 +00:00
LordGood 442e9a9184 corral and possible theatron fix?
This was SVN commit r20303.
2017-10-16 02:14:00 +00:00
elexis dd03ec801f Fix wrong forest type replacement in the prior commit (376d8b3d1e).
Just for the record (as all of that is going to be deleted soon), add
the missing variable declarations that were hoisted from an unrelated
loop prior to 45bb3d2a43.

This was SVN commit r20302.
2017-10-15 19:27:24 +00:00
elexis 376d8b3d1e Cleanup most createArea and some createObjectGroup calls in random map scripts.
Inline the placer, terrainPainter, elevationPainter, group and sizes
helper variables that are used only once.
Thus do not hoist variable declarations from unrelated scopes.
Remove few dozens of painters that are overpainted by the
paintBasedOnTerrainHeight call afterwards.
Remove 334 noisy misaligned code comments (// terrains // widths //
blend radius and // some variation).
Label the createArea calls so that the reader knows what they do.
Remove unbenefitial Math.PI/8 grass min/max angle limitation.
Use height variables for the SmoothElevationPainter calls so that levels
can be modified more easily.
Use Math prototype functions instead of the unfortunate rmgen proxies.
Does not touch starting base code, Unknown maps, Snowflake Searocks and
Corsica & Sardinia which need special treatment.

This was SVN commit r20301.
2017-10-15 17:53:12 +00:00
mimo e396ff170e No need to create aura's rangequery when the aura is not applied
Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D963
This was SVN commit r20300.
2017-10-15 15:14:11 +00:00
mimo 2cf88d79a4 Ranged auras not enabled (because of a tech requirement for example) should not be visualized
Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D962
This was SVN commit r20299.
2017-10-15 09:28:18 +00:00
LordGood 3242d5dae7 Spartan buildings
This was SVN commit r20298.
2017-10-15 04:00:27 +00:00
elexis 8062b7fa6d Unify Cycladic Archipelago Island duplication in a helper function createCycladicArchipelagoIsland, refs #4805, ac4e25e17f.
Do not place starting resources but random resources on non-player
islands.

This was SVN commit r20297.
2017-10-15 01:18:59 +00:00
elexis 6273d111fe Corsica & Sardinia cleanup.
Unify clCorsica, clSardinia to clIsland and the duplicate resource
placement calls using that.
Move and simplify the logic determining which texture to paint depending
on height and slope to a function getCosricaSardiniaTerrain.
Inline the createTerrain to greatly increase readability while possibly
reducing performance slightly.
Fix whitespace of createObjectGroup calls.

This was SVN commit r20296.
2017-10-14 21:04:29 +00:00
elexis 4256744e26 Replace hardcoded trigonometry magic numbers on Corinthian Isthmus with a rotateCoordinates computation, allowing to change the river angle arbitrarily.
The new math library file will contain five more math helpers used by
random maps, refs #4804.
These functions are agnostic of random map vocabulary, so could possibly
be moved to or unified with globalscripts.

Cleanup and label obscure createArea calls in this map, unify duplicate
magic numbers, refs #4805.
Remove three useless LayeredPainter calls that are overwritten by the
paintTerrainBasedOnHeight tShore and tWater calls afterwards.

This was SVN commit r20295.
2017-10-14 15:55:04 +00:00
elexis 6656ec6de6 Remove about 360 unused variables in random map scripts, refs #4805.
Remove unused hasTextureInRadius from 9016b8d866.

This was SVN commit r20294.
2017-10-14 14:25:53 +00:00
elexis 8dc6ed427d Fix string format of the JS test assertion failure following 7c2e9027c2 (cxxtest expects a char* instead of a std::wstring, so newlines were printed as \n characters).
Differential Revision: https://code.wildfiregames.com/D952
Fixes #4807

This was SVN commit r20292.
2017-10-13 21:56:45 +00:00
mimo b8e9dbca0c petra: tune requirements when building defenses
This was SVN commit r20291.
2017-10-13 17:59:30 +00:00
elexis dcc7b1b056 Fix collisions of random forests and mines with starting resources on Cycladic Archipelago and the Lion's Den. Refs #4600.
This was SVN commit r20290.
2017-10-13 14:56:44 +00:00
Imarok c965a7c723 Only close the diplomacy window on succesfull bribe
Reviewed by: bb
Differential Revision: https://code.wildfiregames.com/D171
This was SVN commit r20289.
2017-10-13 10:58:29 +00:00
mimo 3c285a5c54 Wrong FSM state when a unit is captured while unpacking during an attack
Reviewed By: leper
Differential Revision: https://code.wildfiregames.com/D954
This was SVN commit r20287.
2017-10-11 16:33:31 +00:00
elexis b7bf55f054 Fix incorrectly replaced unrelated magic number in 3a1c5669f8, refs #4814.
This was SVN commit r20286.
2017-10-11 15:04:22 +00:00
elexis 024d0e8f34 Fix rmgen2 bug in 6d52a71d4a revealed by the 1* removal in a1949d0b86.
Do not return a string in getRandomDeviation when we need a floating
point number.
Simplify the equation and do not round arbitrarily.

This was SVN commit r20285.
2017-10-11 14:42:56 +00:00
elexis 3a1c5669f8 Fix rmgen2 SimpleObject and RandomObject ignoring the 3 invalid map border tiles.
Let validT take the responsability to account for the actually valid
region of map tiles instead of each caller.

Fixes #4814, refs #4636, #4796

This was SVN commit r20283.
2017-10-11 01:48:12 +00:00
mimo 13b2858259 petra: remove a useless arbitrary historical classes separation
This was SVN commit r20282.
2017-10-10 17:35:40 +00:00
elexis a1949d0b86 Remove rmgen2 defautls that are and should always be given (that could have been inlined in the function header).
Remove 1 * x multiplication, replace scaleByMapSize(x, x) with x.

This was SVN commit r20281.
2017-10-10 10:43:19 +00:00
elexis 0517c34bc8 Delete an unneeded initForestFloor found by leper in 9e931b6fbe.
Delete the function altogether and create that simple array that is only
used in addForests just there.
Delete addForests calls from Ngorngoro that don't do anything.

This was SVN commit r20280.
2017-10-10 10:32:02 +00:00
elexis 9e931b6fbe Remove confusing rmgen2 g_MapInfo and initMapSettings, fixes #4813.
Rename initBiome to initForestFloor, getTeams to getTeamsArray.
Unifying duplicate coordinate computation and inlining unneeded
createArea helper variables in Lions Den.

This was SVN commit r20278.
2017-10-09 21:21:35 +00:00
LordGood 87ff880445 fixed a few errors and complaints regarding new spartan structures
This was SVN commit r20277.
2017-10-09 19:42:10 +00:00