19613 Commits

Author SHA1 Message Date
Groggy Dice
7fb303c57d html.py,style.css: use <pre> with no top-margin on all descriptions
After my last change dealing with this issue, I noticed that descriptions
with <pre> had an extra blank line at the top. Adding top-margin to the
CSS file made this go away, but it also made the <br/> superfluous. Thus,
it is simpler just to have every description use <pre> instead of <br/>.

This should finally resolve everything having to do with the add-on
descriptions.

If I'd noticed that the re module hadn't been imported, I probably wouldn't
have considered URL linking to be important enough to do so. Since I've
already written the code, however, I'll keep it.
2014-05-07 06:09:57 -04:00
ln-zookeeper
4584e3daf7 Fixed recalling sometimes invalidating undo 2014-05-06 18:36:19 +03:00
mattsc
1640856c77 SotBE S7: have scorpions target all side 1 units, not just Kapou'e
The scorpions have no concept of a side leader.  This only affects
moves toward targets, attacks were already done in this way,
2014-05-06 06:34:01 -07:00
Elvish_Hunter
82e5cc8d39 Committed the new Tk-based GUI for wmllint/scope/indent 2014-05-05 17:52:45 +02:00
Elvish_Hunter
7eac0da7f8 Removed the old Wx-based wmllint GUI 2014-05-05 17:51:45 +02:00
Elvish_Hunter
07331c4438 about.cfg: moved myself in the Programming section of the credits. I still was in the Misc section... 2014-05-05 17:42:36 +02:00
mattsc
053a9350a1 Fast MAI: don't target unowned villages if AI side has no leader
Only enemy-owned villages should be targets for leaderless AI sides.
2014-05-05 07:23:02 -07:00
Groggy Dice
7ba550a63e html.py: replace Windows backslashes in icon paths
This is one source of missing-image results.

There remain other reasons for missing icons. The script doesn't find images
in add-ons. And when resources are moved or renamed, they are no longer found
by the script, even if they had been found before.

Also, capitalize a sentence.
2014-05-05 04:21:40 -04:00
Groggy Dice
faf82bed92 style.css,html.py: use <pre> instead of <br/>; re.sub instead of re.finditer
After looking into it some more, I think I've figured out how to handle <pre>
in the CSS. So, use that, when description has more than one line.

Also, go to re.sub for turning URLs into links. The version of Python I was
testing my code on wasn't properly handling backreferences in the replacement
string when in the form "\#", causing me to use finditer instead of sub. But
I've discovered that it does handle backreferences in the form "\g<#>". So
switch to much simpler re.sub code.
2014-05-05 04:20:51 -04:00
mattsc
7ef7d14978 Fast Micro AI: use hex 2 steps beyond next hop for move evaluation
It results in a better evaluation of the best hex to move to when
distance criterion is used (that is, when we are not in dungeon mode).
2014-05-04 14:18:15 -07:00
mattsc
ade936e0b0 Fast Micro AI: Add closeness-to-goal to unit order criterion
How fast (in how many turns) the unit can get there remains the main
criterion, but if that is equal for two units, use the closer unit
first.
2014-05-04 14:18:14 -07:00
mattsc
1dd6f7494e Fast Micro AI: add a dungeon mode 2014-05-04 14:18:14 -07:00
mattsc
6cfbe69784 Fast Micro AI: remove debug output 2014-05-04 14:18:14 -07:00
mattsc
48a0920732 Fast Micro AI: exclude guardians from move-to-targets CA 2014-05-03 17:46:37 -07:00
mattsc
d8b5984a19 Fast Micro AI: use wesnoth.require instead of wesnoth.dofile 2014-05-03 17:45:46 -07:00
mattsc
feabdfb4ea New Micro AI: Fast AI
This AI is meant as a fall-back AI for scenarios where there are so
many units that attacks and moves done by the default AI are slow with
long delays before each move. It replaces the default combat and
move-to-targets candidate actions.
See http://wiki.wesnoth.org/Micro_AIs
2014-05-03 16:52:58 -07:00
David Mikos
6eb14d317b Tutorial: add Delfador animation to summon extra quintains 2014-05-03 12:28:13 +09:30
mattsc
03c1b97802 next_hop(): bug fix for ignoring units when ignore_units=true is set
A bug in the previous version let to them not being ignored when  the
were on the last hex of the next hop.
2014-05-02 19:29:37 -07:00
Alexander van Gessel
2da77a8ad0 Merge pull request #135 from cbeck88/wmltest
WML Unit Tests
2014-05-02 15:48:14 +02:00
mattsc
82e4ccad4d battle_calcs.attack_rating(): overhaul attack rating system
This was long overdue.  The return value is now much closer to
something describing the actual gain/loss (roughly) in units of gold.
2014-04-30 19:09:28 -07:00
mattsc
7623c5513a battle_calcs: do not use variance of attack in attack rating
This was an idea we tried so that we’d start with the most uncertain
attack first, but it did not work very well.
Keep the code for now, just comment it out.
2014-04-30 19:06:57 -07:00
mattsc
0218b88180 attack_combo_stats(): also cache intermediate battle outcomes
Speeds up some calculations significantly.
2014-04-30 19:05:08 -07:00
mattsc
2336921a81 simulate_combat_fake(): don't fill empty HP chances with zeros
That’s what wesnoth.simulate_combat() does, but is different from the
other functions in battle_calcs.  Only hp_chance[0] needs to be set,
even if it is zero.
2014-04-30 19:02:08 -07:00
mattsc
f0c7ddcab1 ai_helper: make AI move error messages more descriptive 2014-04-30 18:59:25 -07:00
mattsc
6f84e14b89 Hang Out MAI: bug fix in best move selection
In rare cases (when the unit has no hexes to move to, not even the one
it is on because it is in a zone to be avoided), this would cause an
error and crash the AI.
2014-04-30 18:52:02 -07:00
mattsc
bbffa5e88a ai_helper: remove a debug message
It’s served its purpose and is not needed any more.
2014-04-26 18:26:45 -07:00
ln-zookeeper
8f87c62785 Prevent Malifor from respawning in cave wall 2014-04-26 23:58:18 +03:00
mattsc
e99423bad9 Lua AIs: do not use empty tables as filters
It’s faster not to provide any argument to wesnoth.get_units() if all
units are to be found.
2014-04-26 07:18:23 -07:00
mattsc
8e9780d606 ai_helper.get_live_units: don't use filter_wml
It’s slow, the new method is between 10 and 20 times faster.
2014-04-26 06:46:32 -07:00
David Mikos
eadfe4a990 Tutorial: set initial facing directions for the player and Delfador 2014-04-26 10:32:43 +09:30
David Mikos
bf81a314a6 Tutorial: add summon quintain animation to Delfador. 2014-04-26 10:28:48 +09:30
Groggy Dice
2a8d4e2d28 html.py: import re module
Bugfix for last commit.
2014-04-25 02:45:26 -04:00
Groggy Dice
c85af755ac html.py: format add-on description for HTML
The description text does not get rendered very well on a webpage. One
solution might be to use pre-wrap/word-wrap in the CSS, but due to
differences between browsers, that's a can of worms (at least for me, I'm
not a web pro).

