Commit Graph

294 Commits

Author SHA1 Message Date
Enno Rehling 74a6bd72c2 additional testing. 2014-10-18 14:16:26 +02:00
Enno Rehling a86c2d88ab Test: After a faction is eliminated, nobody should have it as an ally. 2014-10-17 19:56:26 +02:00
CTD 1c7075573b Plündern
Neues Kommando Plündern für die Monster (kann über XML-Option auch für
Spieler freigeschaltet werden)
2014-10-16 14:45:21 +02:00
Enno Rehling c6b6883477 Merge pull request #36 from CTD1/Workingplace
Arbeitsplätze

It's weird. It worked on this PR, probably because it is based on a revision of master where the .travis.yml file already exists. For older PRs that were created before that file was in master, it doesn't work. We don't have many open ones, so it's not actually worth investigating how to fix that :-)
2014-10-16 14:05:49 +02:00
Enno Rehling 9c6e380ea0 Merge pull request #35 from CTD1/Monster_EMail
Wird schon richtig sein :-)
2014-10-16 11:53:45 +02:00
Enno Rehling ac65d83ba2 test that empty factions are removed, but not monsters. 2014-10-16 09:03:57 +02:00
Enno Rehling 440aca34ea test special treatment for spells in remove_empty_units. 2014-10-16 08:06:44 +02:00
Enno Rehling 559f1f905a Eliminate dead code: FFL_NOTIMEOUT.
old feature for time-limited factions, not used anywhere.
2014-10-16 07:46:08 +02:00
Enno Rehling 7df47fd25c remove bad configuration caching (TODO: cache inside get_param).
move remove_empty_* functions out of config.c
add basic tests for remove_empty_units (no special units yet).
2014-10-16 07:41:49 +02:00
Enno Rehling 403c1ad6a9 fix errors and warnings that clang reports. 2014-10-14 22:57:02 +02:00
Enno Rehling ce3e9cd7d0 Add missing test coverage for update_guards. Fix the weapon:minskill default. 2014-10-14 18:37:45 +02:00
Enno Rehling a78daad4d8 Merge pull request #34 from CTD1/Hunger
Hunger und Segeltalent
2014-10-01 13:48:51 +02:00
Enno Rehling 68730749fb fix astral space special direction, vortex (translation issue). 2014-09-29 21:19:07 +02:00
Enno Rehling 3e829e2880 support for itoab with smaller bases and larger numbers.
also a missing English message (museum-related)
2014-09-29 18:32:12 +02:00
CTD c937f59536 XML Option hinzugefügt
Das Segeln nur 1 Skill Level verliert ist Default und somit an.
2014-09-25 09:54:52 +02:00
CTD1 911b93e343 Update faction.c 2014-09-25 08:59:29 +02:00
Enno Rehling 74582aeb2f fix remaining getstrtoken uses without null-check. 2014-09-21 16:43:17 +02:00
CTD 3484acfa43 Arbeitsplätze
Regionen haben jetzt immer mindestens 10% ihrer size als freie Freie
Arbeitsplätzt, höchstens jedoch 200.  Das sorgt dafür das die Bäume
nicht alle Bauern umbringen. Diese ernähren sich quasi durch Jagt statt
Ackerbau.
Sinnlose Variable MAXPEASANTS_PER_AREA entfernt.
2014-09-18 12:10:42 +02:00
CTD f89721ebec Monster Email
kann jetzt über die config.xml eingestellt werden
2014-09-16 09:21:33 +02:00
CTD 9e5e7a3e52 Hunger und Segeltalent
Hungernde Einheiten verlieren nur noch einen Punkt Segeln (ab T2), nicht
mehr das halbe Talent.
Das sollte die meisten Schiffsunfälle durch vergessene Silber derart
abschwächen, das die Schiffe noch aus eigener Kraft zum nächsten Hafen
kommen.
2014-09-15 16:10:57 +02:00
Enno Rehling b761cb5b97 Merge branch 'master' of https://github.com/eressea/server 2014-09-04 17:22:33 +02:00
Enno Rehling 54cf4f4b7b Merge branch 'version-3-2'
Conflicts:
	src/laws.c
