Commit Graph

40 Commits

Author SHA1 Message Date
Enno Rehling 2c077c25e8 space savings: update data files, remove names from NPC units where their name is their race. 2014-12-09 07:44:26 +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 9394c4324e units without a name will use their race as a default name. 2014-12-09 06:45:21 +01:00
Enno Rehling b551edbdb3 refactoring: moving unitname to unit.c.
also removing static-string some cruft from config.c.
2014-12-09 05:55:16 +01:00
Enno Rehling 669712f04f rename race_ to _race, to follow the style guide. 2014-12-08 22:06:05 +01:00
Enno Rehling 3dd3761acd prevent an invalid assert when undead heroes are magical 2014-12-07 11:14:14 +01:00
Enno Rehling 5b9eb9080f refactoring: move all monster-related code into monster.c
make some features depend on being NPCs, not monster faction.
2014-11-11 16:53:56 +01:00
Enno Rehling e9084d9678 when free_gamedata, also unhash all factions. speed up is_monsters(). 2014-11-07 22:58:29 +01:00
Enno Rehling 59c1c23324 refactor config.c, move the find* functions into the modules they belong to. 2014-11-01 18:34:53 +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 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
Enno Rehling a29e6a7f40 fix segmentation fault in new assert (units without a faction) 2014-10-31 22:20:07 +01:00
Enno Rehling 5b6663cad7 Assert that magicians are single-person units in a few places.
Bug 2028 claims that this is not always the case, though I cannot prove it.
2014-10-31 22:03:00 +01:00
Enno Rehling e9c13cc328 cosmetic changes, quick and easy assert to prevent too many magicians. 2014-10-30 17:48:02 +01: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
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
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 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 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
CTD 3bd63955a2 Klammern vergessen 2014-07-16 10:28:32 +02:00
CTD1 700a88fd79 Umlaute in Kommentaren
sind doof.
2014-07-15 15:46:02 +02:00
CTD1 38a754844e BUG 0001980: Gegener hält Burg obwohl alle geflohen sind!
http://bugs.eressea.de/view.php?id=1980
Der Test unten erzeugt eine Temp-Einheit welche nach dem Kampf die Burg hält, trotz einer vernichtenden Niederlage innerhalb von 2 Kampfrunden. Der Angreifer darf die Burg zwar betreten, bekommt aber nicht das Kommando.
Grund ist das beim Betreten der Burg via u_set_building() nur dann die betretende Einheit zum Burgenbesitzer wird wenn es keinen Burgenbesitzer gibt.
Die eher aufgerufene Funktion building_owner() versucht zwar nach dem Kampf einen neuen Burgenbesitzer zu finden, da sich zu diesem Zeitpunkt aber nur eine Tote Einheit und einen Temp Einheit, beide mit 0 Personen, in der Bug befinden schlägt dies Fehl. Es wird von der Funktion zwar 0 zurückgegeben, aber b->_owner wird nicht zurückgesetzt (Vermutlich da der Server an anderer Stelle sonst annimmt das noch nie jemand in der Burg war). Daher die Überprüfung bei u_set_building ob der Burgenbesitzer tot ist, und wenn ja wird die betretende Einheit neuer Burgenbesitzer.

local r1 = region.create(1, 2, "plain")
local f1 = faction.create("a@b.de", "human", "de")
local f2 = faction.create("c@d.de", "human", "de")
f1.age=20
f2.age=20

local b1 = building.create(r1, "castle")
b1.size = 100

local u0 = unit.create(f1, r1, 10)
u0.building = b1
u0:add_item("money", u0.number * 100)
u0:clear_orders()
u0:add_order("KÄMPFE")
u0:add_order("MACHE TEMP 1")
u0:add_order("ENDE")

local u1 = unit.create(f1, r1, 100)
u1.building = b1
u1:add_item("money", u1.number * 100)
u1:clear_orders()
u1:add_order("KÄMPFE FLIEHE")
u1:add_order("GIB TEMP 1 ALLES PERSONEN")
u1:add_order("GIB TEMP 1 ALLES")
u1:add_order("GIB TEMP 1 Kommando")

local u2 = unit.create(f2, r1, 101)
u2:add_item("sword", u2.number)
u2:add_item("money", u2.number * 100)
u2:set_skill("melee", 16)
u2:clear_orders()
u2:add_order("KÄMPFE")
u2:add_order("ATTACKIEREN " .. itoa36(u1.id))
u2:add_order("BETRETE BURG " .. itoa36(b1.id))

process_orders()


Das sollte für Schiffe eigentlich das gleiche sein, also da die gleiche Änderung.
2014-07-15 15:24:21 +02:00
Enno Rehling b2b35fd9d0 add a test for the E3 reduced give quota.
foreign units receive only 50% of silver given to them.

Conflicts:
	tests/pool.lua
2014-07-07 03:41:33 +02:00
Enno Rehling 88f9d247bd Revert "use race::flags|RCF_NOGIVE instead of race::ec_flags|GIVEITEM"
E3 Tests (GIVE) did not pass.

This reverts commit 5ec3f5b83a.
2014-07-06 00:29:52 -07:00
Enno Rehling 5ec3f5b83a use race::flags|RCF_NOGIVE instead of race::ec_flags|GIVEITEM
None of this has tests, it'd going to be years before a change like this can be made without fear D-:
2014-07-05 23:31:34 -07: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 92f43a7b51 eliminate it_find calls, replace it_find with something backed by rt_find 2014-06-24 22:44:05 -07:00
Enno Rehling d581737744 optimization: caching resource types in get_resourcetype.
eliminate some it_find calls.
eliminate static variables, they make testing hard.
2014-06-24 07:42:45 -07:00
Enno Rehling 73da14e305 getting rid of the olditemtypes[] array
reduce use of statics
reduce use of item_t enum
2014-06-23 07:28:10 -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 7038b021de fix counting of units, making it slower but more correct 2014-05-24 20:25:06 -07:00
Enno Rehling 535a9e6e53 fix number of units in the report header 2014-04-26 12:24:51 -07:00
Enno Rehling 7358c48580 removing some naming conflicts that hapen when trying to re-enable amalgamation builds. 2014-04-11 19:41:17 -07:00
Enno Rehling 0ae8737062 rename MIN/MAX to _min/_max 2014-03-16 05:03:17 +01:00
Enno Rehling 1a7d892a96 use cmake for autoconf, slim down platform.h 2014-03-15 19:29:11 +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
Renamed from core/src/kernel/unit.c (Browse further)