Compare commits

...
Sign in to create a new pull request.

443 commits

Author SHA1 Message Date
8d3b91de90 adding cmake-init command 2021-09-30 09:20:54 +02:00
Enno Rehling
9d5b501994 Merge branch 'master' into develop 2021-09-19 01:45:59 +02:00
Enno Rehling
573170f36e bugfix crash 9/19/2001
when seen from lighthouse, skip units in buildings.
2021-09-19 01:45:23 +02:00
Enno Rehling
209040e198 bugfix crash 9/19/2001
when seen from lighthouse, skip units in buildings.
2021-09-19 01:41:41 +02:00
Enno Rehling
6a26ed5897 banner: fix test that was enforcing the old behavior 2021-09-12 20:10:49 +02:00
Enno Rehling
f40569033d banner: remove unused error message 2021-09-12 20:06:32 +02:00
Enno Rehling
c3db8a4a05 version number increase 2021-09-12 20:05:31 +02:00
Enno Rehling
75a50345ff Allow clearing the faction banner.
https://bugs.eressea.de/view.php?id=2774
2021-09-12 20:05:30 +02:00
Enno Rehling
860d5c75d7 accept that the lates express is not numbered 2021-09-02 20:15:34 +02:00
Enno Rehling
ab078db7cb Merge branch 'master' into develop 2021-08-21 22:17:33 +02:00
Enno Rehling
c4aab2d000 fix parsing, again, tests were failing for good reasons. 2021-08-21 22:15:58 +02:00
Enno Rehling
6790442dcb Merge branch 'master' into develop 2021-08-21 21:59:47 +02:00
Enno Rehling
46ab8f3cb6 fix endless loop in the quoted-string parsing 2021-08-21 21:59:34 +02:00
Enno Rehling
6dea757cb6 Merge branch 'master' into develop 2021-08-06 10:00:42 +02:00
Enno Rehling
205cd6f491 fix null-pointer access (familiar spells) 2021-08-06 09:59:56 +02:00
Enno Rehling
b7253584f2 Merge branch 'master' into develop 2021-07-31 16:41:05 +02:00
Enno Rehling
ae920edab0 remove an invalid assert, quiet messages are quiet. 2021-07-31 16:31:59 +02:00
Enno Rehling
8a174f6520 all monsters can study skills by default 2021-07-28 11:23:30 +02:00
Enno Rehling
3907770d91 Merge branch 'master' into develop 2021-07-25 20:58:01 +02:00
Enno Rehling
49453a84d9 toads can cast spells, but cannt summon familiars. 2021-07-24 18:42:08 +02:00
Enno Rehling
3e71453fb1 Paused factions must not die of too many NMRs. 2021-07-18 20:44:35 +02:00
Enno Rehling
2196319073 Weltentore mit mehr Streuung
https://bugs.eressea.de/view.php?id=2738
2021-07-10 21:05:24 +02:00
Enno Rehling
e7de928757 cannibalism: don't lose victims' items.
add a test for i_merge since we're using it.
2021-06-24 22:01:40 +02:00
Enno Rehling
adde06980d Bauernwachstum aufrunden
https://bugs.eressea.de/view.php?id=2762
2021-06-23 19:47:49 +02:00
Enno Rehling
8e96329881 typo 2021-06-23 19:47:49 +02:00
Enno Rehling
8033f5d20e Bauernwachstum aufrunden
https://bugs.eressea.de/view.php?id=2762
2021-06-23 19:21:21 +02:00
Enno Rehling
363b1224d1 nstall clang-tools for scan-build 2021-06-22 08:30:03 +02:00
Enno Rehling
2ad6d442fe github actions: install dependencies 2021-06-22 08:26:44 +02:00
Enno Rehling
fdf4e18ae6 lazy github actions converion of tavis.yml 2021-06-22 05:15:35 +02:00
Enno Rehling
6b8e8ec054
Update .travis.yml
Kick the build
2021-06-22 04:34:07 +02:00
Enno Rehling
d9123b4491 additional testing for sea serpent visibility 2021-06-22 00:36:22 +02:00
Enno Rehling
407de0db20 resolve cansee and cansee_unit code-duplication 2021-06-22 00:30:06 +02:00
Enno Rehling
aeed92fa80 make mimnimum ring check more readable. 2021-06-21 20:29:20 +02:00
Enno Rehling
15f6cd4206 improved test for ring vs amulet, with comments. 2021-06-21 19:56:56 +02:00
Enno Rehling
c1220f1843 bug 2673: cannot attack sea serpents
https://bugs.eressea.de/view.php?id=2763
visibility rules must be in cansee()
2021-06-20 19:23:37 +02:00
Enno Rehling
0f9cbf8079 theoretical triggers that have no read function are ok. 2021-06-20 00:25:07 +02:00
Enno Rehling
1531ad9a7e oops, segmentation fault 2021-06-20 00:20:25 +02:00
Enno Rehling
d5d0617090 get rid of new coverity scan warnings 2021-06-20 00:18:36 +02:00
Enno Rehling
3e3597e99f remove g_writegame global
use a config variable isntead and check it in Lua.
2021-06-19 19:48:23 +02:00
Enno Rehling
0e83b5b157 fix new changerace test 2021-06-19 19:14:49 +02:00
Enno Rehling
b6d5b729bf avoid units with multiple changerace triggers 2021-06-19 19:12:48 +02:00
Enno Rehling
6cac6439bf unify change_race trigger use.
make all transformations use a single function.
2021-06-19 12:11:57 +02:00
Enno Rehling
4c64affdfc Merge branch 'master' into develop 2021-06-15 22:35:54 +02:00
Enno Rehling
f35f484324 gmtool: markup virgin regions
highlight regions that have never been visited
2021-06-15 21:34:23 +02:00
Enno Rehling
eadad871ec
Merge pull request from eressea/2758-smurf
fix smurfication
2021-06-15 19:26:23 +02:00
Enno Rehling
da7725e58f https://bugs.eressea.de/view.php?id=2758
fix smurfication, properly now.
2021-06-15 18:17:31 +02:00
Enno Rehling
6244c6c437 Merge branch 'master' into develop 2021-06-14 22:00:39 +02:00
Enno Rehling
a1d59b99cb https://bugs.eressea.de/view.php?id=2757
Kampf auf See war kaputt.
2021-06-14 21:56:47 +02:00
Enno Rehling
7632d1a202 Merge branch 'master' into develop 2021-06-12 18:47:15 +02:00
Enno Rehling
060d7e2fd6 https://bugs.eressea.de/view.php?id=2756
BOM steht wieder in der Zugvorlage.
2021-06-12 18:43:20 +02:00
Enno Rehling
317f605ff2
Merge pull request from eressea/expel
VERTREIBE Kommando
2021-06-11 21:11:22 +02:00
Enno Rehling
5926016010 EXPEL: additional messages and tests. 2021-06-11 21:02:30 +02:00
Enno Rehling
1711812b0b VERTREIBE Kommando (expel).
Braucht noch Fehlermeldungen.
2021-06-10 22:21:15 +02:00
Enno Rehling
d35181b5d6 ignore lines that contain only whitespace. 2021-06-10 19:54:17 +02:00
Enno Rehling
573077987c eliminate clang warning 2021-06-09 20:58:38 +02:00
Enno Rehling
c8e09083f6 try being compatible with glibc and ms crt. 2021-06-09 20:58:38 +02:00
Enno Rehling
6fc62eb35c https://bugs.eressea.de/view.php?id=2753
look for iswgraph, instead of not iswspace
2021-06-09 20:58:38 +02:00
Enno Rehling
2f05f12e10 https://bugs.eressea.de/view.php?id=2753
trim anything that is not visible, not just spaces.
2021-06-09 20:58:38 +02:00
Enno Rehling
97655a52b8 begin work on version 3.29 2021-06-09 20:58:38 +02:00
Enno Rehling
e94b3d6447
Merge pull request from eressea/pause-faction
Pause faction
2021-06-09 20:47:10 +02:00
Enno Rehling
4a7580e8eb SORTIERE VOR eine pausierte Einheit
Automatische Kommandoübergabe inklusive.
2021-06-08 19:13:27 +02:00
Enno Rehling
062e5ff7ae paused units do not sort. 2021-06-08 19:13:27 +02:00
Enno Rehling
ab5669a514 monsters do not attack paused factions 2021-06-08 19:13:27 +02:00
Enno Rehling
e6da5d92d8 Pausierte Parteien bewachen nicht. 2021-06-08 19:13:27 +02:00
Enno Rehling
a3916b8271 PAusierte Parteien: HELFE BEWACHE bleibt erhalten. 2021-06-08 19:13:27 +02:00
Enno Rehling
e0d6bb410e Endlosschleife in BETRETE 2021-06-08 19:13:27 +02:00
Enno Rehling
d2cc7bde69 unused variables 2021-06-08 19:13:27 +02:00
Enno Rehling
202642e7d0 paused factions are not allied to anyone. 2021-06-08 19:13:26 +02:00
Enno Rehling
48fd0bd4af paused factions do not execute orders, do not join battles.
lots of change, didn't write any tests for this yet.
2021-06-08 19:13:26 +02:00
Enno Rehling
0fcc1b8d29 fix compilation, add tests for upkeep 2021-06-08 19:13:26 +02:00
Enno Rehling
bed6cdff58 paused units have no weekly maintenance cost. 2021-06-08 19:13:26 +02:00
Enno Rehling
e5b4d925c6 paused factions: resume when new orders arrive 2021-06-08 19:13:26 +02:00
Enno Rehling
18b1139616 test not sorting before building and ship owners. 2021-06-06 16:31:07 +02:00
Enno Rehling
62aaf71b35 move unit reordering into sort.c 2021-06-06 13:14:19 +02:00
Enno Rehling
1994a66f85 Seeschlangen brauchen keine Tarnung lehre, auf dem Ozean sieht man sie eh. 2021-06-05 15:07:02 +02:00
Enno Rehling
4a79960cb1 Große Monster können sich auf dem Ozean nicht verstecken. 2021-06-05 14:55:20 +02:00
Enno Rehling
8c43f21fbe
Merge pull request from eressea/develop
Release 3.28
2021-05-30 18:02:33 +02:00
Enno Rehling
4771d32c01 integration tests: fewer horses in the report now 2021-05-20 18:57:51 +02:00
Enno Rehling
895818c7c7 https://bugs.eressea.de/view.php?id=2750
Katpaulte schiessen nicht wenn KAEMPFE FLIEHE gesetzt ist.
Wenn Katapulte nicht schiessen, versuchen sie keine alternative Attacke, für die sie bihser das Katapult als Bogen benutzt haben.
2021-05-19 21:55:56 +02:00
Enno Rehling
ff80cb52ba https://bugs.eressea.de/view.php?id=2751
Keine Anzeige von Durchreise in von Leuchtturm gesehenem Land
Gleichschaltung NR und CR
2021-05-19 21:27:34 +02:00
Enno Rehling
9b3f5e7a55 remove unused objtype_t constants. 2021-05-08 18:21:14 +02:00
Enno Rehling
c68a356202 fix crash in release build 2021-05-04 21:06:53 +02:00
Enno Rehling
7d7842b849 do_combatspell didn't check that the unit was a mage. 2021-05-03 20:15:23 +02:00
Enno Rehling
30cf9e2659 Merge branch 'master' into develop 2021-05-01 22:21:09 +02:00
Enno Rehling
a811d7680a libcjson requires focal 2021-05-01 22:20:54 +02:00
Enno Rehling
4448cd607c hard-coded search for valgrind
travis: use bionic, do not run valgrind
2021-05-01 22:17:43 +02:00
Enno Rehling
9dd404756d libcjson requires focal 2021-05-01 22:16:56 +02:00
Enno Rehling
13a4388b9c Merge branch 'master' into develop 2021-05-01 22:03:31 +02:00
Enno Rehling
69cf298b6a hard-coded search for valgrind
travis: use bionic, do not run valgrind
2021-05-01 21:58:07 +02:00
Enno Rehling
ff7cd7d20d check for dead curse-magician 2021-05-01 21:53:01 +02:00
Enno Rehling
15e789737c Merge branch 'stm2-newbie' into develop 2021-04-29 17:38:46 +02:00
Enno Rehling
d8cca8089b wording: attacks, not addaults 2021-04-29 17:37:11 +02:00
Enno Rehling
063aa4dd79 remove debug flag 2021-04-29 17:33:59 +02:00
Enno Rehling
f158dab855 hard-coded search for valgrind 2021-04-29 17:33:59 +02:00
Enno Rehling
9cee6a8115 use even fewer single quotes
debug travis builds
2021-04-29 17:33:59 +02:00
Enno Rehling
86778665d4 disable valgrind installation, travis is borked 2021-04-29 17:33:59 +02:00
Enno Rehling
69a3abe627 try not using focal to fix valgrind installation 2021-04-29 17:33:59 +02:00
Enno Rehling
6c55dfb555 try forcing travis to install valgrind dependency 2021-04-29 17:33:59 +02:00
Enno Rehling
22b8c7da22 https://bugs.eressea.de/view.php?id=2745
use double quotation marks in generated orders.
2021-04-29 17:33:59 +02:00
Enno Rehling
93da2fedf8 remove debug flag 2021-04-28 20:04:59 +02:00
Enno Rehling
4608f720ea hard-coded search for valgrind 2021-04-28 20:02:24 +02:00
Enno Rehling
c87b6a8fd3 use even fewer single quotes
debug travis builds
2021-04-28 19:54:32 +02:00
Enno Rehling
a5534336fb disable valgrind installation, travis is borked 2021-04-28 19:46:08 +02:00
Enno Rehling
2f18ac7aea try not using focal to fix valgrind installation 2021-04-28 19:36:32 +02:00
Enno Rehling
5390b9da6c try forcing travis to install valgrind dependency 2021-04-28 19:29:41 +02:00
Enno Rehling
db2c2f0744 https://bugs.eressea.de/view.php?id=2745
use double quotation marks in generated orders.
2021-04-28 17:25:56 +02:00
Steffen Mecke
eb5ddfaeda report newbie immuniy clearly 2021-04-26 21:31:00 +02:00
Enno Rehling
557f5458ea don't cast level 0 combat spells 2021-04-21 18:05:40 +02:00
Enno Rehling
ca787ed447 README update: libexpat relaces libxml2 2021-04-18 17:32:19 +02:00
Enno Rehling
374d9d0bb6 https://bugs.eressea.de/view.php?id=2740
Do not put a UTF-8 BOM into the Zugvorlage.
2021-04-18 11:33:14 +02:00
Enno Rehling
15fd2c9026 xml attribute is called learn, not nolearn. 2021-04-13 21:59:41 +02:00
Enno Rehling
ba51efb06b Kröten und Schlümpfe können nichts lernen. 2021-04-12 20:14:19 +02:00
Enno Rehling
56beb0f4ab covevrity CID 220614 2021-04-09 22:35:11 +02:00
Enno Rehling
adc03b75bc move skill.h to kernel, use enum in struct skill 2021-04-09 21:52:50 +02:00
Enno Rehling
e3f2ca9aaf catch attempts to cast a spell without the magic skill 2021-04-09 21:30:26 +02:00
Enno Rehling
14e2e96c73
Merge pull request from eressea/2737-spells-cost-and-familiars
2737 spells cost and familiars
2021-04-08 21:47:28 +02:00
Enno Rehling
7bc7b339e8 changelog update 2021-04-08 21:39:39 +02:00
Enno Rehling
250c098bf6 https://bugs.eressea.de/view.php?id=2737
finalize spell cost bugfix.
fix familiar spellcost calculation tests.
remove debug names from tests.
2021-04-08 21:25:37 +02:00
Enno Rehling
c8e975333b WIP bug 2737
fix cost of spells with ring of power.
test and fix cost and limits of familiars casting spells.
2021-04-08 21:25:37 +02:00
Enno Rehling
5564543bfd fix gcc build 2021-04-05 19:40:22 +02:00
Enno Rehling
4d8a3d1947 https://bugs.eressea.de/view.php?id=2737
using a ring does not increase the spell's cost
adding tests for spell effectiveness revealed many inconsistencies that are now fixed.
2021-04-05 19:19:49 +02:00
Enno Rehling
bb12ffa2a2 Mit GIB 0 können hungernde Personen an die Bauern gegeben werden. 2021-04-01 18:54:56 +02:00
Enno Rehling
d1bad6773c kill DTD, nothing uses it 2021-03-30 15:13:29 +02:00
Enno Rehling
4e1a124801 https://bugs.eressea.de/view.php?id=2734
additional testing for GIVE UNIT
2021-03-28 19:07:42 +02:00
Enno Rehling
50cdf39245 https://bugs.eressea.de/view.php?id=2736
report the correct region for drifting ships.
2021-03-28 18:58:09 +02:00
Enno Rehling
58c310de29 a working stone circle boosts magic resistance of people inside. 2021-03-27 19:12:12 +01:00
Enno Rehling
721442584c testing for magic resistance curses. 2021-03-27 18:56:17 +01:00
Enno Rehling
60fe8e6200 more testing: magic skill grants additional 5% resistance 2021-03-27 11:17:20 +01:00
Enno Rehling
9a9a9c7a5d https://bugs.eressea.de/view.php?id=2733
add tests for magic resistance formula.
2021-03-27 00:01:44 +01:00
Enno Rehling
8ba80d7dbf https://bugs.eressea.de/view.php?id=2733
magicians resisting their own spells.
2021-03-26 19:56:32 +01:00
Enno Rehling
5a8d0221e8 remove unused variable 2021-03-26 17:59:43 +01:00
Enno Rehling
4582db917a remove battle.alive it was no longer used. 2021-03-25 19:23:20 +01:00
Enno Rehling
ce5ac00b80 remove rowcache optimization, it had hardly any effect. 2021-03-25 19:21:58 +01:00
Enno Rehling
53d4010958 code style: use quotes on local includes 2021-03-24 21:41:20 +01:00
Enno Rehling
3cf58f74af
Merge pull request from stm2/dreams_and_allies
FFL_DEFENDER is deprecated and interfers with dreams
2021-03-24 21:24:27 +01:00
Enno Rehling
5b1d787102 Merge branch 'stm2-confusion_and_panic' into develop 2021-03-24 21:19:06 +01:00
Enno Rehling
081965f0bc remove BATTLE_FAST code
it didn't actually make battles fast.
2021-03-24 21:13:59 +01:00
Enno Rehling
44765edede Merge branch 'develop' into stm2-confusion_and_panic 2021-03-24 21:07:16 +01:00
Enno Rehling
35f562a53f fix damage calculation, again
scale_number was messing with the hp
2021-03-24 21:04:50 +01:00
Enno Rehling
195e49e7f0 disable the battle.fast cache
it doesn't look very good, anyhow
let's see how much that actually costs
2021-03-24 20:58:33 +01:00
Enno Rehling
b5cc4e6fac flee_spell did not need an extra argument
checking for precombat spells is easy and safe!
2021-03-24 20:58:32 +01:00
Enno Rehling
a2d4345f49 fix recent change for terraforming herbs 2021-03-24 20:58:32 +01:00
Enno Rehling
fc438fe0a7 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-24 20:58:32 +01:00
Enno Rehling
47fba27e2a we do not need cmake 3.19 2021-03-24 20:58:32 +01:00
Enno Rehling
73e20b0770 on macos, there is apparently no ncursesw 2021-03-24 20:58:32 +01:00
Enno Rehling
8ed2738bc0 fix recent change for terraforming herbs 2021-03-24 20:58:32 +01:00
Enno Rehling
0928fe0d02 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-24 20:58:32 +01:00
Enno Rehling
c2633afdf5 we do not need cmake 3.19 2021-03-24 20:58:32 +01:00
Enno Rehling
c7bbb97286 on macos, there is apparently no ncursesw 2021-03-24 20:58:32 +01:00
Enno Rehling
52ba83addd fix recent change for terraforming herbs 2021-03-24 20:58:32 +01:00
Enno Rehling
d85ac9b2f9 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-24 20:58:32 +01:00
Enno Rehling
9701cf9d94 we do not need cmake 3.19 2021-03-24 20:58:32 +01:00
Enno Rehling
28d35eec7a on macos, there is apparently no ncursesw 2021-03-24 20:58:32 +01:00
Steffen Mecke
fae0c2608c fix for flee spell 2021-03-24 20:58:32 +01:00
Enno Rehling
8b2857f582 fix recent change for terraforming herbs 2021-03-24 20:58:32 +01:00
Enno Rehling
6feb616c2d terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-24 20:58:32 +01:00
Enno Rehling
f43dd0867c we do not need cmake 3.19 2021-03-24 20:58:31 +01:00
Enno Rehling
cb0ba86593 on macos, there is apparently no ncursesw 2021-03-24 20:58:31 +01:00
Enno Rehling
235075b54e fix recent change for terraforming herbs 2021-03-24 20:58:31 +01:00
Enno Rehling
d3b8c7a2d2 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-24 20:58:31 +01:00
Enno Rehling
bf15070c94 we do not need cmake 3.19 2021-03-24 20:58:31 +01:00
Enno Rehling
e4967d01ea on macos, there is apparently no ncursesw 2021-03-24 20:58:31 +01:00
Enno Rehling
48b0e41c86 fix recent change for terraforming herbs 2021-03-24 20:58:31 +01:00
Enno Rehling
970e3c5432 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-24 20:58:31 +01:00
Enno Rehling
db1523d7ad we do not need cmake 3.19 2021-03-24 20:58:31 +01:00
Enno Rehling
6da06ae4d4 on macos, there is apparently no ncursesw 2021-03-24 20:58:31 +01:00
Steffen Mecke
f48a37e4c7 e3 test irrelevant 2021-03-24 20:58:30 +01:00
Steffen Mecke
807177cc68 reverting "fix" 2021-03-24 20:57:46 +01:00
Steffen Mecke
a713779f34 Gesang der Verwirrung bringt Buchhaltung durcheinander 2021-03-24 20:57:46 +01:00
Enno Rehling
19db01af67 new volcano damage calculation was broken. 2021-03-24 20:56:30 +01:00
Steffen Mecke
598b566ab8 FFL_DEFENDER is deprecated and interfers with dreams 2021-03-24 11:29:19 +01:00
Enno Rehling
335740d12b undo curse_active change
curses should survive the death of a magician.
good dreams needs a magician to decide allegiance.
2021-03-23 21:03:12 +01:00
Enno Rehling
13f9006148 add a test for gooddreams skill modifier. 2021-03-23 20:01:42 +01:00
Enno Rehling
b31715a71e Merge branch 'stm2-gooddreams_mage' into develop 2021-03-23 19:27:47 +01:00
Enno Rehling
a9a7609a9a make curse_active check for a magician.
fix tests that were using curses without a creator.
2021-03-23 19:27:11 +01:00
Enno Rehling
5e7fba50d6 Dämonen können magisch reanimiert werden. 2021-03-23 18:53:11 +01:00
Enno Rehling
5452987cb7 flee_spell did not need an extra argument
checking for precombat spells is easy and safe!
2021-03-23 18:53:11 +01:00
Enno Rehling
b6e084c758 fix recent change for terraforming herbs 2021-03-23 18:52:42 +01:00
Enno Rehling
bb82df04c4 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-23 18:52:42 +01:00
Enno Rehling
5d2dbcb93a we do not need cmake 3.19 2021-03-23 18:52:42 +01:00
Enno Rehling
de1386dba6 on macos, there is apparently no ncursesw 2021-03-23 18:52:42 +01:00
Enno Rehling
de9918f018 fix recent change for terraforming herbs 2021-03-23 18:52:06 +01:00
Enno Rehling
3ef6559c5f terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-23 18:52:06 +01:00
Enno Rehling
26edfea405 we do not need cmake 3.19 2021-03-23 18:52:06 +01:00
Enno Rehling
09c257a3d0 on macos, there is apparently no ncursesw 2021-03-23 18:52:05 +01:00
Enno Rehling
181d82819a fix unsigned mismatch 2021-03-23 18:51:38 +01:00
Enno Rehling
bdf4069675 update changelog 2021-03-23 18:51:38 +01:00
Enno Rehling
9c9be163d8 fix review comments,
extract meffect_protection and add a test.
2021-03-23 18:51:38 +01:00
Enno Rehling
f11802d817 eliminate some type conversion warnings (MSVC) 2021-03-23 18:51:38 +01:00
Enno Rehling
521ae1f769 fix recent change for terraforming herbs 2021-03-23 18:51:38 +01:00
Enno Rehling
eb1785568d terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-23 18:51:37 +01:00
Enno Rehling
a9bca011b9 we do not need cmake 3.19 2021-03-23 18:51:37 +01:00
Enno Rehling
6d106899c1 on macos, there is apparently no ncursesw 2021-03-23 18:51:37 +01:00
Steffen Mecke
5a595bd315 fix for flee spell 2021-03-23 18:50:49 +01:00
Steffen Mecke
4ee01be75f fix für Schild des Fisches 2021-03-23 18:50:49 +01:00
Enno Rehling
480d80f7c6 eliminate type conversion warning 2021-03-23 18:50:48 +01:00
Enno Rehling
842b37a5a2 indentation 2021-03-23 18:50:48 +01:00
Enno Rehling
3548722a58 clarification: at_dict is deprecated but has a conversion. 2021-03-23 18:50:48 +01:00
Enno Rehling
0573ddfbab https://bugs.eressea.de/view.php?id=2732
fix permanent smurfs
2021-03-23 18:50:48 +01:00
Enno Rehling
5fef373181 fix recent change for terraforming herbs 2021-03-23 18:50:48 +01:00
Enno Rehling
c4c81547e8 https://bugs.eressea.de/view.php?id=2732
Einige Untotenrassen konnten nicht desertieren.
2021-03-23 18:50:48 +01:00
Enno Rehling
316188531e terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-23 18:50:48 +01:00
Enno Rehling
738ddfc2e5 fix error message 2021-03-23 18:50:48 +01:00
Enno Rehling
42b71163ec use new storage module version 2021-03-23 18:50:48 +01:00
Enno Rehling
44b75288d2 we do not need cmake 3.19 2021-03-23 18:50:48 +01:00
Enno Rehling
0957209f31 on macos, there is apparently no ncursesw 2021-03-23 18:50:48 +01:00
Enno Rehling
117a506b6b remove tolua submodule, build with system library (WIP) 2021-03-23 18:50:48 +01:00
Enno Rehling
4a16cb5aa5 Dämonen können magisch reanimiert werden. 2021-03-23 18:47:52 +01:00
Enno Rehling
d38130870a Merge branch 'stm2-flee_spell' into develop 2021-03-22 21:10:07 +01:00
Enno Rehling
a7d335b83a flee_spell did not need an extra argument
checking for precombat spells is easy and safe!
2021-03-22 20:34:55 +01:00
Enno Rehling
6a07688ff3 fix unsigned mismatch 2021-03-22 20:32:07 +01:00
Enno Rehling
4b0c6dc90f update changelog 2021-03-22 20:32:07 +01:00
Enno Rehling
e05a60f325 fix review comments,
extract meffect_protection and add a test.
2021-03-22 20:32:07 +01:00
Enno Rehling
288f3d93c8 eliminate some type conversion warnings (MSVC) 2021-03-22 20:32:07 +01:00
Enno Rehling
13a568f048 fix recent change for terraforming herbs 2021-03-22 20:32:07 +01:00
Enno Rehling
5f99c9e882 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-22 20:32:06 +01:00
Enno Rehling
35cd8979fb we do not need cmake 3.19 2021-03-22 20:32:06 +01:00
Enno Rehling
16cb0d7050 on macos, there is apparently no ncursesw 2021-03-22 20:32:06 +01:00
Steffen Mecke
50c89033dc fix für Schild des Fisches 2021-03-22 20:29:10 +01:00
Enno Rehling
c8259c5524 eliminate type conversion warning 2021-03-22 20:29:10 +01:00
Enno Rehling
e9a295cea6 indentation 2021-03-22 20:29:10 +01:00
Enno Rehling
098f27863c clarification: at_dict is deprecated but has a conversion. 2021-03-22 20:29:10 +01:00
Enno Rehling
16edaf9dba https://bugs.eressea.de/view.php?id=2732
fix permanent smurfs
2021-03-22 20:29:10 +01:00
Enno Rehling
1370b63b8b fix recent change for terraforming herbs 2021-03-22 20:29:10 +01:00
Enno Rehling
9f572fab22 https://bugs.eressea.de/view.php?id=2732
Einige Untotenrassen konnten nicht desertieren.
2021-03-22 20:29:10 +01:00
Enno Rehling
52fe2a01dd terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-22 20:29:10 +01:00
Enno Rehling
c1dcb185fe fix error message 2021-03-22 20:29:10 +01:00
Enno Rehling
edeffd0f93 use new storage module version 2021-03-22 20:29:10 +01:00
Enno Rehling
efb70eac58 we do not need cmake 3.19 2021-03-22 20:29:10 +01:00
Enno Rehling
1cf04ba131 on macos, there is apparently no ncursesw 2021-03-22 20:29:10 +01:00
Enno Rehling
44d30b506f remove tolua submodule, build with system library (WIP) 2021-03-22 20:29:09 +01:00
Enno Rehling
e19bd8bd08 fix unsigned mismatch 2021-03-21 18:55:31 +01:00
Enno Rehling
213d0323a0 update changelog 2021-03-21 18:36:56 +01:00
Enno Rehling
e58fab3dd4 Merge branch 'stm2-spell_logic' into develop 2021-03-21 18:35:58 +01:00
Enno Rehling
dea6149902 fix review comments,
extract meffect_protection and add a test.
2021-03-21 18:35:08 +01:00
Enno Rehling
76e99c6957 eliminate some type conversion warnings (MSVC) 2021-03-21 18:09:21 +01:00
Enno Rehling
c0cd90bf62 eliminate type conversion warning 2021-03-21 18:02:04 +01:00
Enno Rehling
d06262e9a2 indentation 2021-03-21 18:02:04 +01:00
Enno Rehling
fb52bc8846 clarification: at_dict is deprecated but has a conversion. 2021-03-21 18:02:04 +01:00
Enno Rehling
7fcecc9468 https://bugs.eressea.de/view.php?id=2732
fix permanent smurfs
2021-03-21 18:02:04 +01:00
Enno Rehling
d7b0da327b fix recent change for terraforming herbs 2021-03-21 18:02:04 +01:00
Enno Rehling
bc1a9b27ef https://bugs.eressea.de/view.php?id=2732
Einige Untotenrassen konnten nicht desertieren.
2021-03-21 18:02:04 +01:00
Enno Rehling
9a1765d917 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-21 18:02:04 +01:00
Enno Rehling
812a416217 fix error message 2021-03-21 18:02:04 +01:00
Enno Rehling
72eec3e5e8 use new storage module version 2021-03-21 18:02:04 +01:00
Enno Rehling
ecafff5ffe we do not need cmake 3.19 2021-03-21 18:02:04 +01:00
Enno Rehling
bd3e26d634 on macos, there is apparently no ncursesw 2021-03-21 18:02:04 +01:00
Enno Rehling
b48ade8598 remove tolua submodule, build with system library (WIP) 2021-03-21 18:02:03 +01:00
Steffen Mecke
3334fc05e7 e3 test irrelevant 2021-03-21 17:50:06 +01:00
Steffen Mecke
109b5d78a7 good dreams end when magician is dead 2021-03-21 14:14:01 +01:00
Steffen Mecke
9d0f283027 fix for flee spell 2021-03-21 13:04:44 +01:00
Steffen Mecke
5f7860b6e6 fix für Schild des Fisches 2021-03-21 12:47:51 +01:00
Enno Rehling
d4a85d9329 eliminate type conversion warning 2021-03-20 10:02:38 +01:00
Enno Rehling
c69972100e indentation 2021-03-19 23:30:34 +01:00
Enno Rehling
2783d54f8d clarification: at_dict is deprecated but has a conversion. 2021-03-19 20:32:28 +01:00
Enno Rehling
7dc1ddbded https://bugs.eressea.de/view.php?id=2732
fix permanent smurfs
2021-03-18 21:02:22 +01:00
Enno Rehling
fc1c051c97 fix recent change for terraforming herbs 2021-03-18 21:00:19 +01:00
Enno Rehling
51e587a1f5 https://bugs.eressea.de/view.php?id=2732
Einige Untotenrassen konnten nicht desertieren.
2021-03-18 20:47:05 +01:00
Enno Rehling
2051eb05e2 terraforming changes herbs
https://bugs.eressea.de/view.php?id=2730
2021-03-18 18:35:25 +01:00
Enno Rehling
bf46eacb5c fix error message 2021-03-17 18:42:09 +01:00
Enno Rehling
ee9a39453a use new storage module version 2021-03-17 18:41:57 +01:00
Enno Rehling
b786dcaa10 we do not need cmake 3.19 2021-03-16 21:35:33 +01:00
Enno Rehling
b6ee09d309 on macos, there is apparently no ncursesw 2021-03-16 21:29:05 +01:00
Enno Rehling
3a67618e4d remove tolua submodule, build with system library (WIP) 2021-03-16 18:14:25 +01:00
Enno Rehling
36653ec65b fix highly theoretical source of crash.
bind_eressea now checks if bindings were called without filename
2021-03-15 20:00:58 +01:00
Enno Rehling
56141ee7a1 include what you use 2021-03-14 17:42:18 +01:00
Enno Rehling
d1aff44d7b Happy Pi day!
Let's use M_PI, it's available in all known math.h implementations.
2021-03-14 17:39:53 +01:00
Enno Rehling
07c1dee907 materials array is terminated with number == 0
we say nothing about rtype.
2021-03-14 16:35:55 +01:00
Enno Rehling
5b7a3cba32 buildings offer protection from volcano damage 2021-03-13 21:19:40 +01:00
Enno Rehling
5876c1a011 https://bugs.eressea.de/view.php?id=2729
castles were giving too much protection.
2021-03-13 21:18:47 +01:00
Enno Rehling
812907ffb5 Add_compile_options(/FC) fixes error messages.
The build output window was showing the wrong filename. See:
https://developercommunity.visualstudio.com/t/cmake-project-cant-click-on-error/729350
https://gitlab.kitware.com/cmake/cmake/-/issues/18261
2021-03-13 17:08:15 +01:00
Enno Rehling
14e95c9675 refactoring building_stage.construction
every building_stage has a construction.
no need to malloc it separately.
optimize some more allocations.
replace some memset and calloc calls.
2021-03-13 15:38:16 +01:00
Enno Rehling
e6e5e75c4c let's try something: exparse handlers should not allocate 2021-03-13 14:39:20 +01:00
Enno Rehling
c5b8839634 introduce new building_protection as a shortcut. 2021-03-13 14:25:30 +01:00
Enno Rehling
376b1106a6 rename to bt_protection 2021-03-13 14:20:37 +01:00
Enno Rehling
c8d8eb85d3 code style: do not cast the result of malloc 2021-03-13 14:17:07 +01:00
Enno Rehling
b9a20bb378 C90 has no inline keyword 2021-03-13 09:01:40 +01:00
Enno Rehling
a9ca16e767 Testing for C90 compatibility 2021-03-13 08:55:45 +01:00
Enno Rehling
38fd655af9 remove the weird rounding macro from peasant growth 2021-03-13 08:14:01 +01:00
Enno Rehling
9c8df88525 reset rng injection before runnign test. 2021-03-12 20:43:43 +01:00
Enno Rehling
dd23307e8e unused variable 2021-03-12 20:23:00 +01:00
Enno Rehling
f9346f4332 lucky cats can survive a volcano 2021-03-12 20:11:45 +01:00
Enno Rehling
154e610423 unused variable 2021-03-12 19:57:27 +01:00
Enno Rehling
8dbe1b6bd3 bring back healing potion effects 2021-03-12 19:38:18 +01:00
Enno Rehling
b288a62542 simplify random injection, extend it to integer constants 2021-03-12 19:24:44 +01:00
Enno Rehling
cd8cd3c45d replace damage_unit with somethign that doesn't malloc 2021-03-11 20:15:25 +01:00
Enno Rehling
e2a567e9c9 add tests for dice_rand term evaluation 2021-03-11 19:53:44 +01:00
Enno Rehling
c0304ff572 error message whenever we recruit less than ordered. 2021-03-11 19:26:50 +01:00
Enno Rehling
1448bc4e98 Merge branch 'master' into develop 2021-03-07 14:13:02 +01:00
Enno Rehling
3715f21e6c add missing XML for drift messages 2021-03-07 14:12:22 +01:00
Enno Rehling
b87d1c955c remove debug output 2021-03-07 13:05:39 +01:00
Enno Rehling
e056955839 Merge branch 'master' into develop 2021-03-06 21:31:49 +01:00
Enno Rehling
1d6825f179 Merge branch 'develop' of github.com:eressea/server into develop 2021-03-06 21:31:16 +01:00
Enno Rehling
1d353fdc2a fix LUA_PATH for run-eressea.cron 2021-03-06 21:30:47 +01:00
Enno Rehling
87a08ad8ba fix LUA_PATH for run-eressea.cron 2021-03-06 21:29:36 +01:00
Enno Rehling
9109a7a61e fix output directory and point runtests script at it. 2021-03-05 18:53:44 +01:00
Enno Rehling
010dde1cb8 fix bug in last change, could not give items to peasants. 2021-03-04 15:49:12 +01:00
Enno Rehling
5df3c3dc4b fix a crash in give_cmd.
do give_unit last, because it kills the actively iterated list.
2021-03-03 20:10:51 +01:00
Enno Rehling
026bcb22cb set LUA_PATH for preview 2021-02-28 17:15:33 +01:00
Enno Rehling
7d434323a7 make use of build no. 2021-02-28 17:11:31 +01:00
Enno Rehling
d53d3d9e12 set LUA_PATH for cron jobs 2021-02-28 16:02:09 +01:00
Enno Rehling
3df552676c begin work on version 3.28 2021-02-24 19:46:55 +01:00
Enno Rehling
ccba09390b compile with ERESSEA_VERSION 2021-02-24 19:45:45 +01:00
Enno Rehling
961b936086
Merge pull request from eressea/develop
release 3.27
2021-02-24 19:34:51 +01:00
Enno Rehling
5fd974d399 https://bugs.eressea.de/view.php?id=2573 magical resistance of adamantium 2021-02-24 19:06:04 +01:00
Enno Rehling
f48551ebcb remove unicode from autoseed (races are always english tokens) 2021-02-24 18:48:12 +01:00
Enno Rehling
9f9b6f4faf rename ERESSEA_DIR to ERESSEA_ROOT 2021-02-23 17:57:44 +01:00
Enno Rehling
e36cac1188 find config files in ERESSEA_DIR if config.install is not set 2021-02-23 17:19:48 +01:00
Enno Rehling
8421e64c6e travis lua_path, again 2021-02-22 20:50:49 +01:00
Enno Rehling
c5cc314c46 travis, install luarocks 2021-02-22 20:08:30 +01:00
Enno Rehling
355b9ff7fc remove lunit from repository (use luarocks)
make info panel bigger, do not cut off names.
2021-02-22 19:51:46 +01:00
Enno Rehling
3508fceddc Add CMakeSettings.json to git
Expect the system LUA_PATH to point to luarocks
2021-02-22 19:32:08 +01:00
Enno Rehling
56896361fb remove luarocks from scripts 2021-02-22 09:54:02 +01:00
Enno Rehling
26bb5d4f07 remove unused ini settings 2021-02-22 02:05:47 +01:00
Enno Rehling
f69a823a14 fix LUA_PATH for runtests script 2021-02-22 02:03:45 +01:00
Enno Rehling
2bb18d27bc replace config.install with environment variable 2021-02-22 01:53:01 +01:00
Enno Rehling
6176e5e754 gmtool no longer needs unicode.h 2021-02-21 22:58:17 +01:00
Enno Rehling
df4317f9f1 remove non-utf8 hacks from mapper.
correclty refresh map window after listboxes close.
2021-02-21 22:32:40 +01:00
Enno Rehling
979f2f7b6e build with ncursesw
Now we can display special characters and proper boxes
2021-02-21 22:05:43 +01:00
Enno Rehling
a3499dd895 fix new bug in ascii converter. 2021-02-21 21:01:52 +01:00
Enno Rehling
abf548cecd overdue unicode cleanup.
our new pdcurses can do utf8 output, let's use it.
convert output on a windows tty to codepage 1252.
2021-02-21 20:49:03 +01:00
Enno Rehling
b9eea2c8a2 forgot to increase verison number for 3.27 2021-02-21 13:41:36 +01:00
Enno Rehling
e0ff829b61 clarify the find_package (Lua) logic 2021-02-21 10:15:27 +01:00
Enno Rehling
f447f35ad3 turn magic resistance off during test of spells 2021-02-21 10:06:22 +01:00
Enno Rehling
61d86cf175 Auch Schiffe haben eine natürliche Resistenz gegen Verzauberung. 2021-02-21 10:00:05 +01:00
Enno Rehling
7dcf9a27e0 windows fixes broke linux build
also disable magic resistance in shipspell tests
2021-02-21 09:53:38 +01:00
Enno Rehling
6b5ddc57d9 MSVC builds go to a single output folder
Fix batch files to deal with new structure.
2021-02-21 09:48:27 +01:00
Enno Rehling
d8c0b57864 we don't need to track age statistics for any but the new factions. rename global age to newbies. 2021-02-21 00:54:33 +01:00
Enno Rehling
e1d117754a fix new callback signature for jsonconf 2021-02-21 00:37:31 +01:00
Enno Rehling
43066b6720 size_t fix in storage 2021-02-21 00:22:38 +01:00
Enno Rehling
d4f09fbf74 fix tests that expected the old storage library behavior 2021-02-21 00:21:19 +01:00
Enno Rehling
b0a23f390c wrong storage library version 2021-02-21 00:18:32 +01:00
Enno Rehling
3db561ec3a require cmake 3.13, not more 2021-02-20 23:24:50 +01:00
Enno Rehling
e0e82c5fa5 fix MSVC warning levels, move _CRT_SECURE_NO_WARNINGS define to sources 2021-02-20 23:22:10 +01:00
Enno Rehling
0af9fd18ef make clean target cleans cmake 2021-02-20 20:17:22 +01:00
Enno Rehling
50f84adc37 build with or without libbsd installed 2021-02-19 18:13:05 +01:00
Enno Rehling
4dfa1035b6 fix libbsd and string function detection 2021-02-18 22:26:41 +01:00
Enno Rehling
74f6076022 add lunitx module for systems without luarocks.
add LUA_PATH to runtests.bat
2021-02-16 10:12:05 +01:00
Enno Rehling
ec645010fa update changelog 2021-02-16 10:12:05 +01:00
Enno Rehling
a17191eb56 remove remainder of custom tolua build 2021-02-16 10:12:05 +01:00
Enno Rehling
b63d5e31ac tolua update again 2021-02-16 10:12:05 +01:00
Enno Rehling
c8d03c9ea3 fix inifile and tolua builds
remove our custom assert header
2021-02-16 10:12:05 +01:00
Enno Rehling
e156a65779 fix the inifile cli editor 2021-02-16 10:12:05 +01:00
Enno Rehling
a59fdf87cb separate stats and log 2021-02-16 10:12:05 +01:00
Enno Rehling
b6b95f58ed import the inifile builder from iniparser repo 2021-02-16 10:12:05 +01:00
Enno Rehling
6b20d27762 try building on ubuntu focal image 2021-02-16 10:12:05 +01:00
Enno Rehling
1d50bd19d2 consider newer lua versions 2021-02-16 10:12:05 +01:00
Enno Rehling
2f3cf7107a fix tolua include 2021-02-16 10:12:05 +01:00
Enno Rehling
4dd84d07ec build with lua 5.3
no need to depend on the old tolua package in apt
2021-02-16 10:12:05 +01:00
Enno Rehling
db402c4e2c include custom version of tolua as a submodule.
change how libm and libbsd are detected.
2021-02-16 10:12:05 +01:00
Enno Rehling
7fae809aa0 update tolua repo if needed 2021-02-16 10:12:05 +01:00
Enno Rehling
a67246ba86 there is only one repository for tolua now 2021-02-16 10:12:05 +01:00
Enno Rehling
d1ec2bbb5c tolua creates sources that abuse the LUALIB_API defines.
Manually fixing the generated files so they don't try to declare dllimports.
2021-02-16 10:12:05 +01:00
Enno Rehling
73b2895306 fix travis build 2021-02-16 10:12:05 +01:00
Enno Rehling
0b2049151a update package list 2021-02-16 10:12:05 +01:00
Enno Rehling
b0093868b3 eliminate cJSON submodule 2021-02-16 10:12:05 +01:00
Enno Rehling
f78d667258 find iniparser.h when installed in subdirectory 2021-02-16 10:12:05 +01:00
Enno Rehling
fb3047beb5 add cmake support for iniparser package 2021-02-16 10:12:05 +01:00
Enno Rehling
d850b28d85 we do not use dlmalloc 2021-02-16 10:12:04 +01:00
Enno Rehling
0d2b3a76b7 fix compilation with Lua 5.4 (LUA_QL no longer exists) 2021-02-16 10:12:04 +01:00
Enno Rehling
b6fff5cb5a run tests where we can clean up after them 2021-02-16 10:12:04 +01:00
Enno Rehling
ba3b9ae6d3 use pdcurses from vcpkg if available 2021-02-16 10:12:04 +01:00
Enno Rehling
ebc8c3f1d2 add FindSQLite3 for older cmake versions 2021-02-16 10:12:04 +01:00
Enno Rehling
70ccef02ae use vcpkg packages on windows
make cmake files smarter
2021-02-16 10:12:04 +01:00
Enno Rehling
117edad7e4 more astral spell magic resist fixes 2021-02-16 10:12:04 +01:00
Enno Rehling
31a3f10e8f latest versions do not complain about cmake min version 2021-02-16 10:12:04 +01:00
Enno Rehling
33332aedb4 stop using the tolua-5.3 repository, the 5.2 works up to lua 5.4 2021-02-16 10:12:04 +01:00
Enno Rehling
b756fde006 spells must deal with resisting targets, or sigsegv will happen 2021-02-16 10:12:04 +01:00
Enno Rehling
8d286d5e23 fix disabling of tree growth. 2021-02-16 10:12:04 +01:00
Enno Rehling
8fbcf3f379 Neue Option für schnelleres Samenwachstum. 2021-02-16 10:12:04 +01:00
Enno Rehling
cc5e062b68 https://bugs.eressea.de/view.php?id=2724
Magieresistenz reparieren.
2021-02-16 10:12:04 +01:00
Enno Rehling
d03face3c1 simplicate and add more lightness 2021-02-16 10:12:04 +01:00
Enno Rehling
88e0af287e https://bugs.eressea.de/view.php?id=2713
spelling fix: caravanserai
2021-02-16 10:12:04 +01:00
Enno Rehling
31f589e76f https://bugs.eressea.de/view.php?id=2716
improved messages when following a ship.
2021-02-16 10:12:04 +01:00
Enno Rehling
8ef95e6729 https://bugs.eressea.de/view.php?id=2716
Bei FOLGE Schiff muss das Zile nicht in der gleichen Region sein!
2021-02-16 10:12:04 +01:00
Enno Rehling
f09bed10b7 personen mit racename können eh nicht übergeben werden, code kann man sich sparen. 2021-02-16 10:12:04 +01:00
Enno Rehling
af2dadfc8e https://bugs.eressea.de/view.php?id=2719
fix shapeshifted units without a timer
do not transfer shapeshift spell when giving to a new unit.
2021-02-16 10:12:04 +01:00
Enno Rehling
fb294d9118 add a debug option, -D
usually do not need to save the game when debugging
2021-02-16 10:12:04 +01:00
Enno Rehling
f4acff67e4 https://bugs.eressea.de/view.php?id=2720
report study costs to the correct unit
2021-02-16 10:12:04 +01:00
Enno Rehling
0bbadf2a66 https://bugs.eressea.de/view.php?id=2718
Better error messages for drifting ship.
2021-02-16 10:12:04 +01:00
Enno Rehling
e97f80ad3c eliminate some high-level warnings 2021-02-16 10:12:04 +01:00
Enno Rehling
da83e3f2f6 coverity CID 215803 Dereference after null check 2021-02-16 10:12:04 +01:00
Steffen Mecke
6bba2a2ed7 PR 929: fix memory leak 2021-02-16 10:11:23 +01:00
Enno Rehling
219ec117c6 fix gcc 10 compatibility 2021-02-16 10:09:14 +01:00
Enno Rehling
b078c89dfb addedndum: add a negative test for nono-aquarians, too. 2021-02-07 13:08:13 +01:00
Enno Rehling
b7b6c4b668 https://bugs.eressea.de/view.php?id=2723
Meermenschen konnten nicht aus fahrenden Schiffen springen.
2021-02-07 12:52:35 +01:00
Enno Rehling
dde2f3644e fix gcc complaints 2021-02-05 22:39:27 +01:00
Enno Rehling
e8aff3b431 https://bugs.eressea.de/view.php?id=2722
Weitere Schiffe sind nicht gesegelt, wenn ein Schiff Startregion = Ziel hatte.
2021-02-05 22:36:30 +01:00
Enno Rehling
2103707489 fix follow_ship crash
error message for non-captains was not generated
2021-01-03 10:22:17 +01:00
Enno Rehling
8ef3d1ed3f fix rename orders.dir after creating orders 2021-01-02 09:19:23 +01:00
Enno Rehling
cd7f4026ca https://bugs.eressea.de/view.php?id=2582
Small tweak to an error message.
2020-12-10 20:54:30 +01:00
Enno Rehling
c02107d037 report monsters if they are only seen by lighthouses 2020-12-10 13:05:51 +01:00
Enno Rehling
ddd37688f9 https://bugs.eressea.de/view.php?id=2714 2020-12-10 11:58:52 +01:00
Enno Rehling
67025b65d0 https://bugs.eressea.de/view.php?id=2714
fix test for seen_travel
2020-12-09 20:32:09 +01:00
Enno Rehling
592fe18779 Bei der Durchreise konnte man große Monster immer sehen.
https://bugs.eressea.de/view.php?id=2714
2020-12-08 23:06:31 +01:00
Enno Rehling
ba3b608296 vs 2019 build for x86, not x64 2020-12-08 22:02:46 +01:00
Enno Rehling
efaa33af35 fix batch file for vs2017 2020-12-07 18:51:32 +01:00
Enno Rehling
8d36403216
Merge pull request from eressea/develop
changes for 3.26
2020-12-06 19:54:05 +01:00
Enno Rehling
830a0d9519 in e3, disable the new resource discovery 2020-12-06 19:24:39 +01:00
Enno Rehling
65246bc35e Enable new resource visibilty by default. 2020-12-06 19:22:59 +01:00
Enno Rehling
a3c8ff78da https://bugs.eressea.de/view.php?id=2651
Störe Astrale Integrität und Mauern der Ewigkeit können mit STUFE gezuabert werden. Als Fixkosten-Sprüche kann die Stufe des Zaubers nicht überschritten werden.
Test für die Reichweite des Astralzaubers.
2020-12-06 19:08:23 +01:00
Enno Rehling
1507090300 avoid type conversion warning in VS2019 2020-12-06 16:02:54 +01:00
Enno Rehling
860fcfacbe Test: Nur Elfen koennen Elfenbogen machen. 2020-12-06 15:52:43 +01:00
Enno Rehling
0cfdee0218 https://bugs.eressea.de/view.php?id=2712
Make the reports.lua script not break passwords of
 new players.
