1 #pragma once 2 3 //******************************************************************************************** 4 //* 5 //* This file is part of Egoboo. 6 //* 7 //* Egoboo is free software: you can redistribute it and/or modify it 8 //* under the terms of the GNU General Public License as published by 9 //* the Free Software Foundation, either version 3 of the License, or 10 //* (at your option) any later version. 11 //* 12 //* Egoboo is distributed in the hope that it will be useful, but 13 //* WITHOUT ANY WARRANTY; without even the implied warranty of 14 //* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 //* General Public License for more details. 16 //* 17 //* You should have received a copy of the GNU General Public License 18 //* along with Egoboo. If not, see <http://www.gnu.org/licenses/>. 19 //* 20 //******************************************************************************************** 21 22 /// @file file_formats/spawn_file.h 23 /// @details loading the environment definitions for a module 24 25 #include "egoboo_typedef.h" 26 #include "egoboo_vfs.h" 27 #include "egoboo_math.h" 28 29 #if defined(__cplusplus) 30 extern "C" 31 { 32 #endif 33 34 //-------------------------------------------------------------------------------------------- 35 //-------------------------------------------------------------------------------------------- 36 37 /// Where a spawned character can be attached 38 enum e_attachment_type 39 { 40 ATTACH_NONE = 0, 41 ATTACH_INVENTORY, 42 ATTACH_LEFT, 43 ATTACH_RIGHT 44 }; 45 46 #define FACE_RANDOM generate_randmask(0, 0xFFFF) 47 48 //-------------------------------------------------------------------------------------------- 49 //-------------------------------------------------------------------------------------------- 50 51 /// The internal representation of a single line in "spawn.txt" 52 struct s_spawn_file_info 53 { 54 bool_t do_spawn; 55 STRING spawn_coment; 56 57 STRING spawn_name; 58 char *pname; 59 int slot; 60 fvec3_t pos; 61 int passage, content, money, level, skin; 62 bool_t stat; 63 TEAM_REF team; 64 FACING_T facing; 65 CHR_REF attach; 66 CHR_REF parent; 67 }; 68 typedef struct s_spawn_file_info spawn_file_info_t; 69 70 //-------------------------------------------------------------------------------------------- 71 //-------------------------------------------------------------------------------------------- 72 spawn_file_info_t * spawn_file_info_init( spawn_file_info_t *pinfo ); 73 spawn_file_info_t * spawn_file_info_reinit( spawn_file_info_t *pinfo ); 74 75 bool_t spawn_file_scan( vfs_FILE * fileread, spawn_file_info_t *pinfo ); 76 77 //-------------------------------------------------------------------------------------------- 78 //-------------------------------------------------------------------------------------------- 79 80 #if defined(__cplusplus) 81 } 82 #endif 83 84 //-------------------------------------------------------------------------------------------- 85 //-------------------------------------------------------------------------------------------- 86 87 #define _spawn_file_h