Go to the documentation of this file.
57 fail_unless(
floor != NULL,
"can't find archetype battleground");
60 fail_unless(
floor != NULL,
"can't find archetype battleground");
64 fail_unless(deplete != NULL,
"can't find archetype %s",
ARCH_DEPLETION);
67 fail_unless(
victim != NULL,
"couldn't create kobold");
68 fail_unless(
victim->inv == NULL,
"kobold shouldn't have an inventory");
70 victim->stats.maxhp = 5000;
75 fail_unless(
hitter != NULL,
"couldn't create sword");
83 for (test = 0; test < 100; test++) {
85 fail_unless(
victim->stats.hp ==
victim->stats.maxhp,
"victim should have %d hp and not %d.",
victim->stats.maxhp,
victim->stats.hp);
87 fail_unless(
victim->inv == NULL,
"kobold shouldn't have an inventory after attacked");
96 fail_unless(
victim->stats.hp !=
victim->stats.maxhp,
"victim shouldn't have %d hp",
victim->stats.hp);
103 fail_unless(
ob,
"wrong archetype human_player");
104 fail_unless(
ob->type ==
PLAYER,
"archetype isn't a player");
119 Suite *s = suite_create(
"attack");
120 TCase *tc_core = tcase_create(
"Core");
125 suite_add_tcase(s, tc_core);
126 tcase_add_test(tc_core, test_hit_player);
127 tcase_add_test(tc_core, test_fix_object_confused);
135 SRunner *sr = srunner_create(s);
144 srunner_set_xml(sr, LOGDIR
"/unit/server/attack.xml");
145 srunner_set_log(sr, LOGDIR
"/unit/server/attack.out");
146 srunner_run_all(sr, CK_ENV);
147 nf = srunner_ntests_failed(sr);
149 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
#define FREE_OBJ_NO_DESTROY_CALLBACK
static END_TEST Suite * attack_suite(void)
mapstruct * get_empty_map(int sizex, int sizey)
#define QUERY_FLAG(xyz, p)
void confuse_living(object *op, object *hitter, int dam)
object * arch_present_in_ob(const archetype *at, const object *op)
void fix_object(object *op)
sstring add_string(const char *str)
void object_free(object *ob, int flags)
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin it tries to load all available files in the SHARE plugins directory as plugin libraries It first displays the Initializing the plugin has the opportunity to signal itself by a message on the console Then the server displays an informative message containing both the plugin content and its keyword For the Python the standard load process thus GreenGoblin When a plugin has been it can request to be warned whenever a global event and are named freely by the developer If the directory doesn t nothing will happen< event name > can be init
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
object * create_archetype(const char *name)
Magical Runes Runes are magical inscriptions on the dungeon floor
archetype * find_archetype(const char *name)
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
static void teardown(void)
START_TEST(test_hit_player)