--- deliantra/server/include/attack.h 2006/02/03 07:12:47 1.1 +++ deliantra/server/include/attack.h 2006/09/03 00:18:41 1.5 @@ -1,9 +1,4 @@ /* - * static char *rcsid_attack_h = - * "$Id$"; - */ - -/* CrossFire, A Multiplayer game for X-windows Copyright (C) 2002 Mark Wedel & Crossfire Development Team @@ -126,7 +121,7 @@ #define AT_BLIND 0x00400000 /* 4194304 thomas@astro.psu.edu */ #define AT_INTERNAL 0x00800000 /* Only used for internal calculations */ #define AT_LIFE_STEALING \ - 0x01000000 /* 16777216 for hp drain */ + 0x01000000 /* 16777216 for hp drain */ #define AT_DISEASE 0x02000000 /* 33554432 disease attacktypes */ /* attacktypes_load is suffixed to resist_ when saving objects. @@ -151,27 +146,17 @@ EXTERN attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]; -#ifndef INIT_C -EXTERN int resist_table[]; -EXTERN char *change_resist_msg[NROFATTACKS]; -EXTERN char *resist_plus[NROFATTACKS]; -EXTERN char *attacktype_desc[NROFATTACKS]; -EXTERN char *resist_save[NROFATTACKS]; +#ifdef INIT_C -/* Beware, names require an _ if there is a space, else they will be read - * as for example: resist_life stealing 50! - */ -#else -EXTERN char *resist_save[NROFATTACKS] = { -"physical ", "magic ", "fire ", "electricity ", "cold ", "confusion ", "acid ", -"drain ", "weaponmagic ", "ghosthit ", "poison ", "slow ", "paralyze ", -"turn_undead ", "fear ", "cancellation ", "deplete ", "death ", "chaos ", -"counterspell ", "godpower ", "holyword ", "blind " , "internal ", "life_stealing ", -"disease " +extern const keyword resist_save[NROFATTACKS] = { +KW_resist_physical, KW_resist_magic, KW_resist_fire, KW_resist_electricity, KW_resist_cold, KW_resist_confusion, KW_resist_acid, +KW_resist_drain, KW_resist_weaponmagic, KW_resist_ghosthit, KW_resist_poison, KW_resist_slow, KW_resist_paralyze, +KW_resist_turn_undead, KW_resist_fear, KW_resist_cancellation, KW_resist_deplete, KW_resist_death, KW_resist_chaos, +KW_resist_counterspell, KW_resist_godpower, KW_resist_holyword, KW_resist_blind , KW_resist_internal, KW_resist_life_stealing, +KW_resist_disease, }; -/* Short description of names of the attacktypes */ -EXTERN char *attacktype_desc[NROFATTACKS] = { +extern const char* const attacktype_desc[NROFATTACKS] = { "physical", "magic", "fire", "electricity", "cold", "confusion", "acid", "drain", "weapon magic", "ghost hit", "poison", "slow", "paralyze", "turn undead", "fear", "cancellation", "deplete", "death", "chaos", @@ -179,9 +164,7 @@ "disease" }; -/* This is the array that is what the player sees. */ - -EXTERN char *resist_plus[NROFATTACKS] = { +extern const char* const resist_plus[NROFATTACKS] = { "armour", "resist magic", "resist fire", "resist electricity", "resist cold", "resist confusion", "resist acid", "resist drain", "resist weaponmagic", "resist ghosthit", "resist poison", "resist slow", @@ -192,10 +175,7 @@ "resist diseases" }; -/* These are the descriptions of the resistances displayed when a - * player puts on/takes off an item. See change_abil() in living.c. - */ -EXTERN char *change_resist_msg[NROFATTACKS] = { +extern const char* const change_resist_msg[NROFATTACKS] = { "physical", "magic", "fire", "electricity", "cold", "confusion", "acid", "draining", "weapon magic", "ghosts", "poison", "slow", "paralyze", "turn undead", "fear", "cancellation", "depletion", "death attacks", "chaos", @@ -203,16 +183,32 @@ "life stealing", "disease" }; +int resist_table[NROFATTACKS] = {ATNR_PHYSICAL, ATNR_MAGIC, ATNR_FIRE, + ATNR_ELECTRICITY,ATNR_COLD, ATNR_CONFUSION, ATNR_ACID, ATNR_DRAIN, + ATNR_GHOSTHIT, ATNR_POISON, ATNR_SLOW, ATNR_PARALYZE, ATNR_TURN_UNDEAD, + ATNR_FEAR, ATNR_DEPLETE, ATNR_DEATH, ATNR_HOLYWORD, ATNR_BLIND, + ATNR_LIFE_STEALING, ATNR_DISEASE}; + +#else + +extern const keyword resist_save[NROFATTACKS]; + +/* Short description of names of the attacktypes */ +extern const char* const attacktype_desc[NROFATTACKS]; + +/* This is the array that is what the player sees. */ +extern const char* const resist_plus[NROFATTACKS]; + +/* These are the descriptions of the resistances displayed when a + * player puts on/takes off an item. See change_abil() in living.c. + */ +extern const char* const change_resist_msg[NROFATTACKS]; /* If you want to weight things so certain resistances show up more often than * others, just add more entries in the table for the protections you want to * show up. */ -EXTERN int resist_table[] = {ATNR_PHYSICAL, ATNR_MAGIC, ATNR_FIRE, - ATNR_ELECTRICITY,ATNR_COLD, ATNR_CONFUSION, ATNR_ACID, ATNR_DRAIN, - ATNR_GHOSTHIT, ATNR_POISON, ATNR_SLOW, ATNR_PARALYZE, ATNR_TURN_UNDEAD, - ATNR_FEAR, ATNR_DEPLETE, ATNR_DEATH, ATNR_HOLYWORD, ATNR_BLIND, - ATNR_LIFE_STEALING, ATNR_DISEASE}; +extern int resist_table[NROFATTACKS]; #endif