Commit Graph

31 Commits

Author SHA1 Message Date
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 1e6a83f357 resize buffer in eval_command, it was too small for many commands.
increase MAXTEACHERS.
eliminate oldterrain warning in json_report.
2015-08-06 16:52:24 +02:00
Enno Rehling 27835dc4e1 unit tests for STUDY and TEACH commands. 2015-07-09 13:24:21 +02:00
Enno Rehling e25d3c8ed1 Fix a bug reporting DETROY messages to the correct unit.
Add missing not-null assertions before accessing function parameters.
Eliminate all of the PVS-Studio warnings.
2015-07-07 00:49:12 +02:00
Enno Rehling 05ec74f9ec annotate with finds from PVS Studio trial static analysis 2015-07-06 21:31:27 +02:00
Enno Rehling f054ea114b Bug 1861: increase MAXTEACHERS, warn if it is still too small. 2015-07-02 16:23:38 +02:00
Enno Rehling 9b64269b6d fix auto-study plus-equal typo 2015-03-19 15:31:25 +01:00
Enno Rehling c54cbfd472 fix copyright notice 2015-01-30 22:10:29 +01: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 5ebf05f625 additional tests for the parser.
move more parsing code out of config.c
2014-12-22 16:45:56 +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 5751a9b3a9 Merge pull request #66 from badgerman/getunit-refactor
refactoring getunit
2014-12-13 13:26:32 +01:00
Enno Rehling c4b898e968 remove some inactive #define macros and the code that goes with them.
mostly rules that were experimental, but have made it into common use (not worth the effort of making them configurable).
2014-12-13 11:53:16 +01:00
Enno Rehling 98994f233d remove the deprecated getunit function.
fix the build, missing return value from give_control_cmd.
2014-12-12 21:06:47 +01:00
Enno Rehling 481275aef1 refactor: eliminate the getunitpeasants global variable.
bugfix: it was possible to uncover stealth units with GIVE CONTROL.
2014-12-12 20:53:39 +01:00
Enno Rehling 1af315ebf2 move magic out of kernel, into src.
clean up/remove a ton of includes, especially of types.h (include in header if you need it, not in every .c file).
2014-11-01 12:57:01 +01:00
Enno Rehling 837227f69c PR code review comments.
- make study rule an enum, for easier debugging
- change parameter name (it's not a type)
2014-10-18 19:53:13 +02:00
CTD 1c8488f2b4 Wenn man 1/2 schreibt
sollte auch 1/2 im Code stehen.
2014-10-17 13:54:07 +02:00
CTD aa07c550ab Auto Lehrer
Config via study.speedup (sollte in E2 und E3 schon mit dem Wert 0 in
der XML stehen)
Wert 1:
Wenn das gerade gelernte Talent wenig Lerntage hat als 1/3 der max.
möglichen (ohne Bonus wie Akademie) hat,  dann gibt es die doppelten
Lerntage. Entspricht etwa dem alten Lehrer Schema.
Wert 2: Es werden die Lerntage aller Talente der Einheit als
Vergleichswert genommen, dann aber gegen den halben maximalen
Lerntagewert.
Es werden niemals die Lerntage der aktuellen Stufe mit eingerechnet,
sondern nur die durchschnittlichen Lerntage der bereits fertig gelernten
Stufen.
In E2 sollte der Lehre Befehl deaktiviert werden wenn diese Option
aktiviert wird.
2014-10-17 13:54:00 +02:00
Enno Rehling 74582aeb2f fix remaining getstrtoken uses without null-check. 2014-09-21 16:43: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 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 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 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 c8dc6be6f2 rename get_keyword, because something else should have that name. 2014-06-16 07:19:22 -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 528dd4b81f remove latin1 characters from some files
experimenting with .gitattributes some more
2014-03-06 19:12:12 -08: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
Renamed from core/src/gamecode/study.c (Browse further)