2014-09-02 09:26:59 +02:00
Enno Rehling 9e81de406b version 3.2
remove regatta plane, it crashes all of a sudden.
why is there a use of init_order here? that is a future feature.
2014-09-02 07:27:11 +02:00
Enno Rehling cf1f3972b6 cleaning out config.c, there is too much code in there.
rules should be in their own modules. here:
upkeep is a concept all by itself, should have its own tests, etc.
movement code should be in move.c.
cleaning up some superfluous include directives.
2014-08-31 16:50:37 +02:00
Enno Rehling e9abfc0f24 peasant blood should not have ill effects on non-demon units that are empty.
This fixes http://bugs.eressea.de/view.php?id=1981
2014-08-28 20:01:37 +02:00
Enno Rehling c0230d2662 In the game, there is only ever one special direction, and it is for the astral space.
less XML, more code.
cleaning up the special direction parsing a bit.
2014-08-28 19:50:38 +02:00
Enno Rehling 932a615837 refactoring: special directions into their own file (vortex.c).
moving spells.c out of spells.
figured that movewhere should be in move.c
2014-08-27 21:30:24 +02:00
Enno Rehling ecaeba3058 add a test for the vortex special direction before touching that code. 2014-08-27 20:10:17 +02:00
Enno Rehling a9a0455207 reorganized directory structure.
flattening the directory structure, moving some modules to the src/ directory.
making stealth a separate file, under test.
more tests for some stuff.
2014-08-27 06:40:35 +02:00
Enno Rehling d435c13bfc adding more tests.
test for build()
test for scale_number()
update submodules
2014-08-26 20:06:49 +02:00
Enno Rehling 2ceeb0b819 fix errors that gcc finds 2014-08-25 08:15:51 +02:00
Enno Rehling e87b1cf372 an experiment to have deterministic sort order for known factions in the report. 2014-08-25 00:06:33 +02:00
Enno Rehling a3037950ff fix a bug in the escape_string function.
remove static return variable from escape_string.
add test coverage.
2014-08-24 23:58:31 +02:00
Enno Rehling 920902f8eb replace resource_type::_name array with a single string. 2014-08-24 23:58:30 +02:00
Enno Rehling 4c00777553 make race::_name a string, not an array of strings. add a test for rc_name. 2014-08-24 23:58:29 +02:00
Enno Rehling de5ef3f87b Merge branch 'master' of https://github.com/eressea/server 2014-08-24 17:11:32 +02:00
Enno Rehling 7d17cafdd6 simple tests for build().
cleaning up the code to give it a common setup function.
change the golem code to use flag, not hard-coded race.
unify the golems, make code more readable, kill a block of unused code.
2014-08-24 17:09:32 +02:00
Enno Rehling 5befbad7c7 Merge branch 'version-3-1'
Conflicts:
	src/laws.c
2014-08-24 00:30:12 +02:00
Enno Rehling f1d78b4b84 fix null-pointer crash. 2014-08-24 00:29:19 +02:00
Enno Rehling 9db6826662 remove unused static function, fix missing include for gcc. 2014-08-23 09:21:40 +02:00
Enno Rehling 808f343e34 make getstrtoken() return null at EOL, kill init_tokens.
init_order all the things!
added a bunch of new assertions to cover for oversights.
added some new tests for order parsing.
2014-08-23 09:17:58 +02:00
Enno Rehling ee2363a4d9 use init_order, it is better than the init_tokens+skip_token pattern.
test for new_units.
additional testing for init_order (renamed from init_command)and init_tokens.
fixed a memory access error when kwd==NOKEYWORD.
2014-08-23 06:45:20 +02:00
Enno Rehling a84e628522 Repair MAKE, which broke when I changed MAKE TEMP.
You can now also write MAKETEMP as one word, and we treat it that way.
Added unit test coverage for MAKE order parsing.
2014-08-21 07:31:28 +02:00
Enno Rehling aed64a70fb cut the number of allocations for order-data in half.
started writing a test file for orders.
2014-08-21 07:30:50 +02:00
Enno Rehling cc0b0ad71b added a test for addfaction.
removing struct player, since it is not in use.
2014-08-20 23:42:33 +02:00
Enno Rehling 7b3a381500 increase version number to 3.1
log an error when trying to create an order for a disabled keyword
monsters might be trying to TAX in E3?
2014-08-20 19:26:37 +02:00
Enno Rehling 68fc4df74d Configurable monster attack chance, default to 40%.
E3 chance to attack is only 10%.
2014-08-20 11:54:11 +02:00
Enno Rehling fb7c8a898f add a test for get_monsters().
I want to make sure I don't break this in the future.
2014-08-20 08:18:47 +02:00
Enno Rehling acfe72f24e add a test for get_monsters().
I want to make sure I don't break this in the future.
2014-08-20 07:00:58 +02:00
Enno Rehling 3fde10d9e8 Configurable monster attack chance, default to 40%.
E3 chance to attack is only 10%.
2014-08-19 15:24:30 +02:00
Enno Rehling 59ccf23db6 Repair MAKE, which broke when I changed MAKE TEMP.
You can now also write MAKETEMP as one word, and we treat it that way.
Added unit test coverage for MAKE order parsing.
2014-08-17 14:47:39 +02:00
Enno Rehling 99124f3d6d Merge branch 'master' of https://github.com/eressea/server 2014-08-17 07:37:50 +02:00
Enno Rehling b385bfc4d2 Merge branch 'fixes-891'
Conflicts:
	src/kernel/faction.c