2020-12-06 15:47:47 +01:00
Enno Rehling
e23d5e6949 remove bad assumption
units on ships are not all at the end of the list, or ordered.
2020-12-06 15:47:47 +01:00
Enno Rehling
e4e06dfcbe bug 2710 ships moving in circles break guard 2020-12-06 15:47:47 +01:00
Enno Rehling
fe463a9f44 bug 2710: add tests, fix land movement 2020-12-06 15:47:47 +01:00
Enno Rehling
b50994bb9c add a test for famililar skill modifiers. 2020-12-06 15:47:47 +01:00
Enno Rehling
4a9c46053f updating submodules 2020-12-06 15:47:47 +01:00
Enno Rehling
69c4595282 Build in Visual Studio 2019
simplify test_create_faction
rewrite lots of tests
2020-12-06 15:47:47 +01:00
Enno Rehling
9e4e9c2d3e fix integer conversion warning 2020-12-06 15:47:47 +01:00
Enno Rehling
0ee4afc023 initialize building_type.magres 2020-12-06 15:47:47 +01:00
Enno Rehling
65488eb2f8 fix undead spawn chance.
disable commands for EX.
2020-12-06 15:47:47 +01:00
Enno Rehling
53fac9ab58 variable-based monster spawns 2020-12-06 15:47:47 +01:00
Enno Rehling
d9eb88134d configuration for new game 2020-12-06 15:47:47 +01:00
Enno Rehling
1293b9f27c disable iwyu, it is reporting garbage 2020-12-06 15:47:47 +01:00
Enno Rehling
2bb10f4406 bug 2628 eindeutige meldung beim abtreiben 2020-12-06 15:47:47 +01:00
Enno Rehling
c39bbed2b5 lighthouses protect from drifting
do not check for maintenance in update_lighthouse, but when the lighthouse is used.
2020-12-06 15:47:47 +01:00
Enno Rehling
68b409e1e7 ships on a ROUTE can drift. 2020-12-06 15:47:47 +01:00
Enno Rehling
814fda43a0 Regentanz / Segen der Erde
Der Effekt soll angeblich nur für Bauern gelten, nicht für Spieler.
2020-12-06 15:47:47 +01:00
Enno Rehling
8c62bd95cd Refactor the wage function for readability.
Add a test for wages at different castle sizes.
2020-12-06 15:47:47 +01:00
Enno Rehling
6868cbb928 screw you, iwyu 2020-12-06 15:47:47 +01:00
Enno Rehling
7eb26db2ec move gcc-specific signal handling out of main.c 2020-12-06 15:47:47 +01:00
Enno Rehling
10cafcbdec pointer out of scope 2020-12-06 15:47:47 +01:00
Enno Rehling
656922a9ec Zauber, revisited.
Mauern der Ewigkeit und Störe Astrale Integrität brauchen keine Stufenangabe, ihre Kosten sind nicht variabel
2020-12-06 15:47:47 +01:00
Enno Rehling
881814f74d Änderung an Heiliger Boden war ein Fehler. 2020-12-06 15:47:47 +01:00
Enno Rehling
9114ceda38 https://bugs.eressea.de/view.php?id=2651
Materialkosten von Heiliger Boden, Mauern der Ewigkeit, Störe Astrale Integrität steigen mit der Stude des Zaubers.
2020-12-06 15:47:47 +01:00
Enno Rehling
58a859f8bf update CHANGELOG 2020-12-06 15:47:47 +01:00
Enno Rehling
be17f600eb resource visibility, code clarification. 2020-12-06 15:47:47 +01:00
Enno Rehling
7987317697 add a setting for an alternate resource discovery rule. 2020-12-06 15:47:47 +01:00
Enno Rehling
8cabd04b75 division by zero error 2020-12-06 15:47:47 +01:00
Enno Rehling
a3f55de9a7 teachers do not need to be in an academy.
remove source files for academy.
2020-12-06 15:47:47 +01:00
Enno Rehling
0c080ad7dd coverity complains about possibly missing warden. 2020-12-06 15:47:47 +01:00
Enno Rehling
2c71e7fb82 start version 3.26 development Q4/2020 2020-12-06 15:47:47 +01:00
Enno Rehling
f78aa507f8 https://bugs.eressea.de/view.php?id=2701
fix the academy
make academy, curses and potions work for LERNE AUTO
remove E3 study.speedup
2020-12-06 15:47:47 +01:00
Enno Rehling
940e56b6ef stop using orders.queue and lockfile 2020-12-05 00:01:06 +01:00
Enno Rehling
4e9bc53288 avoid division by zero for uninitialized btype->magres fractions 2020-11-07 21:28:25 +01:00
Enno Rehling
44ce77e0c4 allow setting region age from lua 2020-10-14 18:55:06 +02:00
Enno Rehling
79924f0551 disable iwyu 2020-10-12 08:52:05 +02:00
Enno Rehling
9575fccdaf fix luarocks detection 2020-10-12 08:50:54 +02:00
Enno Rehling
4a7dadfb9b make regions age only once someone discovers then 2020-10-12 08:47:54 +02:00
Enno Rehling
48ad550527 do not try to install lunitx if already installed 2020-09-30 05:08:23 +02:00
Enno Rehling
5890db482a remove old XML catalogs, no longer used 2020-09-30 05:03:38 +02:00
324 changed files with 7225 additions and 23180 deletions

37
.github/workflows/main.yml vendored Normal file
View file

@ -0,0 +1,37 @@
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt install libexpat1-dev libtolua-dev libncurses5-dev libsqlite3-dev libiniparser-dev libcjson-dev libbsd-dev cppcheck shellcheck luarocks clang-tools
- name: Run .travis.yml build script
uses: ktomk/run-travis-yml@v1
with:
file: .travis.yml
steps: |
install
script
allow-failure: false

2
.gitignore vendored
View file

@ -1,4 +1,3 @@
tolua/
.vscode/
*.orig
eressea.ini
@ -47,4 +46,3 @@ tests/data/185.dat
/critbit/
*.mo
/.vs
/CMakeSettings.json

9
.gitmodules vendored
View file

@ -1,12 +1,3 @@
[submodule "dlmalloc"]
path = dlmalloc
url = https://github.com/ennorehling/dlmalloc.git
[submodule "iniparser"]
path = iniparser
url = https://github.com/ennorehling/iniparser.git
[submodule "cJSON"]
path = cJSON
url = https://github.com/ennorehling/cJSON.git
[submodule "storage"]
path = storage
url = https://github.com/ennorehling/storage.git

View file

@ -1,5 +1,6 @@
sudo: false
language: c
dist: focal
compiler:
- gcc
- clang
@ -9,17 +10,15 @@ addons:
packages:
- libbsd-dev
- libdb-dev
- liblua5.1-dev
- libtolua-dev
- libncurses5-dev
- libsqlite3-dev
- libexpat1-dev
- valgrind
- libiniparser-dev
- libcjson-dev
- cppcheck
- shellcheck
- luarocks
os:
- linux
notifications:
slack:
secure: F89aXLWaE125PaJIlETv12jT4EfH6wLXJmGCPZzrN3OcLn2ahDWqjwuzR7lOEDf2nAISmeMPyDZMhEHXLNHAE5qP6lg9yliYQw5hzGmDK9m1xUq/pPEne/b2Y7K3my1mkRZ6n3asbHgSmBWAfCIk1JN8R5Rv+rmbLuWLc+zofts=

View file

@ -1,12 +1,50 @@
# Geplante Aenderungen in zukuenftigen Eressea-Versionen
# 3.28
Als Anhaltspunkt fuer die Empfaenger der woechentlichen Testauswertungnen
will ich versuchen, die Liste meiner Aenderungen seit dem letzten Release
zu dokumentieren.
- Bugfix für Schild des Fisches (Solthar)
- Dämonen können magisch reanimiert werden.
- "Schöne Träume" verliert seine Wirkung, wenn der Zauberer stirbt.
- Mit GIB 0 können hungernde Personen an die Bauern gegeben werden.
- Magieresistenz: Einheiten widerstehen nicht Zaubern der eigenen Partei [2733].
- Zauberkosten steigen durch Ring der Macht nicht an.
- Effektiv gezauberte Stufe von Zauber anhängig von Verfügbarkeit der Materialen.
- Ring der Macht und Steinkreis erhöhen nicht die Zauberkosten [2737].
- Limits für Vertrautenzauber korrekt implementiert.
- Kröten und Schlümpfe können nichts lernen.
## Version 3.12.0
# 3.27
- Schiffe sind kommentarlos nicht gesegelt [2722].
- Meermenschen konnten nicht mehr anschwimmen [2723].
- Magieresistenz repariert [2724].
- Kleine Änderung an Samenwachstum.
- Umstellung auf neue Versionen von externen Libraries.
# 3.26
- Akademien, Traenke und Verzauberungen wirken auch bei LERNE AUTO
- Das lernen in einer Akademie erhoeht die Lernkosten. Koennen diese
nicht bezahlt werden, wird ohne deren Bonus gelernt.
- Lehrer muessen nicht mehr in der Akademie stehen, damit ihre Schueler
den Bonus bekommen
- Rohstoffe koennen jetzt bereits gesehen werden, wenn eine Einheit nur
die Haelfte des zum Abbau noetigen Talentes hat (statt bisher
Talent-1)
- Mauern der Ewigkeit und Störe Astrale Integrität brauchen keine
Stufenangabe, ihre Kosten sind nicht variabel [2651]
# 3.25
- Ab sofort ist es nicht mehr erlaubt, Befehle mit weniger als 3
Zeichen abzukürzen.
- Leuchttürme entdecken Seeschlangen und Drachen auf dem Ozean [2688]
- Magieresistenz von Insekten und Goblins repariert [2685]
- Getarnte Einheiten können wieder Eisen abbauen [2679]
- Gestaltwandlung kann nur einmal auf die selbe Einheit wirken [2680]
- Handel benötigt eine Burg mit Mindestgröße 2 [2678]
- Geschützte Leerzeichen in Befehlen werden ignoriert [2670]
# 3.12
- [other] optimierte Berechnung der Sichtbarkeit von Leuchttuermen
- [bug] Einheitenlimit bei GIB PERSON beachten
- [bug] Einheitenlimit bei ALLIANCE JOIN beachten
- [rule] Einheiten- und Personenzahl im Report beinhaltet *alle* Einheiten der Partei.

View file

