Commit graph

11559 commits

Author SHA1 Message Date
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
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
mimo
6db2590858 Cache a list of TerritoryDecay components in the TerritoryDecayManager instead of retrieving it each time
Reviewed By: bb
Differential Revision: https://code.wildfiregames.com/D951
This was SVN commit r20276.
2017-10-09 19:38:56 +00:00
LordGood
e63a938529 first commit for Spartan buildings
This was SVN commit r20273.
2017-10-08 17:06:31 +00:00
elexis
e18598cd62 Fix Vector.js rotate oversight in 7778a7b436 (this.x may not be modified before reading again and sin/cos should not be computed twice).
Extend the tests of rotate in 99494251a1 to reveal the bug.
Add non-static clone functions for vectors (as the static ones were
incorrectly removed in e95f4e9744).
Math.pow performance is investigated separately, refs P85.

Checks and balances by mimo, leper, FeXoR and fatherbushido

This was SVN commit r20272.
2017-10-08 15:25:21 +00:00
Imarok
8bbe94c926 Add spies to the summary screen
Patch by: mmoains
Fixes: #4498
Differential Revision: https://code.wildfiregames.com/D567
This was SVN commit r20271.
2017-10-08 11:35:55 +00:00
mimo
9885cc5b79 petra: tune the proportion of support workers
This was SVN commit r20269.
2017-10-07 08:50:31 +00:00
mimo
b5e3b83c9e Add a TerritoryDecayManager component to update territoryMap with the blinking state when territories are recomputed. That's needed by the AI which was up to now not aware of blinking cells.
Differential Revision: https://code.wildfiregames.com/D910
This was SVN commit r20268.
2017-10-07 08:42:39 +00:00
bb
af9c25f879 Fix option page tabs xml style.
Following dd7f38e370 and 3312a83f82

Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D949
This was SVN commit r20266.
2017-10-06 20:50:00 +00:00
elexis
a8b8a33c8e Remove unneeded waterheight init loop from River Archipelago (refs #4354, D467).
Remove unneeded waterheight init loop (with awkward 1 tile sized bump)
that is redundant with the SmoothElevationPainter above from Corinthian
Isthmus (since introduction in 33cb23afa5).

This was SVN commit r20264.
2017-10-06 18:49:09 +00:00
elexis
7778a7b436 Readability improvements of globalscripts vector.js.
In compareLength, use Math.sign to replace a ternary + isNaN check.
In distanceToSquared, Use Math.pow(distance, 2) to avoid repetition of
the distance, inline its value to remove the then unneeded variables.

This was SVN commit r20263.
2017-10-06 18:20:57 +00:00
elexis
99494251a1 Add test for globalscripts vector, refs #4427.
This was SVN commit r20262.
2017-10-06 18:15:09 +00:00
mimo
2f24006afb petra: rework the management of siege units in attacks, to remove some civ hardcodings + some cleanup
This was SVN commit r20260.
2017-10-04 16:29:25 +00:00
mimo
862fd197d9 some cleanups of ai and petra
This was SVN commit r20257.
2017-10-02 17:49:27 +00:00
bb
10277d4ee6 Equal siege status bar sizes
Patch By: temple
Differential Revision: https://code.wildfiregames.com/D942
This was SVN commit r20254.
2017-10-01 16:50:08 +00:00
mimo
365dea222d petra: try to make a better use of ranged siege units
This was SVN commit r20253.
2017-10-01 09:26:07 +00:00
fatherbushido
fca5022f9b Tweak the decay special filter: decay time is set in the rubble template. Refs D938.
This was SVN commit r20252.
2017-10-01 05:38:45 +00:00
Imarok
0da0eaea3b Fix repair hotkey and remove build command
Fix f7ff71e8d5
Ack by elexis
Differential Revision: https://code.wildfiregames.com/D358
This was SVN commit r20250.
2017-09-30 22:04:24 +00:00
Imarok
9d232fd39a Domesticated animals shouldn't be visible in FOW
Reviewed by: Stan
Refs #3201
Differential Revision: https://code.wildfiregames.com/D891
This was SVN commit r20248.
2017-09-30 16:10:13 +00:00
leper
84674911cc Switch back to an unplaceable filter for templates.
This removes FindAllPlaceableTemplates, replaces the few uses of it by
FindAllTemplates,
and makes that ignore all templates starting with special/ in addition
to those starting
with template_.

Now modders can use entirely different template organization schemes
(more folders, different
folders, etc) without having to edit a file that was never well
documented.

In conjunction with a few of the template moving patches preceding this
rubble/ and other/catafalque
are now placeable. The former now does not decay anymore and users that
want that should use the
decay| filter, the latter will be taken care of in #4762.

Return to making FindAllTemplates return all placeable templates again
(switch to unplaceable filter).

To reiterate the main point: Only templates starting with special/ or
template_ will not show up as
placeable in Atlas (or show up to code querying for all (placeable)
templates. If you want to add more
of those use one of these naming schemes (and possibly subfolders in
special/).

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D935
This was SVN commit r20246.
2017-09-30 15:22:51 +00:00
fatherbushido
40cafe5049 Remove unneeded Vision and UnitMotion properties from gaia templates.
Reviewed By: elexis
Differential Revision: https://code.wildfiregames.com/D941
This was SVN commit r20245.
2017-09-30 14:57:12 +00:00
leper
b78896dfa6 Make rubble non-decaying by default.
Explicitly specify that the rubble placed on death is decaying.
This breaks quite a few mods, then again the fix is a simple sed
command.
Run within your mod root directory:
sed -i 's,>rubble/,>decay|rubble/,' `find simulation/templates -name
'*.xml'`

For fields you can just edit the few templates manually and specify
decay_60 instead.

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D938
This was SVN commit r20244.
2017-09-30 13:50:39 +00:00
leper
ff7511d9fc Move special_filter/ templates to special/filter/.
This should help with simplifying the (un)placeable filtering again.

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D934
This was SVN commit r20242.
2017-09-30 07:14:35 +00:00
leper
a85c532f8f Move formations/ templates to special/formations/.
This should help with simplifying the (un)placeable filtering again.

Reviewed By: fatherbushido
Differential Revision: https://code.wildfiregames.com/D933
This was SVN commit r20241.
2017-09-30 06:51:56 +00:00
fatherbushido
8c15a81c58 Removed health leftover from Seleucid wonder.
Patch By: Nescio
Differential Revision: https://code.wildfiregames.com/D936
This was SVN commit r20240.
2017-09-29 18:52:05 +00:00
mimo
a9f95feb42 fix missing parenthese in 49758c8337 and some other minor changes"
This was SVN commit r20239.
2017-09-29 16:58:25 +00:00
fatherbushido
b1d71bfb43 Add a new function to emit a sound from a position not attached to an entity. Use it to improve the attack impact sound code and allow to emit that sound even if the attacker died meanwhile. Use the sound provided by Pureon for catapult. Fix #4779.
Patch By: Mate-86
Differential Revision: https://code.wildfiregames.com/D921
This was SVN commit r20236.
2017-09-28 19:26:07 +00:00
mimo
49758c8337 petra: various minor fixes
This was SVN commit r20234.
2017-09-27 18:58:51 +00:00
elexis
995f9b5975 Northern lights river cleanup following 7d0cc59136.
This was SVN commit r20233.
2017-09-27 14:35:46 +00:00
fatherbushido
bebcd56a84 Leftover in fb6748d723.
This was SVN commit r20231.
2017-09-26 10:06:31 +00:00
fatherbushido
fb6748d723 Use relative templates for unit speed. No significant value change. It makes balancing easier and will permit to change the speed of all units by changing one number. Refs #4352.
Differential Revision: https://code.wildfiregames.com/D930
This was SVN commit r20230.
2017-09-25 18:27:18 +00:00
mimo
c6c02eb081 petra: refactor a bit the defense code to ease future changes
This was SVN commit r20229.
2017-09-25 17:20:15 +00:00