52 Commits

Author SHA1 Message Date
Guillaume Melquiond
5ee8f2ce84 Fixed attack prediction hardcoding kill xp.
Factored code for computing kill xp.
2009-09-13 07:04:36 +00:00
Tomasz Śniatowski
edf1cec46b kill some VC9 warnings 2009-06-23 20:04:35 +01:00
Guillaume Melquiond
1c2ade5f54 Fixed statistics involving a defender with firststrike. 2009-05-30 20:33:39 +00:00
Eric S. Raymond
e7b27b6435 Change the trannstive verb "stone" (as in "turn to stone") to "petrify",
...and all related words such as "unstone", "stoned", etc. Former
usage was not really correct and led to unhelpful ambigiuity with both
"to stone" is in to hit with thrown stones, and "stoned" meaning
intoxicated.

All C++ code, WML, and tags are changed. New wmllint rules will handle all
lifting for UMC.  The wiki has been updated.

Will cause incompatibility with old savefiles containing stoned units.
2009-04-12 00:40:07 +00:00
Daniel Franke
c198e81f25 Ignore healing due to levelup when computing damage statistics.
Fixes bug #13277.

[[Split portion of a mixed commit.]]
2009-03-29 23:01:10 +00:00
Mark de Wever
973a0a7d5c Remove trailing whitespace. 2009-01-01 10:28:26 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Mark de Wever
e46c1cdd8c Partly revert 2008-11-09T04:35:13Z!esr@thyrsus.com.
The deheader tool didn't recognize #if so processed them. The revert has been
done manually to keep the unneeded headers out.
2008-11-09 18:55:22 +00:00
Eric S. Raymond
9223460daa Remove unused headers. 2008-11-09 04:35:13 +00:00
Mark de Wever
81c6a850ab MSVC 6 cleanup.
Now that MSVC 6 is no longer supported start to remove some helper code
to work around problems in that compiler. The first step is to comment
out the code and replace it with new helper code that uses the standard.
The second step is to remove the helper code and fix all callers.

Patch 2/3 for step 2: Remove minimum and maximum and fix all callers.
2008-08-24 16:12:13 +00:00
Jérémy Rosen
7ff70c97a5 take into account lvl up heal when estimating attack prediction,
...patch by roger_wilco
2008-07-07 18:48:42 +00:00
Mark de Wever
5cde77954f Initialize all members. 2008-07-07 18:20:32 +00:00
Mark de Wever
1dba085f38 Add an underscore to all private members. 2008-06-24 05:30:32 +00:00
Mark de Wever
ab8448f8bc Update doxygen comment style. 2008-06-24 04:51:36 +00:00
Bruno Wolff III
a5aa67a47b Silence gcc 4.3 warning about empty for body by adding braces. 2008-03-19 16:55:39 +00:00
Mark de Wever
001af46e6e Updated all headers to 2008. 2008-02-16 08:47:16 +00:00
Mark de Wever
076deefa0e wassert -> assert 2007-12-09 16:11:53 +00:00
Gunter Labes
ae9e10f260 codeclean run
set svn:eol-style to native where missing
2007-08-31 19:09:40 +00:00
Hans Joachim Gurt
304c1f93fe doxygen, comments 2007-08-27 04:14:42 +00:00
Mark de Wever
5a0cbe54e3 C-style cast cleanup. 2007-08-26 18:02:19 +00:00
Mark de Wever
080eb69f60 Updated the headers to state GPL 2+ and a few changelog cleanups. 2007-08-15 13:41:56 +00:00
Mark de Wever
bb01934b85 A rather large update which updates the copyright info
* Wesnoth is distributed under the terms of the GPL version 2, made
  that more explicit

* updated the copyright range to 2007

* updated Dave's email adress
2007-07-21 07:28:04 +00:00
Mark de Wever
ff0892a5de ported 2007-04-06T22:00:39Z!koraq@xs4all.nl frrom 1.2 branch fixes bug #8839 2007-04-06 22:05:50 +00:00
Patrick Parker
9f08e18ded silene's patch #708: appease some compiler warnings in GCC 2007-03-31 16:09:13 +00:00
Mark de Wever
31c354d487 looking at the proper function does not magically include it... really not 2007-03-20 19:01:36 +00:00
Mark de Wever
161b8dce35 fixed an invalid memory access
probably fixes #8756, also added asserts to avoid unchecked array
access.
2007-03-20 18:05:17 +00:00
Mark de Wever
a56980c25a valgrind found some problems,
this might fix bug #8715. Note cound.cpp is not properly fixed but the
evil has been eliminated.
2007-03-18 21:36:03 +00:00
Serge Martin
cefdd66e5a clean a little bit use of new/delete operator.
- replace 1 free by delete

