Commit graph

150 commits

Author SHA1 Message Date
Enno Rehling
e2c7b2c711 merge with master, which was far behind 2017-10-15 20:32:19 +02:00
Enno Rehling
1b53128e1a BUG 2366: Fix cansee for seen_spell regions. 2017-10-10 20:24:20 +02:00
Enno Rehling
5e204083b8 remove noreply email, monster report. 2017-09-18 21:43:52 +02:00
Enno Rehling
455e03fa05 try and make coverity understand the equipment trie.
shorten names.
2017-09-17 20:42:43 +02:00
Enno Rehling
c5181195d7 new feature: sea serpents will not go after small targets. 2017-09-09 12:58:10 +02:00
Enno Rehling
7985ebe511 replace ct_find calls with constants.
reorder a lot of includes.
2017-08-21 20:18:19 +02:00
Enno Rehling
8178f3f1e6 BUG 2334: Nochmal Ponnuki
Monsters cannot attack or guard when they are fleeing
2017-06-18 14:20:01 +02:00
Enno Rehling
ad465f1028 Ponnuki should not be aggressive. 2017-05-07 17:29:55 +02:00
Enno Rehling
1885831204 remove handle_events for unused events. 2017-04-30 03:48:50 +02:00
Enno Rehling
b06e93db7a BUG 2317: wyrms in E2 didn't move 2017-04-17 16:50:15 +02:00
Enno Rehling
b44c5e54bf Neuer Befehlespräfix: ! zur Unterdrückung von Fehlern. 2017-03-25 11:18:48 +01:00
Enno Rehling
4e5f1d05ce Be very strict about C standards.
Compile with -std=c89 in gcc.
remove all // comments (they are nice, but unnecessary).
variables only declared at start of block.
various pedantery.
backwards compatible va_copy for pre-C99 gcc.
2017-02-18 21:15:14 +01:00
Enno Rehling
5b52451d9d remove unused ai.aggression atribute 2017-02-18 19:21:54 +01:00
Enno Rehling
f2ed2c892a bugfix: Drachen "scare" attribut
muss mit MOD, nicht AND angewendet werden. rng_int() & 400 ist eine bekloppte Rechnung.
2017-02-05 18:42:06 +01:00
Enno Rehling
d94cde67a4 kill autoconf.h, replace platform.h for C99 compatibility work 2017-01-26 18:03:48 +01:00
Enno Rehling
8c045d7a78 fix flt/int compilation bug. 2017-01-26 17:57:21 +01:00
Enno Rehling
f297d89958 merge monster.c and monsters.c
move RCF_DESERT handling to monsters.c
2017-01-26 17:57:21 +01:00
Enno Rehling
a4badc0a75 remove quicklist shim, use selist everywhere 2017-01-26 17:41:21 +01:00
Enno Rehling
ec4060cb9a fix curse-vigour calculation math.
also fix a ton of small other niggles from pvs-studio.
2016-11-20 19:08:39 +01:00
Enno Rehling
467ffe2db0 include guard.h directly, not through laws.h 2016-11-01 22:11:10 +01:00
Enno Rehling
754ad78db7 WIP: remove GUARD_* flags.
TODO: does not compile
TODO: write new guard.test.c tests
2016-10-31 07:45:06 +01:00
Enno Rehling
fbdf845cb9 fix overpopulation-checks and movement based on splitsize. 2016-10-03 20:15:38 +02:00
Enno Rehling
26a416c5ba do not call can_survive all this much. 2016-10-03 16:38:17 +02:00
Enno Rehling
ef43aaa830 eliminate some duplicate calculations. 2016-10-03 16:28:18 +02:00
Enno Rehling
42e75007c3 little bit of refactoring and better variable names. 2016-10-03 16:26:40 +02:00
Enno Rehling
423e293745 some more config lookup caching 2016-09-23 20:39:08 +02:00
Enno Rehling
12239178c6 rc_find optimizations in monster AI.
remove dead alp code.
2016-09-19 20:10:01 +02:00
Enno Rehling
1f100a1b6c replace old_race calls with get_race. 2016-09-19 16:10:10 +02:00
Enno Rehling
87fed5b7d2 Merge pull request #548 from ennorehling/refactor-volcano
new tests, TODOs removed, remove code duplication
2016-08-31 17:19:29 +01:00
Enno Rehling
9a72157cf3 split out seaserpent creation for testing 2016-08-31 11:35:07 +02:00
Enno Rehling
1a1ec3f363 cleanup: remove static curse_type variables. 2016-08-29 20:12:31 +01:00
Steffen Mecke
c5014fd766 integrated Ennos suggestions for dragon growls
Dragons now growl 20% more elegantly!
2016-06-11 13:47:38 +02:00
Steffen Mecke
ce312afc95 fix dragon growl for regions with an apostrophe 2016-05-31 01:54:06 +02:00
Enno Rehling
75f2be75d8 remove code for alp (non-functional)
remove code for removecurse trigger (only used by alp)
2016-03-25 21:18:57 +01:00
Enno Rehling
3d5c7ba8fb refactoring: move produceexp from unit.c to study.c 2016-03-09 14:50:54 +01:00
Steffen Mecke
1aca1c6a87 fix logic bug 2015-12-30 14:04:10 +01:00
Steffen Mecke
09836ed249 make dragon movement more deterministic 2015-12-17 11:47:08 +01:00
Steffen Mecke
1f4c521ac8 encapsulate r->land->peasants, money, horses, herbs, morale 2015-12-08 17:57:23 +01:00
Steffen Mecke
e3d7d23d00 re-enable sea serpent piracy 2015-12-01 22:30:51 +01:00
Enno Rehling
70354a355b disable piracy for sea serpents, piracy_cmd cannot handle it (issue #418) 2015-12-01 12:22:03 +01:00
Enno Rehling
6c2f4be4af fix sea serpents using piracy (by re-ordering the decision making process) 2015-11-25 15:29:26 +01:00
Enno Rehling
c85e489f4f Merge branch 'monster_leftovers' of https://github.com/stm2/server into stm2-monster_leftovers
Conflicts:
	src/kernel/unit.c
	src/laws.test.c
	src/monsters.c
2015-11-25 14:25:42 +01:00
Enno Rehling
5b9333f6d9 Merge branch 'release-3.7' into develop
Conflicts:
	src/buildno.h
	src/monsters.c
2015-11-23 17:12:48 +01:00
Enno Rehling
4b7b32cbb5 use monster_attack, not explicit create_order, because we need to check buildings, etc. 2015-11-23 17:00:07 +01:00
Enno Rehling
defd870cd1 https://bugs.eressea.de/view.php?id=2163
Fix order of Arguments when checking for defensive building.
Solthar reminds us that good variable names are good.
2015-11-23 16:48:05 +01:00
Enno Rehling
c7ab0e8f59 fix https://bugs.eressea.de/view.php?id=2164 (ships get no damage when they drift).
simplify attack_chance configuration, set it only once.
this way, I can more easily fudge it to 1.0 in the debugger.
2015-11-23 12:37:42 +01:00
Enno Rehling
a4cb5e2906 replace all get_param_* for global.parameters with config_get_* 2015-11-22 10:44:46 +01:00
Steffen Mecke
8a063c3567 fix bug in dragon_affinity 2015-11-17 17:19:06 +01:00
Steffen Mecke
a144686e66 monsters may attack on ocean 2015-11-17 12:13:23 +01:00
Steffen Mecke
a366cd4b17 tests for plan_monster 2015-11-17 12:12:06 +01:00
Steffen Mecke
384a2ea7d7 remove duplicate monster_attacks code 2015-11-17 02:16:07 +01:00
Steffen Mecke
069303d0ae slightly improved monster code
change normalvariate to more efficient dice based method
try harder to learn a useful skill
2015-11-17 02:14:28 +01:00
Steffen Mecke
8cec4b20e0 reduce code obfuscation 2015-11-17 02:14:08 +01:00
Enno Rehling
efc87a16e3 clarify dragon planning code (bug 2159) 2015-11-16 16:57:51 +01:00
Enno Rehling
7fb5adc7af in_safe_building needs a test and some changes to logic
github issue #393 fixed
2015-11-12 17:55:39 +01:00
Enno Rehling
4eb4ff40ac https://bugs.eressea.de/view.php?id=2155
monsters do not attack units inside a castle or watch
dragons do not attack guards
2015-11-11 14:36:56 +01:00
Enno Rehling
f70b385bef clean up plan_monsters and make it a bit more readable 2015-11-02 15:27:01 +01:00
Enno Rehling
84a92124bd Merge branch 'feature/bug-2053-attack-monsters' of https://github.com/ennorehling/eressea into ennorehling-feature/bug-2053-attack-monsters
Conflicts:
	conf/e3/config.xml
2015-09-19 13:35:53 +02:00
Enno Rehling
5f7b9129bc Merge branch 'master' into develop
Conflicts:
	tests/runtests.bat
2015-09-12 22:47:33 +02:00
Enno Rehling
06a04d0e20 fix logging for sp_igjarjuk, temporarily set log-levels for the game to error|warn|info
remove some code that accesses `verbosity` variable (todo: hide it more, fix logging)
2015-09-12 19:48:03 +02:00
Enno Rehling
9bdc811582 produceexp uses a json-configurable constant
make get_param_flt return a double, floats are for wimps.
2015-09-12 16:38:51 +02:00
Enno Rehling
de808bf146 change effskill signature to take a region, change eff_skill to work on a skill * to avoid multiple lookups. 2015-08-27 16:16:55 +02:00
Enno Rehling
b50c1720cf several monster_attack fixes.
1. do not try to attack other monsters.
2. monsters outside of a building can attack units outside of buildings.
3. dragons can guard without weapons.
2015-08-16 16:18:59 +02:00
Enno Rehling
b53d01eb18 Bug 1890: monsters do not respect the rules when giving excess weight to peasants.
https://bugs.eressea.de/view.php?id=1890
fixed by creating a give order instead of calling give_item directly.
2015-07-02 11:08:38 +02:00
Enno Rehling
abca25d1d5 fix indentation in every file
fix copyright date
remove vi ts=2 code
remove a couple of superfluous extern declarations
2015-01-30 20:37:14 +01:00
Enno Rehling
901c70efd9 config cleanup contd.
createunit => create_unit, everywhere.
make_undead_unit in zombies.c
2014-12-25 18:40:46 +01:00
Enno Rehling
f6f193ab76 Monsters should LOOT if the rules don't allow TAX. 2014-12-20 21:37:06 +01:00
Enno Rehling
c5774e652a also prevent monsters from studying unarmed combat if they cannot learn things.
refactor the unit_can_study functionality into a separate function, we are now using it in multiple places.
2014-12-14 16:17:01 +01:00
Enno Rehling
595dc35fb0 bugfix: monster races that cannot learn skills, will not try to study.
This fixes https://bugs.eressea.de/view.php?id=2054
2014-12-14 15:59:20 +01:00
Enno Rehling
2da1d11277 move chaos to a separate module (it is an old E2 feature) 2014-12-13 11:44:14 +01:00
Enno Rehling
0fead39b41 added a function that sets a monster's name to NULL if it is the name of its race.
deprecate old rc_name function (renamed to rc_name_s) because it used a static return string.
2014-12-09 07:20:36 +01:00
Enno Rehling
ecc3b1b441 Dragons re using the new LOOT command.
Fixing the income message (missing ")").
2014-11-02 11:10:26 +01:00
Enno Rehling
81bfb598d0 refactoring modules, cleaning out the config.c kitchen sink.
- cansee_* rules to laws.c
- translations to language.c
- stealth to attributes/,
- rename build.h -> buildno.h
2014-11-01 12:09:56 +01:00
CTD
2875fdddd1 Fixing Monsters
Drachen haben die Attacke-Chance Einstellung komplett ignoriert.
Jetzt machen sie zumindest bei 0 nicht mehr.
2014-09-01 15:42:56 +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
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
e69fb78e6b Monster attackieren keine Einheiten in Gebäuden. 2014-08-19 15:31:16 +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
8803a9e9a8 properly create missing monster faction when spawning dragons. 2014-08-16 13:46:34 +02:00
Enno Rehling
c3dfbdea18 eliminate new_race array in favor of a function (TODO: make it fast) 2014-06-29 18:10:02 -07:00
Enno Rehling
2c831230a0 Added a test for expensive skills.
When resetting the game rules, make sure basic resources (money, hp, person) are initialized.
2014-06-22 07:55:14 -07:00
Enno Rehling
bff25f3c51 move skill_t into a separate file, give it unit tests.
name functions the same as we did for keyword/direction earlier.
to do: json configuration and lua test.
2014-06-20 23:59:04 -07:00
Enno Rehling
0675c50c7f keyword lookup macro 2014-06-16 23:05:39 -07:00
Enno Rehling
3c4b6b9dd4 rename message.[hc] to messages.[hc] in kernel because of naming conflict with util/
begin json config files (WIP)
2014-06-09 09:56:49 -07:00
Enno Rehling
0ae8737062 rename MIN/MAX to _min/_max 2014-03-16 05:03:17 +01:00
Enno Rehling
03c247c788 I am killing the core/ directory.
Lots of files are moving to a new location in src/
Some intersting CMake changes.
2014-02-18 05:45:00 +01:00
Enno Rehling
b4b8c49934 use getters/setters to access unit::race 2013-05-02 03:50:24 +02:00
Enno Rehling
f7edcf589a update to latest version of the eressea module
fixes for bool type
fixes for lua 5.2
fixes for some intermittent tests
2012-07-09 02:51:48 +02:00
Enno Rehling
4e7a758a75 making server compile with new github repository layout
todo: fix scripts and config files
2012-06-04 21:45:25 -07:00
Enno Rehling
1f0d5f205e rename _log_error to log_error and get rid of the cumbersome #define 2012-05-16 16:52:12 -07:00
Enno Rehling
3c1982da4c improve logging verbosity
adapt to changes in log module
2012-05-16 09:49:28 +02:00
Enno Rehling
835f51c512 eliminate region_list usage from the monster pathfinder 2011-04-25 22:20:27 -07:00
Enno Rehling
d8abd09076 rconnect is not as nice as get_neighbours 2011-04-24 17:44:00 -07:00
Enno
b95f663087 compiling with -pedantic on linux 2011-03-08 08:42:31 +01:00
Enno
d940f29a6c indentation rules, slightly updated 2011-03-07 08:24:48 +01:00
Enno
347a888b67 indentation rules, strictly applied 2011-03-07 08:03:10 +01:00
Enno Rehling
0837fe4176 http://bugs.eressea.de/view.php?id=1809
Monsters attacking units that they cannot see? Bad!
2010-10-10 21:42:27 -07:00
Enno
0f93601454 undo CRLF crazy 2010-08-08 09:40:42 +02:00
Enno Rehling
f8094f77dc use libraries from the external folder, don't depend on any additional installations (VS 2010) 2010-08-07 22:53:41 -07:00
Enno Rehling
64fb51c067 more moving around 2010-03-06 14:40:26 -08:00
Renamed from src/eressea/src/monsters.c (Browse further)