143 lines
5.0 KiB
C
143 lines
5.0 KiB
C
![]() |
#ifndef __MAGIC_BASE_H__
|
|||
|
#define __MAGIC_BASE_H__
|
|||
|
|
|||
|
#include "util.h"
|
|||
|
|
|||
|
typedef enum
|
|||
|
{
|
|||
|
MAGIC_FIELD_ALL, /* <20><><EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_FIELD_BATTLE, /* <20><> <20><><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_FIELD_MAP, /* ɧ<><C9A7>Ѩ<EFBFBD><D1A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
|||
|
}MAGIC_FIELDTYPE;
|
|||
|
|
|||
|
typedef enum
|
|||
|
{
|
|||
|
MAGIC_TARGET_MYSELF, /* <20><><EFBFBD>м<EFBFBD><D0BC><EFBFBD> */
|
|||
|
MAGIC_TARGET_OTHER, /* ְ<><D6B0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ֳ<EFBFBD><D6B3>) */
|
|||
|
MAGIC_TARGET_ALLMYSIDE, /* <20><> */
|
|||
|
MAGIC_TARGET_ALLOTHERSIDE, /* <20><><EFBFBD>촡<EFBFBD><ECB4A1> */
|
|||
|
MAGIC_TARGET_ALL, /* <20>廯 */
|
|||
|
MAGIC_TARGET_NONE, /* <20><><EFBFBD>ּ<EFBFBD> <20><> ئ<>У<EFBFBD> <20><>֧<EFBFBD><EFBFBD><D7BB><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_TARGET_OTHERWITHOUTMYSELF,/* ְ<><D6B0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ֳ<EFBFBD><D6B3>ئ<EFBFBD><D8A6>) */
|
|||
|
MAGIC_TARGET_WITHOUTMYSELFANDPET, /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>½ */
|
|||
|
MAGIC_TARGET_WHOLEOTHERSIDE,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
|||
|
#ifdef _ATTACK_MAGIC
|
|||
|
|
|||
|
MAGIC_TARGET_SINGLE, // <20><><EFBFBD>Եз<D4B5><D0B7><EFBFBD>ijһ<C4B3><D2BB>
|
|||
|
MAGIC_TARGET_ONE_ROW, // <20><><EFBFBD>Եз<D4B5><D0B7><EFBFBD>ijһ<C4B3><D2BB>
|
|||
|
MAGIC_TARGET_ALL_ROWS, // <20><><EFBFBD>Եз<D4B5><D0B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
#endif
|
|||
|
}MAGIC_TARGETTYPE;
|
|||
|
|
|||
|
typedef enum
|
|||
|
{
|
|||
|
MAGIC_ID, /* <20><> į */
|
|||
|
MAGIC_FIELD, /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_TARGET, /* <20><><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_TARGET_DEADFLG, /* <20><><EFBFBD>Ϸַ<CFB7><D6B7>ָ<EFBFBD><D6B8>ޱ<EFBFBD>ֳ<EFBFBD><D6B3><EFBFBD>¾<EFBFBD> */
|
|||
|
#ifdef _ATTACK_MAGIC
|
|||
|
MAGIC_IDX ,
|
|||
|
#endif
|
|||
|
MAGIC_DATAINTNUM,
|
|||
|
}MAGIC_DATAINT;
|
|||
|
|
|||
|
typedef enum
|
|||
|
{
|
|||
|
MAGIC_NAME, /* <20><><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_COMMENT, /* <20>춪<EFBFBD><ECB6AA><EFBFBD><EFBFBD>*/
|
|||
|
MAGIC_FUNCNAME, /* <20><><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_OPTION, /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
MAGIC_DATACHARNUM,
|
|||
|
}MAGIC_DATACHAR;
|
|||
|
|
|||
|
typedef struct tagMagic
|
|||
|
{
|
|||
|
int data[MAGIC_DATAINTNUM];
|
|||
|
STRING64 string[MAGIC_DATACHARNUM];
|
|||
|
|
|||
|
}Magic;
|
|||
|
|
|||
|
#ifdef _ATTACK_MAGIC
|
|||
|
|
|||
|
typedef struct tagAttMagic
|
|||
|
{
|
|||
|
unsigned int uiSpriteNum;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Spr_x.bin<69>ı<EFBFBD><C4B1><EFBFBD>
|
|||
|
unsigned int uiAttackType;// <20><><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD>( <20><><EFBFBD><EFBFBD> ) , <20><><EFBFBD><EFBFBD>( <20><><EFBFBD><EFBFBD> ) , <20><><EFBFBD><EFBFBD>( ͬʱ ) , ȫ<><C8AB>( <20><><EFBFBD><EFBFBD> ) , ȫ<><C8AB>( ͬʱ )
|
|||
|
unsigned int uiSliceTime;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
|||
|
unsigned int uiShowType; // <20><>ʾ<EFBFBD><CABE>λ<EFBFBD>÷<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>롢ָ<EBA1A2><D6B8>
|
|||
|
int siSx; // <20><>ʾ<EFBFBD><CABE>λ<EFBFBD><CEBB> - X<><58>
|
|||
|
int siSy; // <20><>ʾ<EFBFBD><CABE>λ<EFBFBD><CEBB> - Y<><59>
|
|||
|
unsigned int uiShowBehindChar; // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>
|
|||
|
unsigned int uiShakeScreen; // <20>Ƿ<EFBFBD><C7B7><EFBFBD><F0B6AFBB><EFBFBD>
|
|||
|
unsigned int uiShakeFrom; // <20><EFBFBD><F0B6AFBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼʱ<CABC><CAB1>( <20><><EFBFBD><EFBFBD> )
|
|||
|
unsigned int uiShakeTo; // <20><EFBFBD><F0B6AFBB><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>ʱ<EFBFBD><CAB1>( <20><><EFBFBD><EFBFBD> _
|
|||
|
unsigned int uiPrevMagicNum; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>( 0XFFFFFFFFFF <20><>ʾ<EFBFBD><CABE>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> )
|
|||
|
int siPrevMagicSx; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - X<><58>
|
|||
|
int siPrevMagicSy; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - Y<><59>
|
|||
|
int siPrevMagicOnChar; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>
|
|||
|
unsigned int uiPostMagicNum; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>( 0XFFFFFFFF <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> )
|
|||
|
int siPostMagicSx; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - X<><58>
|
|||
|
int siPostMagicSy; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - Y<><59>
|
|||
|
int siPostMagicOnChar; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>
|
|||
|
int siField[3][5]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
}AttMagic;
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
#ifdef _MAGIC_TOCALL
|
|||
|
|
|||
|
typedef struct tagToCallMagic
|
|||
|
{
|
|||
|
unsigned int uiSpriteNum;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Spr_x.bin<69>ı<EFBFBD><C4B1><EFBFBD>
|
|||
|
unsigned int uiAttackType;// <20><><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ˣ<EFBFBD><CBA3><EFBFBD><EFBFBD><EFBFBD>( <20><><EFBFBD><EFBFBD> ) , <20><><EFBFBD><EFBFBD>( <20><><EFBFBD><EFBFBD> ) , <20><><EFBFBD><EFBFBD>( ͬʱ ) , ȫ<><C8AB>( <20><><EFBFBD><EFBFBD> ) , ȫ<><C8AB>( ͬʱ )
|
|||
|
unsigned int uiSliceTime;// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
|
|||
|
unsigned int uiShowType; // <20><>ʾ<EFBFBD><CABE>λ<EFBFBD>÷<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>롢ָ<EBA1A2><D6B8>
|
|||
|
int siSx; // <20><>ʾ<EFBFBD><CABE>λ<EFBFBD><CEBB> - X<><58>
|
|||
|
int siSy; // <20><>ʾ<EFBFBD><CABE>λ<EFBFBD><CEBB> - Y<><59>
|
|||
|
unsigned int uiShowBehindChar; // <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>
|
|||
|
unsigned int uiShakeScreen; // <20>Ƿ<EFBFBD><C7B7><EFBFBD><F0B6AFBB><EFBFBD>
|
|||
|
unsigned int uiShakeFrom; // <20><EFBFBD><F0B6AFBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼʱ<CABC><CAB1>( <20><><EFBFBD><EFBFBD> )
|
|||
|
unsigned int uiShakeTo; // <20><EFBFBD><F0B6AFBB><EFBFBD><EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD>ʱ<EFBFBD><CAB1>( <20><><EFBFBD><EFBFBD> _
|
|||
|
unsigned int uiPrevMagicNum; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>( 0XFFFFFFFFFF <20><>ʾ<EFBFBD><CABE>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> )
|
|||
|
int siPrevMagicSx; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - X<><58>
|
|||
|
int siPrevMagicSy; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - Y<><59>
|
|||
|
int siPrevMagicOnChar; // ǰ<><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>
|
|||
|
unsigned int uiPostMagicNum; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>( 0XFFFFFFFF <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> )
|
|||
|
int siPostMagicSx; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - X<><58>
|
|||
|
int siPostMagicSy; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾλ<CABE><CEBB> - Y<><59>
|
|||
|
int siPostMagicOnChar; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>·<EFBFBD>
|
|||
|
int isPostDisappear; // <20><><EFBFBD><EFBFBD>һ<EFBFBD>㹥<EFBFBD><E3B9A5><EFBFBD><EFBFBD>ʱ<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ
|
|||
|
int ToCallMagicNo; // <20>ٻ<EFBFBD><D9BB><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
|
|||
|
}ToCallMagic;
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
typedef int (*MAGIC_CALLFUNC)( int, int, int, int );
|
|||
|
|
|||
|
INLINE BOOL MAGIC_CHECKINDEX( int index );
|
|||
|
INLINE int MAGIC_getInt( int index, MAGIC_DATAINT element);
|
|||
|
INLINE int MAGIC_setInt( int index, MAGIC_DATAINT element, int data);
|
|||
|
INLINE char* MAGIC_getChar( int index, MAGIC_DATACHAR element);
|
|||
|
INLINE BOOL MAGIC_setChar( int index ,MAGIC_DATACHAR element, char* new );
|
|||
|
int MAGIC_getMagicNum( void);
|
|||
|
BOOL MAGIC_initMagic( char *filename);
|
|||
|
BOOL MAGIC_reinitMagic( void );
|
|||
|
|
|||
|
#ifdef _ATTACK_MAGIC
|
|||
|
|
|||
|
BOOL ATTMAGIC_initMagic( char *filename );
|
|||
|
BOOL ATTMAGIC_reinitMagic( void );
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
int MAGIC_getMagicArray( int magicid);
|
|||
|
MAGIC_CALLFUNC MAGIC_getMagicFuncPointer(char* name);
|
|||
|
// Nuke +1 08/23 : For checking the validity of magic target
|
|||
|
int MAGIC_isTargetValid( int magicid, int toindex);
|
|||
|
|
|||
|
#endif
|
|||
|
|