- return NULL inside of a new object noone delete

- remove some unnecessary check for ==NULL before delete

- call delete for each new call (not true : still one new with no
  delete i've added a FIXME)

- some formating change
2006-11-05 18:39:23 +00:00
Isaac Clerencia Perez
48e0e47791 Merged 13001 13007 13014 13055 13108 13109 into trunk 2006-08-17 06:53:11 +00:00
Rusty Russell
81e004c22a Fast path simple cases of attack_prediction.
Wesbench_ai time before: 2.3 seconds, after: 1.95 seconds.

(Not really worthwhile, but I'd already written code before AI cache,
and it's more impressive than it seems because the AI is only a small
part of that test now).
2006-06-11 10:09:10 +00:00
Gunter Labes
23ca57f01e ran codeclean over all files and set them all to svn:eol-style 'native' 2006-06-05 20:02:25 +00:00
Rusty Russell
5b91e70fb1 Don't use default copy constructor for combatant:
...causes reference to u_ after free when battle_context is copied.

We should reconsider this structure, maybe integrate with unit_stats,
after 1.2.
2006-05-31 09:22:28 +00:00
Rusty Russell
3cc4a763c0 Correct average HP calculation
(dead units don't get healed, and N*0 == 0, so should not add
hp_dist[0] anyway)
2006-05-25 23:27:46 +00:00
Rusty Russell
8b50f26df7 Fix (one?) cause of AI regression w/ new attack_prediction code:
take into account healing defender will receive from village (as old code did).
2006-05-25 12:35:21 +00:00
Rusty Russell
64b6b55c03 Use simulation to choose weapons, making for a more accurate choice
(it takes into account the exact circumstances of the battle).

This roughly doubles the calls to attack_prediction's fight() routine
during heavy AI load, but optimization yet to come.
battle_context/combatant could now use some cleanup.
2006-05-21 13:03:34 +00:00
Rusty Russell
47e4ec7038 Allow sharing of previous combatant status for AI.
Simplify average_hp() as pointed out by Decker2 (and return double).

Correct cumulative calc of poisoned/slowed.
2006-05-15 00:03:18 +00:00
Rusty Russell
0f1337059c Encapsulate poison and slow prob in calculations, provide average_hp calc.
This will be used by AI.
2006-05-09 04:01:39 +00:00
Jörg Hinrichs
d7da277891 replace ugly C-cast with better one 2006-04-12 20:54:28 +00:00
Jörg Hinrichs
87e73e88ae minor correction to make vc++ compile 2006-04-11 17:34:18 +00:00
Rusty Russell
aa48048b51 Enhance attack_prediction to handle stoning, non-30 berserk, non 1/2 slow.
For stoning we set damage to maximum (ie. kill) then revert after simulation.

For berserk we actually record how many rounds are set, not assume 30.

For slow we actually use the given "slowed" damage rather than assume
it's 1/2 normal.

Also remove debugging prints when configured with --enable-debug.
2006-04-11 10:31:55 +00:00
Dominic Bolin
415025c2f8 Illumination now lays an overlay on the ToD graphic;
convert some files to unix line endings.
2006-04-09 18:24:14 +00:00
Jörg Hinrichs
f0f3a5b873 moves include of global.hpp to the very beginning of attack_prediction...
...to silence some vc++ warnings

adds support for upload_log again (i thought i checked everything but
this must have been slipped through)
2006-04-09 13:47:55 +00:00
Rusty Russell
3367b8d31b Tie attack_prediction into using battle_context's unit stats,
...so you can use them together.
2006-04-09 01:08:43 +00:00
Rusty Russell
8f1f7e1b63 Strip ^M from lines which somehow crept in. 2006-04-09 00:23:02 +00:00
Dominic Bolin
8e516e87e8 Fix building with gcc 4.1 2006-04-07 17:33:29 +00:00
Jörg Hinrichs
45dd38ff87 merges the gameplay_refactoring branch
please report any problems to me
2006-04-06 21:31:55 +00:00
Rusty Russell
2c6e8a3bc5 Sew attack_prediction code into the Makefile.am,
and expose through header (decker2's changes coming soon).
2006-04-05 03:15:14 +00:00
Rusty Russell
5e5b383977 Fix completely unrealistic "touched" calculation with almost-correct one.
Fix bug in wesnoth-attack-sim --check which caused it not to warn
about differences.
2006-02-19 12:16:41 +00:00
Rusty Russell
043e69cb2b Enhance attack simulation and prediction file...
...to show problem with "touched" calculation (first step to fixing it).
2006-02-11 10:29:07 +00:00
Rusty Russell
1cfab21cba Change check code to print P(untouched) not P(touched). 2006-01-30 05:37:58 +00:00