Fabian Müller
df24cf3360
Tooltip for the moves now displays the movement costs in the sidebar.
2013-01-16 16:20:52 +00:00
J. Tyne
177605fbaf
Introduce a typedef to make some of the code more readable.
2013-01-16 14:29:31 +00:00
J. Tyne
2da6f3cd3b
Change the unit constructor based on a unit_type to take a reference...
...
...instead of a pointer that was assumed to be (and in fact always
was) non-NULL.
2013-01-16 13:29:56 +00:00
J. Tyne
8c83185317
Change unit::advance_to() so that it takes a unit_type reference...
...
...instead of a pointer that was assumed (in many places) to be
non-NULL.
2013-01-16 12:53:45 +00:00
J. Tyne
b65d5603ee
Change unit::type() to return a reference instead of a never-NULL pointer.
2013-01-16 12:07:23 +00:00
J. Tyne
d09401df2c
Check for unit types found before creating units based on them.
2013-01-16 03:19:31 +00:00
J. Tyne
4bb579c875
Some optimizations made possible by 2013-01-16T00:41:43Z!jt_coding@verizon.net (unit::type() is never NULL).
2013-01-16 01:18:49 +00:00
J. Tyne
4de746be72
Have unit store a pointer to unit_type instead of a unit_type ID string.
...
In addition to speeding access to the unit_type (no need to search),
this makes it easier to see that a unit always has a valid unit_type
(an exception is thrown otherwise).
2013-01-16 00:41:43 +00:00
Fabian Müller
991a3a0878
Put a procedure from unit_helper in use to avoid duplicate code.
2013-01-15 22:24:16 +00:00
Fabian Müller
1fb1590df4
Color coded the hp/resistance tooltip of the sidebar unit display.
2013-01-15 15:48:20 +00:00
Fabian Müller
b6ef09062d
Add precudure for calculating the font color of a resistance value.
2013-01-15 15:35:55 +00:00
J. Tyne
398bd4d432
Correct a comment (copy-and-paste error).
2013-01-14 23:26:22 +00:00
J. Tyne
40f0762454
Don't specify "const" when returning by value.
...
(We don't care if the caller modifies it.)
2013-01-14 23:25:35 +00:00
J. Tyne
0a540d6e4a
Remove a MSVC warning suppression that no longer does anything...
...
...(no code between starting and stopping the suppression).
2013-01-14 19:29:04 +00:00
J. Tyne
d2602a3679
Replace some occurrences of std::find and std::search...
...
...with std::string::find. Just to make the code easier to read.
2013-01-14 19:03:59 +00:00
J. Tyne
7c67404a10
Make some variables names more consistent...
...
...by using the name "type" only when dealing with an actual unit_type
object.
2013-01-14 17:23:55 +00:00
J. Tyne
21eaf5e35f
No need to convert a unit type to its ID...
...
...so that we can search for a unit type with that ID -- just use the
unit type we already have.
2013-01-14 14:13:10 +00:00
J. Tyne
4fc92ade45
Remove an unused variable.
2013-01-14 02:03:55 +00:00
Charles Dang
3c1b40e1b2
Added myself to credits
2013-01-14 01:49:15 +00:00
J. Tyne
e7d28c0211
Punctuate a comment.
2013-01-13 21:40:19 +00:00
J. Tyne
f703943dec
Convert a simulated hash map to boost::unordered_map.
...
This is a @todo that was pending BfW requiring Boost 1.35 or
preferably 1.36.
2013-01-13 21:39:25 +00:00
Simon Forsyth
dd7045ddb5
Allow SoF to continue after gathering materials (bug reported in forums)
2013-01-13 21:28:12 +00:00
Fabian Müller
44a453da3e
Report the unit's vision value in the sidebar.
2013-01-13 20:11:15 +00:00
Fabian Müller
06269beeaf
Support for vision in [unit], previously it worked only in [unit_type].
2013-01-13 20:00:58 +00:00
Fabian Müller
ed41ff9803
Report for the unit's vision value.
2013-01-13 19:41:10 +00:00
Simon Forsyth
3afbd449ba
Do not count regenerating units without moves...
...
...as having moves in healer support micro AI
2013-01-13 03:54:17 +00:00
Simon Forsyth
1ea4ff0f26
Add healer support micro AI to experimental multiplayer AI
2013-01-12 23:31:59 +00:00
Boldizsár Lipka
5cca2a1988
Don't show 'Toggle planning mode' option for observers
2013-01-12 23:08:17 +00:00
Simon Forsyth
d09dc44505
Promote lurker and Mefisto in Art contributions section...
...
...in recognition of the large amount of terrain artwork they have
done recently
2013-01-12 22:30:24 +00:00
Fabian Müller
921c415651
Test case for modifing the vision range.
2013-01-12 21:26:24 +00:00
Matthias Schoeck
ffe0ab21ad
Initialize side and replay data so that replays work for MP games...
...
...launched from the command-line with the -m option. This fixes bug
#19877 . The code paths for command-line and lobby MP games are
entirely separate, so this has no effect on lobby games.
2013-01-12 05:12:59 +00:00
Fabian Müller
50bc8adb08
Nulling resources pointers in the editor_controller's destructor.
...
At least fixing some of the segfaults mentioned in bug #20409 .
2013-01-11 22:24:41 +00:00
Boldizsár Lipka
84d257f90f
Credit irker in about.cfg
2013-01-10 18:06:10 +00:00
Mark de Wever
68fcaf664a
Add copyright headers.
2013-01-09 19:57:01 +00:00
Mark de Wever
e5b193d1e9
Fix a missing new year update.
2013-01-09 19:56:57 +00:00
Mark de Wever
c7900949eb
Fix a signed vs. unsigned comparison warning.
2013-01-09 18:48:31 +00:00
Matthias Schoeck
0215fd9bd9
Update changelog to reflect leader_shares_keep CA renaming
2013-01-09 17:23:26 +00:00
Matthias Schoeck
ce6ee7e586
Rename passive_leader_shares_keep candidate action to leader_shares_keep.
...
This CA is on by default, dealing with a passive leader is only a
special case. The old syntax still works for backward compatibility
(for both CA and macros).
2013-01-09 17:18:45 +00:00
Matthias Schoeck
f6cfcb9822
Fix AI bug in passive_leader_shares_keep candidate action.
...
When the AI leader moves off the keep for an ally leader and doesn't
have full moves left, it was previously not checked that the goal hex
is within reach of the leader.
2013-01-09 02:14:23 +00:00
Simon Forsyth
7df1b138e3
Update copyright string for Xcode project
2013-01-06 06:44:06 +00:00
J. Tyne
110484bca6
Add a variant on parenthetical_split() to helper.lua...
...
...and use it to fix bug #20401 .
If no problems are found with this approach, I can backport it to stable.
2013-01-05 23:47:53 +00:00
Simon Forsyth
8c0f21f9eb
Consider regenerating units as effectively unpoisonable
2013-01-05 21:19:38 +00:00
J. Tyne
26c993207b
Convert some WML macros and lua functions to use...
...
...unpoisonable/undrainable instead of not_living.
One remaining use of "not_living" is in the feeding ability.
2013-01-05 18:16:02 +00:00
J. Tyne
ee19578fc4
Suppress the level-up animation when [transform_unit] is used...
...
...to transform a unit to its normal advancement (for consistency with
transforming to a specified type).
2013-01-05 17:56:39 +00:00
J. Tyne
01c20ecea5
Make it a default to remove poison from immune units.
...
This impacts wesnoth.transform_unit, [effect]apply_to=type, and
[effect]apply_to=variation. If desired, the poisoned state can still
be explicitly set for immune units; this change only affects default
behavior, making it correspond better to the core rules.
2013-01-05 17:46:59 +00:00
J. Tyne
c4f81f2ebf
More regular enforcement of maximum hit points.
...
This impacts [transform_unit], [effect]apply_to=type,
[effect]apply_to=variation, and wesnoth.transform_unit().
2013-01-05 15:12:25 +00:00
J. Tyne
7b0a480254
Make Lua's wesnoth.transform_unit() function preserve hit points.
...
This is actually simpler to implement and is more consistent with the
[transform_unit] tag. Plus, the wiki documentation for
wesnoth.transform_unit() does not state that the hit points definitely
will be changed (it's a bit vague on that point), so this is
consistent with the existing documentation.
2013-01-05 14:53:05 +00:00
J. Tyne
e8796a8279
Have unit::advance_to() no longer change the unit's current hit points.
...
This was overridden more often than not anyway, and the code is
overall simpler without hit points being changed by this function.
2013-01-05 14:11:53 +00:00
J. Tyne
391198f281
Expire modifications (which might affect max movement)...
...
...before restoring movement and attacks in unit::new_turn().
2013-01-05 00:18:35 +00:00
J. Tyne
73a54cfae1
Merge the code for expiring effects.
...
I hope this is adequate for future growth (specifically, for when
someone implements objects that last until the unit gains a level).
2013-01-04 23:22:52 +00:00