So, the not-so-elegant solution is to add <br/> to every line.

URLs are also not linked in the plain text. Although in modern browsers
you can select the text and right-click, it's still convenient to turn
them into actual links.
2014-04-25 01:26:11 -04:00
Groggy Dice
b058f29d1e wmllint: change "usage of" magic comment to re.search
There seems no particular reason to require that this magic comment be at
the very beginning of the line, so why not switch from re.match to
re.search.

Also, update comments to reflect the fact that UtBS no longer uses this
magic comment.

A suggestion has been made to get rid of this magic comment now that UtBS
is no longer using it, but it may still be in use in some UMC somewhere.
2014-04-25 00:56:25 -04:00
mattsc
664eeae888 battle_calcs.lua: fix bug in get_attack_map_unit() for enemy units
Own units with MP left need to be taken off the map before enemy path
finding, not just added to the table.
2014-04-23 18:48:46 -07:00
gfgtdf
c30439a1c6 LoW: Initialize units in start events
previously this was done in side 1 turn 1 events because start events
wasn't synced.

After the fix for 21933 players now loose when they have no units after
start events, so we need to do this in a start event.

replacing check_victory with check_end_level after start events in
play_controller.cpp line 572 doesn't work because we still have the
check_victory in playmp_controller when waiting
for remote packages, that check_victory is needed in order to sync the
behavior of ai turns which calls check_victory after every action on the
local client.
2014-04-23 22:13:00 +02:00
mattsc
ddfdae5e52 battle_calcs.lua: fix a variable name 2014-04-22 16:46:49 -07:00
David Mikos
2c805ea9b7 AnimationWML: explicitly set movement animations for vampire/blood bat. 2014-04-21 17:50:30 +09:30
mattsc
8599266769 Micro AIs other engines: code cleanup 2014-04-20 14:30:02 -07:00
mattsc
7578eb592a [micro_ai] tag setup: minor code cleanup 2014-04-20 14:30:02 -07:00
mattsc
7e8964c48d Goto Micro AI: prevent potential conflict between Goto MAIs
If several Goto MAIs are used on the same side and both have
unique_goals=yes set, they previously might have interfered with each
other, one preventing the other from working correctly. Now the “goal
taken” information is saved such that it only applies to the CA by
which it was set.
2014-04-20 14:30:02 -07:00
mattsc
e4ea795c96 Messenger MAI: fix typo
Sigh.  Intentional typo for testing, forgotten to revert it.
2014-04-19 16:25:46 -07:00
mattsc
d3ce1051ff Messenger Escort Micro AI: code cleanup 2014-04-19 16:23:26 -07:00
mattsc
83d23fac52 Bottleneck Defense Micro AI: code cleanup 2014-04-19 13:09:43 -07:00
Elvish_Hunter
b22ceefa0d Changed all mainline occurrences of {FLAG_VARIANT ragged} to {FLAG_VARIANT6 ragged} 2014-04-19 10:57:48 +02:00
Elvish_Hunter
9e140c183c added wmllint rule for FLAG_VARIANT6 2014-04-19 10:57:47 +02:00
Elvish_Hunter
9289a9fa8a added FLAG_VARIANT6 macro, for use with ragged flags 2014-04-19 10:57:46 +02:00
mattsc
85947e2e82 SotBE S6: remove AI controller
It does not work with leaderless allied sides.
2014-04-18 19:32:48 -07:00
mattsc
5fc48b3e88 Micro AIs: don't check for specific value of move rating
Don’t check whether rating equals (or doesn’t equal) -9e99 or the like,
verify that a valid move was found instead.  Also, avoid setting
variables to empty tables if not needed.
2014-04-18 07:54:56 -07:00
mattsc
9d440fac8e Protect Unit MAI test scenario: use fight_on_without_leader=yes
So that the scenario continues even if the side 2 leader is killed.
2014-04-17 21:03:39 -07:00