From ad049a15b43b7ddba3fe7d0a898652fc8022629d Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 22 Apr 2014 11:46:23 -0700 Subject: Use strict ID types Possibly some missing for the far side of the network. AccountId and BlockId are still terribly entangled. --- src/map/mob.hpp | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'src/map/mob.hpp') diff --git a/src/map/mob.hpp b/src/map/mob.hpp index 570b5a9..d39a2ac 100644 --- a/src/map/mob.hpp +++ b/src/map/mob.hpp @@ -21,7 +21,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +# include "fwd.hpp" # include "mob.t.hpp" @@ -72,41 +72,43 @@ struct mob_db_ int mutations_nr, mutation_power; struct { - int nameid; + ItemNameId nameid; random_::Fixed p; } dropitem[8]; - short hair, hair_color, weapon, shield, head_top, head_mid, head_buttom, option, clothes_color; // [Valaris] + short hair, hair_color, weapon; + ItemNameId shield, head_top, head_mid, head_buttom; + short option, clothes_color; // [Valaris] int equip; // [Valaris] std::vector skills; }; -extern struct mob_db_ mob_db[]; +struct mob_db_& get_mob_db(Species); -int mobdb_searchname(MobName str); -int mobdb_checkid(const int id); -int mob_once_spawn(dumb_ptr sd, +Species mobdb_searchname(MobName str); +Species mobdb_checkid(Species id); +BlockId mob_once_spawn(dumb_ptr sd, MapName mapname, int x, int y, - MobName mobname, int class_, int amount, + MobName mobname, Species class_, int amount, NpcEvent event); -int mob_once_spawn_area(dumb_ptr sd, +BlockId mob_once_spawn_area(dumb_ptr sd, MapName mapname, int x0, int y0, int x1, int y1, - MobName mobname, int class_, int amount, + MobName mobname, Species class_, int amount, NpcEvent event); int mob_target(dumb_ptr md, dumb_ptr bl, int dist); int mob_stop_walking(dumb_ptr md, int type); int mob_stopattack(dumb_ptr); -int mob_spawn(int); +int mob_spawn(BlockId); int mob_damage(dumb_ptr, dumb_ptr, int, int); int mob_heal(dumb_ptr, int); -short mob_get_hair(int); -short mob_get_hair_color(int); -short mob_get_weapon(int); -short mob_get_shield(int); -short mob_get_head_top(int); -short mob_get_head_mid(int); -short mob_get_head_buttom(int); -short mob_get_clothes_color(int); //player mob dye [Valaris] -int mob_get_equip(int); // mob equip [Valaris] +short mob_get_hair(Species); +short mob_get_hair_color(Species); +short mob_get_weapon(Species); +ItemNameId mob_get_shield(Species); +ItemNameId mob_get_head_top(Species); +ItemNameId mob_get_head_mid(Species); +ItemNameId mob_get_head_buttom(Species); +short mob_get_clothes_color(Species); //player mob dye [Valaris] +int mob_get_equip(Species); // mob equip [Valaris] bool mob_readdb(ZString filename); bool mob_readskilldb(ZString filename); @@ -114,7 +116,7 @@ void do_init_mob2(void); int mob_delete(dumb_ptr md); int mob_catch_delete(dumb_ptr md, BeingRemoveWhy type); -void mob_timer_delete(TimerData *, tick_t, int); +void mob_timer_delete(TimerData *, tick_t, BlockId); int mob_deleteslave(dumb_ptr md); @@ -125,8 +127,8 @@ int mob_warp(dumb_ptr md, map_local *m, int x, int y, BeingRemoveWhy t int mobskill_use(dumb_ptr md, tick_t tick, MobSkillCondition event); int mobskill_event(dumb_ptr md, BF flag); -void mobskill_castend_id(TimerData *tid, tick_t tick, int id); -void mobskill_castend_pos(TimerData *tid, tick_t tick, int id); +void mobskill_castend_id(TimerData *tid, tick_t tick, BlockId id); +void mobskill_castend_pos(TimerData *tid, tick_t tick, BlockId id); int mob_summonslave(dumb_ptr md2, int *value, int amount, int flag); void mob_reload(void); -- cgit v1.2.3-60-g2f50