2014-08-17 07:23:07 +02:00
Enno Rehling 138a4c10a0 properly create missing monster faction when spawning dragons.
remove cached monster faction (static).
Conflicts:
	src/kernel/faction.c
2014-08-17 07:14:47 +02:00
Enno Rehling cef068fe9b cut the number of allocations for order-data in half.
started writing a test file for orders.
2014-08-16 23:26:31 +02:00
Enno Rehling 8803a9e9a8 properly create missing monster faction when spawning dragons. 2014-08-16 13:46:34 +02:00
Enno Rehling 90ec28fed3 fix missing monster factions. 2014-08-16 13:33:47 +02:00
Enno Rehling fa52bb4192 pointless assert triggers when new units are created and placed.
spawning dragons was causing this to fail.
2014-08-16 13:19:00 +02:00
Enno Rehling 9587e9f0cd remove unused variables 2014-08-16 12:02:45 +02:00
Enno Rehling 2fd085d1e5 Merge branch 'master' of https://github.com/eressea/server 2014-08-16 11:59:20 +02:00
Enno Rehling c79dd33bfb smarter processing of MAKE TEMP.
the order gets its own keyword. parsing is hard - composite commands are an anti-pattern.
this eliminates a lot of unnecessary mallocs for pushing/poping parser state.
2014-08-16 11:41:19 +02:00
Enno Rehling 41d42fa248 localization of alliance status "ALL".
fix for https://bugs.eressea.de/view.php?id=1993
2014-08-16 03:07:37 +02:00
Enno Rehling 61ebd1d6b7 fix accidental assignment instead of comparison. 2014-08-14 20:08:29 +02:00
Enno Rehling fa0c999d3e Merge branch 'Bug-1525-and-1872' of github.com:CTD1/eressea-server-bugfixing into CTD1-Bug-1525-and-1872 2014-08-14 20:06:14 +02:00
Enno Rehling 158d4f8d4b MSVC: compile cleanly with level 4 warnings 2014-08-14 19:39:45 +02:00
CTD 7dd86959a9 Bewegung durch Region blockieren
Etwas größerer Umbau. Befreundete Wachen erlauben nicht mehr automatisch
die Durchreise.  Es werden sowohl die Befreundeten als auch die
Feindlichen Bewacher in der Region gezählt, und die Differenz mit
rules.guard.guard_number_stop_prob multipliziert. Bei 700 Feindlichen
und keinen freundlichen Wachen ist die Chance dann 100%. Bei 100
Feindlichen und 400 freundlichen ist sie 0.
Zusätzlich gibt rules.guard.castle_stop_prob 10% pro Burgenlevel für den
Burgenbesitzer.
rules.guard.region_type_stop_prob gibt 10% für Regionen mit weniger
Begehbaren Pfaden (Berge und Vulkane) und das doppelte für sehr schwer
passierbare Regionen (Sümpfe und Gletscher).

Für Spiele mit Wahrnehmung (E2) sollten die Werte für:
rules.guard.skill_stop_prob
rules.guard.castle_stop_prob
rules.guard.region_type_stop_prob

auf 5% Angepasst werden.
2014-08-14 12:37:59 +02:00
Enno Rehling ff73358b9c Some tiny errors that slipped through Visual Studio's warnings. 2014-08-14 09:59:33 +02:00
Enno Rehling dafe71f4b8 micro optimizations.
removing a lot of mallocs through strdup  by replacing getcommand calls with get_command, which takes a buffer. only one left.
removing mkname calls with a static buffer for keyword-tokens.
commit the schema file I had lying around.
2014-08-14 09:57:05 +02:00
Enno Rehling 38352ef3bf add the build number to saves.
this should make future debugging sessions easier, telling us what bugs were or were not fixed at the time of an incident.
added a test to make sure data file can be read/written, and at a minimum, sets global data-version.
also clean up test framework a bit, and introduce a helpful macro.
2014-08-14 05:06:36 +02:00
Enno Rehling b6f627a5d8 Merge branch 'Feature-1865' of github.com:CTD1/eressea-server-bugfixing into CTD1-Feature-1865
Conflicts:
	src/economy.c
