1 #ifndef __ITEMS_H 2 #define __ITEMS_H 3 4 /* 5 ITEMS.H 6 7 Copyright (C) 1991-2001 and beyond by Bungie Studios, Inc. 8 and the "Aleph One" developers. 9 10 This program is free software; you can redistribute it and/or modify 11 it under the terms of the GNU General Public License as published by 12 the Free Software Foundation; either version 3 of the License, or 13 (at your option) any later version. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 19 20 This license is contained in the file "COPYING", 21 which is included with this source code; it is available online at 22 http://www.gnu.org/licenses/gpl.html 23 24 Thursday, April 6, 1995 1:06:42 PM (Jason') 25 26 Feb 4, 2000 (Loren Petrich): 27 Added SMG and its ammo 28 29 Feb 15, 2000 (Loren Petrich): 30 Added items initializer and animator; 31 something like those in scenery.h and scenery.c 32 33 May 15, 2000 (Loren Petrich): 34 Added XML support for configuring various item features 35 */ 36 37 /* ---------- constants */ 38 39 enum /* item types (class) */ 40 { 41 _weapon, 42 _ammunition, 43 _powerup, 44 _item, 45 _weapon_powerup, 46 _ball, 47 48 NUMBER_OF_ITEM_TYPES, 49 _network_statistics= NUMBER_OF_ITEM_TYPES // Used in game_window.c 50 }; 51 52 enum /* item types */ 53 { 54 _i_knife, 55 _i_magnum, 56 _i_magnum_magazine, 57 _i_plasma_pistol, 58 _i_plasma_magazine, 59 _i_assault_rifle, 60 _i_assault_rifle_magazine, 61 _i_assault_grenade_magazine, 62 _i_missile_launcher, 63 _i_missile_launcher_magazine, 64 _i_invisibility_powerup, 65 _i_invincibility_powerup, 66 _i_infravision_powerup, 67 _i_alien_shotgun, 68 _i_alien_shotgun_magazine, 69 _i_flamethrower, 70 _i_flamethrower_canister, 71 _i_extravision_powerup, 72 _i_oxygen_powerup, 73 _i_energy_powerup, 74 _i_double_energy_powerup, 75 _i_triple_energy_powerup, 76 _i_shotgun, 77 _i_shotgun_magazine, 78 _i_spht_door_key, 79 _i_uplink_chip, 80 81 BALL_ITEM_BASE, 82 _i_light_blue_ball= BALL_ITEM_BASE, 83 _i_red_ball, 84 _i_violet_ball, 85 _i_yellow_ball, 86 _i_brown_ball, 87 _i_orange_ball, 88 _i_blue_ball, // heh heh 89 _i_green_ball, 90 91 // LP addition: 92 _i_smg, 93 _i_smg_ammo, 94 95 NUMBER_OF_DEFINED_ITEMS 96 }; 97 98 /* ---------- prototypes/ITEMS.C */ 99 100 short new_item(struct object_location *location, short item_type); 101 102 void calculate_player_item_array(short player_index, short type, short *items, short *counts, short *array_count); 103 void get_header_name(char *buffer, short type); 104 void get_item_name(char *buffer, short item_id, bool plural); 105 bool new_item_in_random_location(short item_type); 106 short count_inventory_lines(short player_index); 107 void swipe_nearby_items(short player_index); 108 109 void mark_item_collections(bool loading); 110 short get_item_kind(short item_id); 111 112 bool unretrieved_items_on_map(void); 113 bool item_valid_in_current_environment(short item_type); 114 115 void trigger_nearby_items(short polygon_index); 116 short find_player_ball_color(short player_index); /* returns the color of the ball or NONE if they don't have one */ 117 118 short get_item_shape(short item_id); 119 bool try_and_add_player_item(short player_index, short type); 120 121 // LP: Revealed this function for Pfhortran 122 struct item_definition *get_item_definition_external(const short type); 123 124 /* Returns NONE if this player is not carrying a ball */ 125 short find_player_ball_color(short player_index); 126 127 // LP addition: initializer and animator of items 128 void initialize_items(void); 129 void animate_items(void); 130 131 class InfoTree; 132 void parse_mml_items(const InfoTree& root); 133 void reset_mml_items(); 134 135 #endif 136 137