1 | /* |
1 | /* |
2 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
3 | |
3 | |
|
|
4 | Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | Copyright (C) 2003-2005 Mark Wedel & Crossfire Development Team |
5 | Copyright (C) 2003-2005 Mark Wedel & Crossfire Development Team |
5 | Copyright (C) 1992 Frank Tore Johansen |
6 | Copyright (C) 1992 Frank Tore Johansen |
6 | |
7 | |
7 | This program is free software; you can redistribute it and/or modify |
8 | This program is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by |
9 | it under the terms of the GNU General Public License as published by |
… | |
… | |
421 | * If any FLAG's are added or changed, make sure the flag_names structure in |
422 | * If any FLAG's are added or changed, make sure the flag_names structure in |
422 | * common/loader.l is updated. |
423 | * common/loader.l is updated. |
423 | */ |
424 | */ |
424 | |
425 | |
425 | /* Basic routines to do above */ |
426 | /* Basic routines to do above */ |
426 | #define SET_FLAG(obj, flag) (obj)->flags[flag] = 1 |
427 | #define SET_FLAG(obj, flg) (obj)->flag [flg] = 1 |
427 | #define CLEAR_FLAG(obj, flag) (obj)->flags[flag] = 0 |
428 | #define CLEAR_FLAG(obj, flg) (obj)->flag [flg] = 0 |
428 | #define QUERY_FLAG(obj, flag) (obj)->flags[flag] |
429 | #define QUERY_FLAG(obj, flg) (obj)->flag [flg] |
429 | |
430 | |
430 | /* the flags */ |
431 | /* the flags */ |
431 | |
432 | |
432 | #define FLAG_ALIVE 0 /* Object can fight (or be fought) */ |
433 | #define FLAG_ALIVE 0 /* Object can fight (or be fought) */ |
433 | #define FLAG_WIZ 1 /* Object has special privilegies */ |
434 | #define FLAG_WIZ 1 /* Object has special privilegies */ |
… | |
… | |
590 | #define FLAG_ACTIVATE_ON_RELEASE 106 /* connected object is activated when 'released' */ |
591 | #define FLAG_ACTIVATE_ON_RELEASE 106 /* connected object is activated when 'released' */ |
591 | #define FLAG_IS_WATER 107 |
592 | #define FLAG_IS_WATER 107 |
592 | #define FLAG_CONTENT_ON_GEN 108 |
593 | #define FLAG_CONTENT_ON_GEN 108 |
593 | #define FLAG_IS_A_TEMPLATE 109 /* Object has no ingame life until instanciated */ |
594 | #define FLAG_IS_A_TEMPLATE 109 /* Object has no ingame life until instanciated */ |
594 | #define FLAG_IS_BUILDABLE 110 /* Can build on item */ |
595 | #define FLAG_IS_BUILDABLE 110 /* Can build on item */ |
595 | #define FLAG_AFK 111 /* Player is AFK */ |
596 | #define FLAG_DESTROY_ON_DEATH 111 /* Object will be destroyed when env dies */ |
|
|
597 | |
596 | #define NUM_FLAGS 111 /* Should always be equal to the last |
598 | #define NUM_FLAGS 112 /* Should always be equal to the last |
597 | * defined flag. If you change this, |
599 | * defined flag + 1. If you change this, |
598 | * make sure you update the flag_links |
600 | * make sure you update the flag_links |
599 | * in common/loader.l |
601 | * in common/loader.l |
600 | */ |
602 | */ |
601 | |
603 | |
602 | /* Values can go up to 127 before the size of the flags array in the |
604 | /* Values can go up to 127 before the size of the flags array in the |
… | |
… | |
809 | /* changing directions */ |
811 | /* changing directions */ |
810 | /* this is VERTICAL movement */ |
812 | /* this is VERTICAL movement */ |
811 | #define LO4 15 /* bitmasks for upper and lower 4 bits from 8 bit fields */ |
813 | #define LO4 15 /* bitmasks for upper and lower 4 bits from 8 bit fields */ |
812 | #define HI4 240 |
814 | #define HI4 240 |
813 | |
815 | |
814 | /* |
|
|
815 | * Use of the state-variable in player objects: |
|
|
816 | */ |
|
|
817 | |
|
|
818 | enum { |
|
|
819 | ST_PLAYING, |
|
|
820 | ST_PLAY_AGAIN, |
|
|
821 | ST_ROLL_STAT, |
|
|
822 | ST_CHANGE_CLASS, |
|
|
823 | ST_CONFIRM_QUIT, |
|
|
824 | ST_CONFIGURE, |
|
|
825 | ST_GET_NAME, |
|
|
826 | ST_GET_PASSWORD, |
|
|
827 | ST_CONFIRM_PASSWORD, |
|
|
828 | ST_GET_PARTY_PASSWORD, |
|
|
829 | ST_CUSTOM, |
|
|
830 | }; |
|
|
831 | |
|
|
832 | #define BLANK_FACE_NAME "blank.111" |
816 | #define BLANK_FACE_NAME "blank.x11" |
833 | #define EMPTY_FACE_NAME "empty.111" |
817 | #define EMPTY_FACE_NAME "empty.x11" |
834 | #define DARK_FACE1_NAME "dark1.111" |
818 | #define DARK_FACE1_NAME "dark1.x11" |
835 | #define DARK_FACE2_NAME "dark2.111" |
819 | #define DARK_FACE2_NAME "dark2.x11" |
836 | #define DARK_FACE3_NAME "dark3.111" |
820 | #define DARK_FACE3_NAME "dark3.x11" |
837 | #define SMOOTH_FACE_NAME "default_smoothed.111" |
821 | #define SMOOTH_FACE_NAME "default_smoothed.111" |
838 | |
822 | |
839 | /* |
823 | /* |
840 | * Defines for the luck/random functions to make things more readable |
824 | * Defines for the luck/random functions to make things more readable |
841 | */ |
825 | */ |
… | |
… | |
980 | #define CAN_APPLY_UNAPPLY 0x10 |
964 | #define CAN_APPLY_UNAPPLY 0x10 |
981 | #define CAN_APPLY_UNAPPLY_MULT 0x20 |
965 | #define CAN_APPLY_UNAPPLY_MULT 0x20 |
982 | #define CAN_APPLY_UNAPPLY_CHOICE 0x40 |
966 | #define CAN_APPLY_UNAPPLY_CHOICE 0x40 |
983 | |
967 | |
984 | /* Cut off point of when an object is put on the active list or not */ |
968 | /* Cut off point of when an object is put on the active list or not */ |
985 | #define MIN_ACTIVE_SPEED 0.00001 |
969 | #define MIN_ACTIVE_SPEED 1e-5 |
986 | |
970 | |
987 | /* |
971 | /* |
988 | * random() is much better than rand(). If you have random(), use it instead. |
972 | * random() is much better than rand(). If you have random(), use it instead. |
989 | * You shouldn't need to change any of this |
973 | * You shouldn't need to change any of this |
990 | * |
974 | * |