StoneAge/gmsv/include/battle.h

684 lines
18 KiB
C
Raw Normal View History

2018-08-07 15:51:35 +08:00
#ifndef __BATTLE_H__
#define __BATTLE_H__
#define BATTLE_ENTRY_MAX 10
#define BATTLE_PLAYER_MAX 5
#define SIDE_OFFSET 10
#define BATTLE_STRING_MAX 4096
#define BATTLE_TIME_LIMIT (60*60)
#define DUELPOINT_RATE (0.1)
enum{
BATTLE_MODE_NONE = 0, // <20><>ս<EFBFBD><D5BD>״̬
BATTLE_MODE_INIT, // ս<><D5BD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
BATTLE_MODE_BATTLE, // ս<><D5BD><EFBFBD><EFBFBD>
BATTLE_MODE_FINISH, // ս<><D5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_MODE_STOP, // ս<><D5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<CEB4><CAB9>)
BATTLE_MODE_WATCHBC, // <20><>ս<EFBFBD><D5BD>ʼ<EFBFBD><CABC>
BATTLE_MODE_WATCHPRE, // <20><>ս<><C3BB><EFBFBD><EFBFBD>)
BATTLE_MODE_WATCHWAIT, // <20><>ս<><C3BB><EFBFBD><EFBFBD>)
BATTLE_MODE_WATCHMOVIE, // <20><>ս<><C3BB><EFBFBD><EFBFBD>)
BATTLE_MODE_WATCHAFTER, // <20><>ս<><C3BB><EFBFBD><EFBFBD>)
BATTLE_MODE_END
};
enum{
BATTLE_TYPE_NONE = 0,
BATTLE_TYPE_P_vs_E = 1,
BATTLE_TYPE_P_vs_P = 2,
BATTLE_TYPE_E_vs_E = 3,
BATTLE_TYPE_WATCH = 4,
BATTLE_TYPE_DP_BATTLE = 5,
BATTLE_TYPE_BOSS_BATTLE = 6,
BATTLE_TYPE_END
};
enum{
BATTLE_CHARMODE_NONE = 0, // <20><>ս<EFBFBD><D5BD>״̬
BATTLE_CHARMODE_INIT, // ս<><D5BD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>
BATTLE_CHARMODE_C_WAIT, // <20>ȴ<EFBFBD>ս<EFBFBD><D5BD>ָ<EFBFBD><D6B8>
BATTLE_CHARMODE_C_OK, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ս<EFBFBD><D5BD>ָ<EFBFBD><D6B8>
BATTLE_CHARMODE_BATTLE, // δʹ<CEB4><CAB9>
BATTLE_CHARMODE_RESCUE, // <20><>help״̬<D7B4><CCAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_CHARMODE_FINAL, // ս<><D5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_CHARMODE_WATCHINIT, // <20><>ս<EFBFBD><D5BD>ʼ<EFBFBD><CABC>
BATTLE_CHARMODE_COMMAND, // δʹ<CEB4><CAB9>
BATTLE_CHARMODE_END
};
typedef enum{
BATTLE_ERR_NONE = 0,
BATTLE_ERR_NOTASK,
BATTLE_ERR_NOUSE,
BATTLE_ERR_PARAM,
BATTLE_ERR_ENTRYMAX,
BATTLE_ERR_TYPE,
BATTLE_ERR_CHARAINDEX,
BATTLE_ERR_BATTLEINDEX,
BATTLE_ERR_NOENEMY,
BATTLE_ERR_ALREADYBATTLE,
BATTLE_ERR_SAMEPARTY,
BATTLE_ERR_END
}BATTLE_ERR;
enum{
BATTLE_S_TYPE_PLAYER = 0,
BATTLE_S_TYPE_ENEMY,
BATTLE_S_TYPE_END
};
typedef enum{
BATTLE_COM_NONE,
BATTLE_COM_ATTACK,
BATTLE_COM_GUARD,
BATTLE_COM_CAPTURE,
BATTLE_COM_ESCAPE,
BATTLE_COM_PETIN,
BATTLE_COM_PETOUT,
BATTLE_COM_ITEM,
BATTLE_COM_BOOMERANG,
BATTLE_COM_COMBO,
BATTLE_COM_COMBOEND,
BATTLE_COM_WAIT,
BATTLE_COM_SEKIBAN = 1000,
BATTLE_COM_S_RENZOKU,
BATTLE_COM_S_GBREAK,
BATTLE_COM_S_GUARDIAN_ATTACK,
BATTLE_COM_S_GUARDIAN_GUARD,
BATTLE_COM_S_CHARGE,
BATTLE_COM_S_MIGHTY,
BATTLE_COM_S_POWERBALANCE,
BATTLE_COM_S_STATUSCHANGE,
BATTLE_COM_S_EARTHROUND0,
BATTLE_COM_S_EARTHROUND1,
BATTLE_COM_S_LOSTESCAPE,
BATTLE_COM_S_ABDUCT,
BATTLE_COM_S_STEAL,
BATTLE_COM_S_NOGUARD,
BATTLE_COM_S_CHARGE_OK,
BATTLE_COM_JYUJYUTU = 2000,
BATTLE_COM_COMPELESCAPE, //ǿ<><C7BF><EFBFBD>
#ifdef __ATTACK_MAGIC
BATTLE_COM_S_ATTACK_MAGIC, // <20><><EFBFBD><EFBFBD>ħ<EFBFBD><C4A7>
#endif
#ifdef _PSKILL_FALLGROUND
BATTLE_COM_S_FALLRIDE, //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#endif
#ifdef _PETSKILL_EXPLODE
BATTLE_COM_S_EXPLODE,
#endif
#ifdef _PETSKILL_TIMID
BATTLE_COM_S_TIMID,
#endif
#ifdef _PETSKILL_2TIMID
BATTLE_COM_S_2TIMID,
#endif
#ifdef _PETSKILL_ANTINTER
BATTLE_COM_S_ANTINTER,
#endif
#ifdef _PETSKILL_PROPERTY
BATTLE_COM_S_PROPERTYSKILL,
#endif
#ifdef _PETSKILL_TEAR
BATTLE_COM_S_PETSKILLTEAR,
#endif
#ifdef _BATTLE_LIGHTTAKE
BATTLE_COM_S_LIGHTTAKE,
#endif
#ifdef _BATTLE_ATTCRAZED // ANDY <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ATTCRAZED,
#endif
#ifdef _SHOOTCHESTNUT // Syu ADD <20><EFBFBD><E8BCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ATTSHOOT,
#endif
#ifdef _BATTLESTEAL_FIX
BATTLE_COM_S_STEALMONEY,
#endif
#ifdef _PRO_BATTLEENEMYSKILL
BATTLE_COM_S_ENEMYRELIFE, //NPC ENEMY <20><><EFBFBD><EFBFBD><EEBCBC>
BATTLE_COM_S_ENEMYREHP, //NPC ENEMY <20><>Ѫ<EFBFBD><D1AA><EFBFBD><EFBFBD>
BATTLE_COM_S_ENEMYHELP, //NPC ENEMY <20><><EFBFBD><EFBFBD>
#endif
#ifdef _SKILL_DAMAGETOHP
BATTLE_COM_S_DAMAGETOHP, //<2F><>Ѫ<EFBFBD><D1AA>
#endif
#ifdef _Skill_MPDAMAGE
BATTLE_COM_S_MPDAMAGE, //MP<4D>˺<EFBFBD>
#endif
#ifdef _SKILL_WILDVIOLENT_ATT
BATTLE_COM_S_WILDVIOLENTATTACK, //<2F>񱩹<EFBFBD><F1B1A9B9><EFBFBD> vincent add 2002/05/16
#endif
#ifdef _SKILL_SPEEDY_ATT
BATTLE_COM_S_SPEEDYATTACK, //<2F><><EFBFBD>ٹ<EFBFBD><D9B9><EFBFBD> vincent add 2002/05/20
#endif
#ifdef _SKILL_GUARDBREAK2
BATTLE_COM_S_GBREAK2, //<2F>Ƴ<EFBFBD><C6B3><EFBFBD><EFBFBD><EFBFBD>2 vincent add 2002/05/20
#endif
#ifdef _SKILL_SACRIFICE
BATTLE_COM_S_SACRIFICE, //<2F><>Ԯ vincent add 2002/05/30
#endif
#ifdef _SKILL_WEAKEN
BATTLE_COM_S_WEAKEN, //<2F><><EFBFBD><EFBFBD> vincent add 2002/07/11
#endif
#ifdef _SKILL_DEEPPOISON
BATTLE_COM_S_DEEPPOISON, //<2F>綾 vincent add 2002/07/16
#endif
#ifdef _SKILL_BARRIER
BATTLE_COM_S_BARRIER, //ħ<><C4A7> vincent add 2002/07/16
#endif
#ifdef _SKILL_NOCAST
BATTLE_COM_S_NOCAST, //<2F><>Ĭ vincent add 2002/07/16
#endif
#ifdef _SKILL_ROAR
BATTLE_COM_S_ROAR, //<2F><><EFBFBD><EFBFBD> vincent add 2002/07/11
#endif
#ifdef _BATTLENPC_WARP_PLAYER
BATTLE_COM_WARP, // npc warp player
#endif
#ifdef _SKILL_TOOTH
BATTLE_COM_S_TOOTHCRUSHE,
#endif
#ifdef _PSKILL_MODIFY
BATTLE_COM_S_MODIFYATT,
#endif
#ifdef _PSKILL_MDFYATTACK
BATTLE_COM_S_MDFYATTACK,
#endif
#ifdef _MAGIC_SUPERWALL
BATTLE_COM_S_SUPERWALL,
#endif
#ifdef _SKILL_REFRESH
BATTLE_COM_S_REFRESH,
#endif
#ifdef _VARY_WOLF
BATTLE_COM_S_VARY,
#endif
#ifdef _PETSKILL_SETDUCK
BATTLE_COM_S_SETDUCK,
#endif
#ifdef _MAGICPET_SKILL
BATTLE_COM_S_SETMAGICPET,
#endif
#ifdef _PROFESSION_SKILL // WON ADD <20><><EFBFBD><EFBFBD>ְҵ<D6B0><D2B5><EFBFBD><EFBFBD>
// <20><>ʦ
BATTLE_COM_S_VOLCANO_SPRINGS, // <20><>ɽȪ
BATTLE_COM_S_FIRE_BALL, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_FIRE_SPEAR, // <20><><EFBFBD><EFBFBD>ǹ
BATTLE_COM_S_SUMMON_THUNDER, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_CURRENT, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_STORM, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ICE_ARROW, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ICE_CRACK, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ICE_MIRROR, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_DOOM, // <20><><EFBFBD><EFBFBD>ĩ<EFBFBD><C4A9>
BATTLE_COM_S_BLOOD, // <20><>Ѫ<EFBFBD><D1AA><EFBFBD><EFBFBD>
BATTLE_COM_S_BLOOD_WORMS, // <20><>Ѫ<EFBFBD><D1AA>
BATTLE_COM_S_SIGN, // һ<><D2BB><EFBFBD><EFBFBD>Ѫ
BATTLE_COM_S_FIRE_ENCLOSE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ICE_ENCLOSE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_THUNDER_ENCLOSE, // <20>׸<EFBFBD><D7B8><EFBFBD>
BATTLE_COM_S_ENCLOSE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_TRANSPOSE, // <20><><EFBFBD>λ<EFBFBD>λ
// <20><>ʿ
BATTLE_COM_S_BRUST, // <20><><EFBFBD><EFBFBD>
BATTLE_COM_S_CHAIN_ATK, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_AVOID, // <20>ر<EFBFBD>
BATTLE_COM_S_RECOVERY, // <20><>Ѫ
BATTLE_COM_S_WEAPON_FOCUS, // <20><><EFBFBD><EFBFBD>ר<EFBFBD><D7A8>
BATTLE_COM_S_REBACK, // ״̬<D7B4>ظ<EFBFBD>
BATTLE_COM_S_CHAIN_ATK_2, // ˫<>ع<EFBFBD><D8B9><EFBFBD>
BATTLE_COM_S_SCAPEGOAT, // <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>
BATTLE_COM_S_ENRAGE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_COLLECT, // <20><><EFBFBD><EFBFBD><EFBFBD>ۼ<EFBFBD>
BATTLE_COM_S_FOCUS, // רעս<D7A2><D5BD>
BATTLE_COM_S_SHIELD_ATTACK, // <20>ܻ<EFBFBD>
BATTLE_COM_S_DUAL_WEAPON, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_DEFLECT, // <20><><EFBFBD><EFBFBD>
BATTLE_COM_S_THROUGH_ATTACK, // <20><EFBFBD><E1B4A9><EFBFBD><EFBFBD>
BATTLE_COM_S_CAVALRY, // <20><><EFBFBD><EFBFBD><EFB9A5>
BATTLE_COM_S_DEAD_ATTACK, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_CONVOLUTE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_CHAOS, // <20><><EFBFBD>ҹ<EFBFBD><D2B9><EFBFBD>
// <20><><EFBFBD><EFBFBD>
BATTLE_COM_S_TRAP, // <20><><EFBFBD><EFBFBD>
BATTLE_COM_S_TRACK, // ׷Ѱ<D7B7><D1B0><EFBFBD><EFBFBD>
BATTLE_COM_S_DOCILE, // ѱ<><D1B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ENRAGE_PET, // <20><>ŭ<EFBFBD><C5AD><EFBFBD><EFBFBD>
BATTLE_COM_S_DRAGNET, // <20><><EFBFBD>޵<EFBFBD><DEB5><EFBFBD>
BATTLE_COM_S_ENTWINE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_AUTARKY, // <20>Ը<EFBFBD><D4B8><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_PLUNDER, // <20><><EFBFBD>Ӷ<EFBFBD>
BATTLE_COM_S_TOXIN_WEAPON, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_RESIST_FIRE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_RESIST_ICE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_RESIST_THUNDER, // <20>׿<EFBFBD><D7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_G_RESIST_FIRE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_G_RESIST_ICE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_G_RESIST_THUNDER, // <20><><EFBFBD><EFBFBD><EFBFBD>׿<EFBFBD><D7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_ATTACK_WEAK, // <20><><EFBFBD><EFBFBD><E3B9A5>
BATTLE_COM_S_INSTIGATE, // <20><><EFBFBD><EFBFBD>
BATTLE_COM_S_OBLIVION, // <20><><EFBFBD><EFBFBD>
#ifdef _PROFESSION_ADDSKILL
BATTLE_COM_S_RESIST_F_I_T, // <20><>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD>
BATTLE_COM_S_CALL_NATURE, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ
BATTLE_COM_S_BOUNDARY, // <20><><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD><EFBFBD>
#endif
#endif
#ifdef _PET_SKILL_SARS // WON ADD <20><>ɷ<EFBFBD><C9B7><EFBFBD><EFBFBD>
BATTLE_COM_S_SARS,
#endif
#ifdef _SONIC_ATTACK // WON ADD <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
BATTLE_COM_S_SONIC,
BATTLE_COM_S_SONIC2,
#endif
#ifdef _PETSKILL_REGRET
BATTLE_COM_S_REGRET,
BATTLE_COM_S_REGRET2,
#endif
#ifdef _PETSKILL_GYRATE
BATTLE_COM_S_GYRATE,
#endif
#ifdef _PETSKILL_ACUPUNCTURE
BATTLE_COM_S_ACUPUNCTURE,
#endif
#ifdef _PETSKILL_RETRACE
BATTLE_COM_S_RETRACE,
#endif
#ifdef _PETSKILL_HECTOR
BATTLE_COM_S_HECTOR,
#endif
#ifdef _PETSKILL_FIREKILL
BATTLE_COM_S_FIREKILL,
#endif
#ifdef _PETSKILL_DAMAGETOHP
BATTLE_COM_S_DAMAGETOHP2, //<2F><><EFBFBD>¿<EFBFBD><C2BF><EFBFBD>(<28><>Ѫ<EFBFBD><D1AA><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>)
#endif
#ifdef _PETSKILL_BECOMEFOX
BATTLE_COM_S_BECOMEFOX,
#endif
#ifdef _PETSKILL_BECOMEPIG
BATTLE_COM_S_BECOMEPIG,
#endif
#ifdef _PETSKILL_SHOWMERCY
BATTLE_COM_S_SHOWMERCY,
#endif
#ifdef _PETSKILL_LER
BATTLE_COM_S_BAT_FLY, // <20>׶<EFBFBD><D7B6><EFBFBD> - Ⱥ<><C8BA><EFBFBD>Ĵ<EFBFBD>
BATTLE_COM_S_DIVIDE_ATTACK, // <20>׶<EFBFBD><D7B6><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#endif
#ifdef _PETSKILL_BATTLE_MODEL
BATTLE_COM_S_BATTLE_MODEL, // <20><><EFBFBD><EFBFBD><EFBCBC>ս<EFBFBD><D5BD>ģ<EFBFBD><C4A3>
#endif
BATTLE_COM_END
}BATTLE_COM;
enum{
BATTLE_RET_NORMAL,
BATTLE_RET_CRITICAL,
BATTLE_RET_MISS,
BATTLE_RET_DODGE,
BATTLE_RET_ALLGUARD,
#ifdef _EQUIT_ARRANGE
BATTLE_RET_ARRANGE,
#endif
BATTLE_RET_END
}BATTLE_RET;
#define BC_FLG_NEW (1<<0)
#define BC_FLG_DEAD (1<<1)
#define BC_FLG_PLAYER (1<<2)
#define BC_FLG_POISON (1<<3)
#define BC_FLG_PARALYSIS (1<<4)
#define BC_FLG_SLEEP (1<<5)
#define BC_FLG_STONE (1<<6)
#define BC_FLG_DRUNK (1<<7)
#define BC_FLG_CONFUSION (1<<8)
#define BC_FLG_HIDE (1<<9)
#define BC_FLG_REVERSE (1<<10)
#ifdef _MAGIC_WEAKEN
#define BC_FLG_WEAKEN (1<<11) // <20><><EFBFBD><EFBFBD>
#endif
#ifdef _MAGIC_DEEPPOISON
#define BC_FLG_DEEPPOISON (1<<12) // <20>
#endif
#ifdef _MAGIC_BARRIER
#define BC_FLG_BARRIER (1<<13) // ħ<><C4A7>
#endif
#ifdef _MAGIC_NOCAST
#define BC_FLG_NOCAST (1<<14) // <20><>Ĭ
#endif
#ifdef _PET_SKILL_SARS // WON ADD <20><>ɷ<EFBFBD><C9B7><EFBFBD><EFBFBD>
#define BC_FLG_SARS (1<<15) // <20><>ɷ
#endif
#ifdef _PROFESSION_SKILL // WON ADD <20><><EFBFBD><EFBFBD>ְҵ<D6B0><D2B5><EFBFBD><EFBFBD>
#define BC_FLG_DIZZY (1<<16) // <20><>ѣ
#define BC_FLG_ENTWINE (1<<17) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define BC_FLG_DRAGNET (1<<18) // <20><><EFBFBD>޵<EFBFBD><DEB5><EFBFBD>
#define BC_FLG_ICECRACK (1<<19) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define BC_FLG_OBLIVION (1<<20) // <20><><EFBFBD><EFBFBD>
#define BC_FLG_ICEARROW (1<<21) // <20><><EFBFBD><EFBFBD>
#define BC_FLG_BLOODWORMS (1<<22) // <20><>Ѫ<EFBFBD><D1AA>
#define BC_FLG_SIGN (1<<23) // һ<><D2BB><EFBFBD><EFBFBD>Ѫ
#define BC_FLG_CARY (1<<24) // <20><><EFBFBD><EFBFBD>
#define BC_FLG_F_ENCLOSE (1<<25) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define BC_FLG_I_ENCLOSE (1<<26) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define BC_FLG_T_ENCLOSE (1<<27) // <20>׸<EFBFBD><D7B8><EFBFBD>
#ifdef _PROFESSION_ADDSKILL
#define BC_FLG_WATER (1<<28) // ˮ<><CBAE><EFBFBD><EFBFBD>
#define BC_FLG_FEAR (1<<29) // <20>־<EFBFBD>
#endif
#ifdef _PETSKILL_LER
#define BC_FLG_CHANGE (1<<30) // <20>׶<EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD>
#endif
#endif
#define BP_FLG_JOIN (1<<0)
#define BP_FLG_PLAYER_MENU_OFF (1<<1)
#define BP_FLG_BOOMERANG (1<<2)
#define BP_FLG_PET_MENU_OFF (1<<3)
#define BP_FLG_ENEMY_SURPRISAL (1<<4)
#define BP_FLG_PLAYER_SURPRISAL (1<<5)
#define CHAR_BATTLEFLG_ULTIMATE (1<<0)
#define CHAR_BATTLEFLG_AIBAD (1<<1)
#define CHAR_BATTLEFLG_REVERSE (1<<2)
#define CHAR_BATTLEFLG_GUARDIAN (1<<3)
#define CHAR_BATTLEFLG_NORETURN (1<<4)
#define CHAR_BATTLEFLG_RECOVERY (1<<5)
#define CHAR_BATTLEFLG_ABIO (1<<6)
#define CHAR_BATTLEFLG_NODUCK (1<<7)
#define GETITEM_MAX 3
typedef struct
{
int attacker;
}INVADER;
typedef struct
{
int charaindex;
int bid;
int escape;
int flg;
int guardian;
int duelpoint;
int getitem[GETITEM_MAX];
}BATTLE_ENTRY;
#define BENT_FLG_ULTIMATE (1<<0)
typedef struct
{
int type;
int flg;
int common_dp;
BATTLE_ENTRY Entry[BATTLE_ENTRY_MAX];
}BATTLE_SIDE;
#define BSIDE_FLG_SURPRISE ( 1 << 0 )
#define BSIDE_FLG_HELP_OK ( 1 << 1 )
typedef struct _Battle
{
BOOL use; /* <20><><EFBFBD>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD>¾<EFBFBD><C2BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int battleindex; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> į */
int mode; /* <20>ػ<EFBFBD><D8BB><EFBFBD><EFBFBD><EFBFBD> ƹ<><C6B9><EFBFBD><EFBFBD> */
int type; /* <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (0:ɧ<><C9A7>)(1:DUEL)(2:ʾ<><CABE><EFBFBD><EFBFBD>) */
int dpbattle; /* DP<44><50><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBEAE> */
int norisk; /* <20><><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBEAE> */
int turn; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int timer; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEBFB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѩ */
int leaderindex; /* <20>޼<EFBFBD><DEBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD>ҷ¼<D2B7><C2BC>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD> */
int winside; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int field_att; /* <20><>ū<EFBFBD><C5AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
int att_count; /* <20><>ū<EFBFBD><C5AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѩ */
int att_pow; /* <20><>ū<EFBFBD><C5AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>ɷ<EFBFBD><C9B7><EFBFBD> */
int field_no;
int flg; /* <20><><EFBFBD>˰׷º<D7B7> */
BATTLE_SIDE Side[2];
#ifdef _BATTLE_TIMESPEED
unsigned int CreateTime;
unsigned int EndTime;
unsigned int PartTime;
int flgTime;
#endif
#ifdef _PROFESSION_ADDSKILL
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int ice_count;//<2F>ݴ<EFBFBD><DDB4><EFBFBD><EFBFBD><EFBFBD>
int ice_bout[20];//<2F>غϼ<D8BA><CFBC><EFBFBD>
BOOL ice_use[20];//<2F>Ƿ<EFBFBD>ʹ<EFBFBD><CAB9>
int ice_toNo[20];//<2F><><EFBFBD><EFBFBD>
int ice_level[20];//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int ice_array[20];
int ice_charaindex[20];
int ice_attackNo[20];
#endif
#ifdef _DEATH_CONTEND
int menum;
int tonum;
#endif
#ifdef _ACTION_BULLSCR
int enemynum;
#endif
int iEntryBack[BATTLE_ENTRY_MAX*2]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD>׶<EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int iEntryBack2[BATTLE_ENTRY_MAX*2]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD>׶<EFBFBD><D7B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int createindex; /* <20>𼰾<EFBFBD> ë<><C3AB>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD>ҷ<EFBFBD><D2B7>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>(NPCئ<43><D8A6>) */
int (*WinFunc)( int battleindex, int charaindex );
#ifdef _DEATH_CONTEND//<2F><><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>func
int (*PkFunc)( int menum, int tonum, int winside, int battlemap);
int battlemap;
#endif
struct _Battle *pNext; // <20>ݼ<EFBFBD><DDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
struct _Battle *pBefore; // 󡼰<><F3A1BCB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
}BATTLE;
#define BATTLE_FLG_FREEDP ( 1 << 0 ) // <20>ͻ<EFBFBD><CDBB><EFBFBD> Ӽ<><D3BC>ئ<EFBFBD><D8A6>
#define BATTLE_FLG_CHARALOST ( 1 << 1 ) // ƽ<>ҷ»<D2B7><C2BB><EFBFBD><EFBFBD>Ϸ<EFBFBD>Ի <20><><EFBFBD><EFBFBD>Ի<EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD>
enum{ // <20><><EFBFBD><EFBFBD>field_att <20><> ľ<>°<EFBFBD>
BATTLE_ATTR_NONE = 0, // <20><><EFBFBD><EFBFBD>
BATTLE_ATTR_EARTH, // <20><>
BATTLE_ATTR_WATER, //
BATTLE_ATTR_FIRE, // <20><>
BATTLE_ATTR_WIND, // <20><>
BATTLE_ATTR_END
};
//krynn 2001/12/28
enum
{
BATTLE_SIDE_RIGHT, // ս<><D5BD><EFBFBD><EFBFBD><EFBFBD>Ҳ<EFBFBD> right side of battle
BATTLE_SIDE_LEFT, // ս<><D5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> left side of battle
BATTLE_SIDE_WATCH, // <20><>ս watch battle player
};
//krynn end
#define TARGET_SIDE_0 20 // 㯴<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ϶<><CFB6>
#define TARGET_SIDE_1 21 // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ϶<><CFB6>
#define TARGET_ALL 22 // <20><> ϶<><CFB6>
#ifdef __ATTACK_MAGIC
#define TARGET_SIDE_0_B_ROW 26 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
#define TARGET_SIDE_0_F_ROW 25 // <20><><EFBFBD><EFBFBD>ǰһ<C7B0><D2BB>
#define TARGET_SIDE_1_F_ROW 24 // <20><><EFBFBD><EFBFBD>ǰһ<C7B0><D2BB>
#define TARGET_SIDE_1_B_ROW 23 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>
// won add
#define TARGER_THROUGH 27
#endif
extern int gItemCrushRate; // ç <20><><EFBFBD><EFBFBD><EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD>
extern BATTLE *BattleArray; /* <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
extern int BATTLE_battlenum; /* <20><><EFBFBD><EFBFBD> */
extern char szAllBattleString[BATTLE_STRING_MAX]; /* <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѩ<EFBFBD><D1A8><EFBFBD><EFBFBD> ٯ */
extern char *pszBattleTop, *pszBattleLast; /* <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ٯ <20><><EFBFBD><EFBFBD> */
extern char szBadStatusString[]; // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ٯ
extern int gWeponType; // <20>ػ<EFBFBD><D8BB><EFBFBD> տ<><D5BF><EFBFBD><EFBFBD>
extern float gDamageDiv; // ĸ<><C4B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define BATTLE_CHECKINDEX( a ) ( ((a)>=BATTLE_battlenum || (a)<0 )?(FALSE):(TRUE) )
#define BATTLE_CHECKSIDE( a ) ( ((a)>=2 || (a)<0)?(FALSE):( TRUE) )
#define BATTLE_CHECKNO( a ) ( ((a)>=20 || (a)<0 )?(FALSE):(TRUE) )
#define BATTLE_CHECKADDRESS( a ) ((&BattleArray[0])<=(a) && (a)<=(&BattleArray[BATTLE_battlenum-1] )?(TRUE):(FALSE) )
#define IsBATTLING( a ) (CHAR_getWorkInt((a),CHAR_WORKBATTLEMODE)?(TRUE):(FALSE))
#define STRCPY_TAIL( _pszTop, _pszLast, _szBuffer) { int _len = strlen( _szBuffer ); ( _pszTop + _len < (_pszLast)-1 )?( memcpy( _pszTop, _szBuffer, _len ), _pszTop += _len, _pszTop[0] = 0):(0); }
#define BATTLESTR_ADD( _szBuffer ){ int _len = strlen( _szBuffer ); ( pszBattleTop + _len < ( pszBattleLast)-1 )?( memcpy( pszBattleTop, _szBuffer, _len ), pszBattleTop += _len, pszBattleTop[0] = 0):(0); }
#define BATTLE_MAP_MAX 219
#define CH_FIX_PLAYERLEVELUP (+2) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ì<EFBFBD>ﻥʧ<EFBBA5><CAA7><EFBFBD><EFBFBD>
#define CH_FIX_PLAYERDEAD (-2) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɧ<EFBFBD><C9A7><EFBFBD><EFBFBD>
#define CH_FIX_PLAYEULTIMATE (-4) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7> ū<><C5AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define CH_FIX_PETESCAPE (-1) // ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
#define AI_FIX_PETLEVELUP (+5*100) // ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ì<EFBFBD><C3AC>ʧ<EFBFBD><CAA7><EFBFBD><EFBFBD>
#define AI_FIX_PETWIN (+1) // ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define AI_FIX_PETGOLDWIN (+2*10) // ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ì<EFBFBD><EFBFBD><EFBCB0><EFBFBD>г<EFBFBD>ë<EFBFBD><C3AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define AI_FIX_PETRECOVERY (+10) // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define AI_FIX_PETRESSURECT (+3*100) // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//#define AI_FIX_PETRECOVERY (+50) // <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define AI_FIX_SEKKAN (-2*100) // <20><><EFBFBD>м<EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD>ë <20><>
#define AI_FIX_PLAYERULTIMATE (-10*100) // <20><><EFBFBD>м<EFBFBD>DZ<EFBFBD>л<EFBFBD>ʧ<EFBFBD><CAA7> ū<><C5AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define AI_FIX_PETULTIMATE (-10*100) // ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7> ū<><C5AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define AI_FIX_PLAYERDEAD (-1*100) // <20><><EFBFBD>м<EFBFBD>DZ<EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD>
#define AI_FIX_PETDEAD (-5*100) // ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#ifdef _Item_ReLifeAct
int BATTLE_getBattleDieIndex( int battleindex, int bid );
#endif
int BATTLE_No2Index( int battleindex, int No);
int BATTLE_Index2No( int battleindex, int charaindex);
BOOL BATTLE_initBattleArray( int battlenum);
int BATTLE_CreateBattle( void );
int BATTLE_DeleteBattle( int battleindex);
int BATTLE_NewEntry( int charaindex, int battleindex, int side);
#define BATTLE_Exit( charaindex, battleindex) _BATTLE_Exit( __FILE__, __LINE__, charaindex, battleindex)
INLINE int _BATTLE_Exit( char *file, int line, int charaindex ,int battleindex);
#define BATTLE_ExitAll( battleindex) _BATTLE_ExitAll( __FILE__, __LINE__, battleindex)
INLINE void _BATTLE_ExitAll( char *file, int line, int battleindex);
int BATTLE_CreateVsPlayer( int charaindex0, int charaindex1);
int BATTLE_CreateVsEnemy( int charaindex, int mode, int npcindex);
int BATTLE_CountEntry( int battleindex, int side);
int BATTLE_Loop( void );
int BATTLE_FinishSet( int battleindex );
int BATTLE_StopSet( int battleindex );
int BATTLE_RescueEntry( int charaindex, int toindex);
int BATTLE_PetDefaultExit( int charaindex, int battleindex);
int BATTLE_PetDefaultEntry(
int charaindex, // ʸ<><CAB8><EFBFBD><EFBFBD>ë <20>Ȼ<EFBFBD><C8BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int battleindex,// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̼<EFBFBD><CCBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD>
int side
);
BOOL BATTLE_RescueTry( int charaindex);
BOOL BATTLE_RescueParentTry(
int charaindex,
int pindex
);
int BATTLE_DefaultAttacker( int battleindex, int side);
BOOL BATTLE_IsThrowWepon( int itemindex);
void BATTLE_BadStatusString( int defNo, int status );
int BATTLE_MultiList( int battleindex, int toNo, int ToList[] );
BOOL BATTLE_IsCharge( int com );
BOOL BATTLE_CanMoveCheck( int charaindex );
int BATTLE_TargetCheck( int battleindex, int defNo);
char *BATTLE_CharTitle( int charaindex );
void BATTLE_EscapeDpSend( int battleindex, int charaindex );
int BATTLE_GetDuelPoint( int battleindex, int side, int num);
int BATTLE_TargetCheckDead( int battleindex, int defNo);
void BATTLE_MultiListDead( int battleindex, int toNo, int ToList[] );
BOOL BATTLE_WatchTry( int charaindex);
int BATTLE_WatchEntry( int charaindex, int toindex);
void BATTLE_WatchStop( int charaindex );
int BATTLE_WatchUnLink( int battleindex );
void BATTLE_BpSendToWatch( BATTLE *pBattle, char *pszBcString);
int BATTLE_GetWepon( int charaindex );
#ifdef _ITEM_EQUITSPACE
int BATTLE_GetEqShield( int charaindex );
#endif
int BATTLE_GetAttackCount( int charaindex );
int DoujyouRandomWeponSet( int charaindex );
void BATTLE_AttReverse( int charaindex );
void BATTLE_BadStatusAllClr( int charaindex );
#define CHAR_GETWORKINT_HIGH( index, pos ) ( CHAR_getWorkInt( (index), (pos) ) >> 16 )
#define CHAR_SETWORKINT_HIGH( index, pos, set ) { int iTmp = CHAR_getWorkInt( (index), (pos) ) & 0xFFFF, work = (set); CHAR_setWorkInt( (index), (pos), (work << 16)|iTmp ); }
#define CHAR_GETWORKINT_LOW( index, pos ) ( CHAR_getWorkInt( (index), (pos) ) & 0xFFFF )
#define CHAR_SETWORKINT_LOW( index, pos, set ) { int iTmp = CHAR_getWorkInt( index, pos ) & 0xFFFF0000, work = (set); CHAR_setWorkInt( (index), (pos), (work & 0x0000FFFF) | iTmp ); }
int Battle_getTotalBattleNum();
#ifdef _TYPE_TOXICATION
void CHAR_ComToxicationHp( int charaindex);
#endif
#ifdef _PROFESSION_SKILL // WON ADD <20><><EFBFBD><EFBFBD>ְҵ<D6B0><D2B5><EFBFBD><EFBFBD>
void BATTLE_ProfessionStatus_init( int battleindex, int charaindex );
void BATTLE_ProfessionStatusSeq( int battleindex, int charaindex);
#endif
#endif