1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2001 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
… | |
… | |
294 | |
294 | |
295 | // 8 free bits |
295 | // 8 free bits |
296 | |
296 | |
297 | //float ACC (RW, expmul) = 1.0; /* needed experience = (calc_exp*expmul) - means some */ |
297 | //float ACC (RW, expmul) = 1.0; /* needed experience = (calc_exp*expmul) - means some */ |
298 | // /* races/classes can need less/more exp to gain levels */ |
298 | // /* races/classes can need less/more exp to gain levels */ |
299 | static const float expmul = 1.0;//D |
299 | constexpr static const float expmul = 1.0;//D |
300 | float ACC (RW, move_slow_penalty); /* How much this slows down the object */ |
300 | float ACC (RW, move_slow_penalty); /* How much this slows down the object */ |
301 | |
301 | |
302 | /* Following are values used by any object */ |
302 | /* Following are values used by any object */ |
303 | /* this objects turns into or what this object creates */ |
303 | /* this objects turns into or what this object creates */ |
304 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
304 | treasurelist *ACC (RW, randomitems); /* Items to be generated */ |
… | |
… | |
481 | // strangely enough, using ?: here causes code to inflate |
481 | // strangely enough, using ?: here causes code to inflate |
482 | return type == CONTAINER |
482 | return type == CONTAINER |
483 | && ((env && env->container_ () == this) |
483 | && ((env && env->container_ () == this) |
484 | || (!env && flag [FLAG_APPLIED])); |
484 | || (!env && flag [FLAG_APPLIED])); |
485 | } |
485 | } |
|
|
486 | |
|
|
487 | MTH object *find_spell (const_utf8_string prefix) const; |
486 | |
488 | |
487 | MTH object *force_find (shstr_tmp name); |
489 | MTH object *force_find (shstr_tmp name); |
488 | MTH void force_set_timer (int duration); |
490 | MTH void force_set_timer (int duration); |
489 | MTH object *force_add (shstr_tmp name, int duration = 0); |
491 | MTH object *force_add (shstr_tmp name, int duration = 0); |
490 | |
492 | |
… | |
… | |
882 | MTH object *instance (); |
884 | MTH object *instance (); |
883 | |
885 | |
884 | MTH void post_load_check (); // do some adjustments after parsing |
886 | MTH void post_load_check (); // do some adjustments after parsing |
885 | |
887 | |
886 | object_vector_index ACC (RW, archid); // index in archvector |
888 | object_vector_index ACC (RW, archid); // index in archvector |
887 | shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ |
889 | shstr ACC (RW, archname); /* More definite name, like "generate_kobold" */ |
888 | |
890 | |
889 | sint8 ACC (RW, max_x); /* extents, compared to the head (min_x, min_y should be zero, but aren't...) */ |
891 | sint8 ACC (RW, max_x); /* extents, compared to the head (min_x, min_y should be zero, but aren't...) */ |
890 | |
892 | |
891 | // support for archetype loading |
893 | // support for archetype loading |
892 | static archetype *read (object_thawer &f); |
894 | static archetype *read (object_thawer &f); |
… | |
… | |
924 | // "safely" iterate over inv in a way such that the current item is removable |
926 | // "safely" iterate over inv in a way such that the current item is removable |
925 | // quite horrible, that's why its hidden in some macro |
927 | // quite horrible, that's why its hidden in some macro |
926 | #define for_inv_removable(op,var) \ |
928 | #define for_inv_removable(op,var) \ |
927 | for (object *var, *next_ = (op)->inv; (var = next_), var && (next_ = var->below), var; ) |
929 | for (object *var, *next_ = (op)->inv; (var = next_), var && (next_ = var->below), var; ) |
928 | |
930 | |
929 | #define for_all_objects(var) \ |
931 | #define for_all_objects(var) \ |
930 | for (unsigned _i = 0; _i < objects.size (); ++_i) \ |
932 | for (unsigned _i = 0; _i < objects.size (); ++_i) \ |
931 | statementvar (object *, var, objects [_i]) |
933 | statementvar (object *, var, objects [_i]) |
932 | |
934 | |
933 | #define for_all_actives(var) \ |
935 | #define for_all_actives(var) \ |
934 | for (unsigned _i = 0; _i < actives.size (); ++_i) \ |
936 | for (unsigned _i = 0; _i < actives.size (); ++_i) \ |
935 | statementvar (object *, var, actives [_i]) |
937 | statementvar (object *, var, actives [_i]) |
936 | |
938 | |
937 | #define for_all_archetypes(var) \ |
939 | #define for_all_archetypes(var) \ |
938 | for (unsigned _i = 0; _i < archetypes.size (); ++_i) \ |
940 | for (unsigned _i = 0; _i < archetypes.size (); ++_i) \ |
939 | statementvar (archetype *, var, archetypes [_i]) |
941 | statementvar (archetype *, var, archetypes [_i]) |
940 | |
942 | |
941 | //+GPL |
943 | //+GPL |
942 | |
944 | |
943 | /* Used by update_object to know if the object being passed is |
945 | /* Used by update_object to know if the object being passed is |
… | |
… | |
946 | #define UP_OBJ_INSERT 1 |
948 | #define UP_OBJ_INSERT 1 |
947 | #define UP_OBJ_REMOVE 2 |
949 | #define UP_OBJ_REMOVE 2 |
948 | #define UP_OBJ_CHANGE 3 |
950 | #define UP_OBJ_CHANGE 3 |
949 | #define UP_OBJ_FACE 4 /* Only thing that changed was the face */ |
951 | #define UP_OBJ_FACE 4 /* Only thing that changed was the face */ |
950 | |
952 | |
951 | /* These are flags passed to insert_ob_in_map and |
953 | /* These are flags passed to insert_ob_in_map and |
952 | * insert_ob_in_ob. Note that all flags may not be meaningful |
954 | * insert_ob_in_ob. Note that all flags may not be meaningful |
953 | * for both functions. |
955 | * for both functions. |
954 | * Most are fairly explanatory: |
956 | * Most are fairly explanatory: |
955 | * INS_NO_MERGE: don't try to merge inserted object with ones alrady |
957 | * INS_NO_MERGE: don't try to merge inserted object with ones alrady |
956 | * on space. |
958 | * on space. |