1 /* 2 3 Copyright (C) 2015-2018 Night Dive Studios, LLC. 4 5 This program is free software: you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation, either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 18 */ 19 #ifndef __AI_H 20 #define __AI_H 21 22 /* 23 * $Source: n:/project/cit/src/inc/RCS/ai.h $ 24 * $Revision: 1.22 $ 25 * $Author: xemu $ 26 * $Date: 1994/06/21 02:14:10 $ 27 * 28 * 29 */ 30 31 // Includes 32 #include "objects.h" 33 34 // Defines 35 #define NUM_AI_MOODS 5 36 #define AI_MOOD_FRIENDLY 0 37 #define AI_MOOD_NEUTRAL 1 38 #define AI_MOOD_HOSTILE 2 39 #define AI_MOOD_ISOLATION 3 40 #define AI_MOOD_ATTACKING 4 41 42 #define NUM_AI_ORDERS 6 43 #define AI_ORDERS_GUARD 0 // hang out until player comes around 44 #define AI_ORDERS_ROAM 1 // wander about 45 #define AI_ORDERS_SLEEP 2 // do nothing ever until awakened 46 #define AI_ORDERS_PATROL 3 // back n forth between 2 points 47 #define AI_ORDERS_HIGHWAY 4 // follow invisible highway 48 #define AI_ORDERS_NOMOVE 5 // like guard, but will never move 49 50 #define AI_FLAG_NONE 0x00 51 #define AI_FLAG_FLYING 0x01 // we can fly 52 #define AI_FLAG_NOALERT 0x02 // don't speed up reaction when in combat 53 #define AI_FLAG_SMALL 0x04 // for musicai 54 55 #define SPREAD_DIST 2 56 57 #define SLOW_PROJECTILE_DURATION 1000 58 #define SLOW_PROJECTILE_GRAVITY fix_make(0,0x0C00) 59 60 // Macros 61 62 // Prototypes 63 64 // External Functions: 65 // Let all the AI system spend time figuring out what to do. Those AIs that know what they are doing, 66 // do it, others plan, the time load is hopefully distributed as nicely as possible 67 errtype ai_run(void); 68 69 // What do do when we are hit 70 errtype ai_critter_hit(ObjSpecID osid, short damage, uchar tranq, uchar stun); 71 72 // When we pretend that we're dead (pretend we're dead) 73 errtype ai_critter_die(ObjSpecID osid); 74 errtype ai_critter_really_dead(ObjSpecID osid); 75 76 // actually do attack 77 errtype ai_attack_player(ObjSpecID osid, char a); 78 79 // Change a critter's posture, and do appropriate 80 // things to other anim variables 81 errtype set_posture(ObjSpecID osid, ubyte new_pos); 82 83 // Looting. 84 errtype do_regular_loot(ObjSpecID source_critter, ObjID corpse); 85 errtype do_random_loot(ObjID corpse); 86 87 void ai_find_player(ObjID id); 88 void ai_critter_seen(void); 89 void ai_misses(ObjSpecID osid); 90 91 // Globals 92 93 #endif // __AI_H 94