2010-08-08 10:06:34 +02:00
|
|
|
|
/*
|
2015-01-30 22:10:29 +01:00
|
|
|
|
Copyright (c) 1998-2015, Enno Rehling <enno@eressea.de>
|
2014-12-09 14:14:35 +01:00
|
|
|
|
Katja Zedel <katze@felidae.kn-bremen.de
|
|
|
|
|
Christian Schlittchen <corwin@amber.kn-bremen.de>
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
|
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
#include <platform.h>
|
|
|
|
|
#include <kernel/config.h>
|
|
|
|
|
#include "attributes.h"
|
|
|
|
|
|
2015-11-24 19:32:52 +01:00
|
|
|
|
#include "laws.h"
|
|
|
|
|
#include "move.h"
|
|
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
|
/* attributes includes */
|
|
|
|
|
#include "follow.h"
|
2017-02-27 20:16:50 +01:00
|
|
|
|
#include "fleechance.h"
|
2010-08-08 10:06:34 +02:00
|
|
|
|
#include "hate.h"
|
|
|
|
|
#include "iceberg.h"
|
|
|
|
|
#include "key.h"
|
2014-11-01 12:09:56 +01:00
|
|
|
|
#include "stealth.h"
|
2015-11-24 19:32:52 +01:00
|
|
|
|
#include "magic.h"
|
2010-08-08 10:06:34 +02:00
|
|
|
|
#include "moved.h"
|
|
|
|
|
#include "movement.h"
|
2015-01-17 13:22:26 +01:00
|
|
|
|
#include "dict.h"
|
2010-08-08 10:06:34 +02:00
|
|
|
|
#include "otherfaction.h"
|
|
|
|
|
#include "overrideroads.h"
|
|
|
|
|
#include "racename.h"
|
|
|
|
|
#include "raceprefix.h"
|
|
|
|
|
#include "reduceproduction.h"
|
|
|
|
|
#include "targetregion.h"
|
|
|
|
|
|
|
|
|
|
/* kernel includes */
|
2015-11-24 19:32:52 +01:00
|
|
|
|
#include <kernel/ally.h>
|
|
|
|
|
#include <kernel/connection.h>
|
|
|
|
|
#include <kernel/curse.h>
|
2010-08-08 10:06:34 +02:00
|
|
|
|
#include <kernel/unit.h>
|
|
|
|
|
#include <kernel/faction.h>
|
2015-11-24 19:32:52 +01:00
|
|
|
|
#include <kernel/group.h>
|
2010-08-08 10:06:34 +02:00
|
|
|
|
#include <kernel/region.h>
|
|
|
|
|
#include <kernel/ship.h>
|
|
|
|
|
#include <kernel/building.h>
|
|
|
|
|
|
|
|
|
|
/* util includes */
|
|
|
|
|
#include <util/attrib.h>
|
2015-11-24 19:32:52 +01:00
|
|
|
|
#include <util/event.h>
|
2016-02-13 13:42:02 +01:00
|
|
|
|
#include <util/gamedata.h>
|
2015-11-24 19:32:52 +01:00
|
|
|
|
|
|
|
|
|
#include <storage.h>
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
2017-02-27 20:16:50 +01:00
|
|
|
|
|
2010-08-08 10:06:34 +02:00
|
|
|
|
attrib_type at_unitdissolve = {
|
2014-12-09 14:14:35 +01:00
|
|
|
|
"unitdissolve", NULL, NULL, NULL, a_writechars, a_readchars
|
2010-08-08 10:06:34 +02:00
|
|
|
|
};
|
|
|
|
|
|
2016-02-13 13:42:02 +01:00
|
|
|
|
static int read_ext(attrib * a, void *owner, gamedata *data)
|
2015-11-24 19:32:52 +01:00
|
|
|
|
{
|
|
|
|
|
int len;
|
|
|
|
|
|
2016-02-13 13:42:02 +01:00
|
|
|
|
READ_INT(data->store, &len);
|
|
|
|
|
data->store->api->r_bin(data->store->handle, NULL, (size_t)len);
|
2015-11-24 19:32:52 +01:00
|
|
|
|
return AT_READ_OK;
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-07 08:02:35 +01:00
|
|
|
|
void register_attributes(void)
|
2010-08-08 10:06:34 +02:00
|
|
|
|
{
|
2015-11-24 19:32:52 +01:00
|
|
|
|
/* Alle speicherbaren Attribute m<>ssen hier registriert werden */
|
|
|
|
|
at_register(&at_shiptrail);
|
|
|
|
|
at_register(&at_familiar);
|
|
|
|
|
at_register(&at_familiarmage);
|
|
|
|
|
at_register(&at_clone);
|
|
|
|
|
at_register(&at_clonemage);
|
|
|
|
|
at_register(&at_eventhandler);
|
|
|
|
|
at_register(&at_mage);
|
|
|
|
|
at_register(&at_countdown);
|
|
|
|
|
at_register(&at_curse);
|
|
|
|
|
|
|
|
|
|
at_register(&at_seenspell);
|
|
|
|
|
|
|
|
|
|
/* neue REGION-Attribute */
|
|
|
|
|
at_register(&at_moveblock);
|
|
|
|
|
at_register(&at_deathcount);
|
|
|
|
|
at_register(&at_woodcount);
|
|
|
|
|
|
|
|
|
|
/* neue UNIT-Attribute */
|
|
|
|
|
at_register(&at_siege);
|
|
|
|
|
at_register(&at_effect);
|
|
|
|
|
at_register(&at_private);
|
|
|
|
|
|
|
|
|
|
at_register(&at_icastle);
|
|
|
|
|
at_register(&at_group);
|
|
|
|
|
|
|
|
|
|
at_register(&at_building_generic_type);
|
|
|
|
|
at_register(&at_maxmagicians);
|
|
|
|
|
at_register(&at_npcfaction);
|
|
|
|
|
|
|
|
|
|
/* connection-typen */
|
|
|
|
|
register_bordertype(&bt_noway);
|
|
|
|
|
register_bordertype(&bt_fogwall);
|
|
|
|
|
register_bordertype(&bt_wall);
|
|
|
|
|
register_bordertype(&bt_illusionwall);
|
|
|
|
|
register_bordertype(&bt_road);
|
|
|
|
|
|
|
|
|
|
at_register(&at_germs);
|
|
|
|
|
|
2017-02-27 18:21:41 +01:00
|
|
|
|
at_deprecate("hurting", a_readint); /* an old arena attribute */
|
2015-11-24 19:32:52 +01:00
|
|
|
|
at_deprecate("xontormiaexpress", a_readint); /* required for old datafiles */
|
2016-11-13 17:13:59 +01:00
|
|
|
|
at_deprecate("orcification", a_readint); /* required for old datafiles */
|
2015-11-24 19:32:52 +01:00
|
|
|
|
at_deprecate("lua", read_ext); /* required for old datafiles */
|
2014-12-25 18:16:24 +01:00
|
|
|
|
at_deprecate("gm", a_readint);
|
2016-10-30 09:18:19 +01:00
|
|
|
|
at_deprecate("guard", a_readint); /* used to contain guard-flags (v3.10.0-259-g8597e8b) */
|
2014-11-01 12:09:56 +01:00
|
|
|
|
at_register(&at_stealth);
|
2015-01-17 13:22:26 +01:00
|
|
|
|
at_register(&at_dict);
|
2014-12-09 14:14:35 +01:00
|
|
|
|
at_register(&at_unitdissolve);
|
|
|
|
|
at_register(&at_overrideroads);
|
|
|
|
|
at_register(&at_raceprefix);
|
|
|
|
|
at_register(&at_iceberg);
|
|
|
|
|
at_register(&at_key);
|
2016-02-09 07:03:11 +01:00
|
|
|
|
at_register(&at_keys);
|
2014-12-09 14:14:35 +01:00
|
|
|
|
at_register(&at_follow);
|
|
|
|
|
at_register(&at_targetregion);
|
|
|
|
|
at_register(&at_hate);
|
|
|
|
|
at_register(&at_reduceproduction);
|
|
|
|
|
at_register(&at_otherfaction);
|
|
|
|
|
at_register(&at_racename);
|
2014-12-25 18:16:24 +01:00
|
|
|
|
at_register(&at_speedup);
|
2014-12-09 14:14:35 +01:00
|
|
|
|
at_register(&at_movement);
|
|
|
|
|
at_register(&at_moved);
|
2010-08-08 10:06:34 +02:00
|
|
|
|
}
|