@ -1,69 +1,74 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.13)
if (WIN32)
FILE(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH )
FILE(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH )
file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH )
endif(WIN32)
project (eressea-server C)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
if (WIN32)
# make subdirectories build to the same output folders (DLLs):
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
endif (WIN32)
if (MSVC)
find_package (PDCurses)
set (CURSES_FOUND ${PDCURSES_FOUND})
set (CURSES_LIBRARIES ${PDCURSES_LIBRARY})
set (CURSES_INCLUDE_DIRS ${PDCURSES_INCLUDE_DIR})
endif(MSVC)
if (NOT CURSES_FOUND)
set(CURSES_NEED_WIDE TRUE)
set(CURSES_NEED_NCURSES TRUE)
find_package (Curses)
if (NOT CURSES_FOUND)
set(CURSES_NEED_WIDE FALSE)
find_package (Curses REQUIRED)
endif(NOT CURSES_FOUND)
endif (NOT CURSES_FOUND)
find_package (ToLua 5.2 REQUIRED)
#find_package (BerkeleyDB REQUIRED)
find_package (SQLite3 REQUIRED)
find_package (IniParser REQUIRED)
find_package (CJSON REQUIRED)
find_package (EXPAT REQUIRED)
find_package (Lua)
if (NOT LUA_FOUND)
find_package (Lua51 REQUIRED)
endif()
if (MSVC)
find_package (PDCurses)
set (CURSES_FOUND ${PDCURSES_FOUND})
set (CURSES_LIBRARIES ${PDCURSES_LIBRARY})
set (CURSES_INCLUDE_DIR ${PDCURSES_INCLUDE_DIR})
set (HAVE_STRDUP 0)
set (HAVE_STRLCAT 0)
set (HAVE_LIBBSD 0)
set (HAVE_SIGNAL_H 0)
set (HAVE_EXECINFO_H 0)
include (MSVC)
else (MSVC)
find_package (Curses)
include (CheckIncludeFile)
CHECK_INCLUDE_FILE(signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILE(execinfo.h HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE(bsd/string.h HAVE_LIBBSD)
check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(execinfo.h HAVE_EXECINFO_H)
include (CheckLibraryExists)
check_library_exists(m fmin "" HAVE_LIBM)
check_library_exists(bsd strlcat "" HAVE_LIBBSD)
include (CheckFunctionExists)
CHECK_FUNCTION_EXISTS(strdup HAVE_STRDUP)
check_function_exists(strdup HAVE_STRDUP)
check_function_exists(strlcat HAVE_STRLCAT)
if (HAVE_LIBBSD)
include (CheckLibraryExists)
CHECK_LIBRARY_EXISTS(bsd strlcat "bsd/string.h" HAVE_STRLCAT)
else (HAVE_LIBBSD)
CHECK_FUNCTION_EXISTS(strlcat HAVE_STRLCAT)
set (HAVE_STRLCAT 1)
endif (HAVE_LIBBSD)
endif (MSVC)
find_package (Readline)
if (ERESSEA_DB STREQUAL "db")
find_package (BerkeleyDB REQUIRED QUIET)
else()
find_package (SQLite3 REQUIRED QUIET)
endif()
find_package(EXPAT REQUIRED)
find_package (ToLua REQUIRED)
if (TOLUA_FOUND)
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.3")
find_package (Lua 5.3 REQUIRED)
elseif (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
find_package (Lua 5.2 REQUIRED)
elseif (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.3")
find_package ( Lua 5.3 REQUIRED)
else ()
find_package (Lua51 REQUIRED)
endif()
endif(TOLUA_FOUND)
enable_testing()
add_subdirectory (cJSON)
add_subdirectory (tools)
add_subdirectory (storage)
add_subdirectory (iniparser)
add_subdirectory (clibs)
add_subdirectory (process)
add_subdirectory (src eressea)

62
CMakeSettings.json Normal file
View file

@ -0,0 +1,62 @@
{
"configurations": [
{
"name": "x64-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"inheritEnvironments": [ "msvc_x64_x64" ],
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "-v",
"ctestCommandArgs": "",
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake",
"type": "STRING"
},
{
"name": "CMAKE_MODULE_PATH",
"value": "${workspaceRoot}/cmake/Modules",
"type": "STRING"
}
]
},
{
"name": "x86-Debug",
"generator": "Ninja",
"configurationType": "Debug",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ],
"variables": [
{
"name": "CMAKE_TOOLCHAIN_FILE",
"value": "${env.VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake",
"type": "STRING"
},
{
"name": "CMAKE_MODULE_PATH",
"value": "${workspaceRoot}/cmake/Modules",
"type": "STRING"
}
]
},
{
"name": "x64-Release",
"generator": "Ninja",
"configurationType": "RelWithDebInfo",
"buildRoot": "${projectDir}\\out\\build\\${name}",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
}
]
}

View file

@ -5,5 +5,5 @@ test:
s/runtests
clean:
@rm -f *.log.*
@rm -rf *.log.* Debug/CMake*
@find . -name "*~" | xargs rm -f

View file

@ -9,8 +9,9 @@ Eressea depends on a number of external libraries. On a recent
Debian-based Linux system, this is the apt-get command to
install all of them:
sudo apt-get install git cmake gcc make luarocks libxml2-dev \
liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev
sudo apt-get install git cmake gcc make luarocks \
liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev \
libcjson-dev libiniparser-dev libexpat1-dev
# How to check out and build the Eressea server
@ -22,6 +23,7 @@ Here's how you clone and build the source on Linux or macOS:
git clone --recursive git://github.com/eressea/server.git source
cd source
git submodule update --init
s/cmake-init
s/build
If you got this far and all went well, you have built the server, and

1
cJSON

@ -1 +0,0 @@
Subproject commit 8df81fb497cc48b089a57fcdc3a9933540ebc7c9

2
clibs

@ -1 +1 @@
Subproject commit 484fbf23e34f6844f1c4e3f685bb6c53cadf5bfe
Subproject commit 61a19671c25184ffece2a2668c37e5b69e9f16a7

View file

@ -1,50 +0,0 @@
# -*- cmake -*-
# - Find BerkeleyDB
# Find the BerkeleyDB includes and library
# This module defines
# DB_INCLUDE_DIR, where to find db.h, etc.
# DB_LIBRARIES, the libraries needed to use BerkeleyDB.
# DB_FOUND, If false, do not try to use BerkeleyDB.
# also defined, but not for general use are
# DB_LIBRARY, where to find the BerkeleyDB library.
FIND_PATH(DB_INCLUDE_DIR db.h
/usr/local/include/db4
/usr/local/include
/usr/include/db4
/usr/include
)
SET(DB_NAMES ${DB_NAMES} db)
FIND_LIBRARY(DB_LIBRARY
NAMES ${DB_NAMES}
PATHS /usr/lib /usr/local/lib
)
IF (DB_LIBRARY AND DB_INCLUDE_DIR)
SET(DB_LIBRARIES ${DB_LIBRARY})
SET(DB_FOUND "YES")
ELSE (DB_LIBRARY AND DB_INCLUDE_DIR)
SET(DB_FOUND "NO")
ENDIF (DB_LIBRARY AND DB_INCLUDE_DIR)
IF (DB_FOUND)
IF (NOT DB_FIND_QUIETLY)
MESSAGE(STATUS "Found BerkeleyDB: ${DB_LIBRARIES}")
ENDIF (NOT DB_FIND_QUIETLY)
ELSE (DB_FOUND)
IF (DB_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find BerkeleyDB library")
ENDIF (DB_FIND_REQUIRED)
ENDIF (DB_FOUND)
# Deprecated declarations.
SET (NATIVE_DB_INCLUDE_PATH ${DB_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_DB_LIB_PATH ${DB_LIBRARY} PATH)
MARK_AS_ADVANCED(
DB_LIBRARY
DB_INCLUDE_DIR
)

View file

@ -0,0 +1,59 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindCJSON
-----------
.. versionadded:: 3.20
Find the cJSON libraries, v3
IMPORTED targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` target:
``DaveGamble::CJSON``
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables if found:
``CJSON_INCLUDE_DIRS``
where to find sqlite3.h, etc.
``CJSON_LIBRARIES``
the libraries to link against to use CJSON.
``CJSON_VERSION``
version of the CJSON library found
``CJSON_FOUND``
TRUE if found
#]=======================================================================]
# Look for the necessary header
find_path(CJSON_INCLUDE_DIR cJSON.h PATH_SUFFIXES cjson)
mark_as_advanced(CJSON_INCLUDE_DIR)
# Look for the necessary library
find_library(CJSON_LIBRARY cjson)
mark_as_advanced(CJSON_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CJSON
REQUIRED_VARS CJSON_INCLUDE_DIR CJSON_LIBRARY
VERSION_VAR CJSON_VERSION)
# Create the imported target
if(CJSON_FOUND)
set(CJSON_INCLUDE_DIRS ${CJSON_INCLUDE_DIR})
set(CJSON_LIBRARIES ${CJSON_LIBRARY})
if(NOT TARGET DaveGamble::CJSON)
add_library(DaveGamble::CJSON UNKNOWN IMPORTED)
set_target_properties(DaveGamble::CJSON PROPERTIES
IMPORTED_LOCATION "${CJSON_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${CJSON_INCLUDE_DIR}")
endif()
endif()

View file

@ -0,0 +1,59 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindIniParser
-----------
.. versionadded:: 3.20
Find the IniParser libraries, v3
IMPORTED targets
^^^^^^^^^^^^^^^^
This module defines the following :prop_tgt:`IMPORTED` target:
``Devillard::IniParser``
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables if found:
``IniParser_INCLUDE_DIRS``
where to find sqlite3.h, etc.
``IniParser_LIBRARIES``
the libraries to link against to use IniParser.
``IniParser_VERSION``
version of the IniParser library found
``IniParser_FOUND``
TRUE if found
#]=======================================================================]
# Look for the necessary header
find_path(IniParser_INCLUDE_DIR iniparser.h PATH_SUFFIXES iniparser)
mark_as_advanced(IniParser_INCLUDE_DIR)
# Look for the necessary library
find_library(IniParser_LIBRARY iniparser)
mark_as_advanced(IniParser_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(IniParser
REQUIRED_VARS IniParser_INCLUDE_DIR IniParser_LIBRARY
VERSION_VAR IniParser_VERSION)
# Create the imported target
if(IniParser_FOUND)
set(IniParser_INCLUDE_DIRS ${IniParser_INCLUDE_DIR})
set(IniParser_LIBRARIES ${IniParser_LIBRARY})
if(NOT TARGET Devillard::IniParser)
add_library(Devillard::IniParser UNKNOWN IMPORTED)
set_target_properties(Devillard::IniParser PROPERTIES
IMPORTED_LOCATION "${IniParser_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${IniParser_INCLUDE_DIR}")
endif()
endif()

View file

@ -1,47 +0,0 @@
# - Try to find readline include dirs and libraries
#
# Usage of this module as follows:
#
# find_package(Readline)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# READLINE_ROOT_DIR Set this variable to the root installation of
# readline if the module has problems finding the
# proper installation path.
#
# Variables defined by this module:
#
# READLINE_FOUND System has readline, include and lib dirs found
# READLINE_INCLUDE_DIR The readline include directories.
# READLINE_LIBRARY The readline library.
find_path(READLINE_ROOT_DIR
NAMES include/readline/readline.h
)
find_path(READLINE_INCLUDE_DIR
NAMES readline/readline.h
HINTS ${READLINE_ROOT_DIR}/include
)
find_library(READLINE_LIBRARY
NAMES readline
HINTS ${READLINE_ROOT_DIR}/lib
)
if(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND Ncurses_LIBRARY)
set(READLINE_FOUND TRUE)
else(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND Ncurses_LIBRARY)
FIND_LIBRARY(READLINE_LIBRARY NAMES readline)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG READLINE_INCLUDE_DIR READLINE_LIBRARY )
MARK_AS_ADVANCED(READLINE_INCLUDE_DIR READLINE_LIBRARY)
endif(READLINE_INCLUDE_DIR AND READLINE_LIBRARY AND Ncurses_LIBRARY)
mark_as_advanced(
READLINE_ROOT_DIR
READLINE_INCLUDE_DIR
READLINE_LIBRARY
)

View file

@ -1,63 +1,69 @@
# - Try to find the SQLite3 library
# Once done this will define
#
# SQLITE3_FOUND - System has SQLite3
# SQLITE3_INCLUDE_DIR - The SQLite3 include directory
# SQLITE3_LIBRARIES - The libraries needed to use SQLite3
# SQLITE3_DEFINITIONS - Compiler switches required for using SQLite3
# SQLITE3_EXECUTABLE - The SQLite3 command line shell
# SQLITE3_VERSION_STRING - the version of SQLite3 found (since CMake 2.8.8)
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
#[=======================================================================[.rst:
FindSQLite3
-----------
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
find_package(PkgConfig QUIET)
PKG_CHECK_MODULES(PC_SQLITE QUIET sqlite3)
set(SQLITE3_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER})
.. versionadded:: 3.14
find_path(SQLITE3_INCLUDE_DIR NAMES sqlite3.h
HINTS
${PC_SQLITE_INCLUDEDIR}
${PC_SQLITE_INCLUDE_DIRS}
)
Find the SQLite libraries, v3
find_library(SQLITE3_LIBRARIES NAMES sqlite3
HINTS
${PC_SQLITE_LIBDIR}
${PC_SQLITE_LIBRARY_DIRS}
)
IMPORTED targets
^^^^^^^^^^^^^^^^
find_program(SQLITE3_EXECUTABLE sqlite3)
This module defines the following :prop_tgt:`IMPORTED` target:
if(PC_SQLITE_VERSION)
set(SQLITE3_VERSION_STRING ${PC_SQLITE_VERSION})
elseif(SQLITE3_INCLUDE_DIR AND EXISTS "${SQLITE3_INCLUDE_DIR}/sqlite3.h")
file(STRINGS "${SQLITE3_INCLUDE_DIR}/sqlite3.h" sqlite3_version_str
REGEX "^#define[\t ]+SQLITE_VERSION[\t ]+\".*\"")
``SQLite::SQLite3``
string(REGEX REPLACE "^#define[\t ]+SQLITE_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
SQLITE3_VERSION_STRING "${sqlite3_version_str}")
unset(sqlite3_version_str)
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables if found:
``SQLite3_INCLUDE_DIRS``
where to find sqlite3.h, etc.
``SQLite3_LIBRARIES``
the libraries to link against to use SQLite3.
``SQLite3_VERSION``
version of the SQLite3 library found
``SQLite3_FOUND``
TRUE if found
#]=======================================================================]
# Look for the necessary header
find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h)
mark_as_advanced(SQLite3_INCLUDE_DIR)
# Look for the necessary library
find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite)
mark_as_advanced(SQLite3_LIBRARY)
# Extract version information from the header file
if(SQLite3_INCLUDE_DIR)
file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line
REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
LIMIT_COUNT 1)
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
SQLite3_VERSION "${_ver_line}")
unset(_ver_line)
endif()
# handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SQLite3
REQUIRED_VARS SQLITE3_LIBRARIES SQLITE3_INCLUDE_DIR
VERSION_VAR SQLITE3_VERSION_STRING)
find_package_handle_standard_args(SQLite3
REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
VERSION_VAR SQLite3_VERSION)
# Create the imported target
if(SQLite3_FOUND)
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
if(NOT TARGET SQLite::SQLite3)
add_library(SQLite::SQLite3 UNKNOWN IMPORTED)
set_target_properties(SQLite::SQLite3 PROPERTIES
IMPORTED_LOCATION "${SQLite3_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}")
endif()
endif()
mark_as_advanced(SQLITE3_INCLUDE_DIR SQLITE3_LIBRARIES SQLITE3_EXECUTABLE)

View file

@ -59,7 +59,7 @@ elseif(TOLUA_INCLUDE_DIR AND EXISTS "${TOLUA_INCLUDE_DIR}/tolua.h")
TOLUA_VERSION_STRING "${tolua_version_str}")
unset(tolua_version_str)
else(PC_TOLUA_VERSION)
message(ERROR "TOLUA_VERSION_STRING cannot be determined")
message ("TOLUA_VERSION_STRING cannot be determined")
endif(PC_TOLUA_VERSION)
# handle the QUIETLY and REQUIRED arguments and set TOLUA_FOUND to TRUE if

View file

@ -1,19 +0,0 @@
MACRO (MSVC_CRT_SECURE_NO_WARNINGS)
IF (MSVC)
FOREACH (target ${ARGN})
SET_TARGET_PROPERTIES (${target} PROPERTIES
COMPILE_DEFINITIONS _CRT_SECURE_NO_WARNINGS
)
ENDFOREACH (target)
ENDIF (MSVC)
ENDMACRO (MSVC_CRT_SECURE_NO_WARNINGS)
MACRO (MSVC_SET_WARNING_LEVEL level)
IF (MSVC)
IF(CMAKE_C_FLAGS MATCHES "/W[0-4]")
STRING(REGEX REPLACE "/W[0-4]" "/W${level}" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W${level}")
ENDIF()
ENDIF(MSVC)
ENDMACRO (MSVC_SET_WARNING_LEVEL)

View file

@ -1,16 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE catalog
PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI
uriStartString="config://core/"
rewritePrefix="../../res/core/" />
<rewriteURI
uriStartString="config://game/"
rewritePrefix="../../res/eressea/" />
<rewriteURI
uriStartString="config://default/"
rewritePrefix="../../res/" />
</catalog>

View file

@ -1,63 +1,63 @@
{
"include": [
"config://conf/keywords.json",
"config://conf/calendar.json",
"config://conf/prefixes.json",
"config://conf/e2/locales.json",
"config://conf/e2/terrains.json",
"config://conf/e2/items.json",
"config://res/core/ships.xml",
"config://res/core/common/buildings.xml",
"config://res/eressea/buildings.xml",
"config://res/buildings/castle.xml",
"config://res/eressea/races.xml",
"config://res/eressea/artrewards.xml",
"config://res/eressea/spells.xml",
"config://res/eressea/spellbooks/gray.xml",
"config://res/eressea/spellbooks/gwyrrd.xml",
"config://res/eressea/spellbooks/draig.xml",
"config://res/eressea/spellbooks/illaun.xml",
"config://res/eressea/spellbooks/cerddor.xml",
"config://res/eressea/spellbooks/tybied.xml"
],
"disabled": [
"jsreport"
],
"settings": {
"game.name" : "Eressea",
"game.mailcmd" : "ERESSEA",
"game.id" : 2,
"orders.default": "work",
"NewbieImmunity": 8,
"modules.market": false,
"modules.astralspace": true,
"modules.wormhole": true,
"modules.iceberg": true,
"modules.volcano": true,
"monsters.spawn.chance": 50,
"entertain.base": 0,
"entertain.perlevel": 20,
"taxing.perlevel": 20,
"nmr.timeout": 5,
"nmr.removenewbie": false,
"GiveRestriction": 3,
"hunger.long": false,
"hunger.damage": "1d8+6",
"init_spells": 0,
"game.era": 2,
"game.start": 184,
"rules.reserve.twophase": true,
"rules.give.max_men": -1,
"rules.check_overload": false,
"rules.limit.faction": 2500,
"rules.maxskills.magic": 5,
"rules.guard.base_stop_prob": 0.30,
"rules.guard.skill_stop_prob": 0.05,
"rules.guard.amulet_stop_prob": 0.10,
"rules.guard.guard_number_stop_prob": 0.001,
"rules.guard.castle_stop_prob": 0.05,
"rules.guard.region_type_stop_prob": 0.05,
"rules.economy.repopulate_maximum": 500,
"rules.lighthouse.unit_capacity": true
}
"settings": {
"game.name": "Eressea",
"game.mailcmd": "ERESSEA",
"game.id": 2,
"orders.default": "work",
"NewbieImmunity": 8,
"modules.market": false,
"modules.astralspace": true,
"modules.wormhole": true,
"modules.iceberg": true,
"modules.volcano": true,
"monsters.spawn.chance": 50,
"entertain.base": 0,
"entertain.perlevel": 20,
"taxing.perlevel": 20,
"nmr.timeout": 5,
"nmr.removenewbie": false,
"GiveRestriction": 3,
"hunger.long": false,
"hunger.damage": "1d8+6",
"init_spells": 0,
"game.era": 2,
"game.start": 184,
"rules.reserve.twophase": true,
"rules.give.max_men": -1,
"rules.check_overload": false,
"rules.limit.faction": 2500,
"rules.maxskills.magic": 5,
"rules.guard.base_stop_prob": 0.30,
"rules.guard.skill_stop_prob": 0.05,
"rules.guard.amulet_stop_prob": 0.10,
"rules.guard.guard_number_stop_prob": 0.001,
"rules.guard.castle_stop_prob": 0.05,
"rules.guard.region_type_stop_prob": 0.05,
"rules.economy.repopulate_maximum": 500,
"rules.lighthouse.unit_capacity": true
},
"disabled": [
"jsreport"
],
"include": [
"config://conf/keywords.json",
"config://conf/calendar.json",
"config://conf/prefixes.json",
"config://conf/e2/locales.json",
"config://conf/e2/terrains.json",
"config://conf/e2/items.json",
"config://res/core/ships.xml",
"config://res/core/common/buildings.xml",
"config://res/eressea/buildings.xml",
"config://res/buildings/castle.xml",
"config://res/eressea/races.xml",
"config://res/eressea/artrewards.xml",
"config://res/eressea/spells.xml",
"config://res/eressea/spellbooks/gray.xml",
"config://res/eressea/spellbooks/gwyrrd.xml",
"config://res/eressea/spellbooks/draig.xml",
"config://res/eressea/spellbooks/illaun.xml",
"config://res/eressea/spellbooks/cerddor.xml",
"config://res/eressea/spellbooks/tybied.xml"
]
}

View file

@ -1,16 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE catalog
PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI
uriStartString="config://core/"
rewritePrefix="../../res/core/" />
<rewriteURI
uriStartString="config://game/"
rewritePrefix="../../res/e3a/" />
<rewriteURI
uriStartString="config://default/"
rewritePrefix="../../res/" />
</catalog>

View file

@ -67,7 +67,6 @@
"init_spells": 0,
"recruit.allow_merge": true,
"study.expensivemigrants": true,
"study.speedup": 2,
"game.era": 3,
"game.start": 1,
"rules.reserve.twophase": true,
@ -111,6 +110,7 @@
"rules.lighthouse.unit_capacity": true,
"movement.shipspeed.skillbonus": 6,
"alliance.auto": "fight",
"alliance.restricted": "fight"
"alliance.restricted": "fight",
"resource.visibility.rule": 0
}
}

68
conf/ex/config.json Normal file
View file

@ -0,0 +1,68 @@
{
"include": [
"config://conf/keywords.json",
"config://conf/calendar.json",
"config://conf/prefixes.json",
"config://conf/e2/locales.json",
"config://conf/e2/terrains.json",
"config://conf/e2/items.json",
"config://res/core/ships.xml",
"config://res/core/common/buildings.xml",
"config://res/eressea/buildings.xml",
"config://res/buildings/castle.xml",
"config://res/eressea/races.xml",
"config://res/eressea/artrewards.xml",
"config://res/eressea/spells.xml",
"config://res/eressea/spellbooks/gray.xml",
"config://res/eressea/spellbooks/gwyrrd.xml",
"config://res/eressea/spellbooks/draig.xml",
"config://res/eressea/spellbooks/illaun.xml",
"config://res/eressea/spellbooks/cerddor.xml",
"config://res/eressea/spellbooks/tybied.xml"
],
"disabled": [
"destroy",
"steal",
"number",
"jsreport"
],
"settings": {
"game.name" : "Eressea",
"game.mailcmd" : "ERESSEA",
"game.id" : 2,
"orders.default": "work",
"NewbieImmunity": 8,
"modules.market": false,
"modules.astralspace": true,
"modules.wormhole": true,
"modules.iceberg": true,
"modules.volcano": true,
"monsters.spawn.chance": 50,
"entertain.base": 0,
"entertain.perlevel": 20,
"taxing.perlevel": 20,
"nmr.timeout": 5,
"nmr.removenewbie": false,
"GiveRestriction": 3,
"hunger.long": false,
"hunger.damage": "1d8+6",
"init_spells": 0,
"game.era": 2,
"game.start": 184,
"rules.reserve.twophase": true,
"rules.give.max_men": -1,
"rules.check_overload": false,
"rules.wage.function": 2,
"monsters.spawn.chance" : 0,
"rules.limit.faction": 2500,
"rules.maxskills.magic": 5,
"rules.guard.base_stop_prob": 0.30,
"rules.guard.skill_stop_prob": 0.05,
"rules.guard.amulet_stop_prob": 0.10,
"rules.guard.guard_number_stop_prob": 0.001,
"rules.guard.castle_stop_prob": 0.05,
"rules.guard.region_type_stop_prob": 0.05,
"rules.economy.repopulate_maximum": 500,
"rules.lighthouse.unit_capacity": true
}
}

50
conf/ex/items.json Normal file
View file

@ -0,0 +1,50 @@
{
"include": [
"config://res/core/spoils.xml",
"config://res/core/common/herbs.xml",
"config://res/core/common/items.xml",
"config://res/core/common/luxuries.xml",
"config://res/core/common/potions.xml",
"config://res/core/armor/chainmail.xml",
"config://res/core/armor/laenmail.xml",
"config://res/core/armor/laenshield.xml",
"config://res/core/armor/plate.xml",
"config://res/core/armor/rustychainmail.xml",
"config://res/core/armor/rustyshield.xml",
"config://res/core/armor/shield.xml",
"config://res/core/resources/cart.xml",
"config://res/core/resources/horse.xml",
"config://res/core/resources/hp.xml",
"config://res/core/resources/iron.xml",
"config://res/core/resources/laen.xml",
"config://res/core/resources/log.xml",
"config://res/core/resources/mallorn.xml",
"config://res/core/resources/mallornseed.xml",
"config://res/core/resources/seed.xml",
"config://res/core/resources/peasant.xml",
"config://res/core/resources/stone.xml",
"config://res/core/weapons/axe.xml",
"config://res/core/weapons/bow.xml",
"config://res/core/weapons/catapult.xml",
"config://res/core/weapons/crossbow.xml",
"config://res/core/weapons/firesword.xml",
"config://res/core/weapons/greatbow.xml",
"config://res/core/weapons/greatsword.xml",
"config://res/core/weapons/halberd.xml",
"config://res/core/weapons/laensword.xml",
"config://res/core/weapons/lance.xml",
"config://res/core/weapons/mallornbow.xml",
"config://res/core/weapons/mallorncrossbow.xml",
"config://res/core/weapons/mallornlance.xml",
"config://res/core/weapons/mallornspear.xml",
"config://res/core/weapons/runesword.xml",
"config://res/core/weapons/rustyaxe.xml",
"config://res/core/weapons/rustygreatsword.xml",
"config://res/core/weapons/rustyhalberd.xml",
"config://res/core/weapons/rustysword.xml",
"config://res/core/weapons/spear.xml",
"config://res/core/weapons/sword.xml",
"config://res/eressea/items.xml",
"config://res/adamantium.xml"
]
}

34
conf/ex/locales.json Normal file
View file

@ -0,0 +1,34 @@
{
"include": [
"config://res/translations/strings.de.po",
"config://res/translations/strings-e2.de.po",
"config://res/translations/strings.en.po",
"config://res/translations/strings-e2.en.po",
"config://res/translations/messages.de.po",
"config://res/translations/messages.en.po",
"config://res/core/messages.xml"
],
"aliases": {
"de": {
"spell::earthquake": [
"Beschwöre einen Erdelementar",
"Beschwörung eines Erdelementares"
],
"spell::goodwinds": [
"Beschwörung eines Wasserelementares",
"Beschwöre einen Wasserelementar"
],
"spell::stormwinds": [
"Beschwöre einen Sturmelementar",
"Beschwörung eines Sturmelementares"
],
"spell::summonfireelemental": [
"Beschwöre einen Hitzeelementar",
"Beschwörung eines Hitzeelementares"
]
},
"en": {
"spell::migration": "Rit of Acceptance"
}
}
}

8
conf/ex/readme.txt Normal file
View file

@ -0,0 +1,8 @@
# Änderungen gegenüber E2
- ARBEITE produziert nur genug Silber für den Unterhalt der Einheit
- NUMMER Befehl abgeschafft.
- Ebene und Hochland haben 20%, alle anderen Regionen 10% der Arbeitsplätze von E2.
- Keine Zufallsmonster
- ZERSTÖRE Befehl abgeschafft.
- BEKLAUE Befehl abgeschafft.

286
conf/ex/terrains.json Normal file
View file

@ -0,0 +1,286 @@
{
"terrains": {
"ocean": {
"size": 10,
"flags": [ "swim", "sea", "sail", "fly" ]
},
"plain": {
"size": 2000,
"herbs": [ "h0", "h1", "h2", "h3", "h4", "h5" ],
"seed": 3,
"road": 50,
"flags": [ "forest", "cavalry", "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 0.1,
"base": "5d8",
"div": "2d20+10",
"level": "2d4-1"
},
"stone": {
"chance": 0.15,
"base": "5d8",
"div": "2d30+20",
"level": "1d4"
},
"laen": {
"chance": 0.01,
"base": "1d4",
"div": "2d20+50",
"level": "1d4"
}
}
},
"swamp": {
"size": 200,
"herbs": [ "h6", "h7", "h8" ],
"seed": 2,
"road": 75,
"flags": [ "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 0.02,
"base": "5d8",
"div": "2d20+10",
"level": "2d4-1"
},
"stone": {
"chance": 0.02,
"base": "5d8",
"div": "2d30+20",
"level": "1d4"
},
"laen": {
"chance": 0.02,
"base": "1d4",
"div": "2d20+50",
"level": "1d4"
}
}
},
"desert": {
"size": 50,
"herbs": [ "h9", "h10", "h11" ],
"seed": 2,
"road": 100,
"flags": [ "land", "walk", "sail", "fly", "cavalry" ],
"production": {
"iron": {
"chance": 0.15,
"base": "5d8",
"div": "2d20+10",
"level": "2d4-1"
},
"stone": {
"chance": 0.25,
"base": "5d8",
"div": "2d30+20",
"level": "1d4"
},
"laen": {
"chance": 0.025,
"base": "1d4",
"div": "2d20+50",
"level": "1d4"
}
}
},
"highland": {
"size": 800,
"herbs": [ "h12", "h13", "h14" ],
"seed": 2,
"road": 100,
"flags": [ "land", "walk", "sail", "fly", "cavalry" ],
"production": {
"iron": {
"chance": 0.15,
"base": "5d8",
"div": "2d20+10",
"level": "2d4-1"
},
"stone": {
"chance": 0.25,
"base": "5d8",
"div": "2d30+20",
"level": "1d4"
},
"laen": {
"chance": 0.025,
"base": "1d4",
"div": "2d20+50",
"level": "1d4"
}
}
},
"mountain": {
"size": 100,
"herbs": [ "h15", "h16", "h17" ],
"seed": 2,
"road": 250,
"flags": [ "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 1.0,
"base": "50",
"div": "50",
"level": "1"
},
"stone": {
"chance": 1.0,
"base": "100",
"div": "100",
"level": "1"
},
"laen": {
"chance": 0.05,
"base": "4",
"div": "100",
"level": "1"
}
}
},
"glacier": {
"size": 10,
"herbs": [ "h18", "h19", "h20" ],
"seed": 2,
"road": 250,
"flags": [ "arctic", "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 1.0,
"base": "3",
"div": "50",
"level": "1"
},
"stone": {
"chance": 1.0,
"base": "2",
"div": "100",
"level": "1"
},
"laen": {
"chance": 0.05,
"base": "4",
"div": "100",
"level": "1"
}
}
},
"iceberg": {
"size": 10,
"herbs": [ "h18", "h19", "h20" ],
"flags": [ "arctic", "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 0.9,
"base": "3",
"div": "50",
"level": "1"
},
"stone": {
"chance": 0.9,
"base": "2",
"div": "100",
"level": "1"
}
}
},
"iceberg_sleep": {
"size": 10,
"herbs": [ "h18", "h19", "h20" ],
"flags": [ "arctic", "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 0.9,
"base": "3",
"div": "50",
"level": "1"
},
"stone": {
"chance": 0.9,
"base": "2",
"div": "100",
"level": "1"
},
"laen": {
"chance": 0.05,
"base": "4",
"div": "100",
"level": "1"
}
}
},
"firewall": {
"flags": [ "forbidden" ]
},
"fog": {
"flags": [ "walk", "fly" ]
},
"thickfog": {
"flags": [ "forbidden" ]
},
"volcano": {
"size": 50,
"road": 250,
"seed": 1,
"flags": [ "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 0.5,
"level": "1",
"base": "50",
"div": "50"
},
"stone": {
"chance": 0.5,
"level": "1",
"base": "100",
"div": "100"
},
"laen": {
"chance": 0.075,
"level": "1",
"base": "4",
"div": "100"
}
}
},
"activevolcano": {
"size": 50,
"road": 250,
"flags": [ "land", "walk", "sail", "fly" ],
"production": {
"iron": {
"chance": 0.5,
"level": "1",
"base": "50",
"div": "50"
},
"stone": {
"chance": 0.5,
"level": "1",
"base": "100",
"div": "100"
},
"laen": {
"chance": 0.075,
"level": "1",
"base": "4",
"div": "100"
}
}
},
"hell": {
"flags": [ "walk" ]
},
"hall1": {
"flags": [ "land", "walk", "sail" ]
},
"corridor1": {
"flags": [ "land", "walk", "sail" ]
},
"wall1": {
"flags": [ "forbidden", "land" ]
}
}
}

View file

@ -1,11 +1,11 @@
{
"keywords": {
"en" : {
"plant": "PLANT",
"grow": [ "GROW", "BREED" ],
"promote": ["PROMOTE", "PROMOTION" ],
"locale": ["LANGUAGE", "LOCALE"],
"combat": [ "COMBAT", "FIGHT" ]
"plant": "PLANT",
"grow": [ "GROW", "BREED" ],
"promote": ["PROMOTE", "PROMOTION" ],
"locale": ["LANGUAGE", "LOCALE"],
"combat": [ "COMBAT", "FIGHT" ]
},
"de": {
"//" : "//",
@ -36,6 +36,7 @@
"maketemp": ["MACHE TEMP", "MACHETEMP"],
"move" : "NACH",
"password" : "PASSWORT",
"expel" : "VERTREIBE",
"loot" : ["PLÜNDERE", "PLÜNDERN"],
"recruit": ["REKRUTIERE", "REKRUTIEREN"],
"reserve": ["RESERVIERE", "RESERVIEREN"],

@ -1 +0,0 @@
Subproject commit f1446c47ca1774ae84bf86a28502e91daf6b421a

File diff suppressed because it is too large Load diff

@ -1 +0,0 @@
Subproject commit 31d42782e2713591da4c1a7db1aca4937137e352

View file

@ -1,6 +1,6 @@
install(PROGRAMS create-orders backup-eressea run-turn send-zip-report
send-bz2-report compress.py compress.sh epasswd.py orders-process
process-orders.py accept-orders.py getemail.py checkpasswd.py
send-bz2-report compress.py compress.sh epasswd.py
accept-orders.py getemail.py checkpasswd.py
sendreport.sh sendreports.sh orders-accept DESTINATION bin)
install(DIRECTORY cron/ DESTINATION bin USE_SOURCE_PERMISSIONS

View file

@ -327,11 +327,6 @@ def accept(game, locale, stream, extend=None):
print text_ok, fail, email
print filename
if not fail:
queue = open(gamedir + "/orders.queue", "a")
queue.write("email=%s file=%s locale=%s game=%s\n" % (email, filename, locale, game))
queue.close()
logger.info("done - accepted orders from " + email)
return 0

View file

@ -10,7 +10,6 @@ fi
cd "$ERESSEA/game-$GAME" || exit
lockfile -r3 -l120 orders.queue.lock
if [ -d "orders.dir.$TURN" ]; then
echo "orders.dir.$TURN already exists"
exit
@ -25,5 +24,3 @@ cd .. || exit
mv orders.dir "orders.dir.$TURN"
mkdir -p orders.dir
rm -f orders.queue.lock

View file

@ -4,6 +4,8 @@
[ -z "${ERESSEA}" ] && ERESSEA="$HOME/eressea"
eval "$(luarocks path)"
export LUA_PATH="${ERESSEA}/git/scripts/?.lua;$LUA_PATH"
branch="develop"
if [ -e "${ERESSEA}/build/.preview" ]; then
branch=$(cat "${ERESSEA}/build/.preview")

View file

@ -1,12 +1,13 @@
#!/bin/bash
eval "$(luarocks path)"
GAME=$1
(
[ "$ENABLED" == "no" ] && exit
[ -z "$ERESSEA" ] && ERESSEA="$HOME/eressea"
export ERESSEA
eval "$(luarocks path)"
export LUA_PATH="${ERESSEA}/server/scripts/?.lua;$LUA_PATH"
BIN="$ERESSEA/server/bin"
TURN=$(cat "$ERESSEA/game-$GAME/turn")
if [ ! -e "$ERESSEA/game-$GAME/data/$TURN.dat" ]; then
@ -46,6 +47,11 @@ if [ ! -s "$ERESSEA/game-$GAME/data/$TURN.dat" ]; then
echo "server did not create data for turn $TURN in game $GAME"
exit 3
fi
if [ ! -f "express-$TURN.txt" ]; then
if [ -f express.txt ]; then
mv express.txt "express-$TURN.txt"
fi
fi
echo "sending reports for game $GAME, turn $TURN"
"$BIN/compress.sh" "$GAME" "$TURN"
"$BIN/sendreports.sh" "$GAME"

View file

@ -8,14 +8,9 @@ lang="$2"
SCRIPT=$(readlink -f "$0")
BIN=$(dirname "$SCRIPT")
LOCKFILE="$ERESSEA/game-$game/orders.queue.lock"
set -e
trap 'rm -f "$LOCKFILE"' EXIT
cd "$ERESSEA/game-$game"
mkdir -p orders.dir
cd orders.dir
lockfile -r3 -l120 "$LOCKFILE"
eval "$(python "$BIN/accept-orders.py" "$@")"
if [ -e "$ACCEPT_FILE" ]
then

View file

@ -1,8 +0,0 @@
#!/bin/sh
SCRIPT=$(readlink -f "$0")
SCRDIR=$(dirname "$SCRIPT")
cd "$SCRDIR" || exit
lockfile -r3 -l120 orders.queue.lock
python process-orders.py "$@"
rm -f orders.queue.lock

View file

@ -1,187 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os import unlink, symlink, rename, popen, tmpfile
import sys
import os
import os.path
import ConfigParser
import subprocess
from re import compile, IGNORECASE
from string import split, join, upper, strip
from sys import argv, exit
from time import sleep, time, ctime
from syslog import openlog, closelog, syslog
from epasswd import EPasswd
def pwd_get_email(faction, pwd, pwdfile=None):
return None
def split_filename(filename):
return os.path.split(filename)
messages = {
"subject-de": "Befehle angekommen",
"subject-en": "orders received",
"validate-en": "Validating",
"validate-de": "Verarbeite",
"noorders-en": "The email contained no recognizable orders.",
"noorders-de": "Es konnten keine Befehle gefunden werden.",
"faction-en": "Faction",
"faction-de": "Partei",
"unknown-de": "WARNUNG: Die Partei ist nicht bekannt, oder das Passwort falsch!",
"unknown-en": "WARNING: This faction is unknown, or the password is incorrect!",
"warning-de": "Warnung",
"warning-en": "Warning",
"error-de": "Fehler",
"error-en": "Error",
}
game = int(sys.argv[1])
echeck_cmd = "/home/eressea/echeck/echeck.sh"
maxlines = 25
# base directory for all your games:
install_dir = "/home/eressea/eressea"
if 'ERESSEA' in os.environ:
install_dir = os.environ['ERESSEA']
elif 'HOME' in os.environ:
install_dir = os.path.join(os.environ['HOME'], 'eressea')
if not os.path.isdir(install_dir):
print "please set the ERESSEA environment variable to the install path"
sys.exit(1)
game_dir = os.path.join(install_dir, "game-%d" % (game, ))
gamename = 'Eressea'
inifile = os.path.join(game_dir, 'eressea.ini')
queue_file = os.path.join(game_dir, "orders.queue")
if not os.path.exists(queue_file):
exit(0)
# regular expression that finds the start of a faction
fact_re = compile("^\s*(eressea|partei|faction)\s+([a-zA-Z0-9]+)\s+\"?([^\"]*)\"?", IGNORECASE)
def check_pwd(filename, email, pw_data):
results = []
try:
file = open(filename, "r")
except:
print "could not open file", filename
return results
for line in file.readlines():
mo = fact_re.search(strip(line))
if mo != None:
fact_nr = str(mo.group(2))
fact_pw = str(mo.group(3))
if pw_data.fac_exists(fact_nr):
if not pw_data.check(fact_nr, fact_pw):
game_email = pw_data.get_email(fact_nr)
results = results + [ (fact_nr, game_email, False, fact_pw) ]
else:
game_email = pw_data.get_email(fact_nr)
results = results + [ (fact_nr, game_email, True, fact_pw) ]
else:
results = results + [ (fact_nr, None, False, fact_pw) ]
return results
def echeck(filename, locale, rules):
dirname, filename = split_filename(filename)
stream = popen("%s %s %s %s %s" % (echeck_cmd, locale, filename, dirname, rules), 'r')
lines = stream.readlines()
if len(lines)==0:
stream.close()
return None
if len(lines)>maxlines:
mail = join(lines[:maxlines-3] + ["...", "\n"] + lines[-3:], '')
else:
mail = join(lines[:maxlines], '')
stream.close()
return mail
#print "reading password file..."
pw_data = EPasswd()
try:
pw_data.load_database(os.path.join(game_dir, "eressea.db"))
except:
pw_data.load_file(os.path.join(game_dir, "passwd"))
#print "reading orders.queue..."
# move the queue file to a safe space while locking it:
queuefile = open(queue_file, "r")
lines = queuefile.readlines()
queuefile.close()
# copy to a temp file
tname="/tmp/orders.queue.%s" % str(time())
tmpfile=open(tname, "w")
for line in lines:
tmpfile.write(line)
tmpfile.close()
openlog("orders")
unlink(queue_file)
for line in lines:
tokens = split(line[:-1], ' ')
dict = {}
for token in tokens:
name, value = split(token, '=')
dict[name] = value
email = dict["email"]
locale = dict["locale"]
game = int(dict["game"])
infile = dict["file"]
gamename='[E%d]' % game
rules='e%d' % game
warning = ""
failed = True
results = check_pwd(infile, email, pw_data)
logfile = open(os.path.join(game_dir, "zug.log"), "a")
dirname, filename = split_filename(infile)
msg = messages["validate-"+locale] + " " + infile + "\n\n"
if len(results)==0:
msg = msg + messages["noorders-"+locale]
for faction, game_email, success, pwd in results:
msg = msg + messages["faction-"+locale] + " " + faction + "\n"
if success: failed = False
else: msg = msg + messages["unknown-"+locale] + "\n"
msg = msg + "\n"
logfile.write("%s:%s:%s:%s:%s\n" % (ctime(time()), email, game_email, faction, success))
logfile.close()
if failed:
warning = " (" + messages["warning-" + locale] + ")"
syslog("failed - no valid password in " + infile)
else:
result = None
if os.path.exists(echeck_cmd):
result = echeck(infile, locale, rules)
if result is None:
# echeck did not finish
msg = msg + "Echeck is broken. Your turn was accepted, but could not be verified.\n"
warning = " (" + messages["warning-" + locale] + ")"
syslog("process - echeck broken, " + infile)
else:
msg = msg + result
syslog("process - checked orders in " + infile)
subject = gamename + " " + messages["subject-" + locale] + warning
try:
sp = subprocess.Popen(['mutt', '-s', subject, email], stdin=subprocess.PIPE)
sp.communicate(msg)
except:
syslog("failed - cannot send to " + email)
closelog()
unlink(tname)

View file

@ -16,7 +16,7 @@
<requirement type="adamantium" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" magical="true" skill="melee" offmod="2" defmod="-2" magres="0.30">
<weapon cut="true" magical="true" skill="melee" offmod="2" defmod="-2" magres="0.3">
<damage type="rider" value="3d4+15"/>
<damage type="footman" value="3d4+15"/>
</weapon>
@ -28,7 +28,7 @@
<construction skill="armorer" minskill="10">
<requirement type="adamantium" quantity="3"/>
</construction>
<armor ac="7" penalty="0.1"/>
<armor ac="7" penalty="0.1" magres="0.3"/>
</item>
</resource>

View file

@ -1181,6 +1181,18 @@
<arg name="dir" type="direction"/>
</type>
</message>
<message name="ship_drift_overload" section="events">
<type>
<arg name="ship" type="ship"/>
<arg name="dir" type="direction"/>
</type>
</message>
<message name="ship_drift_nocrew" section="events">
<type>
<arg name="ship" type="ship"/>
<arg name="dir" type="direction"/>
</type>
</message>
<message name="iceberg_drift" section="events">
<type>
<arg name="region" type="region"/>
@ -2216,6 +2228,18 @@
<arg name="unit" type="unit"/>
</type>
</message>
<message name="followdetect_ship" section="movement">
<type>
<arg name="follower" type="ship"/>
<arg name="ship" type="ship"/>
</type>
</message>
<message name="followfail_ship" section="movement">
<type>
<arg name="follower" type="ship"/>
<arg name="ship" type="ship"/>
</type>
</message>
<message name="moveblocked" section="errors">
<type>
<arg name="unit" type="unit"/>
@ -3783,13 +3807,6 @@
<arg name="command" type="order"/>
</type>
</message>
<message name="error185" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
</message>
<message name="error187" section="errors">
<type>
<arg name="unit" type="unit"/>
@ -4518,13 +4535,6 @@
<arg name="command" type="order"/>
</type>
</message>
<message name="error125" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
</message>
<message name="error84" section="errors">
<type>
<arg name="unit" type="unit"/>
@ -4715,6 +4725,13 @@
<arg name="command" type="order"/>
</type>
</message>
<message name="feedback_not_inside" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
</message>
<message name="feedback_unit_not_found" section="errors">
<type>
<arg name="unit" type="unit"/>
@ -5463,6 +5480,8 @@
<arg name="turns" type="int"/>
</type>
</message>
<message name="newbieimmunityending" section="nr" />
<message name="newbieimmunityended" section="nr" />
<message name="alliance::kickedout" section="events">
<type>
<arg name="votes" type="int"/>

View file

@ -5,7 +5,7 @@
<!-- begin main races -->
<race name="template" maintenance="0" magres="100" maxaura="0" regaura="0" weight="0" capacity="1000" speed="10.0" hp="10" damage="1d4" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" fly="yes" swim="yes" walk="yes" shapeshift="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" recruitunlimited="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<attack type="1" damage="1d4"/>
</race>
<race name="lynx" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.0" hp="20" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="5" walk="yes" teach="no" getitem="yes">
@ -32,7 +32,7 @@
</race>
<race name="human" maxaura="1" regaura="1" recruitcost="100" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<param name="other_race" value="elf"/>
<skill name="riding" modifier="+1"/>
<skill name="shipcraft" modifier="2"/>
@ -45,7 +45,7 @@
</race>
<race name="orc" studyspeed="-5" magres="-5" maxaura="1" regaura="1" recruitcost="100" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<param name="other_race" value="troll"/>
<skill name="bow" speed="+5"/>
@ -76,7 +76,7 @@
capacity="540" speed="1.0" hp="20" damage="1d5" unarmedattack="-2"
unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes"
giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<param name="other_race" value="dwarf"/>
<param name="luxury_trade" value="600"/>
<skill name="bow" modifier="-1"/>
@ -102,7 +102,7 @@
<!-- begin secondary races -->
<race name="demon" magres="15" maxaura="1" regaura="1.1" recruitcost="360" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="30" ac="2" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="cartmaking" modifier="-2"/>
<skill name="forestry" modifier="1"/>
<skill name="melee" modifier="1"/>
@ -125,7 +125,7 @@
speed="1.0" hp="20" damage="1d5" unarmedattack="-2"
unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes"
giveunit="yes" getitem="yes" equipment="yes" >
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="armorer" modifier="-1"/>
<skill name="bow" modifier="2"/>
<skill name="building" modifier="-1"/>
@ -143,7 +143,7 @@
</race>
<race name="troll" magres="10" maxaura="1" regaura="1" recruitcost="260" maintenance="10" weight="2000" capacity="1080" speed="1.0" hp="20" ac="1" damage="1d5+3" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<param name="armor.stamina" value="4"/> <!-- +1 natural armor per X levels stamina -->
<skill name="armorer" modifier="2"/>
<skill name="bow" modifier="-2"/>
@ -169,7 +169,7 @@
speed="1.0" hp="20" damage="1d5" unarmedattack="-2"
unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes"
giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="armorer" modifier="2"/>
<skill name="bow" modifier="-1"/>
<skill name="building" modifier="2"/>
@ -598,13 +598,13 @@
<attack type="1" damage="1d6"/>
</race>
<race name="braineater" magres="90" maxaura="1.0" regaura="1.0" weight="100" capacity="540" speed="1.0" hp="20" damage="0d0" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="10" fly="yes" walk="yes" teach="no" invinciblenonmagic="yes">
<ai splitsize="500" scarepeasants="yes" killpeasants="yes" moverandom="yes" learn="yes"/>
<ai splitsize="500" scarepeasants="yes" killpeasants="yes" moverandom="yes"/>
<attack type="2" damage="3d15"/>
<attack type="3" damage="1d1"/>
<attack type="4" damage="1d1"/>
</race>
<race name="toad" magres="20" maxaura="1" regaura="1" maintenance="10" weight="100" capacity="540" speed="1.0" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes">
<ai splitsize="1" learn="yes"/>
<race name="toad" magres="20" maxaura="1" regaura="1" maintenance="10" weight="100" capacity="540" speed="1.0" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes" learn="no">
<ai splitsize="1"/>
<skill name="crossbow" modifier="-10"/>
<skill name="mining" modifier="-10"/>
<skill name="bow" modifier="-10"/>
@ -627,8 +627,8 @@
<skill name="stamina" modifier="-10"/>
<attack type="4" damage="1d2"/>
</race>
<race name="smurf" weight="1000" capacity="540" speed="1.0" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes">
<ai splitsize="1" learn="yes"/>
<race name="smurf" weight="1000" capacity="540" speed="1.0" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes" learn="no">
<ai splitsize="1"/>
<skill name="crossbow" modifier="-10"/>
<skill name="mining" modifier="-10"/>
<skill name="bow" modifier="-10"/>
@ -656,13 +656,13 @@
<attack type="4" damage="2d40"/>
</race>
<race name="shadowmaster" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.0" regaura="2.0" weight="500" capacity="540" speed="1.0" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" walk="yes" teach="no" desert="yes">
<ai splitsize="50" scarepeasants="yes" killpeasants="yes" moverandom="yes" learn="yes"/>
<ai splitsize="50" scarepeasants="yes" killpeasants="yes" moverandom="yes"/>
<attack type="4" damage="2d4"/>
<attack type="2" damage="2d30"/>
<attack type="3" damage="1d2"/>
</race>
<race name="shadowdemon" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" walk="yes" teach="no" desert="yes" recruitethereal="yes">
<ai splitsize="1000" scarepeasants="yes" killpeasants="yes" moverandom="yes" learn="yes"/>
<ai splitsize="1000" scarepeasants="yes" killpeasants="yes" moverandom="yes"/>
<attack type="4" damage="2d3"/>
<attack type="3" damage="1d1"/>
</race>
@ -684,14 +684,14 @@
</race>
<race name="dracoid" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" walk="yes" teach="no" giveperson="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
<attack type="1" damage="1d5"/>
</race>
<race name="ent" magres="25" maxaura="1.0" regaura="0.5" weight="5000" capacity="2500" speed="1.0" hp="50" ac="4" damage="2d4+12" unarmedattack="0" unarmeddefense="0" attackmodifier="9" defensemodifier="7" walk="yes" teach="no">
<ai splitsize="1000" moverandom="yes" learn="yes" scarepeasants="yes"/>
<ai splitsize="1000" moverandom="yes" scarepeasants="yes"/>
<attack type="4" damage="2d12"/>
<attack type="4" damage="2d12"/>
</race>
@ -732,7 +732,7 @@
<attack type="1" damage="0d0"/>
</race>
<race name="ghast" magres="60" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghast" magres="60" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes" desert="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes" scarepeasants="yes" absorbpeasants="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -750,7 +750,7 @@
<attack type="2" damage="1d30"/>
</race>
<race name="ghoul" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghoul" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes" desert="yes">
<ai splitsize="10000" killpeasants="yes" scarepeasants="yes" moverandom="yes" absorbpeasants="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -783,7 +783,7 @@
<attack type="3" damage="1d1"/>
</race>
<race name="zombie" magres="20" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="zombie" magres="20" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes" desert="yes">
<ai splitsize="10000" killpeasants="yes" scarepeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -832,8 +832,9 @@
</race>
<race name="seaserpent" magres="50" maxaura="1.0" regaura="1.0" weight="20000" capacity="5000" speed="1.0" hp="600" ac="3" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" swim="yes" teach="no" getitem="yes" resistbash="yes">
<ai splitsize="6" scarepeasants="yes" killpeasants="yes" moverandom="yes" learn="yes" moveattack="yes"/>
<ai splitsize="6" scarepeasants="yes" killpeasants="yes" moverandom="yes" moveattack="yes"/>
<skill name="tactics" modifier="4"/>
<skill name="stealth" modifier="-99"/>
<attack type="4" damage="1d30"/>
<attack type="4" damage="1d30"/>
<attack type="4" damage="1d30"/>

View file

@ -436,7 +436,7 @@
<resource name="dragonblood" amount="1" cost="fixed"/><!-- Drachenblut -->
</spell>
<spell name="auratransfer" rank="1" syntax="aura" parameters="ui" ship="true">
<spell name="auratransfer" rank="1" syntax="aura" parameters="ui" noresist="true" ship="true">
<!-- Auratransfer -->
<resource name="aura" amount="1" cost="fixed"/>
</spell>
@ -528,7 +528,7 @@
<resource name="h12" amount="1" cost="fixed"/>
<resource name="h20" amount="1" cost="fixed"/>
</spell>
<spell name="sound_out" rank="5" parameters="ur" los="true">
<spell name="sound_out" rank="5" parameters="ur" noresist="true" los="true">
<resource name="aura" amount="4" cost="fixed"/>
<resource name="money" amount="100" cost="fixed"/>
</spell>
@ -595,7 +595,7 @@
<spell name="shockwave" rank="5" variable="true" combat="2">
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="eternal_walls" rank="5" parameters="b" ship="true" variable="true">
<spell name="eternal_walls" rank="5" parameters="b" ship="true">
<resource name="aura" amount="50" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>

View file

@ -1,190 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD generated by XMLSpy v2018 rel. 2 (x64) (http://www.altova.com) -->
<!ELEMENT ai EMPTY>
<!ATTLIST ai
splitsize (1 | 1000 | 10000 | 2 | 2000 | 20000 | 50 | 500 | 5000 | 6 | 9999 | 99999) #REQUIRED
moverandom CDATA #FIXED "yes"
learn CDATA #FIXED "yes"
killpeasants CDATA #FIXED "yes"
moveattack CDATA #FIXED "yes"
>
<!ELEMENT set ((item+, ((skill+, item*) | callback | subset+)?) | (skill+, ((item+, subset?) | callback | subset | spell+)?) | callback)?>
<!ATTLIST set
name (fam_direwolf | fam_dreamcat | fam_eagle | fam_fairy | fam_ghost | fam_hellcat | fam_imp | fam_lynx | fam_nymph | fam_owl | fam_rat | fam_songdragon | fam_tiger | fam_tunnelworm | fam_unicorn | i_bow | i_chain | i_plate | i_rustyshield | i_spear | i_sword | new_dracoid | new_orc | rand_bow | rand_crossbow | rand_desert | rand_forest | rand_glacier | rand_herbalist | rand_highland | rand_mountain | rand_plain | rand_rider | rand_spear | rand_swamp | rand_sword | rand_villagers | rising_undead | seed_aquarian | seed_braineater | seed_cat | seed_demon | seed_dragon | seed_dwarf | seed_elf | seed_goblin | seed_halfling | seed_human | seed_insect | seed_orc | seed_seaserpent | seed_troll | spo_dragon | spo_seaserpent | spo_wyrm | spo_youngdragon) #REQUIRED
chance (0.25 | 0.33 | 0.34) #IMPLIED
>
<!ELEMENT item (weapon?)>
<!ATTLIST item
name (axe | balm | bow | cart | chainmail | crossbow | dragonblood | dragonhead | fairyboot | horse | incense | jewel | money | myrrh | nestwarmth | oil | plate | roi | rustychainmail | rustyshield | rustysword | seaserpenthead | silk | spear | spice | stone | sword | wagon) #IMPLIED
amount CDATA #IMPLIED
notlost CDATA #FIXED "yes"
weight (0 | 1 | 100) #IMPLIED
use CDATA #FIXED "yes"
cursed (true | yes) #IMPLIED
score CDATA #FIXED "0"
>
<!ELEMENT race ((ai, ((skill+, attack+, familiar*) | (param, skill+, attack, familiar+) | attack+)) | attack+)>
<!ATTLIST race
name (aquarian | braineater | cat | catdragon | clone | demon | direwolf | dolphin | dracoid | dragon | dreamcat | dwarf | eagle | elf | ent | fairy | ghast | ghost | ghoul | giantturtle | gnome | goblin | halfling | hellcat | human | imp | insect | irongolem | juju | kraken | lynx | mountainguard | museumghost | nymph | orc | owl | peasant | rat | seaserpent | shadowdemon | shadowdragon | shadowknight | shadowmaster | skeleton | skeletonlord | smurf | snotling | snowman | songdragon | special | spell | stonegolem | template | tiger | toad | troll | tunnelworm | undead | unicorn | wolf | wyrm | youngdragon | zombie) #REQUIRED
magres (-0.050000 | -5 | 10 | 100 | 15 | 20 | 25 | 30 | 5 | 50 | 60 | 70 | 75 | 80 | 90 | 95 | 99) #IMPLIED
maxaura (0.000000 | 0.500000 | 1.000000 | 1.500000) #IMPLIED
regaura (0.000000 | 0.100000 | 0.500000 | 1.000000 | 1.250000 | 1.500000 | 2.000000 | 3.000000) #IMPLIED
weight (0 | 100 | 1000 | 10000 | 1600 | 18000 | 200 | 2000 | 20000 | 30000 | 500 | 5000 | 600) #REQUIRED
capacity (0 | 1000 | 10000 | 100000 | 1000000 | 1080 | 200 | 2000 | 2500 | 440 | 5000 | 540 | 600) #REQUIRED
equipment (no | yes) #IMPLIED
speed (0.000000 | 1.000000 | 1.500000 | 10.000000 | 2.000000) #REQUIRED
hp (1 | 10 | 1000 | 15 | 150 | 16 | 18 | 20 | 24 | 25 | 2700 | 30 | 300 | 40 | 50 | 6 | 60 | 600 | 80 | 9 | 900) #REQUIRED
ac (1 | 10 | 12 | 2 | 3 | 4 | 5 | 6 | 7 | 8) #IMPLIED
damage CDATA #REQUIRED
unarmedattack (-2 | 0 | 1 | 10 | 2 | 3 | 6) #REQUIRED
unarmeddefense (-2 | 0 | 1 | 10 | 2 | 3 | 6) #REQUIRED
attackmodifier (1 | 10 | 11 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) #IMPLIED
defensemodifier (1 | 10 | 11 | 12 | 13 | 14 | 2 | 3 | 4 | 5 | 50 | 6 | 7 | 8) #IMPLIED
fly (no | yes) #IMPLIED
walk (no | yes) #IMPLIED
canteach CDATA #FIXED "no"
getitem CDATA #FIXED "yes"
recruitcost (110 | 130 | 150 | 40 | 70 | 75 | 80 | 90) #IMPLIED
maintenance (0 | 10) #IMPLIED
playerrace (no | yes) #IMPLIED
giveperson CDATA #FIXED "yes"
giveunit CDATA #FIXED "yes"
coastal CDATA #FIXED "yes"
swim CDATA #FIXED "yes"
teach CDATA #FIXED "no"
resistpierce CDATA #FIXED "yes"
invinciblenonmagic CDATA #FIXED "yes"
scarepeasants CDATA #FIXED "yes"
unarmedguard CDATA #FIXED "yes"
cannotmove CDATA #FIXED "yes"
canlearn CDATA #FIXED "no"
noweapons CDATA #FIXED "yes"
cansail CDATA #FIXED "no"
cansteal CDATA #FIXED "no"
desert CDATA #FIXED "yes"
recruitethereal CDATA #FIXED "yes"
stonegolem CDATA #FIXED "true"
irongolem CDATA #FIXED "true"
noheal CDATA #FIXED "yes"
illusionary CDATA #FIXED "yes"
invisible CDATA #FIXED "yes"
shapeshift CDATA #FIXED "yes"
dragon CDATA #FIXED "yes"
resistbash CDATA #FIXED "yes"
undead CDATA #FIXED "yes"
shipspeed CDATA #FIXED "yes"
shapeshiftany CDATA #FIXED "yes"
recruitunlimited CDATA #FIXED "yes"
absorbpeasants CDATA #FIXED "yes"
resistcut CDATA #FIXED "yes"
noblock CDATA #FIXED "yes"
studyspeed CDATA #FIXED "-5"
>
<!ELEMENT text (#PCDATA)>
<!ATTLIST text
locale (de | en | fr) #REQUIRED
>
<!ELEMENT param EMPTY>
<!ATTLIST param
name (hunger.damage | migrants.formula | recruit_multi) #REQUIRED
value CDATA #REQUIRED
>
<!ELEMENT races (race+)>
<!ELEMENT skill EMPTY>
<!ATTLIST skill
name (alchemy | armorer | bow | building | cartmaking | catapult | crossbow | entertainment | espionage | forestry | herbalism | magic | melee | mining | perception | polearm | quarrying | riding | roadwork | sailing | shipcraft | stamina | stealth | tactics | taxation | trade | training | unarmed | weaponsmithing) #REQUIRED
level CDATA #IMPLIED
modifier (-1 | -10 | -2 | -3 | -99 | 1 | 10 | 12 | 14 | 2 | 20 | 3 | 4 | 5 | 8) #IMPLIED
>
<!ELEMENT spell (#PCDATA | resource)*>
<!ATTLIST spell
name CDATA #REQUIRED
level (1 | 12 | 2 | 3 | 4 | 5 | 6 | 7 | 8) #IMPLIED
ship CDATA #FIXED "true"
rank (1 | 2 | 3 | 4 | 5 | 7) #IMPLIED
variable CDATA #FIXED "true"
combat (1 | 2 | 3) #IMPLIED
parameters CDATA #IMPLIED
los CDATA #FIXED "true"
far CDATA #FIXED "true"
ocean CDATA #FIXED "true"
syntax (aura | buildingtype | direction | race | spellid) #IMPLIED
regiontarget (false | true) #IMPLIED
unittarget CDATA #FIXED "false"
buildingtarget CDATA #FIXED "true"
shiptarget CDATA #FIXED "true"
globaltarget CDATA #FIXED "true"
>
<!ELEMENT attack EMPTY>
<!ATTLIST attack
type (1 | 2 | 3 | 4 | 5 | 6 | 8) #REQUIRED
damage CDATA #IMPLIED
spell (aura_of_fear | drain_skills | fiery_dragonbreath | icy_dragonbreath | powerful_dragonbreath) #IMPLIED
level (12 | 3 | 6) #IMPLIED
>
<!ELEMENT damage EMPTY>
<!ATTLIST damage
type (footman | rider) #REQUIRED
value CDATA #FIXED "3d8+8"
>
<!ELEMENT spells (spell+)>
<!ELEMENT string (text+)>
<!ATTLIST string
name (adamantium | adamantium_p | adamantiumaxe | adamantiumaxe_p | adamantiumplate | adamantiumplate_p | almond | analysedream | aoc | aoc_p | apple | artacademy | aurapotion50 | aurapotion50_p | bagpipeoffear | bagpipeoffear_p | balloon | birthdaycake | birthdaycake_p | cookie | eyeofdragon | headache | jadee_dress | jadee_dress_p | jadee_ring | jadee_ring_p | lifepotion | newbie_info_cr | nut | pavilion | portal | ring | ring_of_levitation | ring_of_levitation_p | ring_p | rm_adamantium | seaserpenthead | seaserpenthead_p | seashell | seashell_p | snowball | snowman | snowman_p | stardust | temple | wente_dress | wente_dress_p | wente_ring | wente_ring_p | xmastree) #REQUIRED
>
<!ELEMENT subset (set+)>
<!ATTLIST subset
chance (0.2 | 0.3 | 0.4 | 0.6) #IMPLIED
>
<!ELEMENT weapon (damage+, modifier+)>
<!ATTLIST weapon
bash CDATA #FIXED "true"
missile CDATA #FIXED "true"
skill CDATA #FIXED "unarmed"
offmod CDATA #FIXED "0"
defmod CDATA #FIXED "0"
reload CDATA #FIXED "0"
magres CDATA #FIXED "0.0"
>
<!ELEMENT eressea (equipment+, buildings, resources, races, strings, spells)>
<!ELEMENT strings (namespace+, string+)>
<!ELEMENT building EMPTY>
<!ATTLIST building
name (artacademy | pavilion | portal | temple) #REQUIRED
maxsize (100 | 2 | 50) #REQUIRED
maxcapacity CDATA #FIXED "2"
nobuild CDATA #FIXED "yes"
nodestroy CDATA #FIXED "yes"
unique CDATA #FIXED "yes"
auraregen CDATA #FIXED "1.00"
>
<!ELEMENT callback EMPTY>
<!ATTLIST callback
name CDATA #FIXED "equip_newunits"
>
<!ELEMENT familiar EMPTY>
<!ATTLIST familiar
race (demon | dolphin | dreamcat | eagle | fairy | ghost | giantturtle | goblin | hellcat | imp | kraken | lynx | nymph | owl | rat | songdragon | tiger | tunnelworm | unicorn | wolf) #REQUIRED
default CDATA #FIXED "yes"
>
<!ELEMENT modifier EMPTY>
<!ATTLIST modifier
type (missile_target | skill) #REQUIRED
value (-90 | 100 | 2) #REQUIRED
races CDATA #FIXED "snowman"
>
<!ELEMENT resource (item?)>
<!ATTLIST resource
name (almond | aoc | aog | apple | aura | birthdaycake | cookie | dragonblood | dragonhead | eyeofdragon | h12 | h20 | h7 | hp | iron | jadee_dress | jadee_ring | laen | laensword | lebkuchenherz | lifepotion | lmsreward | log | mallorn | money | museumexitticket | museumticket | nut | oil | p10 | peasant | permaura | questkey1 | questkey2 | ring_of_levitation | seaserpenthead | seashell | snowball | snowglobe | snowman | stardust | stone | sword | toadslime | wente_dress | wente_ring | xmastree) #REQUIRED
appearance (amulet | key | ring | vial) #IMPLIED
amount (1 | 10 | 100 | 1000 | 12 | 140 | 15 | 150 | 16 | 18 | 2 | 20 | 200 | 24 | 25 | 250 | 28 | 3 | 30 | 3000 | 30000 | 35 | 350 | 4 | 40 | 4000 | 5 | 50 | 5000 | 6 | 600 | 7 | 8 | 80 | 800 | 90) #IMPLIED
cost (fixed | level) #IMPLIED
>
<!ELEMENT buildings (building+)>
<!ELEMENT equipment (set+)>
<!ELEMENT namespace (string+)>
<!ATTLIST namespace
name (describe | iteminfo | race | shipinfo | spell | spellinfo) #REQUIRED
>
<!ELEMENT resources (resource+)>

View file

@ -12,7 +12,7 @@
</race>
<race name="human" maxaura="1.0" regaura="1.0" recruitcost="75" maintenance="10" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes" migrants="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="trade" modifier="1"/>
<skill name="herbalism" modifier="-1"/>
<skill name="shipcraft" modifier="1"/>
@ -579,13 +579,13 @@
</race>
<race name="braineater" magres="90" maxaura="1.0"
regaura="1.0" weight="100" capacity="540" speed="1.0" hp="20" damage="0d0" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="10" fly="yes" walk="yes" teach="no" invinciblenonmagic="yes">
<ai splitsize="500" scarepeasants="yes" killpeasants="yes" moverandom="yes" learn="yes"/>
<ai splitsize="500" scarepeasants="yes" killpeasants="yes" moverandom="yes"/>
<attack type="2" damage="3d15"/>
<attack type="3" damage="1d1"/>
<attack type="4" damage="1d1"/>
</race>
<race name="toad" magres="20" maxaura="1" regaura="1" maintenance="10" weight="100" capacity="540" speed="1" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes">
<ai splitsize="1" learn="yes"/>
<race name="toad" magres="20" maxaura="1" regaura="1" maintenance="10" weight="100" capacity="540" speed="1" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes" learn="no">
<ai splitsize="1"/>
<skill name="alchemy" modifier="-10"/>
<skill name="crossbow" modifier="-10"/>
<skill name="mining" modifier="-10"/>
@ -616,8 +616,8 @@
<skill name="stamina" modifier="-10"/>
<attack type="4" damage="1d2"/>
</race>
<race name="smurf" weight="1000" capacity="540" speed="1" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes">
<ai splitsize="1" learn="yes"/>
<race name="smurf" weight="1000" capacity="540" speed="1" hp="10" damage="1d2" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" giveperson="yes" giveunit="yes" getitem="yes" walk="yes" learn="no">
<ai splitsize="1"/>
<skill name="alchemy" modifier="-10"/>
<skill name="crossbow" modifier="-10"/>
<skill name="mining" modifier="-10"/>
@ -653,13 +653,13 @@
<attack type="4" damage="2d40"/>
</race>
<race name="shadowmaster" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.0" regaura="2.0" weight="500" capacity="540" speed="1.0" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" walk="yes" teach="no" desert="yes">
<ai splitsize="50" scarepeasants="yes" killpeasants="yes" moverandom="yes" learn="yes"/>
<ai splitsize="50" scarepeasants="yes" killpeasants="yes" moverandom="yes"/>
<attack type="4" damage="2d4"/>
<attack type="2" damage="2d30"/>
<attack type="3" damage="1d2"/>
</race>
<race name="shadowdemon" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" walk="yes" teach="no" desert="yes" recruitethereal="yes">
<ai splitsize="1000" scarepeasants="yes" killpeasants="yes" moverandom="yes" learn="yes"/>
<ai splitsize="1000" scarepeasants="yes" killpeasants="yes" moverandom="yes"/>
<attack type="4" damage="2d3"/>
<attack type="3" damage="1d1"/>
</race>
@ -680,7 +680,7 @@
<attack type="1" damage="1d4"/>
</race>
<race name="dracoid" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" walk="yes" teach="no" giveperson="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
<attack type="1" damage="1d5"/>
@ -693,12 +693,12 @@
<attack type="4" damage="2d40"/>
</race>
<race name="ent" magres="25" maxaura="1.0" regaura="0.5" weight="5000" capacity="2500" speed="1.0" hp="50" ac="4" damage="2d4+12" unarmedattack="0" unarmeddefense="0" attackmodifier="9" defensemodifier="7" walk="yes" teach="no">
<ai splitsize="1000" moverandom="yes" learn="yes" scarepeasants="yes"/>
<ai splitsize="1000" moverandom="yes" scarepeasants="yes"/>
<attack type="4" damage="2d12"/>
<attack type="4" damage="2d12"/>
</race>
<race name="wyrm" magres="90" maxaura="1.0" regaura="3.0" weight="18000" capacity="1000000" speed="1.0" hp="2700" ac="8" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="10" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" dragon="yes" unarmedguard="yes">
<ai splitsize="1" killpeasants="yes" learn="yes" scarepeasants="yes"/>
<ai splitsize="1" killpeasants="yes" scarepeasants="yes"/>
<skill name="magic" modifier="12"/>
<skill name="tactics" modifier="12"/>
<skill name="perception" modifier="10"/>
@ -708,7 +708,7 @@
<attack type="6" spell="powerful_dragonbreath" level="12" />
</race>
<race name="dragon" magres="70" maxaura="1.0" regaura="2.0" weight="10000" capacity="1000000" speed="1.500000" hp="900" ac="6" damage="2d30" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes" dragon="yes">
<ai splitsize="2" killpeasants="yes" learn="yes" scarepeasants="yes"/>
<ai splitsize="2" killpeasants="yes" scarepeasants="yes"/>
<skill name="magic" modifier="8"/>
<skill name="tactics" modifier="8"/>
<skill name="perception" modifier="5"/>
@ -718,7 +718,7 @@
<attack type="6" spell="icy_dragonbreath" level="6" />
</race>
<race name="youngdragon" magres="50" maxaura="1.0" regaura="1.0" weight="20000" capacity="10000" speed="1.0" hp="300" ac="4" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes" dragon="yes">
<ai splitsize="6" killpeasants="yes" learn="yes" scarepeasants="yes"/>
<ai splitsize="6" killpeasants="yes" scarepeasants="yes"/>
<skill name="magic" modifier="4"/>
<skill name="tactics" modifier="4"/>
<skill name="stealth" modifier="2"/>
@ -734,7 +734,7 @@
<attack type="5"/>
</race>
<race name="aquarian" maxaura="1" regaura="1" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" shipspeed="yes" playerrace="yes" coastal="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="mining" modifier="-2"/>
<skill name="building" modifier="-1"/>
<skill name="trade" modifier="2"/>
@ -752,7 +752,7 @@
<familiar race="kraken"/>
</race>
<race name="cat" maxaura="1" regaura="1" recruitcost="90" maintenance="10" weight="1000" capacity="540" speed="1" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" defensemodifier="1" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="alchemy" modifier="-1"/>
<skill name="mining" modifier="-2"/>
<skill name="building" modifier="-1"/>
@ -777,7 +777,7 @@
<familiar race="hellcat"/>
</race>
<race name="halfling" magres="5" maxaura="1" regaura="1" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1" hp="18" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<param name="hunger_damage" value="1d10+7"/>
<skill name="crossbow" modifier="1"/>
<skill name="mining" modifier="1"/>
@ -809,7 +809,7 @@
<familiar race="rat"/>
</race>
<race name="insect" magres="5" maxaura="1" regaura="1" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1" hp="24" ac="2" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="mining" modifier="1"/>
<skill name="bow" modifier="-2"/>
@ -840,7 +840,7 @@
maintenance="10" weight="1000" capacity="540" speed="1" hp="50" ac="2" damage="1d5"
unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes"
giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="alchemy" modifier="2"/>
<skill name="trade" modifier="-3"/>
<skill name="forestry" modifier="1"/>
@ -870,7 +870,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<familiar race="imp"/>
</race>
<race name="troll" magres="10" maxaura="1" regaura="1" recruitcost="90" maintenance="10" weight="2000" capacity="1080" speed="1" hp="30" ac="1" damage="1d5+3" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="mining" modifier="2"/>
<skill name="bow" modifier="-2"/>
<skill name="building" modifier="2"/>
@ -900,7 +900,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<familiar race="wolf"/>
</race>
<race name="goblin" magres="-5" maxaura="1" regaura="1" recruitcost="40" maintenance="10" weight="600" capacity="440" speed="1" hp="16" damage="1d5" unarmedattack="-2" unarmeddefense="0" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="alchemy" modifier="1"/>
<skill name="mining" modifier="1"/>
<skill name="building" modifier="1"/>
@ -957,7 +957,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<attack type="1" damage="0d0"/>
</race>
<race name="template" maintenance="0" magres="100" maxaura="0" regaura="0" weight="0" capacity="1000" speed="10" hp="10" damage="1d4" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" fly="yes" swim="yes" walk="yes" shapeshift="yes" shapeshiftany="yes" giveperson="yes" giveunit="yes" getitem="yes" recruitethereal="yes" recruitunlimited="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<attack type="1" damage="1d4"/>
</race>
<race name="gnome" magres="100" maxaura="0.0" regaura="0.0" weight="1000" capacity="540" speed="1.0" hp="50" damage="1d4" unarmedattack="10" unarmeddefense="10" attackmodifier="10" defensemodifier="10" walk="yes" teach="no">
@ -982,7 +982,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<attack type="2" damage="5d600"/>
<attack type="1" damage="1d4"/>
</race>
<race name="ghast" magres="60" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghast" magres="60" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes" desert="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes" scarepeasants="yes" absorbpeasants="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -999,7 +999,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<attack type="2" damage="1d30"/>
<attack type="2" damage="1d30"/>
</race>
<race name="ghoul" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghoul" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes" desert="yes">
<ai splitsize="10000" absorbpeasants="yes" killpeasants="yes" moverandom="yes" scarepeasants="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1030,7 +1030,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<attack type="3" damage="1d1"/>
<attack type="3" damage="1d1"/>
</race>
<race name="zombie" magres="20" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="zombie" magres="20" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes" desert="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes" scarepeasants="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1075,7 +1075,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<attack type="1" damage="1d1"/>
</race>
<race name="seaserpent" magres="50" maxaura="1.0" regaura="1.0" weight="20000" capacity="5000" speed="1.0" hp="600" ac="3" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" swim="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes">
<ai splitsize="6" killpeasants="yes" moverandom="yes" learn="yes" moveattack="yes" scarepeasants="yes"/>
<ai splitsize="6" killpeasants="yes" moverandom="yes" moveattack="yes" scarepeasants="yes"/>
<skill name="tactics" modifier="4"/>
<attack type="4" damage="1d30"/>
<attack type="4" damage="1d30"/>
@ -1086,7 +1086,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<race name="snotling" magres="-5" maxaura="1" regaura="1"
maintenance="10" weight="1000" capacity="540" speed="1" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="no" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="alchemy" modifier="1"/>
<skill name="mining" modifier="1"/>
<skill name="building" modifier="1"/>
@ -1115,7 +1115,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<familiar race="demon"/>
</race>
<race name="elf" magres="10" maxaura="1" regaura="1.25" recruitcost="130" maintenance="10" weight="1000" capacity="540" speed="1" hp="18" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="alchemy" modifier="-1"/>
<skill name="mining" modifier="-2"/>
<skill name="bow" modifier="2"/>
@ -1141,7 +1141,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<familiar race="imp"/>
</race>
<race name="dwarf" magres="5" maxaura="1" regaura="0.5" recruitcost="110" maintenance="10" weight="1000" capacity="540" speed="1" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<skill name="mining" modifier="2"/>
<skill name="bow" modifier="-1"/>
<skill name="building" modifier="2"/>
@ -1172,7 +1172,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<familiar race="rat"/>
</race>
<race name="orc" studyspeed="-5" magres="-5" maxaura="1" regaura="1" recruitcost="70" maintenance="10" weight="1000" capacity="540" speed="1" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<ai splitsize="10000" moverandom="yes"/>
<param name="recruit_multi" value="0.5"/>
<skill name="alchemy" modifier="1"/>
<skill name="mining" modifier="1"/>
@ -1202,7 +1202,7 @@ giveunit="yes" getitem="yes" recruitethereal="yes" equipment="yes">
<familiar race="demon"/>
</race>
<race name="shadowdragon" magres="95" maxaura="1.0" regaura="3.0" weight="100" capacity="100000" speed="1.0" hp="2700" ac="10" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="12" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes">
<ai splitsize="1" killpeasants="yes" learn="yes" scarepeasants="yes"/>
<ai splitsize="1" killpeasants="yes" scarepeasants="yes"/>
<skill name="tactics" modifier="20"/>
<skill name="perception" modifier="20"/>
<attack type="4" damage="5d30"/>

View file

@ -93,7 +93,7 @@
<spell name="transferauratraum" rank="1" syntax="aura" parameters="ui" ship="true">
<resource name="aura" amount="2" cost="fixed"/>
</spell>
<spell name="auratransfer" rank="1" syntax="aura" parameters="ui" ship="true">
<spell name="auratransfer" rank="1" syntax="aura" parameters="ui" noresist="true" ship="true">
<resource name="aura" amount="1" cost="fixed"/>
</spell>
<spell name="stonegolem" rank="4" variable="true">
@ -192,7 +192,7 @@
<resource name="h7" amount="3" cost="fixed"/>
<resource name="money" amount="50" cost="fixed"/>
</spell>
<spell name="enterastral" rank="7" parameters="u+" variable="true">
<spell name="enterastral" rank="7" parameters="u+" noresist="true" variable="true">
<resource name="aura" amount="2" cost="level"/>
</spell>
<spell name="leaveastral" rank="7" parameters="ru+" variable="true">
@ -214,13 +214,13 @@
<spell name="view_reality" rank="5">
<resource name="aura" amount="40" cost="fixed"/>
</spell>
<spell name="astral_disruption" rank="4" variable="true">
<spell name="astral_disruption" rank="4" noresist="true" variable="true">
<resource name="aura" amount="140" cost="fixed"/>
</spell>
<spell name="seduction" rank="5" parameters="u" los="true">
<resource name="aura" amount="12" cost="fixed"/>
</spell>
<spell name="sound_out" rank="5" parameters="ur" los="true">
<spell name="sound_out" rank="5" parameters="ur" noresist="true" los="true">
<resource name="aura" amount="4" cost="fixed"/>
<resource name="money" amount="100" cost="fixed"/>
</spell>

View file

@ -590,6 +590,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Um in Gletscher
msgid "feedback_unit_not_found"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit wurde nicht gefunden.\""
msgid "feedback_not_inside"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit kontrolliert kein Schiff oder Gebäude.\""
msgid "error206"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Auf dem Gebäude liegt bereits so ein Zauber.\""
@ -689,9 +692,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit kan
msgid "error85"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es wurde keine Emailadresse angegeben.\""
msgid "error125"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es wurde kein Banner angegeben.\""
msgid "starvation"
msgstr "\"$unit($unit) verliert in $region($region) $int($dead) von $int($add($live,$dead)) Personen durch Unterernährung.\""
@ -1163,6 +1163,12 @@ msgstr "\"$unit($target) gehört der Partei $faction($faction) an.\""
msgid "ship_drift"
msgstr "\"Die $ship($ship) treibt nach $direction($dir).\""
msgid "ship_drift_overload"
msgstr "\"Die $ship($ship) ist überladen und treibt nach $direction($dir).\""
msgid "ship_drift_nocrew"
msgstr "\"Die $ship($ship) hat zu wenig Segler und treibt nach $direction($dir).\""
msgid "error_max_magicians"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es kann maximal $int($amount) Magier pro Partei geben.\""
@ -1422,7 +1428,7 @@ msgid "error259"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Der Befehl ist nur auf Einheiten innerhalb des selben Gebäudes oder Schiffes anwendbar.\""
msgid "building_needed"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit steht nicht im benötigten Gebäude, $localize($building).\""
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit steht in keinem funktionierenden $localize($building).\""
msgid "error149"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Wohin soll die Botschaft gehen?\""
@ -1931,9 +1937,6 @@ msgstr "\"Albträume plagen die Leute. ($int36($id))\""
msgid "error295"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Nur ein Magier kann einen Astralkristall benutzen.\""
msgid "error185"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Der Zauber scheint ungewöhnlich schwach zu sein. Irgendetwas hat die magischen Energien abgeleitet.\""
msgid "error181"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Dazu muß sich der Magier in der Burg oder an Bord des Schiffes befinden.\""
@ -2597,6 +2600,12 @@ msgstr "\"$unit($follower) konnte $unit($unit) nicht folgen.\""
msgid "followdetect"
msgstr "\"$unit($follower) ist $unit($unit) gefolgt.\""
msgid "followfail_ship"
msgstr "\"Die $ship($follower) konnte die $ship($ship) nicht einholen.\""
msgid "followdetect_ship"
msgstr "\"Die $ship($ship) wurde von $ship($follower) verfolgt.\""
msgid "unitnotfound_id"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Einheit $id wurde nicht gefunden.\""
@ -2640,7 +2649,13 @@ msgid "error201"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Rasse und Zieleinheit wurden vergessen.\""
msgid "newbieimmunity"
msgstr "\"Deine Partei ist noch $int($turns) Wochen immun gegen Angriffe.\""
msgstr "\"Deine Partei ist noch die nächsten $int($turns) Wochen immun gegen Angriffe.\""
msgid "newbieimmunityending"
msgstr "\"Deine Partei ist nur noch in der kommenden Woche immun gegen Angriffe.\""
msgid "newbieimmunityended"
msgstr "\"Deine Partei ist nun nicht mehr immun gegen Angriffe.\""
msgid "curseinfo::auraboost_0"
msgstr "\"$unit($unit) fühlt sich von starken magischen Energien durchströmt. ($int36($id))\""

View file

@ -590,6 +590,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - You must build
msgid "feedback_unit_not_found"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit could not be found.\""
msgid "feedback_unit_not_found"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit is not the owner of a ship or building.\""
msgid "error206"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - There is alrady a spell on that building.\""
@ -689,9 +692,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit cannot
msgid "error85"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - No email address was supplied.\""
msgid "error125"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - No banner text was supplied.\""
msgid "starvation"
msgstr "\"$unit($unit) loses $int($dead) of $int($add($live,$dead)) people due to starvation in $region($region).\""
@ -1163,6 +1163,12 @@ msgstr "\"$unit($target) belongs to $faction($faction).\""
msgid "ship_drift"
msgstr "\"The ship $ship($ship) drifts to the $direction($dir).\""
msgid "ship_drift_overload"
msgstr "\"The ship $ship($ship) is too heavily loaded and drifts to the $direction($dir).\""
msgid "ship_drift_nocrew"
msgstr "\"The ship $ship($ship) needs more sailors and drifts to the $direction($dir).\""
msgid "error_max_magicians"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - There may not be more than $int($amount) magicians in your faction.\""
@ -1422,7 +1428,7 @@ msgid "error259"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - That order only applies to units in the same building or ship.\""
msgid "building_needed"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit must be in a $localize($building) to produce this.\""
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit must be in a working $localize($building) to produce this.\""
msgid "error149"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Who is supposed to get this message?\""
@ -1812,7 +1818,7 @@ msgid "error243"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - You did not specify a valid race.\""
msgid "error133"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - You must build a caravansary before building roads through deserts.\""
msgstr "\"$unit($unit) in $region($region): '$order($command)' - You must build a caravanserai before building roads through deserts.\""
msgid "changepasswd"
msgstr "\"The password of this faction is '$value'.\""
@ -1931,9 +1937,6 @@ msgstr "\"Nightmares plague the population. ($int36($id))\""
msgid "error295"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Only mages may use an astralcrystal.\""
msgid "error185"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The spell seems exceptionally weak. Something has interfred with the magical energies.\""
msgid "error181"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - To do this, the magician has to be in a castle or on board a ship.\""
@ -2591,6 +2594,12 @@ msgstr "\"$unit($mage) makes $unit($target) appear as $race($race,$unit.size($ta
msgid "error248"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - The faction has to be 10 turns old.\""
msgid "followfail_ship"
msgstr "\"$ship($follower) could not catch up to $ship($ship).\""
msgid "followdetect_ship"
msgstr "\"$ship($follower) followed $ship($ship).\""
msgid "followfail"
msgstr "\"$unit($follower) could not follow $unit($unit).\""
@ -2640,7 +2649,13 @@ msgid "error201"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Race and target unit have not been supplied.\""
msgid "newbieimmunity"
msgstr "\"Your faction is immune against assaults for $int($turns) more weeks.\""
msgstr "\"Your faction will be protected against attacks for the next $int($turns) weeks.\""
msgid "newbieimmunityending"
msgstr "\"Your faction will be protected against attacks only one more week.\""
msgid "newbieimmunityended"
msgstr "\"Your faction will no longer be protected against attacks.\""
msgid "curseinfo::auraboost_0"
msgstr "\"Powerful magical energies are pulsing through $unit($unit). ($int36($id))\""

View file

@ -2496,6 +2496,10 @@ msgctxt "keyword"
msgid "loot"
msgstr "PLÜNDERE"
msgctxt "keyword"
msgid "expel"
msgstr "VERTREIBE"
msgctxt "calendar"
msgid "month_1"
msgstr "Feldsegen"
@ -6085,7 +6089,7 @@ msgstr "ENDE"
msgctxt "raceinfo"
msgid "tunnelworm"
msgstr "Diese aus den Tiefen Eresseas stammende gigantische Geschöpf ist dem Leben im Untergrund hervorragend angepasst. Blind, taub und nicht besonders intelligent, aber mit seinen gewaltigen Kräften kann es ganze Berge versetzen oder Wälder roden."
msgstr "Dieses aus den Tiefen Eresseas stammende gigantische Geschöpf ist dem Leben im Untergrund hervorragend angepasst. Blind, taub und nicht besonders intelligent, aber mit seinen gewaltigen Kräften kann es ganze Berge versetzen oder Wälder roden."
msgctxt "race"
msgid "aquarian_d"

View file

@ -1318,7 +1318,7 @@ msgid "peasantblood"
msgstr "peasant blood"
msgid "caravan"
msgstr "caravanserei"
msgstr "caravanserai"
msgctxt "race"
msgid "human"
@ -1741,10 +1741,6 @@ msgstr "caravel"
msgid "stone_p"
msgstr "stones"
msgctxt "keyword"
msgid "locale"
msgstr "LOCALE"
msgctxt "spellinfo"
msgid "song_suscept_magic"
msgstr "This song, which is woven into the magical essence of the region, weakens the natural resistance against a singular enchantment by 15%. Only the allies of the bard (HELP GUARD) are immune to the effect of the chant."
@ -2171,6 +2167,10 @@ msgctxt "keyword"
msgid "loot"
msgstr "loot"
msgctxt "keyword"
msgid "expel"
msgstr "EXPEL"
msgctxt "keyword"
msgid "guard"
msgstr "GUARD"

View file

@ -1,6 +1,5 @@
#!/bin/sh
ROOT=$(git rev-parse --show-toplevel)
eval $(luarocks path)
[ -z "$BUILD" ] && BUILD=Debug
if [ -z "$JOBS" ] ; then
if [ -e /usr/sbin/sysctl ]; then

View file

@ -6,7 +6,6 @@ pkg-config --exists sqlite3 && ERESSEA_DB=sqlite
GETOPT=getopt
GETOPT_LONG=1
luarocks install lunitx --local
if [ "Darwin" = "$(uname)" ] ; then
if [ -x "/usr/local/opt/gnu-getopt/bin/getopt" ] ; then
GETOPT="/usr/local/opt/gnu-getopt/bin/getopt"
@ -46,6 +45,7 @@ fi
shift 1
done
git submodule update --init
ROOT=$(git rev-parse --show-toplevel)
[ -z $BUILD ] && BUILD=Debug
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
@ -75,22 +75,20 @@ fi
DEST=$(dirname $ROOT)/server
LUA_VERSION="5.2"
LUA_INCLUDE=/usr/include
LUA_DIR=/usr
if [ -d /usr/local/include/lua5.3 ]; then
LUA_VERSION="5.3"
LUA_INCLUDE=/usr/local/include/lua5.3
if [ -d /usr/local/include/lua ]; then
LUA_INCLUDE=/usr/local/include/lua
elif [ -d /usr/include/lua5.4 ]; then
LUA_INCLUDE=/usr/include/lua5.4
elif [ -d /usr/include/lua5.3 ]; then
LUA_INCLUDE=/usr/include/lua5.3
elif [ -d /usr/include/lua5.2 ]; then
export LUA_DIR=/usr
LUA_VERSION="5.2"
LUA_INCLUDE=/usr/include/lua5.2
elif [ -d /usr/include/lua5.1 ]; then
LUA_VERSION="5.1"
LUA_INCLUDE=/usr/include/lua5.1
elif [ -d /usr/local/include/lua5.1 ]; then
export LUA_DIR=/usr/local
LUA_VERSION="5.1"
LUA_DIR=/usr/local
LUA_INCLUDE=/usr/local/include/lua5.1
fi
@ -108,27 +106,6 @@ SET (CMAKE_LIBRARY_PATH "$LIBRARY_PATH" CACHE PATH "")
SET (CMAKE_PREFIX_PATH "$PREFIX_PATH" CACHE PATH "")
HEREDOC
path="$(which tolua)"
if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then
echo "tolua is not installed, building from source"
cd $ROOT
if [ ! -d tolua/include ]; then
echo "fetching tolua ${LUA_VERSION} from github..."
git clone https://github.com/ennorehling/tolua-${LUA_VERSION}.git tolua
fi
echo "building tolua..."
cd tolua
make
cd -
cat >> $BUILD/config.cmake <<TOLUA
SET(PC_TOLUA_DIR "$ROOT/tolua" CACHE PATH "tolua root")
TOLUA
else
echo "tolua is $path"
fi
unset path
set -e
cd $BIN_DIR

View file

@ -58,7 +58,6 @@ cat >| eressea.ini <<HEREDOC
dbname = eressea.db
dbswap = :memory:
install = $SOURCE
paths = $SOURCE/lunit:$SOURCE/git/scripts
rules = e$game
HEREDOC
}

View file

@ -1,19 +1,16 @@
#!/bin/bash
set -e
eval $(luarocks path)
ROOT=$(git rev-parse --show-toplevel)
export LUA_PATH="$ROOT/scripts/?.lua;$LUA_PATH"
[ -z $BUILD ] && BUILD=Debug ; export BUILD
UNIT_TESTS=$ROOT/$BUILD/eressea/test_eressea
RUN_TESTS=$ROOT/$BUILD/eressea/eressea
if [ "$1" = "-V" ]; then
VALGRIND=$(which valgrind)
if [ -n "$VALGRIND" ]; then
SUPP=$ROOT/share/ubuntu-12_04.supp
UNIT_TESTS="$VALGRIND --quiet --suppressions=$SUPP --error-exitcode=1 --leak-check=no $UNIT_TESTS"
RUN_TESTS="$VALGRIND --quiet --suppressions=$SUPP --error-exitcode=1 --leak-check=no $RUN_TESTS"
fi
UNIT_TESTS="valgrind --quiet --suppressions=$SUPP --error-exitcode=1 --leak-check=no $UNIT_TESTS"
RUN_TESTS="valgrind --quiet --suppressions=$SUPP --error-exitcode=1 --leak-check=no $RUN_TESTS"
fi
if [ ! -e $ROOT/$BUILD ]; then
@ -21,8 +18,8 @@ if [ ! -e $ROOT/$BUILD ]; then
exit
fi
$UNIT_TESTS
cd $ROOT/tests
$UNIT_TESTS
$RUN_TESTS -v1 ../scripts/run-tests.lua
$RUN_TESTS -v1 ../scripts/run-tests-e2.lua
$RUN_TESTS -v1 ../scripts/run-tests-e3.lua

View file

@ -102,7 +102,6 @@ ini_add game id $game
ini_add game start 1
ini_sec lua
ini_add lua install $SOURCE
ini_add lua paths $SOURCE/scripts:$SOURCE/lunit
ini_add lua rules $rules
echo 0 > turn

View file

@ -6,7 +6,7 @@ inifile() {
cd $ROOT
if [ ! -e eressea.ini ]; then
cp conf/eressea.ini .
$BUILD/iniparser/inifile eressea.ini add lua:paths lunit:scripts
$BUILD/tools/inifile eressea.ini add lua:paths lunit:scripts
fi
}
@ -39,5 +39,14 @@ cd ../process
make
cd $ROOT
inifile
s/runtests -V
luarocks install lunitx --local
eval $(luarocks path)
export LUA_PATH="$ROOT/scripts/?.lua;$LUA_PATH"
echo $LUA_PATH
if [ -e /usr/bin/valgrind ]; then
s/runtests -V
else
s/runtests
fi
integration_tests

View file

@ -66,7 +66,6 @@ local sets = {
['seed_seaserpent'] = {
['skills'] = {
['magic'] = 4,
['stealth'] = 2,
['stamina'] = 1,
['perception'] = 3,
}

View file

@ -1,5 +1,9 @@
if config.paths ~= nil then
for path in string.gmatch(config.paths, "([^:]+)") do
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
end
local path = '.'
if config.install then
path = config.install
else
path = os.getenv("ERESSEA_ROOT") or path
config.install = path
end
path = path .. "/scripts"
package.path = path .. '/?.lua;' .. path .. '/?/init.lua;' .. package.path

View file

@ -18,7 +18,7 @@ end
local function get_target(param)
local ntargets = #targets
if ntargets == 0 then
eressea.log.error("Zero tunnel targets for [" .. param .. "]")
eressea.log.error("No tunnel targets for [" .. param .. "]")
return nil
end
local rn = math.fmod(rng_int(), ntargets)
@ -31,10 +31,13 @@ end
local function tunnel_action(b, param)
local units = tunnel_travelers(b)
local rto = get_target(param)
eressea.log.info("Tunnel from " .. tostring(b) .. " [" .. param .. "]")
if rto and units then
if units then
for _, u in pairs(units) do
local rto = get_target(param)
if not rto then
break
end
u.region = rto
eressea.log.info("teleported " .. tostring(u) .. " to " .. tostring(rto))
end

View file

@ -1,8 +1,3 @@
local path = 'scripts'
if config.install then
path = config.install .. '/' .. path
end
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
require 'eressea.path'
require 'eressea'
require 'eressea.xmlconf'

View file

@ -1,4 +1,7 @@
dofile('config.lua')
eressea.read_game(get_turn() .. '.dat')
init_reports()
write_reports()
-- do not use write_reports, since it will change passwords
for f in factions() do
write_report(f)
end

View file

@ -1,22 +1,15 @@
-- Tests that work in all games. With game config of E2.
-- Tests are under scripts/test/e2 and all files must be in scripts/test/e2/init.lua
lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
module = lunit.module
end
path = 'scripts'
if config.install then
path = config.install .. '/' .. path
end
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
config.rules = 'e2'
lunit = require 'lunit'
if _VERSION >= 'Lua 5.2' then
module = lunit.module
end
require 'eressea.path'
require 'eressea'
require 'eressea.xmlconf'
require 'eressea.path'
require 'tests.e2'
rng.inject(0)

View file

@ -1,21 +1,14 @@
-- Tests that work in E3. With game config of E3.
-- Tests are under scripts/test/e3 and all files must be in scripts/test/e3/init.lua
lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
module = lunit.module
end
path = 'scripts'
if config.install then
path = config.install .. '/' .. path
end
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
config.rules = 'e3'
lunit = require 'lunit'
if _VERSION >= 'Lua 5.2' then
module = lunit.module
end
require 'eressea'
require 'eressea.path'
require 'eressea'
require 'eressea.xmlconf'
require 'tests.e3'

View file

@ -1,19 +1,13 @@
-- Basic test without loading XML Config. Test care about needed settings.
-- Tests are under scripts/test/ and all files must be in scripts/test/init.lua
lunit = require('lunit')
lunit = require 'lunit'
if _VERSION >= 'Lua 5.2' then
module = lunit.module
end
path = 'scripts'
if config.install then
path = config.install .. '/' .. path
end
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
require 'eressea'
require 'eressea.path'
require 'eressea'
require 'tests'
result = lunit.main()
return result.errors + result.failed

View file

@ -1,3 +1,5 @@
require 'eressea.path'
function nmr_check(maxnmrs)
local nmrs = get_nmrs(1)
if nmrs > maxnmrs then
@ -14,15 +16,15 @@ function open_game(turn)
return eressea.read_game(file .. ".dat")
end
function callbacks(rules, name, ...)
for k, v in pairs(rules) do
if 'table' == type(v) then
cb = v[name]
if 'function' == type(cb) then
cb(...)
end
end
end
local function callbacks(rules, name, ...)
for k, v in pairs(rules) do
if 'table' == type(v) then
cb = v[name]
if 'function' == type(cb) then
cb(...)
end
end
end
end
local function write_emails(locales)
@ -47,8 +49,8 @@ local function write_emails(locales)
end
local function join_path(a, b)
if a then return a .. '/' .. b end
return b
if a then return a .. '/' .. b end
return b
end
local function write_addresses()
@ -83,23 +85,23 @@ local function write_aliases()
end
local function write_htpasswd()
local out = io.open(join_path(config.basepath, "htpasswd"), "w")
if out then
for f in factions() do
if f.password then
out:write(itoa36(f.id) .. ":" .. f.password .. "\n")
end
end
out:close()
local out = io.open(join_path(config.basepath, "htpasswd"), "w")
if out then
for f in factions() do
if f.password then
out:write(itoa36(f.id) .. ":" .. f.password .. "\n")
end
end
out:close()
end
end
local function write_files(locales)
write_reports()
write_summary()
write_database()
write_passwords()
write_htpasswd()
write_reports()
write_summary()
write_database()
write_passwords()
write_htpasswd()
end
local function write_scores()
@ -121,86 +123,83 @@ local function write_scores()
end
function process(rules, orders)
local confirmed_multis = { }
local suspected_multis = { }
local confirmed_multis = { }
local suspected_multis = { }
if open_game(get_turn())~=0 then
eressea.log.error("could not read game")
return -1
end
if open_game(get_turn())~=0 then
eressea.log.error("could not read game")
return -1
end
turn_begin()
-- create orders for monsters:
plan_monsters()
-- read orders for players:
if eressea.read_orders(orders) ~= 0 then
print("could not read " .. orders)
return -1
end
turn_begin()
-- create orders for monsters:
plan_monsters()
-- read orders for players:
if eressea.read_orders(orders) ~= 0 then
print("could not read " .. orders)
return -1
end
if nmr_check(config.maxnmrs or 80)~=0 then
return -1
end
callbacks(rules, 'init')
-- run the turn:
turn_process()
callbacks(rules, 'update')
turn_end() -- ageing, etc.
if nmr_check(config.maxnmrs or 80)~=0 then
return -1
end
callbacks(rules, 'init')
-- run the turn:
turn_process()
callbacks(rules, 'update')
turn_end() -- ageing, etc.
write_files(config.locales)
update_scores()
if not config.debug then
write_files(config.locales)
update_scores()
file = '' .. get_turn() .. '.dat'
if eressea.write_game(file)~=0 then
file = '' .. get_turn() .. '.dat'
if eressea.write_game(file)~=0 then
eressea.log.error("could not write game")
return -1
end
return 0
end
end
return 0
end
function run_turn(rules)
local turn = get_turn()
if turn<0 then
turn = read_turn()
set_turn(turn)
end
local turn = get_turn()
if turn<0 then
turn = read_turn()
set_turn(turn)
end
orderfile = orderfile or config.basepath .. '/orders.' .. turn
eressea.log.debug("executing turn " .. get_turn() .. " with " .. orderfile .. " with rules=" .. config.rules)
local result = process(rules, orderfile)
return result
orderfile = orderfile or config.basepath .. '/orders.' .. turn
eressea.log.debug("executing turn " .. get_turn() .. " with " .. orderfile .. " with rules=" .. config.rules)
local result = process(rules, orderfile)
return result
end
function file_exists(name)
local f=io.open(name,"r")
if not f then
return false
end
io.close(f)
return true
local f=io.open(name,"r")
if not f then
return false
end
io.close(f)
return true
end
if file_exists('execute.lock') then
eressea.log.error("Lockfile exists, aborting.")
assert(false)
eressea.log.error("Lockfile exists, aborting.")
assert(false)
end
math.randomseed(rng.random())
local path = 'scripts'
if config.install then
path = config.install .. '/' .. path
end
package.path = package.path .. ';' .. path .. '/?.lua;' .. path .. '/?/init.lua'
require 'eressea'
require 'eressea.xmlconf' -- read xml data
local rules = {}
if config.rules then
rules = require('eressea.' .. config.rules)
eressea.log.info('loaded ' .. #rules .. ' modules for ' .. config.rules)
rules = require('eressea.' .. config.rules)
eressea.log.info('loaded ' .. #rules .. ' modules for ' .. config.rules)
else
eressea.log.warning('no rule modules loaded, specify a game in eressea.ini or with -r')
eressea.log.warning('no rule modules loaded, specify a game in eressea.ini or with -r')
end
run_turn(rules)

View file

@ -66,7 +66,7 @@ function test_flags()
local f = create_faction('halfling')
local u = unit.create(f, r, 1)
local no = itoa36(f.id)
local flags = 50332672
local flags = 50331648
f.flags = flags
eressea.write_game("test.dat")
@ -136,11 +136,9 @@ function test_fleeing_units_can_be_transported()
u1.number = 100
u1:add_order("ATTACKIEREN " .. itoa36(u2.id))
u2.number = 100
u2.name = 'Passagier'
u2:add_order("FAHREN " .. itoa36(u3.id))
u2:add_order("KAEMPFE FLIEHE")
u3.number = 100
u3.name = 'Transporter'
u3:add_order("KAEMPFE FLIEHE")
u3:add_order("TRANSPORT " .. itoa36(u2.id))
u3:add_order("NACH O ")
@ -642,7 +640,6 @@ function test_laen2()
u1:set_skill("mining", 15)
u1:clear_orders()
u1:add_order("MACHEN Laen")
u1.name = "Laenmeister"
local b = building.create(r, "mine")
b.size = 10

View file

@ -13,6 +13,7 @@ function setup()
eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.food.flags", "4")
eressea.settings.set("rules.peasants.growth.factor", "0")
eressea.settings.set("magic.resist.enable", "0")
eressea.settings.set("magic.fumble.enable", "0")
eressea.settings.set("magic.regeneration.enable", "0")
end

View file

@ -9,11 +9,13 @@ end
function setup()
eressea.free_game()
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.grow.formula", "0")
eressea.settings.set("rules.food.flags", "4")
eressea.settings.set("rules.ship.storms", "0")
eressea.settings.set("rules.encounters", "0")
eressea.settings.set("study.produceexp", "0")
eressea.settings.set("rules.peasants.growth.factor", "0")
eressea.settings.set("magic.resist.enable", "0")
end
function disabled_double_default()
@ -88,7 +90,6 @@ function test_herbalism()
local f = faction.create("human")
local u = unit.create(f, r, 1)
eressea.settings.set("rules.grow.formula", 0) -- plants do not grow
u:add_item("money", u.number * 100)
u:set_skill("herbalism", 5)
r:set_resource("seed", 100)
@ -114,7 +115,6 @@ function test_dwarf_bonus()
local u = unit.create(faction.create("dwarf"), r)
assert_equal("dwarf", u.faction.race)
assert_equal("dwarf", u.race)
u.faction.name = "Zwerge"
u.number = 10
u:set_skill("mining", 1)
u:add_order("MACHE EISEN")
@ -606,7 +606,7 @@ function test_seacast()
u2.ship = s1
u2:add_spell("stormwinds")
u2:clear_orders()
u2:add_order("Zaubere stufe 2 'Sturmelementar' " .. itoa36(s1.id))
u2:add_order("ZAUBERE STUFE 2 'Sturmelementar' " .. itoa36(s1.id))
u1:clear_orders()
u1:add_order("NACH O O O O")
process_orders()

View file

@ -0,0 +1,84 @@
local tcname = 'tests.e2.familiars'
local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall')
else
module(tcname, lunit.testcase, package.seeall)
end
function setup()
eressea.game.reset()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.food.flags", "4")
eressea.settings.set("rules.peasants.growth.factor", "0")
eressea.settings.set("magic.resist.enable", "0")
eressea.settings.set("magic.fumble.enable", "0")
eressea.settings.set("magic.regeneration.enable", "0")
end
local function setup_familiars(f, r)
f.magic = 'gwyrrd'
local uf = unit.create(f, r)
uf.magic = 'gray'
local u = unit.create(f, r)
u.magic = 'gwyrrd'
u:set_skill('magic', 9)
u.familiar = uf
return u, uf
end
function test_moneyspell()
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local um, uf = setup_familiars(f, r)
um.aura = 9
um:add_order('ZAUBERE STUFE 9 Viehheilung')
process_orders()
assert_equal(0, um.aura)
assert_equal(450, um:get_item('money'))
end
function test_moneyspell_through_familiar()
-- casting magician's spell with the familiar: double cost
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local um, uf = setup_familiars(f, r)
um.aura = 12
uf:add_order('ZAUBERE STUFE 3 Viehheilung')
process_orders()
assert_equal(0, uf:get_skill('magic'))
assert_equal(12, um.aura) -- cannot cast, familiar needs magic skill
assert_equal(0, uf:get_item('money'))
assert_equal(0, um:get_item('money'))
uf:set_skill('magic', 2) -- can cast no higher than level 2
process_orders()
assert_equal(8, um.aura) -- double the cost
assert_equal(100, uf:get_item('money'))
assert_equal(0, um:get_item('money'))
um:set_skill('magic', 4) -- use at most half of skill
uf:set_skill('magic', 1) -- too low for level 2 spell, cast at level 1
process_orders()
assert_equal(6, um.aura) -- double cost of level 1
assert_equal(150, uf:get_item('money'))
assert_equal(0, um:get_item('money'))
end
function test_moneyspell_as_familiar()
-- familiar has the spell and has magic skills: regular spellcasting rules apply
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local um, uf = setup_familiars(f, r)
um.aura = 9
uf.aura = 20
uf:set_skill('magic', 10)
uf:add_spell('earn_silver#gwyrrd')
uf:add_order('ZAUBERE STUFE 10 Viehheilung')
process_orders()
assert_equal(500, uf:get_item('money'))
assert_equal(10, uf.aura)
assert_equal(9, um.aura)
end

View file

@ -79,3 +79,66 @@ function test_no_guard_no_move_after_combat() -- bug 1493
u1 = get_unit(uid1)
assert_equal(r1, u1.region)
end
function test_move_stops_guarding()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "plain")
local f = faction.create("human", "test@example.com", "de")
local u = unit.create(f, r1, 1)
u:add_item("sword", 1)
u:set_skill("melee", 2)
u:add_order("NACH O")
u:add_order("BEWACHE")
u.guard = true
process_orders()
assert_equal(r2, u.region)
assert_false(u.guard)
end
function test_move_to_same_region_stops_guarding()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "plain")
local f = faction.create("human", "test@example.com", "de")
local u = unit.create(f, r1, 1)
u:add_item("horse", 1)
u:add_item("sword", 1)
u:set_skill("melee", 2)
u:set_skill("riding", 2)
u:add_order("NACH O W")
u.guard = true
process_orders()
assert_equal(r1, u.region)
assert_false(u.guard)
end
function test_mover_cannot_start_guarding()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "plain")
local f = faction.create("human", "test@example.com", "de")
local u = unit.create(f, r1, 1)
u:add_item("horse", 1)
u:add_item("sword", 1)
u:set_skill("melee", 2)
u:set_skill("riding", 2)
u:add_order("BEWACHE")
u:add_order("NACH O")
process_orders()
assert_equal(r2, u.region)
assert_false(u.guard)
end
function test_move_to_same_region_stops_guarding()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "plain")
local f = faction.create("human", "test@example.com", "de")
local u = unit.create(f, r1, 1)
u:add_item("horse", 1)
u:add_item("sword", 1)
u:set_skill("melee", 2)
u:set_skill("riding", 2)
u:add_order("BEWACHE")
u:add_order("NACH O W")
process_orders()
assert_equal(r1, u.region)
assert_false(u.guard)
end

View file

@ -1,3 +1,4 @@
require 'tests.e2.migration'
require 'tests.e2.trolls'
require 'tests.e2.trees'
require 'tests.e2.buildings'
@ -5,6 +6,8 @@ require 'tests.e2.movement'
require 'tests.e2.carts'
require 'tests.e2.astral'
require 'tests.e2.spells'
require 'tests.e2.migration'
require 'tests.e2.familiars'
require 'tests.e2.e2features'
require 'tests.e2.insects'
require 'tests.e2.production'
@ -30,6 +33,5 @@ require 'tests.magicbag'
require 'tests.process'
require 'tests.xmas'
require 'tests.production'
require 'tests.spells'
require 'tests.undead'
require 'tests.spells'

View file

@ -0,0 +1,131 @@
local tcname = 'tests.e2.migration'
local lunit = require('lunit')
if _VERSION >= 'Lua 5.2' then
_ENV = module(tcname, 'seeall')
else
module(tcname, lunit.testcase, package.seeall)
end
function setup()
eressea.game.reset()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.food.flags", "4")
eressea.settings.set("rules.peasants.growth.factor", "0")
eressea.settings.set("magic.resist.enable", "0")
eressea.settings.set("magic.fumble.enable", "0")
eressea.settings.set("magic.regeneration.enable", "0")
end
local function setup_mage(f, r)
local u = unit.create(f, r)
u.magic = 'tybied'
u:set_skill('magic', 10)
u:add_spell('migration')
return u
end
function test_migration_success()
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local u = setup_mage(f, r)
local u2 = unit.create(faction.create('human'), r)
u2:add_order('KONTAKTIERE ' .. itoa36(u.id))
u:add_order('ZAUBERE STUFE 1 "Ritual der Aufnahme" ' .. itoa36(u2.id))
u.aura = 9
u.aura_max = 9
process_orders()
assert_equal(f, u2.faction)
assert_equal(6, u.aura)
assert_equal(8, u.aura_max)
end
function test_migration_no_contact()
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local u = setup_mage(f, r)
local u2 = unit.create(faction.create('human'), r)
u:add_order('ZAUBERE STUFE 1 "Ritual der Aufnahme" ' .. itoa36(u2.id))
u.aura = 9
u.aura_max = 9
process_orders()
assert_not_equal(f, u2.faction)
assert_equal(9, u.aura)
assert_equal(9, u.aura_max)
end
function test_migration_too_many()
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local u = setup_mage(f, r)
local u2 = unit.create(faction.create('human'), r)
u2:add_order('KONTAKTIERE ' .. itoa36(u.id))
u2.number = 2
u:add_order('ZAUBERE STUFE 1 "Ritual der Aufnahme" ' .. itoa36(u2.id))
u.aura = 9
u.aura_max = 9
process_orders()
assert_not_equal(f, u2.faction)
assert_equal(9, u.aura)
assert_equal(9, u.aura_max)
end
function test_migration_with_ring()
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local u = setup_mage(f, r)
local u2 = unit.create(faction.create('human'), r)
u2:add_order('KONTAKTIERE ' .. itoa36(u.id))
u2.number = 2
u:add_item('rop', 1)
u:add_order('ZAUBERE STUFE 1 "Ritual der Aufnahme" ' .. itoa36(u2.id))
u.aura = 9
u.aura_max = 9
process_orders()
assert_equal(f, u2.faction)
assert_equal(6, u.aura)
assert_equal(8, u.aura_max)
end
function test_migration_insufficient_aura()
-- if unit cannot pay full costs, it casts at a lower level.
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local u = setup_mage(f, r)
local u2 = unit.create(faction.create('human'), r)
u2:add_order('KONTAKTIERE ' .. itoa36(u.id))
u2.number = 2
u:add_order('ZAUBERE STUFE 2 "Ritual der Aufnahme" ' .. itoa36(u2.id))
u.aura = 3
u.aura_max = 9
process_orders()
-- spell fails, costs nothing:
assert_not_equal(f, u2.faction)
assert_equal(3, u.aura)
assert_equal(9, u.aura_max)
end
function test_migration_reduced_cost()
-- if unit cannot pay full costs, it casts at a lower level.
local r = region.create(0, 0, "plain")
local f = faction.create('human')
local u = setup_mage(f, r)
local u2 = unit.create(faction.create('human'), r)
u2:add_order('KONTAKTIERE ' .. itoa36(u.id))
u:add_order('ZAUBERE STUFE 2 "Ritual der Aufnahme" ' .. itoa36(u2.id))
u.aura = 3
u.aura_max = 9
process_orders()
-- spell is cast at level 1:
assert_equal(f, u2.faction)
assert_equal(0, u.aura)
assert_equal(7, u.aura_max)
end
--[[
additional tests:
- not enough aura, casting at lower level
- no aura, ring does not grant level 1
- magic tower, like ring, cumulative
]]--

View file

@ -165,3 +165,73 @@ function assert_capacity(text, u, silver, r1, r2, rx)
process_orders()
assert_equal(rx, u.region, text .. "unit should not move")
end
function test_move_to_same_region_leaves_building()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "plain")
local f = faction.create("human", "test@example.com", "de")
local u = unit.create(f, r1, 1)
local b = building.create(u.region, "castle")
b.size = 2
u.building = b
assert_not_nil(u.building)
u:add_item("horse", 1)
u:set_skill("riding", 2)
u:add_order("NACH O W")
process_orders()
assert_equal(r1, u.region)
assert_nil(u.building)
end
function test_aquarians_can_swim()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "ocean")
local r3 = region.create(2, 0, "ocean")
local f = faction.create("aquarian")
local u1 = unit.create(f, r2, 1)
local u2 = unit.create(f, r2, 1)
local sh = ship.create(r2, 'boat')
u1.ship = sh
u1:set_skill('sailing', 2)
u1:add_order("NACH O")
u2.ship = sh
u2:add_order("NACH W")
process_orders()
assert_equal(r1, u2.region)
assert_equal(r3, u1.region)
end
function test_only_aquarians_can_swim()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "ocean")
local r3 = region.create(2, 0, "ocean")
local f = faction.create('human')
local u1 = unit.create(f, r2, 1)
local u2 = unit.create(f, r2, 1)
local sh = ship.create(r2, 'boat')
u1.ship = sh
u1:set_skill('sailing', 2)
u1:add_order("NACH O")
u2.ship = sh
u2:add_order("NACH W")
process_orders()
assert_equal(r3, u2.region)
assert_equal(r3, u1.region)
end
function test_looping_ship()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "ocean")
local f = faction.create("aquarian")
local u1 = unit.create(f, r1, 1)
u1.ship = ship.create(r1, 'boat')
local u2 = unit.create(f, r1, 1)
u2.ship = ship.create(r1, 'boat')
u1:set_skill('sailing', 2)
u1:add_order("NACH O W")
u2:set_skill('sailing', 2)
u2:add_order("NACH O")
process_orders()
assert_equal(r1, u1.region)
assert_equal(r2, u2.region)
end

View file

@ -22,7 +22,6 @@ function test_ship_requires_skill()
assert_not_nil(r2)
local f = faction.create("human", "fake@eressea.de", "de")
local u1 = unit.create(f, r1, 1)
u1.name = "fake"
u1.ship = ship.create(r1, "longboat")
u1:clear_orders()
u1:add_order("NACH O")
@ -519,3 +518,29 @@ function test_build_convoy_max()
assert_equal(100, sh.size)
assert_equal(25, u:get_item('log'))
end
function test_ship_crew_stops_guarding()
local r1 = region.create(0, 0, "plain")
local r2 = region.create(1, 0, "ocean")
local f = faction.create("human")
local u1 = unit.create(f, r1, 1)
local u2 = unit.create(f, r1, 1)
local sh = ship.create(r1, "longboat")
u1.ship = sh
u2.ship = sh
u1:clear_orders()
u1:add_order("NACH O W")
u1:set_skill("sailing", 1) -- cptskill = 1
u2:set_skill("sailing", 9) -- sumskill = 10
u2:add_item("sword", 1)
u2:set_skill("melee", 2)
u2:add_order("BEWACHE")
u2.guard = true
process_orders()
assert_false(u2.guard)
assert_equal(sh, u1.ship)
assert_equal(sh, u2.ship)
assert_equal(r1, sh.region)
assert_equal(r1, u1.region)
assert_equal(r1, u2.region)
end

View file

@ -181,7 +181,7 @@ function test_familiar()
local f = faction.create("human")
local u = unit.create(f, r)
local uid = u.id
u.name = 'Hodor'
u.name = 'Bonzi'
u.magic = "gwyrrd"
u.race = "elf"
u:set_skill("magic", 10)
@ -192,7 +192,7 @@ function test_familiar()
process_orders()
for u in r.units do
if u.id ~= uid then
assert_equal('Vertrauter von Hodor (' .. itoa36(uid) ..')', u.name)
assert_equal('Vertrauter von Bonzi (' .. itoa36(uid) ..')', u.name)
end
end
end
@ -222,6 +222,8 @@ function test_bug_2480()
end
function test_bug_2517()
-- Magier macht lange Befehle, wenn sein Vertrauter
-- zaubert (auch wenn es nicht eigene Zauber sind).
local r = region.create(0, 0, "plain")
local f = faction.create("elf")
local um = unit.create(f, r, 1)
@ -242,12 +244,25 @@ function test_bug_2517()
assert_equal('gray', uf.magic)
uf:add_order('LERNE Magie')
um:clear_orders()
assert_equal(1, uf:get_skill('magic'))
um:add_order('ARBEITEN')
assert_equal(0, um:get_item('money'))
process_orders()
assert_equal('gray', uf.magic)
uf:add_order('ZAUBERE STUFE 1 Viehheilung')
um.aura = 10
uf.aura = 10
assert_equal(10, um:get_item('money')) -- langer Befehl wurde ausgefuehrt
process_orders()
assert_equal(50, uf:get_item('money'))
assert_equal(20, um:get_item('money')) -- langer Befehl wurde ausgefuehrt
assert_equal(8, um.aura) -- kein eigener Zauber, Aura des Magiers
assert_equal(10, uf.aura)
uf:add_spell('earn_silver#gwyrrd') -- ins private spellbook aufnehmen
process_orders()
assert_equal(9, uf.aura) -- einfache Kosten, aus eigener Aura
assert_equal(8, um.aura) -- keine Kosten für den Magier
assert_equal(30, um:get_item('money')) -- langer Befehl wurde ausgefuehrt
end
function test_familiar_school()
@ -273,15 +288,64 @@ end
function test_astral_disruption()
local r = region.create(0, 0, "plain")
local r2 = r:get_astral('fog')
local r3 = region.create(r2.x+1, r2.y, 'fog')
local f = faction.create("human")
local u = unit.create(f, r)
local uh = unit.create(get_monsters(), r2, 1, "braineater")
u.magic = "draig"
u.magic = "tybied"
u:set_skill("magic", 100) -- level 100 should beat magic resistance
u.aura = 200
u:add_spell("astral_disruption")
u:add_spell("astral_disruption", 14)
u:add_order('ZAUBERE STUFE 1 "Stoere Astrale Integritaet"')
process_orders()
assert_not_nil(r2:get_curse("astralblock"))
assert_equal(60, u.aura)
assert_equal(100, r2:get_curse("astralblock"))
assert_nil(r3:get_curse("astralblock"))
assert_equal(r, uh.region)
end
function test_astral_disruption_levels()
local r = region.create(0, 0, "plain")
local r2 = r:get_astral('fog')
local r3 = region.create(r2.x+1, r2.y, 'fog')
local r4 = region.create(r2.x+2, r2.y, 'fog')
local f = faction.create("human")
local u = unit.create(f, r)
local uh = unit.create(get_monsters(), r2, 1, "braineater")
u.magic = "tybied"
u:set_skill("magic", 100) -- level 100 should beat magic resistance
u.aura = 200
u:add_spell("astral_disruption", 14)
-- at level 5, range +1:
u:add_order('ZAUBERE STUFE 5 "Stoere Astrale Integritaet"')
process_orders()
assert_equal(60, u.aura)
assert_equal(100, r2:get_curse("astralblock"))
assert_equal(100, r3:get_curse("astralblock"))
assert_nil(r4:get_curse("astralblock"))
assert_equal(r, uh.region)
end
function test_astral_disruption_default_level()
local r = region.create(0, 0, "plain")
local r2 = r:get_astral('fog')
local r3 = region.create(r2.x+1, r2.y, 'fog')
local r4 = region.create(r3.x+1, r2.y, 'fog')
local r5 = region.create(r4.x+1, r2.y, 'fog')
local f = faction.create("human")
local u = unit.create(f, r)
local uh = unit.create(get_monsters(), r2, 1, "braineater")
u.magic = "tybied"
u:set_skill("magic", 100) -- level 100 should beat magic resistance
u.aura = 200
u:add_spell("astral_disruption", 14)
-- no level means cast at the spell's level (14)
u:add_order('ZAUBERE "Stoere Astrale Integritaet"')
process_orders()
assert_equal(60, u.aura)
assert_equal(100, r2:get_curse("astralblock"))
assert_equal(100, r3:get_curse("astralblock"))
assert_equal(100, r4:get_curse("astralblock"))
assert_nil(r5:get_curse("astralblock"))
assert_equal(r, uh.region)
end

View file

@ -45,7 +45,6 @@ function test_stealth_faction_on()
end
function test_stealth_faction_other()
u.name = "Enno"
u:clear_orders()
u:add_order("TARNEN PARTEI NUMMER " .. itoa36(f.id))

View file

@ -6,7 +6,6 @@ else
module(tcname, lunit.testcase, package.seeall)
end
local settings
-- use the C implementation in market.c, because the Lua
-- module is wrong (https://bugs.eressea.de/view.php?id=2225)
@ -16,28 +15,14 @@ local function process_markets()
eressea.process.markets()
end
local function set_rule(key, value)
if value==nil then
eressea.settings.set(key, settings[key])
else
settings[key] = settings[key] or eressea.settings.get(key)
eressea.settings.set(key, value)
end
end
function setup()
eressea.game.reset()
settings = {}
set_rule("rules.move.owner_leave", "1")
set_rule("rules.food.flags", "4")
set_rule("rules.ship.drifting", "0")
set_rule("rules.ship.storms", "0")
end
function teardown()
for k,_ in pairs(settings) do
set_rule(k)
end
eressea.settings.set("rules.move.owner_leave", "1")
eressea.settings.set("rules.food.flags", "4")
eressea.settings.set("rules.ship.drifting", "0")
eressea.settings.set("rules.ship.storms", "0")
eressea.settings.set("magic.resist.enable", "0")
end
function test_new_faction_cannot_give_unit()
@ -988,7 +973,7 @@ function test_no_uruk()
end
function test_bug2187()
set_rule("rules.food.flags", "0")
eressea.settings.set("rules.food.flags", "0")
local r = region.create(0,0,"plain")
local f = faction.create("goblin", "2187@eressea.de", "de")
@ -1005,7 +990,7 @@ function test_bug2187()
-- init_reports()
-- write_report(f)
set_rule("rules.food.flags", "4")
eressea.settings.set("rules.food.flags", "4")
end
@ -1027,8 +1012,8 @@ end
function test_demons_using_mallornlance()
-- bug 2392
set_rule("skillchange.demon.up", "0")
set_rule("NewbieImmunity", "0")
eressea.settings.set("skillchange.demon.up", "0")
eressea.settings.set("NewbieImmunity", "0")
local r = region.create(0, 0, "plain")
local f = faction.create('goblin')
local u = unit.create(f, r, 1, 'demon')

View file

@ -230,6 +230,27 @@ function test_use_domore()
assert_equal(2, u:get_item("sword"))
end
function test_make_greatbow()
local r = region.create(0, 0, "plain")
local f = faction.create("human", "greatbow@eressea.de", "de")
local u = unit.create(f, r, 1)
turn_begin()
u:add_item('mallorn', 2)
u:set_skill('weaponsmithing', 5)
u:clear_orders()
u:add_order("MACHE 1 Elfenbogen")
turn_process()
assert_equal(2, u:get_item('mallorn'))
assert_equal(0, u:get_item('greatbow'))
assert_equal(1, f:count_msg_type('error117'))
u.race='elf'
turn_process()
assert_equal(0, u:get_item('mallorn'))
assert_equal(1, u:get_item('greatbow'))
turn_end()
end
function test_bloodpotion_demon()
local r = region.create(0, 0, "plain")
local f = faction.create("demon")

View file

@ -256,7 +256,6 @@ function test_promote_after_recruit()
local r1 = region.create(0, 0, 'plain')
local r2 = region.create(1, 0, 'plain')
local u1 = unit.create(f, r1, 1)
u1.name = 'Xolgrim'
local u2 = unit.create(f, r2, 55)
u2:add_order('REKRUTIERE 1')
u1:add_order('BEFOERDERE')

View file

@ -15,6 +15,7 @@ function setup()
eressea.settings.set("rules.encounters", "0")
eressea.settings.set("magic.fumble.enable", "0")
eressea.settings.set("magic.regeneration.enable", "0")
eressea.settings.set("magic.resist.enable", "0")
end
function test_create_bogus()
@ -93,7 +94,6 @@ function test_appeasement_can_move()
r2 = region.create(1, 0, 'plain')
u2 = unit.create(faction.create('human'), r1, 1)
u2.race = 'elf'
u2.name = 'Angsthase'
u2.magic = 'gwyrrd'
u2:set_skill('magic', 5)
u2.aura = 10
@ -117,7 +117,6 @@ function test_appeasement_break_guard()
r2 = region.create(1, 0, 'plain')
u2 = unit.create(faction.create('human'), r1, 1)
u2.race = 'elf'
u2.name = 'Angsthase'
u2.magic = 'gwyrrd'
u2.guard = true
u2.status = 1
@ -137,3 +136,53 @@ function test_appeasement_break_guard()
assert_equal(5, u2.status)
assert_equal(false, u2.guard)
end
local function create_cp_mage(f, r)
local u2 = unit.create(f, r, 1)
u2.race = 'human'
u2.magic = 'cerddor'
u2:set_skill('magic', 20)
u2.aura = 100
u2:add_spell('song_of_confusion')
u2:add_spell('frighten')
u2.status = 3
return u2
end
local function create_cp_front(f, r)
local u2 = unit.create(f, r, 1000)
u2:set_skill('melee', 20)
u2:set_skill('stamina', 3)
u2:add_item('axe', u2.number)
u2:add_item('plate', u2.number)
u2:add_item('shield', u2.number)
u2.hp = u2.hp_max * u2.number
return u2
end
function test_confusion_and_panic()
f = faction.create('demon')
f2 = faction.create('demon')
local u1, u2, u3, u4, r
r = region.create(0, 0, 'plain')
u1 = create_cp_front(f, r)
u2 = create_cp_mage(f, r)
u3 = create_cp_mage(f, r)
u2:add_order('KAMPFZAUBER STUFE 10 "Gesang der Angst"')
u3:add_order('KAMPFZAUBER STUFE 10 "Gesang der Verwirrung"')
create_cp_mage(f, r)
local u4 = create_cp_front(f2, r)
create_cp_mage(f2, r)
create_cp_mage(f2, r)
create_cp_mage(f2, r)
for ux in r.units do
for uy in r.units do
if ux.faction ~= uy.faction then
ux:add_order("ATTACKIERE " .. itoa36(uy.id))
end
end
end
process_orders()
end

View file

@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.13)
project (server C)
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
include_directories (${CJSON_INCLUDE_DIR})
include_directories (${CRYPTO_INCLUDE_DIR})
include_directories (${CLIBS_INCLUDE_DIR})
include_directories (${STORAGE_INCLUDE_DIR})
@ -10,43 +9,34 @@ include_directories (${TOLUA_INCLUDE_DIR})
include_directories (${LUA_INCLUDE_DIR})
include_directories (${INIPARSER_INCLUDE_DIR})
IF(DEFINED ERESSEA_VERSION)
set_source_files_properties(kernel/version.c PROPERTIES
COMPILE_DEFINITIONS ERESSEA_VERSION="${ERESSEA_VERSION}")
ENDIF()
IF(DEFINED ERESSEA_BUILDNO)
set_source_files_properties(kernel/version.c PROPERTIES
COMPILE_DEFINITIONS ERESSEA_BUILDNO="${ERESSEA_BUILDNO}")
ENDIF()
IF (CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wvla")
ENDIF()
IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion -Wno-sign-conversion")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long")
# SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89")
ELSEIF(MSVC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /WX /MP /D_CRT_SECURE_NO_WARNINGS /D_USE_MATH_DEFINES")
if (CMAKE_COMPILER_IS_GNUCC)
add_compile_options(-Wvla)
endif()
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wsign-compare -Wall -Werror -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wno-char-subscripts -Wno-long-long)
elseif(MSVC)
add_compile_options(/WX /MP /FC)
# set(EXTRA_C_FLAGS /WX /MP /D_CRT_SECURE_NO_WARNINGS /D_USE_MATH_DEFINES)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG
"${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE
"${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib")
ELSE()
MESSAGE(STATUS "unknown compiler ${CMAKE_C_COMPILER_ID}")
ENDIF()
else()
message(STATUS "unknown compiler ${CMAKE_C_COMPILER_ID}")
endif()
IF(CMAKE_COMPILER_IS_CLANG)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wtautological-compare -Weverything")
MESSAGE(STATUS "compiler is clang: ${CMAKE_C_COMPILER_ID}")
ELSEIF(CMAKE_COMPILER_IS_GCC)
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wtautological-compare -Weverything")
message(STATUS "compiler is clang: ${CMAKE_C_COMPILER_ID}")
elseif(CMAKE_COMPILER_IS_GCC)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
IF (GCC_VERSION VERSION_GREATER 4.9)
if (GCC_VERSION VERSION_GREATER 4.9)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wfloat-conversion")
ENDIF()
ENDIF(CMAKE_COMPILER_IS_CLANG)
endif()
endif(CMAKE_COMPILER_IS_CLANG)
string(REGEX REPLACE "/W[3|4]" "/w" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_subdirectory(util)
add_subdirectory(kernel)
@ -57,25 +47,24 @@ add_subdirectory(triggers)
add_subdirectory(modules)
add_subdirectory(races)
MACRO(ADD_LUA_MODULE MODULE_NAME FILES)
ADD_LIBRARY (${MODULE_NAME} SHARED ${FILES})
SET_TARGET_PROPERTIES(${MODULE_NAME}
macro(ADD_LUA_MODULE MODULE_NAME FILES)
add_library (${MODULE_NAME} SHARED ${FILES})
set_target_properties(${MODULE_NAME}
PROPERTIES
PREFIX ""
)
ENDMACRO(ADD_LUA_MODULE)
endmacro(ADD_LUA_MODULE)
MACRO(TOLUA_BINDING PKGFILE FILES)
ADD_CUSTOM_COMMAND(
macro(TOLUA_BINDING PKGFILE FILES)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${PKGFILE}.c
DEPENDS ${FILES} ${PKGFILE}
COMMAND ${TOLUA_EXECUTABLE}
ARGS -o ${CMAKE_CURRENT_SOURCE_DIR}/${PKGFILE}.c ${PKGFILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
ENDMACRO(TOLUA_BINDING)
endmacro(TOLUA_BINDING)
IF(NOT MSVC)
TOLUA_BINDING(log.pkg util/log.h)
TOLUA_BINDING(locale.pkg bind_locale.h)
TOLUA_BINDING(config.pkg bind_config.h)
@ -83,7 +72,6 @@ TOLUA_BINDING(process.pkg bind_process.h)
TOLUA_BINDING(game.pkg bind_eressea.h config.h)
TOLUA_BINDING(eressea.pkg bind_eressea.h)
TOLUA_BINDING(settings.pkg kenel/config.h)
ENDIF()
set (PARSER_SRC
${DB_SRC}
@ -92,7 +80,6 @@ set (PARSER_SRC
set (ERESSEA_SRC
vortex.c
academy.c
alchemy.c
automate.c
battle.c
@ -126,7 +113,7 @@ set (ERESSEA_SRC
renumber.c
report.c
reports.c
skill.c
sort.c
spells.c
spy.c
steal.c
@ -168,6 +155,7 @@ set(SERVER_SRC
bindings.c
console.c
helpers.c
signals.c
main.c
)
@ -179,40 +167,52 @@ set (SERVER_SRC ${SERVER_SRC}
)
endif(CURSES_FOUND)
find_program(IWYU_PATH NAMES include-what-you-use iwyu)
if(NOT IWYU_PATH)
message(STATUS "Could not find the program include-what-you-use")
#find_program(IWYU_PATH NAMES include-what-you-use iwyu)
if(IWYU_PATH)
# set(C_INCLUDE_WHAT_YOU_USE "${IWYU_PATH} -Xiwyu --no_fwd_decls")
else(IWYU_PATH)
# message(STATUS "Could not find the program include-what-you-use")
endif()
add_library(version STATIC ${VERSION_SRC})
if(DEFINED ERESSEA_VERSION)
target_compile_definitions(version PRIVATE ERESSEA_VERSION="${ERESSEA_VERSION}")
endif()
if(DEFINED ERESSEA_BUILDNO)
target_compile_definitions(version PRIVATE ERESSEA_BUILDNO="${ERESSEA_BUILDNO}")
endif()
add_library(parser ${PARSER_SRC})
target_link_libraries(parser
${CLIBS_LIBRARIES}
${CRYPTO_LIBRARIES}
)
add_executable(checker ${CHECK_SRC})
target_link_libraries(checker parser)
if (HAVE_LIBBSD)
set (EXTRA_LIBS ${EXTRA_LIBS} bsd)
endif (HAVE_LIBBSD)
if (HAVE_LIBM)
set (EXTRA_LIBS ${EXTRA_LIBS} m)
endif (HAVE_LIBM)
add_library(game ${ERESSEA_SRC})
target_link_libraries(game parser version)
target_link_libraries(game ${EXTRA_LIBS} parser version)
add_executable(eressea ${SERVER_SRC})
if (IWYU_PATH)
set_property(TARGET eressea PROPERTY C_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
endif(IWYU_PATH)
target_link_libraries(eressea
game
${TOLUA_LIBRARIES}
${LUA_LIBRARIES}
${STORAGE_LIBRARIES}
${CJSON_LIBRARIES}
${INIPARSER_LIBRARIES}
${IniParser_LIBRARIES}
)
set(TESTS_SRC
academy.test.c
alchemy.test.c
automate.test.c
battle.test.c
@ -238,7 +238,7 @@ set(TESTS_SRC
renumber.test.c
report.test.c
reports.test.c
skill.test.c
sort.test.c
spells.test.c
spy.test.c
study.test.c
@ -268,9 +268,14 @@ target_link_libraries(test_eressea
${CLIBS_LIBRARIES}
${STORAGE_LIBRARIES}
${CJSON_LIBRARIES}
${INIPARSER_LIBRARIES}
${IniParser_LIBRARIES}
)
set_target_properties(test_eressea eressea PROPERTIES C_STANDARD 90)
if (IWYU_PATH)
set_target_properties(test_eressea eressea PROPERTIES C_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
endif(IWYU_PATH)
add_test(server test_eressea)
#add_test(NAME E3
# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/game-e3
@ -282,51 +287,54 @@ add_test(server test_eressea)
install(TARGETS eressea DESTINATION "bin")
if (HAVE_EXECINFO_H AND HAVE_SIGNAL_H)
add_definitions(-DHAVE_BACKTRACE)
add_compile_definitions(HAVE_BACKTRACE)
endif ()
if (HAVE_LIBBSD)
add_definitions(-DHAVE_LIBBSD)
add_compile_definitions(HAVE_LIBBSD)
endif (HAVE_LIBBSD)
if (HAVE_STRLCAT)
add_definitions(-DHAVE_BSDSTRING)
add_compile_definitions(HAVE_BSDSTRING)
endif (HAVE_STRLCAT)
if (HAVE_STRDUP)
add_definitions(-DHAVE_STRDUP)
add_compile_definitions(HAVE_STRDUP)
endif(HAVE_STRDUP)
if (HAVE_LIBBSD)
target_link_libraries(parser bsd)
endif (HAVE_LIBBSD)
if (SQLITE3_FOUND)
include_directories (${SQLITE3_INCLUDE_DIR})
target_link_libraries(eressea ${SQLITE3_LIBRARIES})
target_link_libraries(test_eressea ${SQLITE3_LIBRARIES})
add_definitions(-DUSE_SQLITE)
target_include_directories (game PUBLIC ${CJSON_INCLUDE_DIRS})
target_include_directories (game PUBLIC ${IniParser_INCLUDE_DIRS})
if (SQLite3_FOUND)
target_include_directories (game PRIVATE ${SQLite3_INCLUDE_DIRS})
target_link_libraries(eressea ${SQLite3_LIBRARIES})
target_link_libraries(test_eressea ${SQLite3_LIBRARIES})
target_compile_definitions(game PRIVATE USE_SQLITE)
elseif (DB_FOUND)
include_directories (${DB_INCLUDE_DIR})
#include_directories (${DB_INCLUDE_DIR})
target_link_libraries(eressea ${DB_LIBRARIES})
target_link_libraries(test_eressea ${DB_LIBRARIES})
add_definitions(-DUSE_DB)
endif(SQLITE3_FOUND)
target_compile_definitions(game PRIVATE USE_DB)
endif(SQLite3_FOUND)
if (READLINE_FOUND)
include_directories (${READLINE_INCLUDE_DIR})
#include_directories (${READLINE_INCLUDE_DIR})
target_link_libraries(eressea ${READLINE_LIBRARY})
add_definitions(-DUSE_READLINE)
target_compile_definitions(eressea PRIVATE DUSE_READLINE)
endif (READLINE_FOUND)
if (CURSES_FOUND)
include_directories (${CURSES_INCLUDE_DIR})
target_include_directories (eressea PRIVATE ${CURSES_INCLUDE_DIRS})
target_link_libraries(eressea ${CURSES_LIBRARIES})
add_definitions(-DUSE_CURSES)
target_compile_definitions(eressea PRIVATE USE_CURSES)
endif(CURSES_FOUND)
if (EXPAT_FOUND)
include_directories (${EXPAT_INCLUDE_DIRS})
target_include_directories (game PRIVATE ${EXPAT_INCLUDE_DIRS})
target_link_libraries(eressea ${EXPAT_LIBRARIES})
target_link_libraries(test_eressea ${EXPAT_LIBRARIES})
endif (EXPAT_FOUND)

View file

@ -1,22 +0,0 @@
#include "platform.h"
#include "kernel/config.h"
#include <kernel/unit.h>
#include <kernel/building.h>
#include <kernel/item.h>
#include <kernel/pool.h>
#include "academy.h"
#include "study.h"
void academy_teaching_bonus(struct unit *u, skill_t sk, int students) {
if (students > 0 && sk != NOSKILL) {
/* actually students * EXPERIENCEDAYS / MAX_STUDENTS */
learn_skill(u, sk, students);
}
}
bool academy_can_teach(unit *teacher, unit *scholar, skill_t sk) {
const struct building_type *btype = bt_find("academy");
return (active_building(scholar, btype));
}

View file

@ -1,16 +0,0 @@
#ifndef H_ACADEMY
#define H_ACADEMY
#include <skill.h>
#ifdef __cplusplus
extern "C" {
#endif
struct unit;
void academy_teaching_bonus(struct unit *u, skill_t sk, int academy);
bool academy_can_teach(struct unit *teacher, struct unit *scholar, skill_t sk);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,52 +0,0 @@
#include <platform.h>
#include "academy.h"
#include "skill.h"
#include <kernel/config.h>
#include <kernel/building.h>
#include <kernel/faction.h>
#include <kernel/unit.h>
#include <kernel/item.h>
#include <kernel/region.h>
#include <CuTest.h>
#include "tests.h"
static void test_academy(CuTest * tc)
{
faction *f;
unit *u, *u2;
region *r;
building *b;
const item_type *it_silver;
test_setup();
config_set_int("skills.cost.alchemy", 100);
r = test_create_region(0, 0, NULL);
f = test_create_faction(NULL);
u = test_create_unit(f, r);
b = test_create_building(r, test_create_buildingtype("academy"));
u2 = test_create_unit(f, r);
it_silver = test_create_silver();
CuAssert(tc, "teacher must be in academy", !academy_can_teach(u, u2, SK_CROSSBOW));
u_set_building(u, b);
CuAssert(tc, "student must be in academy", !academy_can_teach(u, u2, SK_CROSSBOW));
u_set_building(u2, b);
CuAssert(tc, "student must have 50 silver", !academy_can_teach(u, u2, SK_CROSSBOW));
i_change(&u2->items, it_silver, 50);
CuAssert(tc, "building must be maintained", !academy_can_teach(u, u2, SK_CROSSBOW));
b->flags |= BLD_MAINTAINED;
CuAssert(tc, "building must have capacity", !academy_can_teach(u, u2, SK_CROSSBOW));
b->size = 2;
CuAssertTrue(tc, academy_can_teach(u, u2, SK_CROSSBOW));
test_teardown();
}
CuSuite *get_academy_suite(void)
{
CuSuite *suite = CuSuiteNew();
SUITE_ADD_TEST(suite, test_academy);
return suite;
}

View file

@ -2,21 +2,21 @@
#include <kernel/config.h>
#include "alchemy.h"
#include "guard.h"
#include "skill.h"
#include "study.h"
#include <kernel/item.h>
#include <kernel/faction.h>
#include <kernel/messages.h>
#include <kernel/attrib.h>
#include <kernel/build.h>
#include <kernel/faction.h>
#include <kernel/gamedata.h>
#include <kernel/item.h>
#include <kernel/messages.h>
#include <kernel/region.h>
#include <kernel/pool.h>
#include <kernel/race.h>
#include <kernel/unit.h>
#include "kernel/skill.h"
#include "kernel/unit.h"
/* util includes */
#include <kernel/attrib.h>
#include <kernel/gamedata.h>
#include <util/base36.h>
#include <util/log.h>
#include <util/macros.h>

View file

@ -29,10 +29,10 @@ static void test_herbsearch(CuTest * tc)
r = test_create_region(0, 0, NULL);
rc = rc_get_or_create("dragon");
rc->flags |= RCF_UNARMEDGUARD;
u2 = test_create_unit(test_create_faction(rc), r);
u2 = test_create_unit(test_create_faction_ex(rc, NULL), r);
setguard(u2, true);
f = test_create_faction(NULL);
f = test_create_faction();
u = test_create_unit(f, r);
itype = test_create_itemtype("rosemary");

View file

@ -14,7 +14,6 @@
#include "stealth.h"
#include "magic.h"
#include "movement.h"
#include "dict.h"
#include "otherfaction.h"
#include "overrideroads.h"
#include "racename.h"
@ -61,7 +60,7 @@ static int obs_age(struct attrib *a, void *owner)
UNUSED_ARG(owner);
update_interval(od->f, (region *)owner);
return --od->timer;
return --od->timer > 0;
}
static void obs_write(const variant *var, const void *owner,
@ -90,13 +89,13 @@ attrib_type at_observer = {
"observer", obs_init, a_free_voidptr, obs_age, obs_write, obs_read
};
static attrib *make_observer(faction *f, int perception)
static attrib *make_observer(faction *f, int perception, int timer)
{
attrib * a = a_new(&at_observer);
obs_data *od = (obs_data *)a->data.v;
od->f = f;
od->skill = perception;
od->timer = 2;
od->timer = timer;
return a;
}
@ -132,7 +131,7 @@ void set_observer(region *r, faction *f, int skill, int turns)
else {
fset(r, RF_OBSERVER);
}
a_add(&r->attribs, make_observer(f, skill));
a_add(&r->attribs, make_observer(f, skill, turns));
}
attrib_type at_unitdissolve = {
@ -145,7 +144,7 @@ static int read_ext(variant *var, void *owner, gamedata *data)
UNUSED_ARG(var);
READ_INT(data->store, &len);
data->store->api->r_bin(data->store->handle, NULL, (size_t)len);
data->store->api->r_str(data->store->handle, NULL, (size_t)len);
return AT_READ_OK;
}
@ -198,7 +197,6 @@ void register_attributes(void)
at_deprecate("gm", a_readint);
at_deprecate("guard", a_readint); /* used to contain guard-flags (v3.10.0-259-g8597e8b) */
at_register(&at_stealth);
at_register(&at_dict);
at_register(&at_unitdissolve);
at_register(&at_observer);
at_register(&at_overrideroads);

View file

@ -1,4 +1,6 @@
#include <platform.h>
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <kernel/config.h>
#include "key.h"

View file

@ -38,8 +38,8 @@ static void test_otherfaction(CuTest *tc) {
faction *f;
test_setup();
u = test_create_unit(test_create_faction(NULL), test_create_region(0, 0, NULL));
f = test_create_faction(NULL);
u = test_create_unit(test_create_faction(), test_create_region(0, 0, NULL));
f = test_create_faction_ex(u->faction->race, u->faction->locale);
config_set("stealth.faction.other", "1");
CuAssertIntEquals(tc, true, rule_stealth_other());
CuAssertPtrEquals(tc, u->faction, visible_faction(f, u));

View file

@ -15,7 +15,7 @@ static void test_stealth(CuTest *tc) {
unit *u;
test_setup();
u = test_create_unit(test_create_faction(test_create_race("human")), test_create_region(0, 0, NULL));
u = test_create_unit(test_create_faction(), test_create_region(0, 0, NULL));
set_level(u, SK_STEALTH, 2);
CuAssertIntEquals(tc, -1, u_geteffstealth(u));
CuAssertIntEquals(tc, 2, eff_stealth(u, u->region));

View file

@ -6,9 +6,12 @@
#include "kernel/order.h"
#include "kernel/region.h"
#include "kernel/unit.h"
#include "kernel/pool.h"
#include "kernel/item.h"
#include "util/keyword.h"
#include "util/log.h"
#include "util/stats.h"
#include "automate.h"
#include "laws.h"
@ -36,7 +39,7 @@ int autostudy_init(scholar scholars[], int max_scholars, unit **units, skill_t *
if (kwd == K_AUTOSTUDY) {
if (f == u->faction) {
unext = u->next;
if (long_order_allowed(u)) {
if (long_order_allowed(u, false)) {
scholar * st = scholars + nscholars;
skill_t sk = getskill(u->faction->locale);
if (skill == NOSKILL && sk != NOSKILL) {
@ -195,6 +198,7 @@ void do_autostudy(region *r)
assert(batchsize <= MAXSCHOLARS);
}
for (u = r->units; u; u = u->next) {
if (is_paused(u->faction)) continue;
if (!fval(u, UFL_MARK)) {
unit *ulist = u;
int sum_scholars = 0;
@ -210,7 +214,12 @@ void do_autostudy(region *r)
autostudy_run(scholars, nscholars);
for (i = 0; i != nscholars; ++i) {
int days = STUDYDAYS * scholars[i].learn;
learn_skill(scholars[i].u, skill, days);
int money = learn_skill(scholars[i].u, skill, days, 0);
if (money > 0) {
use_pooled(u, get_resourcetype(R_SILVER), GET_DEFAULT, money);
ADDMSG(&u->faction->msgs, msg_message("studycost",
"unit region cost skill", scholars[i].u, r, money, skill));
}
}
}
}

View file

@ -3,10 +3,9 @@
#ifndef H_GC_AUTOMATE
#define H_GC_AUTOMATE
#include "skill.h"
struct region;
struct unit;
enum skill_t;
typedef struct scholar {
struct unit *u;
@ -19,7 +18,8 @@ typedef struct scholar {
void do_autostudy(struct region *r);
int autostudy_init(scholar scholars[], int max_scholars, struct unit **units, skill_t *o_skill);
int autostudy_init(scholar scholars[], int max_scholars,
struct unit **units, enum skill_t *o_skill);
void autostudy_run(scholar scholars[], int nscholars);
#endif

View file

@ -29,7 +29,7 @@ static void test_autostudy_init(CuTest *tc) {
mt_create_error(771);
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_ENTERTAINMENT]);
test_create_unit(f, r);
@ -40,7 +40,7 @@ static void test_autostudy_init(CuTest *tc) {
u4->thisorder = create_order(K_AUTOSTUDY, f->locale, "Dudelidu");
u3 = test_create_unit(f, r);
u3->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_PERCEPTION]);
u5 = test_create_unit(test_create_faction(NULL), r);
u5 = test_create_unit(test_create_faction(), r);
u5->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_PERCEPTION]);
scholars[2].u = NULL;
@ -82,7 +82,7 @@ static void test_autostudy_run_twoteachers(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
set_level(u1, SK_ENTERTAINMENT, 2);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_ENTERTAINMENT]);
@ -123,7 +123,7 @@ static void test_autostudy_run_bigunit(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
set_number(u1, 20);
set_level(u1, SK_ENTERTAINMENT, 16);
@ -154,7 +154,7 @@ static void test_autostudy_run_few_teachers(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
set_number(u1, 20);
set_level(u1, SK_ENTERTAINMENT, 16);
@ -190,7 +190,7 @@ static void test_autostudy_run_few_teachers_reverse(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
set_number(u1, 20);
set_level(u1, SK_ENTERTAINMENT, 16);
@ -224,7 +224,7 @@ static void test_autostudy_run(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_ENTERTAINMENT]);
set_number(u1, 2);
@ -268,7 +268,7 @@ static void test_autostudy_run_noteachers(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_ENTERTAINMENT]);
set_number(u1, 5);
@ -303,7 +303,7 @@ static void test_autostudy_run_teachers_learn(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_ENTERTAINMENT]);
set_number(u1, 2);
@ -332,7 +332,7 @@ static void test_autostudy_run_skilldiff(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_PERCEPTION]);
set_number(u1, 1);
@ -364,7 +364,7 @@ static void test_autostudy_batches(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_PERCEPTION]);
set_number(u1, 1);
@ -396,7 +396,7 @@ static void test_do_autostudy(CuTest *tc) {
test_setup();
r = test_create_plain(0, 0);
f = test_create_faction(NULL);
f = test_create_faction();
u1 = test_create_unit(f, r);
u1->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_PERCEPTION]);
set_number(u1, 1);
@ -406,7 +406,7 @@ static void test_do_autostudy(CuTest *tc) {
set_number(u2, 10);
u3 = test_create_unit(f, r);
u3->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_ENTERTAINMENT]);
u4 = test_create_unit(test_create_faction(NULL), r);
u4 = test_create_unit(test_create_faction(), r);
u4->thisorder = create_order(K_AUTOSTUDY, f->locale, skillnames[SK_ENTERTAINMENT]);
do_autostudy(r);
CuAssertIntEquals(tc, 2, get_level(u1, SK_PERCEPTION));

View file

@ -1,4 +1,5 @@
#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#include <platform.h>
#endif
@ -9,56 +10,57 @@
#include "laws.h"
#include "monsters.h"
#include "move.h"
#include "skill.h"
#include "study.h"
#include "spy.h"
#include <spells/buildingcurse.h>
#include <spells/regioncurse.h>
#include <spells/unitcurse.h>
#include "spells/buildingcurse.h"
#include "spells/regioncurse.h"
#include "spells/unitcurse.h"
#include <kernel/ally.h>
#include <kernel/alliance.h>
#include <kernel/build.h>
#include <kernel/building.h>
#include <kernel/curse.h>
#include <kernel/equipment.h>
#include <kernel/faction.h>
#include <kernel/group.h>
#include <kernel/item.h>
#include <kernel/messages.h>
#include <kernel/order.h>
#include <kernel/plane.h>
#include <kernel/race.h>
#include <kernel/region.h>
#include <kernel/ship.h>
#include <kernel/terrain.h>
#include <kernel/unit.h>
#include <kernel/spell.h>
#include "kernel/ally.h"
#include "kernel/alliance.h"
#include "kernel/build.h"
#include "kernel/building.h"
#include "kernel/curse.h"
#include "kernel/equipment.h"
#include "kernel/faction.h"
#include "kernel/group.h"
#include "kernel/item.h"
#include "kernel/messages.h"
#include "kernel/order.h"
#include "kernel/plane.h"
#include "kernel/race.h"
#include "kernel/region.h"
#include "kernel/ship.h"
#include "kernel/skill.h"
#include "kernel/terrain.h"
#include "kernel/unit.h"
#include "kernel/spell.h"
#include <reports.h>
#include "reports.h"
/* attributes includes */
#include <attributes/key.h>
#include <attributes/racename.h>
#include <attributes/otherfaction.h>
#include "attributes/key.h"
#include "attributes/racename.h"
#include "attributes/otherfaction.h"
/* util includes */
#include <util/assert.h>
#include <kernel/attrib.h>
#include <util/base36.h>
#include <util/language.h>
#include <util/lists.h>
#include <util/log.h>
#include <util/macros.h>
#include <util/parser.h>
#include <util/strings.h>
#include <util/rand.h>
#include <util/rng.h>
#include "kernel/attrib.h"
#include "util/base36.h"
#include "util/language.h"
#include "util/lists.h"
#include "util/log.h"
#include "util/macros.h"
#include "util/parser.h"
#include "util/strings.h"
#include "util/stats.h"
#include "util/rand.h"
#include "util/rng.h"
#include <selist.h>
/* libc includes */
#include <assert.h>
#include <ctype.h>
#include <limits.h>
#include <math.h>
@ -109,6 +111,7 @@ const troop no_troop = { 0, 0 };
static int max_turns;
static int rule_damage;
static int rule_loot;
static double loot_divisor;
static int flee_chance_max_percent;
static int flee_chance_base;
static int flee_chance_skill_bonus;
@ -146,6 +149,7 @@ static void init_rules(void)
rule_vampire = config_get_int("rules.combat.demon_vampire", 0);
rule_loot = config_get_int("rules.combat.loot",
LOOT_MONSTERS | LOOT_OTHERS | LOOT_KEEPLOOT);
loot_divisor = config_get_flt("rules.items.loot_divisor", 1);
/* new formula to calculate to-hit-chance */
skill_formula = config_get_int("rules.combat.skill_formula",
FORMULA_ORIG);
@ -193,7 +197,7 @@ void battle_message_faction(battle * b, faction * f, struct message *m)
assert(f);
if (f->battles == NULL || f->battles->r != r) {
struct bmsg *bm = (struct bmsg *)calloc(1, sizeof(struct bmsg));
assert_alloc(bm);
assert(bm);
bm->next = f->battles;
f->battles = bm;
bm->r = r;
@ -375,7 +379,7 @@ static int get_row(const side * s, int row, const side * vs)
memset(size, 0, sizeof(size));
for (line = FIRST_ROW; line != NUMROWS; ++line) {
int si, sa_i;
/* how many enemies are there in the first row? */
/* how many enemies are there in this row? */
for (si = 0; s->enemies[si]; ++si) {
side *se = s->enemies[si];
if (se->size[line] > 0) {
@ -425,24 +429,14 @@ int get_unitrow(const fighter * af, const side * vs)
int row = statusrow(af->status);
if (vs == NULL) {
int i;
for (i = FIGHT_ROW; i != row; ++i)
if (af->side->size[i])
for (i = FIGHT_ROW; i != row; ++i) {
if (af->side->size[i]) {
break;
}
}
return FIGHT_ROW + (row - i);
}
else {
battle *b = vs->battle;
if (row != b->rowcache.row || b->alive != b->rowcache.alive
|| af->side != b->rowcache.as || vs != b->rowcache.vs) {
b->rowcache.alive = b->alive;
b->rowcache.as = af->side;
b->rowcache.vs = vs;
b->rowcache.row = row;
b->rowcache.result = get_row(af->side, row, vs);
return b->rowcache.result;
}
return b->rowcache.result;
}
return get_row(af->side, row, vs);
}
static void reportcasualties(battle * b, fighter * fig, int dead)
@ -774,7 +768,28 @@ int select_magicarmor(troop t)
return ma;
}
/* Sind side ds und Magier des meffect verbuendet, dann return 1*/
int meffect_apply(struct meffect *me, int damage) {
assert(0 <= damage); /* damage sollte hier immer mindestens 0 sein */
/* jeder Schaden wird um effect% reduziert bis der Schild duration
* Trefferpunkte aufgefangen hat */
if (me->typ == SHIELD_REDUCE && me->effect <= 100) {
int hp = damage * me->effect / 100;
if (hp > me->duration) {
hp = me->duration;
}
damage -= hp;
me->duration -= hp;
}
/* gibt Ruestung +effect fuer duration Treffer */
else if (me->typ == SHIELD_ARMOR) {
damage -= me->effect;
if (damage < 0) damage = 0;
me->duration--;
}
return damage;
}
/* Sind side ds und Magier des meffect verbuendet? */
bool meffect_protection(battle * b, meffect * s, side * ds)
{
UNUSED_ARG(b);
@ -789,7 +804,7 @@ bool meffect_protection(battle * b, meffect * s, side * ds)
return false;
}
/* Sind side as und Magier des meffect verfeindet, dann return 1*/
/* Sind side as und Magier des meffect verfeindet? */
bool meffect_blocked(battle * b, meffect * s, side * as)
{
UNUSED_ARG(b);
@ -815,7 +830,6 @@ void rmfighter(fighter * df, int i)
/* erst ziehen wir die Anzahl der Personen von den Kaempfern in der
* Schlacht, dann von denen auf dieser Seite ab*/
df->side->alive -= i;
df->side->battle->alive -= i;
/* Dann die Kampfreihen aktualisieren */
ds->size[SUM_ROW] -= i;
@ -852,9 +866,7 @@ void remove_troop(troop dt)
{
fighter *df = dt.fighter;
struct person p = df->person[dt.index];
battle *b = df->side->battle;
b->fast.alive = -1; /* invalidate cached value */
b->rowcache.alive = -1; /* invalidate cached value */
++df->removed;
++df->side->removed;
df->person[dt.index] = df->person[df->alive - df->removed];
@ -899,7 +911,7 @@ void drain_exp(struct unit *u, int n)
}
}
if (sk != NOSKILL) {
reduce_skill_days(u, sk, n);
change_skill_days(u, sk, -n);
}
}
@ -1215,37 +1227,25 @@ static int apply_race_resistance(int reduced_damage, fighter *df,
return reduced_damage;
}
static int apply_magicshield(int reduced_damage, fighter *df,
static int apply_magicshield(int damage, fighter *df,
const weapon_type *awtype, battle *b, bool magic) {
side *ds = df->side;
selist *ql;
int qi;
if (reduced_damage <= 0)
if (damage <= 0) {
return 0;
}
/* Schilde */
for (qi = 0, ql = b->meffects; ql; selist_advance(&ql, &qi, 1)) {
meffect *me = (meffect *)selist_get(ql, qi);
if (meffect_protection(b, me, ds) != 0) {
assert(0 <= reduced_damage); /* rda sollte hier immer mindestens 0 sein */
/* jeder Schaden wird um effect% reduziert bis der Schild duration
* Trefferpunkte aufgefangen hat */
if (me->typ == SHIELD_REDUCE) {
int hp = reduced_damage * (me->effect / 100);
reduced_damage -= hp;
me->duration -= hp;
}
/* gibt Ruestung +effect fuer duration Treffer */
if (me->typ == SHIELD_ARMOR) {
reduced_damage -= me->effect;
if (reduced_damage < 0) reduced_damage = 0;
me->duration--;
}
damage = meffect_apply(me, damage);
}
}
return reduced_damage;
return damage;
}
bool
@ -1406,35 +1406,11 @@ count_enemies_i(battle * b, const fighter * af, int minrow, int maxrow,
}
int
count_enemies(battle * b, const fighter * af, int minrow, int maxrow,
count_enemies(battle *b, const fighter *af, int minrow, int maxrow,
int select)
{
int sr = statusrow(af->status);
side *as = af->side;
if (b->alive == b->fast.alive && as == b->fast.side && sr == b->fast.status
&& minrow == b->fast.minrow && maxrow == b->fast.maxrow) {
if (b->fast.enemies[select] >= 0) {
return b->fast.enemies[select];
}
else if (select & SELECT_FIND) {
if (b->fast.enemies[select - SELECT_FIND] >= 0) {
return b->fast.enemies[select - SELECT_FIND];
}
}
}
else if (select != SELECT_FIND || b->alive != b->fast.alive) {
b->fast.side = as;
b->fast.status = sr;
b->fast.minrow = minrow;
b->fast.alive = b->alive;
b->fast.maxrow = maxrow;
memset(b->fast.enemies, -1, sizeof(b->fast.enemies));
}
if (maxrow >= FIRST_ROW) {
int i = count_enemies_i(b, af, minrow, maxrow, select);
b->fast.enemies[select] = i;
return i;
return count_enemies_i(b, af, minrow, maxrow, select);
}
return 0;
}
@ -1709,60 +1685,52 @@ void do_combatmagic(battle * b, combatmagic_t was)
for (s = b->sides; s != b->sides + b->nsides; ++s) {
fighter *fig;
for (fig = s->fighters; fig; fig = fig->next) {
unit *mage = fig->unit;
unit *caster = mage;
unit *u = fig->unit;
unit *caster = u;
if (fig->alive <= 0)
continue; /* fighter kann im Kampf getoetet worden sein */
level = effskill(mage, SK_MAGIC, r);
level = effskill(u, SK_MAGIC, r);
if (level > 0) {
double power;
const spell *sp;
const struct locale *lang = mage->faction->locale;
const struct locale *lang = u->faction->locale;
order *ord;
switch (was) {
case DO_PRECOMBATSPELL:
sp = get_combatspell(mage, 0);
sl = get_combatspelllevel(mage, 0);
sp = mage_get_combatspell(get_mage(u), 0, &sl);
break;
case DO_POSTCOMBATSPELL:
sp = get_combatspell(mage, 2);
sl = get_combatspelllevel(mage, 2);
sp = mage_get_combatspell(get_mage(u), 2, &sl);
break;
default:
/* Fehler! */
return;
}
if (sp == NULL)
if (sp == NULL || !u_hasspell(u, sp))
continue;
ord = create_order(K_CAST, lang, "'%s'", spell_name(mkname_spell(sp), lang));
if (!cancast(mage, sp, 1, 1, ord)) {
free_order(ord);
continue;
}
level = eff_spelllevel(mage, caster, sp, level, 1);
level = max_spell_level(u, caster, sp, level, 1, NULL);
if (sl > 0 && sl < level) {
level = sl;
}
if (level < 0) {
report_failed_spell(b, mage, sp);
free_order(ord);
if (level < 1) {
report_failed_spell(b, u, sp);
continue;
}
power = spellpower(r, mage, sp, level, ord);
ord = create_order(K_CAST, lang, "'%s'", spell_name(mkname_spell(sp), lang));
power = spellpower(r, u, sp, level);
free_order(ord);
if (power <= 0) { /* Effekt von Antimagie */
report_failed_spell(b, mage, sp);
pay_spell(mage, NULL, sp, level, 1);
report_failed_spell(b, u, sp);
pay_spell(u, NULL, sp, level, 1);
}
else if (fumble(r, mage, sp, level)) {
report_failed_spell(b, mage, sp);
pay_spell(mage, NULL, sp, level, 1);
else if (fumble(r, u, sp, level)) {
report_failed_spell(b, u, sp);
pay_spell(u, NULL, sp, level, 1);
}
else {
co = create_castorder_combat(0, fig, sp, level, power);
@ -1804,37 +1772,35 @@ static void do_combatspell(troop at)
{
const spell *sp;
fighter *fi = at.fighter;
unit *mage = fi->unit;
unit *u = fi->unit;
battle *b = fi->side->battle;
region *r = b->region;
selist *ql;
int level, qi;
int level, qi, sl;
double power;
int fumblechance = 0;
order *ord;
int sl;
const struct locale *lang = mage->faction->locale;
struct sc_mage *mage = get_mage(u);
sp = get_combatspell(mage, 1);
if (sp == NULL) {
if (!mage) {
fi->magic = 0; /* Hat keinen Kampfzauber, kaempft nichtmagisch weiter */
return;
}
ord = create_order(K_CAST, lang, "'%s'", spell_name(mkname_spell(sp), lang));
if (!cancast(mage, sp, 1, 1, ord)) {
sp = mage_get_combatspell(mage, 1, &sl);
if (sp == NULL || sl <= 0 || !u_hasspell(u, sp)) {
fi->magic = 0; /* Hat keinen Kampfzauber, kaempft nichtmagisch weiter */
return;
}
level = max_spell_level(u, u, sp, fi->magic, 1, NULL);
if (level < 1) {
fi->magic = 0; /* Kann nicht mehr Zaubern, kaempft nichtmagisch weiter */
return;
}
level = eff_spelllevel(mage, mage, sp, fi->magic, 1);
sl = get_combatspelllevel(mage, 1);
if (sl > 0 && sl < level) {
else if (sl < level) {
level = sl;
}
if (fumble(r, mage, sp, level)) {
report_failed_spell(b, mage, sp);
pay_spell(mage, NULL, sp, level, 1);
if (fumble(r, u, sp, level)) {
report_failed_spell(b, u, sp);
pay_spell(u, NULL, sp, level, 1);
return;
}
@ -1850,16 +1816,14 @@ static void do_combatspell(troop at)
/* Antimagie die Fehlschlag erhoeht */
if (rng_int() % 100 < fumblechance) {
report_failed_spell(b, mage, sp);
pay_spell(mage, NULL, sp, level, 1);
free_order(ord);
report_failed_spell(b, u, sp);
pay_spell(u, NULL, sp, level, 1);
return;
}
power = spellpower(r, mage, sp, level, ord);
free_order(ord);
power = spellpower(r, u, sp, level);
if (power <= 0) { /* Effekt von Antimagie */
report_failed_spell(b, mage, sp);
pay_spell(mage, NULL, sp, level, 1);
report_failed_spell(b, u, sp);
pay_spell(u, NULL, sp, level, 1);
return;
}
@ -1924,8 +1888,7 @@ int skilldiff(troop at, troop dt, int dist)
}
}
if (b->type->flags & BTF_FORTIFICATION) {
int stage = buildingeffsize(b, false);
int beff = building_protection(b->type, stage);
int beff = building_protection(b);
if (beff > 0) {
skdiff -= beff;
is_protected = 2;
@ -2123,12 +2086,13 @@ static void attack(battle * b, troop ta, const att * a, int numattack)
* sonst helden mit feuerschwertern zu maechtig */
if (numattack == 0 && wp && wp->type->attack) {
int dead = 0;
standard_attack = wp->type->attack(&ta, wp->type, &dead);
if (!standard_attack)
standard_attack = false;
if (wp->type->attack(&ta, wp->type, &dead)) {
reload = true;
af->catmsg += dead;
if (!standard_attack && af->person[ta.index].last_action < b->turn) {
af->person[ta.index].last_action = b->turn;
af->catmsg += dead;
if (af->person[ta.index].last_action < b->turn) {
af->person[ta.index].last_action = b->turn;
}
}
}
if (standard_attack) {
@ -2425,7 +2389,7 @@ troop select_ally(fighter * af, int minrow, int maxrow, int allytype)
dt.fighter = df;
return dt;
}
allies -= df->alive;
allies -= (df->alive - df->removed);
}
}
}
@ -2439,10 +2403,9 @@ static int loot_quota(const unit * src, const unit * dst,
{
UNUSED_ARG(type);
if (dst && src && src->faction != dst->faction) {
double divisor = config_get_flt("rules.items.loot_divisor", 1);
assert(divisor <= 0 || divisor >= 1);
if (divisor >= 1) {
double r = n / divisor;
assert(loot_divisor <= 0 || loot_divisor >= 1);
if (loot_divisor > 1) {
double r = n / loot_divisor;
int x = (int)r;
r = r - x;
@ -3108,7 +3071,6 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack)
fig->side = s1;
fig->alive = u->number;
fig->side->alive += u->number;
fig->side->battle->alive += u->number;
fig->catmsg = -1;
/* Freigeben nicht vergessen! */
@ -3165,7 +3127,8 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack)
int dwp[WMAX];
int wcount[WMAX];
int wused[WMAX];
int oi = 0, di = 0, w = 0;
int oi = 0, di = 0;
int w = 0;
for (itm = u->items; itm && w != WMAX; itm = itm->next) {
const weapon_type *wtype = resource2weapon(itm->type->rtype);
if (wtype == NULL || itm->number == 0)
@ -3180,9 +3143,9 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack)
}
assert(w != WMAX);
}
assert(w >= 0);
fig->weapons = (weapon *)calloc((size_t)(w + 1), sizeof(weapon));
memcpy(fig->weapons, weapons, (size_t)w * sizeof(weapon));
fig->weapons = malloc((1 + (size_t)w) * sizeof(weapon));
memcpy(fig->weapons, weapons, w * sizeof(weapon));
fig->weapons[w].type = NULL;
for (i = 0; i != w; ++i) {
int j, o = 0, d = 0;
@ -3266,7 +3229,7 @@ fighter *make_fighter(battle * b, unit * u, side * s1, bool attack)
for (itm = u->items; itm; itm = itm->next) {
if (itm->type->rtype->atype) {
if (i_canuse(u, itm->type)) {
struct armor *adata = (struct armor *)malloc(sizeof(armor)), **aptr;
struct armor *adata = malloc(sizeof(armor)), **aptr;
adata->atype = itm->type->rtype->atype;
adata->count = itm->number;
for (aptr = &fig->armors; *aptr; aptr = &(*aptr)->next) {
@ -3561,6 +3524,8 @@ static void join_allies(battle * b)
faction *f = u->faction;
fighter *c = NULL;
if (is_paused(u->faction)) continue;
for (s = b->sides; s != s_end; ++s) {
side *se;
/* Wenn alle attackierten noch FFL_NOAID haben, dann kaempfe nicht mit. */
@ -3685,8 +3650,7 @@ static bool start_battle(region * r, battle ** bp)
bool fighting = false;
for (u = r->units; u != NULL; u = u->next) {
if (fval(u, UFL_LONGACTION))
continue;
if (!long_order_allowed(u, true)) continue;
if (u->number > 0) {
order *ord;
@ -3720,10 +3684,6 @@ static bool start_battle(region * r, battle ** bp)
continue;
}
/* ist ein Fluechtling aus einem andern Kampf */
if (fval(u, UFL_LONGACTION))
continue;
if (curse_active(get_curse(r->attribs, &ct_peacezone))) {
ADDMSG(&u->faction->msgs, msg_feedback(u, ord, "peace_active", ""));
continue;
@ -3892,10 +3852,6 @@ static void battle_flee(battle * b)
int runhp = (int)(0.9 + unit_max_hp(u) * hpflee(u->status));
if (runhp > 600) runhp = 600;
if (u->ship && fval(u->region->terrain, SEA_REGION)) {
/* keine Flucht von Schiffen auf hoher See */
continue;
}
if (fval(u_race(u), RCF_UNDEAD) || u_race(u) == get_race(RC_SHADOWKNIGHT)) {
/* Untote fliehen nicht. Warum eigentlich? */
continue;
@ -3959,24 +3915,31 @@ void force_leave(region *r, battle *b) {
for (u = r->units; u; u = u->next) {
unit *uo = NULL;
if (is_paused(u->faction)) continue;
if (u->building) {
uo = building_owner(u->building);
}
if (u->ship && r->land) {
else if (u->ship && r->land) {
uo = ship_owner(u->ship);
}
if (uo && is_enemy(b, uo, u)) {
message *msg = NULL;
if (u->building) {
msg = msg_message("force_leave_building", "unit owner building", u, uo, u->building);
else {
continue;
}
if (is_enemy(b, uo, u)) {
if (leave(u, true)) {
message *msg;
if (uo->building) {
msg = msg_message("force_leave_building", "unit owner building", u, uo, uo->building);
}
else {
msg = msg_message("force_leave_ship", "unit owner ship", u, uo, uo->ship);
}
add_message(&u->faction->msgs, msg);
add_message(&uo->faction->msgs, msg);
msg_release(msg);
}
else {
msg = msg_message("force_leave_ship", "unit owner ship", u, uo, u->ship);
}
if (msg) {
ADDMSG(&u->faction->msgs, msg);
}
leave(u, false);
}
}
}

View file

@ -85,21 +85,6 @@ extern "C" {
signed char keeploot; /* keep (50 + keeploot) percent of items as loot */
bool has_tactics_turn;
bool reelarrow;
int alive;
struct {
const struct side *as;
const struct side *vs;
int alive;
int row;
int result;
} rowcache;
struct {
struct side *side;
int status;
int alive;
int minrow, maxrow;
int enemies[8];
} fast;
} battle;
typedef struct weapon {
@ -254,6 +239,7 @@ extern "C" {
void battle_message_faction(struct battle * b, struct faction * f, struct message *m);
double tactics_chance(const struct unit *u, int skilldiff);
int meffect_apply(struct meffect *me, int damage);
#ifdef __cplusplus
}
#endif

View file

@ -1,10 +1,13 @@
#include <platform.h>
#ifdef _MSC_VER
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif
#include "battle.h"
#include "guard.h"
#include "reports.h"
#include "skill.h"
#include <kernel/config.h>
#include <kernel/building.h>
@ -15,7 +18,8 @@
#include <kernel/race.h>
#include <kernel/region.h>
#include <kernel/ship.h>
#include <kernel/unit.h>
#include "kernel/skill.h"
#include "kernel/unit.h"
#include <spells/buildingcurse.h>
@ -63,7 +67,7 @@ static void test_make_fighter(CuTest * tc)
test_setup();
test_create_horse();
r = test_create_region(0, 0, NULL);
f = test_create_faction(NULL);
f = test_create_faction();
au = test_create_unit(f, r);
enable_skill(SK_MAGIC, true);
enable_skill(SK_RIDING, true);
@ -103,7 +107,7 @@ static void test_select_weapon_restricted(CuTest *tc) {
race * rc;
test_setup();
au = test_create_unit(test_create_faction(NULL), test_create_plain(0, 0));
au = test_create_unit(test_create_faction(), test_create_plain(0, 0));
itype = test_create_itemtype("halberd");
wtype = new_weapontype(itype, 0, frac_zero, NULL, 0, 0, 0, SK_MELEE);
i_change(&au->items, itype, 1);
@ -160,7 +164,7 @@ static void test_select_armor(CuTest *tc) {
battle *b;
test_setup();
au = test_create_unit(test_create_faction(NULL), test_create_plain(0, 0));
au = test_create_unit(test_create_faction(), test_create_plain(0, 0));
itype = test_create_itemtype("plate");
new_armortype(itype, 0.0, frac_zero, 1, 0);
i_change(&au->items, itype, 2);
@ -182,21 +186,7 @@ static void test_select_armor(CuTest *tc) {
}
static building_type * setup_castle(void) {
building_type * btype;
construction *cons;
btype = test_create_buildingtype("castle");
assert(btype->stages);
assert(btype->stages->construction);
btype->flags |= BTF_FORTIFICATION;
cons = btype->stages->construction;
cons->maxsize = 5;
btype->stages->next = calloc(1, sizeof(building_stage));
cons = calloc(1, sizeof(construction));
cons->maxsize = -1;
btype->stages->next->construction = cons;
return btype;
return test_create_castle();
}
static void test_defenders_get_building_bonus(CuTest * tc)
@ -215,8 +205,8 @@ static void test_defenders_get_building_bonus(CuTest * tc)
r = test_create_region(0, 0, NULL);
bld = test_create_building(r, btype);
du = test_create_unit(test_create_faction(NULL), r);
au = test_create_unit(test_create_faction(NULL), r);
du = test_create_unit(test_create_faction(), r);
au = test_create_unit(test_create_faction(), r);
u_set_building(du, bld);
b = make_battle(r);
@ -233,11 +223,16 @@ static void test_defenders_get_building_bonus(CuTest * tc)
at.fighter = af;
at.index = 0;
bld->size = 10; /* stage 1 building */
CuAssertIntEquals(tc, 1, buildingeffsize(bld, false));
bld->size = 10; /* stage 2 building */
CuAssertIntEquals(tc, 2, buildingeffsize(bld, false));
CuAssertIntEquals(tc, -1, skilldiff(at, dt, 0));
CuAssertIntEquals(tc, 0, skilldiff(dt, at, 0));
bld->size = 9; /* stage 1 building */
CuAssertIntEquals(tc, 1, buildingeffsize(bld, false));
CuAssertIntEquals(tc, 0, skilldiff(at, dt, 0));
CuAssertIntEquals(tc, 0, skilldiff(dt, at, 0));
bld->size = 1; /* stage 0 building */
CuAssertIntEquals(tc, 0, buildingeffsize(bld, false));
CuAssertIntEquals(tc, 0, skilldiff(at, dt, 0));
@ -264,7 +259,7 @@ static void test_attackers_get_no_building_bonus(CuTest * tc)
bld = test_create_building(r, btype);
bld->size = 10;
au = test_create_unit(test_create_faction(NULL), r);
au = test_create_unit(test_create_faction(), r);
u_set_building(au, bld);
b = make_battle(r);
@ -294,7 +289,7 @@ static void test_building_bonus_respects_size(CuTest * tc)
bld = test_create_building(r, btype);
bld->size = 10;
f = test_create_faction(NULL);
f = test_create_faction();
au = test_create_unit(f, r);
scale_number(au, 9);
u_set_building(au, bld);
@ -320,20 +315,21 @@ static void test_building_defense_bonus(CuTest * tc)
test_setup();
btype = setup_castle();
btype->maxsize = -1; /* unlimited buildigs get the castle bonus */
CuAssertIntEquals(tc, 0, building_protection(btype, 0));
CuAssertIntEquals(tc, 1, building_protection(btype, 1));
CuAssertIntEquals(tc, 3, building_protection(btype, 2));
CuAssertIntEquals(tc, 5, building_protection(btype, 3));
CuAssertIntEquals(tc, 8, building_protection(btype, 4));
CuAssertIntEquals(tc, 12, building_protection(btype, 5));
CuAssertIntEquals(tc, 12, building_protection(btype, 6));
btype->maxsize = -1; /* unlimited buildings get the castle bonus */
CuAssertIntEquals(tc, 0, bt_protection(btype, 0));
CuAssertIntEquals(tc, 0, bt_protection(btype, 1));
CuAssertIntEquals(tc, 1, bt_protection(btype, 2));
CuAssertIntEquals(tc, 2, bt_protection(btype, 3));
CuAssertIntEquals(tc, 3, bt_protection(btype, 4));
CuAssertIntEquals(tc, 4, bt_protection(btype, 5));
CuAssertIntEquals(tc, 5, bt_protection(btype, 6));
CuAssertIntEquals(tc, 5, bt_protection(btype, 7)); /* illegal castle size */
btype->maxsize = 10; /* limited-size buildings are treated like an E3 watchtower */
CuAssertIntEquals(tc, 0, building_protection(btype, 0));
CuAssertIntEquals(tc, 1, building_protection(btype, 1));
CuAssertIntEquals(tc, 2, building_protection(btype, 2));
CuAssertIntEquals(tc, 2, building_protection(btype, 3));
CuAssertIntEquals(tc, 0, bt_protection(btype, 0));
CuAssertIntEquals(tc, 1, bt_protection(btype, 1));
CuAssertIntEquals(tc, 2, bt_protection(btype, 2));
CuAssertIntEquals(tc, 2, bt_protection(btype, 3));
test_teardown();
}
@ -355,7 +351,7 @@ static void test_natural_armor(CuTest * tc)
test_setup();
rc = test_create_race("human");
u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, NULL));
u = test_create_unit(test_create_faction_ex(rc, NULL), test_create_region(0, 0, NULL));
set_level(u, SK_STAMINA, 2);
CuAssertIntEquals(tc, 0, rc_armor_bonus(rc));
CuAssertIntEquals(tc, 0, natural_armor(u));
@ -399,7 +395,7 @@ static void test_calculate_armor(CuTest * tc)
achain = new_armortype(ichain, 0.0, v50p, 3, ATF_NONE);
wtype = new_weapontype(it_get_or_create(rt_get_or_create("sword")), 0, v50p, 0, 0, 0, 0, SK_MELEE);
rc = test_create_race("human");
du = test_create_unit(test_create_faction(rc), r);
du = test_create_unit(test_create_faction_ex(rc, NULL), r);
dt.index = 0;
dt.fighter = setup_fighter(&b, du);
@ -452,6 +448,30 @@ static void test_calculate_armor(CuTest * tc)
test_teardown();
}
static void test_spells_reduce_damage(CuTest *tc)
{
struct meffect me;
me.typ = SHIELD_ARMOR;
me.duration = 10;
me.effect = 5;
CuAssertIntEquals(tc, 5, meffect_apply(&me, 10));
CuAssertIntEquals(tc, 9, me.duration);
CuAssertIntEquals(tc, 5, me.effect);
CuAssertIntEquals(tc, 0, meffect_apply(&me, 1));
CuAssertIntEquals(tc, 8, me.duration);
CuAssertIntEquals(tc, 5, me.effect);
me.typ = SHIELD_REDUCE;
me.duration = 10;
me.effect = 50;
CuAssertIntEquals(tc, 5, meffect_apply(&me, 10));
CuAssertIntEquals(tc, 5, me.duration);
CuAssertIntEquals(tc, 50, me.effect);
CuAssertIntEquals(tc, 7, meffect_apply(&me, 12));
CuAssertIntEquals(tc, 0, me.duration);
}
static void test_magic_resistance(CuTest *tc)
{
troop dt;
@ -472,7 +492,7 @@ static void test_magic_resistance(CuTest *tc)
ichain = it_get_or_create(rt_get_or_create("chainmail"));
achain = new_armortype(ichain, 0.0, v50p, 3, ATF_NONE);
rc = test_create_race("human");
du = test_create_unit(test_create_faction(rc), r);
du = test_create_unit(test_create_faction_ex(rc, NULL), r);
dt.index = 0;
i_change(&du->items, ishield, 1);
@ -543,7 +563,7 @@ static void test_projectile_armor(CuTest * tc)
wtype = new_weapontype(it_get_or_create(rt_get_or_create("sword")), 0, v50p, 0, 0, 0, 0, SK_MELEE);
rc = test_create_race("human");
rc->battle_flags |= BF_EQUIPMENT;
du = test_create_unit(test_create_faction(rc), r);
du = test_create_unit(test_create_faction_ex(rc, NULL), r);
dt.index = 0;
i_change(&du->items, ishield, 1);
@ -571,8 +591,8 @@ static void test_battle_skilldiff(CuTest *tc)
test_setup();
r = test_create_region(0, 0, NULL);
ud = test_create_unit(test_create_faction(NULL), r);
ua = test_create_unit(test_create_faction(NULL), r);
ud = test_create_unit(test_create_faction(), r);
ua = test_create_unit(test_create_faction(), r);
td.fighter = setup_fighter(&b, ud);
td.index = 0;
ta.fighter = setup_fighter(&b, ua);
@ -606,8 +626,8 @@ static void test_terminate(CuTest * tc)
r = test_create_region(0, 0, NULL);
rc = test_create_race("human");
au = test_create_unit(test_create_faction(rc), r);
du = test_create_unit(test_create_faction(rc), r);
au = test_create_unit(test_create_faction_ex(rc, NULL), r);
du = test_create_unit(test_create_faction_ex(rc, NULL), r);
dt.index = 0;
at.index = 0;
@ -638,8 +658,8 @@ static void test_battle_report_one(CuTest *tc)
test_setup();
setup_messages();
r = test_create_plain(0, 0);
u1 = test_create_unit(test_create_faction(NULL), r);
u2 = test_create_unit(test_create_faction(NULL), r);
u1 = test_create_unit(test_create_faction(), r);
u2 = test_create_unit(test_create_faction(), r);
b = make_battle(r);
join_battle(b, u1, true, &fig);
join_battle(b, u2, false, &fig);
@ -669,9 +689,8 @@ static void test_battle_report_two(CuTest *tc)
locale_setstring(lang, "and", "and");
setup_messages();
r = test_create_plain(0, 0);
u1 = test_create_unit(test_create_faction(NULL), r);
u1->faction->locale = lang;
u2 = test_create_unit(test_create_faction(NULL), r);
u1 = test_create_unit(test_create_faction_ex(NULL, lang), r);
u2 = test_create_unit(test_create_faction_ex(NULL, lang), r);
u2->faction->locale = lang;
str_slprintf(expect, sizeof(expect), "%s and %s", factionname(u1->faction), factionname(u2->faction));
@ -702,11 +721,11 @@ static void test_battle_report_three(CuTest *tc)
locale_setstring(lang, "and", "and");
setup_messages();
r = test_create_plain(0, 0);
u1 = test_create_unit(test_create_faction(NULL), r);
u1 = test_create_unit(test_create_faction(), r);
u1->faction->locale = lang;
u2 = test_create_unit(test_create_faction(NULL), r);
u2 = test_create_unit(test_create_faction(), r);
u2->faction->locale = lang;
u3 = test_create_unit(test_create_faction(NULL), r);
u3 = test_create_unit(test_create_faction(), r);
u3->faction->locale = lang;
str_slprintf(expect, sizeof(expect), "%s, %s and %s", factionname(u1->faction), factionname(u2->faction), factionname(u3->faction));
@ -735,9 +754,9 @@ static void test_battle_skilldiff_building(CuTest *tc)
btype = setup_castle();
r = test_create_region(0, 0, NULL);
ud = test_create_unit(test_create_faction(NULL), r);
ud = test_create_unit(test_create_faction(), r);
ud->building = test_create_building(ud->region, btype);
ua = test_create_unit(test_create_faction(NULL), r);
ua = test_create_unit(test_create_faction(), r);
td.fighter = setup_fighter(&b, ud);
td.index = 0;
ta.fighter = setup_fighter(&b, ua);
@ -746,13 +765,14 @@ static void test_battle_skilldiff_building(CuTest *tc)
CuAssertIntEquals(tc, 0, skilldiff(ta, td, 0));
ud->building->size = 10;
CuAssertIntEquals(tc, 1, buildingeffsize(ud->building, false));
CuAssertIntEquals(tc, 2, buildingeffsize(ud->building, false));
CuAssertIntEquals(tc, 1, building_protection(ud->building));
CuAssertIntEquals(tc, -1, skilldiff(ta, td, 0));
create_curse(NULL, &ud->building->attribs, &ct_magicwalls, 1, 1, 1, 1);
create_curse(ud, &ud->building->attribs, &ct_magicwalls, 1, 1, 1, 1);
CuAssertIntEquals(tc, -2, skilldiff(ta, td, 0));
create_curse(NULL, &ud->building->attribs, &ct_strongwall, 1, 1, 2, 1);
create_curse(ud, &ud->building->attribs, &ct_strongwall, 1, 1, 2, 1);
CuAssertIntEquals(tc, -4, skilldiff(ta, td, 0));
free_battle(b);
@ -784,7 +804,7 @@ static void test_drain_exp(CuTest *tc)
test_setup();
config_set("study.random_progress", "0");
u = test_create_unit(test_create_faction(NULL), test_create_region(0, 0, NULL));
u = test_create_unit(test_create_faction(), test_create_region(0, 0, NULL));
set_level(u, SK_STAMINA, 3);
CuAssertIntEquals(tc, 3, unit_skill(u, SK_STAMINA)->level);
@ -842,7 +862,7 @@ static void test_tactics_chance(CuTest *tc) {
ship_type *stype;
test_setup();
u = test_create_unit(test_create_faction(NULL), test_create_ocean(0, 0));
u = test_create_unit(test_create_faction(), test_create_ocean(0, 0));
CuAssertDblEquals(tc, 0.1, tactics_chance(u, 1), 0.01);
CuAssertDblEquals(tc, 0.3, tactics_chance(u, 3), 0.01);
stype = test_create_shiptype("brot");
@ -859,8 +879,8 @@ static void test_battle_fleeing(CuTest *tc) {
test_setup();
setup_messages();
r = test_create_plain(0, 0);
u1 = test_create_unit(test_create_faction(NULL), r);
u2 = test_create_unit(test_create_faction(NULL), r);
u1 = test_create_unit(test_create_faction(), r);
u2 = test_create_unit(test_create_faction(), r);
u1->status = ST_FLEE;
u2->status = ST_AGGRO;
#if 0
@ -902,6 +922,7 @@ CuSuite *get_battle_suite(void)
SUITE_ADD_TEST(suite, test_calculate_armor);
SUITE_ADD_TEST(suite, test_natural_armor);
SUITE_ADD_TEST(suite, test_magic_resistance);
SUITE_ADD_TEST(suite, test_spells_reduce_damage);
SUITE_ADD_TEST(suite, test_projectile_armor);
SUITE_ADD_TEST(suite, test_tactics_chance);
SUITE_ADD_TEST(suite, test_terminate);

View file

@ -1,7 +1,8 @@
#ifdef _MSC_VER
#include <platform.h>
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif
#include "bind_config.h"
#include "jsonconf.h"

View file

@ -1,5 +1,7 @@
#ifdef _MSC_VER
#include <platform.h>
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#endif
#include "bind_eressea.h"
@ -26,52 +28,65 @@ void eressea_free_game(void) {
}
int eressea_read_game(const char * filename) {
return readgame(filename);
if (filename) {
return readgame(filename);
}
return -1;
}
int eressea_write_game(const char * filename) {
remove_empty_factions();
return writegame(filename);
if (filename) {
remove_empty_factions();
return writegame(filename);
}
return -1;
}
int eressea_read_orders(const char * filename) {
FILE * F = fopen(filename, "r");
int result;
if (filename) {
FILE *F = fopen(filename, "r");
int result;
if (!F) {
perror(filename);
return -1;
if (!F) {
perror(filename);
return -1;
}
log_info("reading orders from %s", filename);
result = parseorders(F);
fclose(F);
return result;
}
log_info("reading orders from %s", filename);
result = parseorders(F);
fclose(F);
return result;
return -1;
}
int eressea_export_json(const char * filename, int flags) {
FILE *F = fopen(filename, "w");
if (F) {
stream out = { 0 };
int err;
fstream_init(&out, F);
err = json_export(&out, flags);
fstream_done(&out);
return err;
if (filename) {
FILE *F = fopen(filename, "w");
if (F) {
stream out = { 0 };
int err;
fstream_init(&out, F);
err = json_export(&out, flags);
fstream_done(&out);
return err;
}
perror(filename);
}
perror(filename);
return -1;
}
int eressea_import_json(const char * filename) {
FILE *F = fopen(filename, "r");
if (F) {
stream out = { 0 };
int err;
fstream_init(&out, F);
err = json_import(&out);
fstream_done(&out);
return err;
if (filename) {
FILE *F = fopen(filename, "r");
if (F) {
stream out = { 0 };
int err;
fstream_init(&out, F);
err = json_import(&out);
fstream_done(&out);
return err;
}
perror(filename);
}
perror(filename);
return -1;
}

View file

@ -188,7 +188,7 @@ static void lua_paint_info(struct window *wnd, const struct state *st)
int size = getmaxx(win) - 2;
int line = 0, maxline = getmaxy(win) - 2;
const char *str = result;
wxborder(win);
box(win, 0, 0);
while (*str && line < maxline) {
const char *end = strchr(str, '\n');

View file

@ -10,6 +10,7 @@
#include "magic.h"
#include "market.h"
#include "move.h"
#include "sort.h"
#include "study.h"
#include <kernel/alliance.h>

Some files were not shown because too many files have changed in this diff Show more