2014-08-13 19:44:57 +02:00
Enno Rehling 3c2ae7ca93 preview script and logging cleanup
1. all log messages will be terminated with \n, whether the user provided
	it or not.
2. remove a bunch of print() calls from scripts to reduce clutter
3. replace printf calls with log_* calls to reduce clutter
4. add the new release preview script
2014-08-11 12:04:12 +02:00
Enno Rehling 45a16681c4 logic fix for FOLLOW (if we are not following a ship, and cannot see the target unit, then exit). 2014-08-08 18:18:17 +02:00
CTD fe0ff71aa1 E2 fähig gemacht
Der Burgenbesitzer sieht nur noch etwas wenn er auch Leuchtturmbesitzer
ist.
Das geht jetzt auch für E2 ohne region_owner rule.
2014-08-08 17:15:12 +02:00
CTD 90cf6d845f replace strstr
Neu Funktion check_param die überprüft ob ein übergebener Wert in dem
Wert des entsprechenden Parameters steht.
2014-08-08 13:29:26 +02:00
Enno Rehling 8dd4b783b1 fix gcc error 2014-08-08 01:26:35 +02:00
Enno Rehling 3767957caa indentation + whitespace changes 2014-08-08 01:24:12 +02:00
Enno Rehling 1918f56990 indentation + whitespace changes 2014-08-08 01:16:35 +02:00
CTD bf4bda36a2 Bug 1610 FOLGE SCHIFF und andere lange Befehle
FOLGE SCHIFF ist genau wie FOLGE EINHEIT jetzt ein Halblanger Befehl.
Das ist konsequent und entfernt an einigen Stellen Spezialbehandlungen.
2014-08-08 01:14:58 +02:00
CTD f33de38812 Piraterie repariert
Die Piraten sind oftmals einfach in ein falsches (leeres) Ozeanfeld
gesegelt, wenn es irgendwo ein Opfer gab.
2014-08-08 01:14:57 +02:00
CTD 0d0aad593a Abtreiben Unabhänig von Wahrnehmung
Der Kapitän sollte den Leuchtturm auch sehen, wenn das Besitzer mangels
genug Wahrnehmung das Schiff nicht sieht. Sprich der Sturmschutz des
Leuchtturm hängt jetzt nicht mehr vom Wahrnehmungstalent der Insassen
sondern nur noch von der Größe des Leuchtturms ab, und davon ob der
Unterhalt bezahlt wurde.
sail() ruft als einzige Funktion check_leuchtturm() ohne Partei auf,
daher der einfach Check ob eine Partei übergeben wurde oder nicht.
2014-08-08 01:14:56 +02:00
CTD 549a4fbe5b Bug 1857 abtreiben trotz leuchtturmüberwachung e2
Leuchttürme verhindern nicht das Abtreiben sondern reduzieren nur die
Chance auf 1/3.
Das ist für Automatisierung schlecht, daher Reduzieren Leuchttürme das
Abtreiben jetzt auf 0.
Für E4 oder zukünftige Spiele habe ich das auch gleich konfigurierbar
gemacht.
rules.lighthous.stormchancedevisor gibt den Wert an durch den die
Sturmchance geteilt wird, 0 = kein Abtreiben wenn Leuchtturm in
Reichweite.
2014-08-08 01:14:55 +02:00
Enno Rehling 13ba2b8362 Merge pull request #24 from CTD1/Bug-1610
Bug 1610 FOLGE SCHIFF und andere lange Befehle
2014-08-08 01:11:31 +02:00
Enno Rehling 1470b56253 Merge pull request #23 from CTD1/Piraterie
Piraterie repariert
2014-08-08 01:06:49 +02:00
Enno Rehling cad82999d0 Merge pull request #22 from CTD1/Bug-1857
Bug 1857 abtreiben trotz leuchtturmüberwachung e2
2014-08-08 01:00:59 +02:00
Enno Rehling b3a58c6a43 fix tabs 2014-08-08 00:37:51 +02:00
Enno Rehling 500e24d71e Merge pull request #18 from CTD1/Bug-1938
Bug 1938 [E3] Magiepatzer kaputt (auraverlust statt kostensteigerung)!
2014-08-08 00:36:36 +02:00
CTD c49c3af1d9 Bug 1610 FOLGE SCHIFF und andere lange Befehle
FOLGE SCHIFF ist genau wie FOLGE EINHEIT jetzt ein Halblanger Befehl.
Das ist konsequent und entfernt an einigen Stellen Spezialbehandlungen.
2014-08-07 18:53:29 +02:00
CTD 7ac56b3fbf Piraterie repariert
Die Piraten sind oftmals einfach in ein falsches (leeres) Ozeanfeld
gesegelt, wenn es irgendwo ein Opfer gab.
2014-08-07 16:02:47 +02:00
CTD 906dd457fc Abtreiben Unabhänig von Wahrnehmung
Der Kapitän sollte den Leuchtturm auch sehen, wenn das Besitzer mangels
genug Wahrnehmung das Schiff nicht sieht. Sprich der Sturmschutz des
Leuchtturm hängt jetzt nicht mehr vom Wahrnehmungstalent der Insassen
sondern nur noch von der Größe des Leuchtturms ab, und davon ob der
Unterhalt bezahlt wurde.
sail() ruft als einzige Funktion check_leuchtturm() ohne Partei auf,
daher der einfach Check ob eine Partei übergeben wurde oder nicht.
2014-08-07 14:37:49 +02:00
CTD 37e0226e5b Bug 1857 abtreiben trotz leuchtturmüberwachung e2
Leuchttürme verhindern nicht das Abtreiben sondern reduzieren nur die
Chance auf 1/3.
Das ist für Automatisierung schlecht, daher Reduzieren Leuchttürme das
Abtreiben jetzt auf 0.
Für E4 oder zukünftige Spiele habe ich das auch gleich konfigurierbar
gemacht.
rules.lighthous.stormchancedevisor gibt den Wert an durch den die
Sturmchance geteilt wird, 0 = kein Abtreiben wenn Leuchtturm in
Reichweite.
2014-08-07 14:04:03 +02:00
CTD 8b9f344484 Fixing server crash
Mit rules.region_owner_pay_building  ein kann es vorkommen, das wegen
einem leeren Gebäude die größte Burg in der Region gesucht wird. Wenn es
aber keine Burg in der Region gibt, wird building_owner mit NULL
aufgerufen. Das musste abgefangen werden.
2014-08-07 11:24:55 +02:00
Enno Rehling 405c63f447 this old race alias stuff has been dead code for years. 2014-08-06 23:44:47 +02:00
Enno Rehling afd41286b5 config file reading based on game name and install location. 2014-08-03 20:37:05 +02:00
CTD 51356b061c Feature 1865 leere unterhaltspflichtige Gebäude
Gebäude ohne Besitzer werden automatisch vom Regionsbesitzer übernommen
(Die Einheit wird sozusagen der neue Gebäudebesitzer). Betreten dann nur
noch wenn Helfe Bewache vom Regionsbesitzer.
Wichtig:
<param name="rules.region_owners" value="1"/>, ist Voraussetzung,  es
geht also nicht in E2.
Es kann für beliebige Gebäude eingeschaltet werden.
Example config :
<param name="rules.region_owner_pay_building" value="market harbour
lighthouse"/>
2014-08-01 16:13:35 +02:00
CTD 8aa356df75 Bug 1938 [E3] Magiepatzer kaputt (auraverlust statt kostensteigerung)!
Erst Bezahlen, dann Patzer. Sonst werden die Kosten im Falle des
"kleinsten" Patzers noch beim aktuellen Spruch erhöht.
2014-07-28 15:38:39 +02:00
Enno Rehling bd2809a975 removing the core directory (moving to res and scripts).
it's from when open-source Eressea was limited, and we no longer need the separation.
JSON configuration for ship flags.
2014-07-28 14:27:30 +02:00
Enno Rehling d994caf7a3 Merge branch 'master' of https://github.com/eressea/server 2014-07-26 22:52:31 +02:00
Enno Rehling d9457a2488 rewrite of the Lua module system.
At this time, only E2 is working.
Fixing a lot of old code (monster is no longer id 0).
package.paths configured from eressea.ini
install directory configured from eressea.ini
moving building_action into a seaprate module (it's deprecated)
2014-07-26 22:52:25 +02:00
Enno Rehling 955a57273d code review changes 2014-07-24 08:04:30 +02:00
Enno Rehling 10e08ab306 Merge pull request #14 from CTD1/master
Bug 1755 Beschworene Skelette mit Ausdauerproblemen
2014-07-24 07:58:50 +02:00