class EmeraldEn(PointerGlobal): NAME = "绿宝石(英文版)" active_pokemon_count = Field(0x020244E9) active_pokemon = ModelField(0x020244EC, PokemonStructActives) stored_pokemon = Field((0x03005D94, 4)) safari_balls = ByteField(0x0203A9FC) safari_time = WordField(0x0203A076) exp_gain = SignedField(0x020241F0, size=2) store = ArrayField(0x02005274, 8, ModelField(0, StoreItem)) area = WordField(0x020322E4) wild_pokemon = WordField(0x03007E28) furniture_purchase = ByteField(0x03005E3A) appearance = ByteField(0x02024A5C) Inner = EmeraldJp.Inner inner = ModelPtrField(0x03005D90, Inner) # rom breed_list = ArrayField(0x083203CC, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x00329D48) # ^ exp_list = ArrayField(0x0831F72C, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x005839A0) skill_list = Field(0x0031C898)
class Global(BaseGlobal): # chapter = ByteField(0x0202BCFA) # turns = WordField(0x0202BCFC) person_addr = Field(0x021BED30) curx = ByteField(0x02273BD4) # 0x02272EA4 cury = ByteField(0x02273BD5) # 0x02272EA5 # persons = ArrayField(0x202be48, 0xff, ModelField(0, Person)) train_items = ArrayField(0x022C7420, 100, ModelField(0, ItemSlot)) # 运输队 ourturn = ToggleField(0x021CC278, enable=0xE3A01001, disable=0xE5D01000) control_enemy = ToggleField(0x021D5674, enable=0xE1500000, disable=0xE1510000) upgrade_max = ToggleField(0x02050AC0, enable=0xB1A06004, disable=0xB2866001) upgrade_all = ToggleField(0x02050A98, enable=0xE1A00000, disable=0xAA000009) lv1_can_transfer = ToggleField(0x02049EE0, enable=0x00000001, disable=0xE350000A) can_train = ToggleField(0x021EBE08, enable=0xE3A00002, disable=0xEBF98E8F) can_visit = ToggleField(0x021ECB14, enable=0xE3A00002, disable=0xEBF98B4C) can_holddown = ToggleField(0x021EBBD8, enable=0xE3A00002, disable=0xEBF98F1B) use_enemy_prof = ToggleField(0x021D4CEC, enable=0xEA000022, disable=0x1A000022) infinite_refine = ToggleField(0x02069683, size=1, enable=0, disable=0xE3) item_consume = ToggleField(0x02051650, size=2, enable=0x0000, disable=0x0001) enemy_item_drop = ToggleField(0x021F8CE0, size=8, enable=0xE3500000E1D006B0, disable=0xE3100020E5D00063) exp_rate = Field(0x021F4DA8) pro_rate = Field(0x021F4F5C) config = ModelPtrField(0x021BD44C, Config, 4) # iteminfo_base = Field(0x0227A748) _iteminfos = ArrayField(0x022AA97C, 0xff, ModelField(0, ItemInfo)) @property def _offset(self): return self.handler.read32(0x021BD44C) - 0x022BEAA0 @property def iteminfos(self): self.field('_iteminfos').offset = self.handler.read32(0x0227A748 + self._offset) return self._iteminfos
class PokemonStructInfo(Model): SIZE = 12 BreedInfo = ModelField(0, PokemonStructBreedInfo) SkillInfo = ModelField(0, PokemonStructSkillInfo) AcquiredInfo = ModelField(0, PokemonStructAcquiredInfo) InnateInfo = ModelField(0, PokemonStructInnateInfo) value = Field(0, bytes, SIZE)
class Chariot(Model): SIZE = 0x256 # name = Field(0x021A1B8C, type=bytes, size=10) sp = WordField(0x21A1B9E, label="装甲") chassis = ModelField(0x021A1BA0, ChariotEquipInfo, label="底盘") equips = ArrayField(0x021A1BB4, 8, ModelField(0, ChariotEquipInfo), label="装备") # C装置,引擎,引擎2,洞1~5 items = ArrayField(0x021A1C54, 9, ModelField(0, ChariotItemInfo), label="道具") special_bullets = ArrayField(0x21A1DC6, 15, ModelField(0, ItemInfo), label="特殊炮弹") exportable_fields = ('equips', 'items', 'special_bullets') def health(self): for equip in self.equips: equip.status = 0 @classmethod def item_type(self, id): if 0x028F <= id < 0x02CC: return 'item' elif 0x02CC <= id < 0x0326: return 'engine' elif 0x0326 <= id < 0x034E: return 'control' elif 0x034E <= id < 0x04AE: return 'weapon'
class Global(Model): tp = ByteField(0x020091CF, label="TP") favors = ArrayField(0x020091A0, 8, ByteField(0)) # 好感度 member_num = ByteField(0x020069DC, label="队伍人数") members = ArrayField(0x020069DD, 5, ByteField(0), label="队员") item_num = ByteField(0x020091DD, label="道具数量") items = ArrayField(0x02006DBC, 16, ModelField(0, ItemSlot)) kill_slot = WordField(0x020028E2, label="必杀槽") rage = WordField(0x020028EC, label="RAGE") battle_time = ByteField(0x020028F6, label="战斗时间") person_battles = ArrayField(0, 6, ModelField(0, PersonBattle)) # 战斗中人物信息 event_items = ArrayField(0x02008170, 10, WordField(0)) # 事件道具
class RubySapphireEn(BaseGlobal): active_pokemon_count = Field(0x03004350) active_pokemon = ModelField(0x03004360, PokemonStructActives) stored_pokemon = Field(0x020300A4) _player_name = Field(0x02024EA4, bytes, 10) _player_id = Field(0x02024EAE) xor_mask = 0 money = MaskedField(Field(0x02025BC4)) coin = MaskedField(WordField(0x02025BC8)) dust = WordField(0x02026B04) menu = Field(0x02026A54) decorate = Field(0x02027DD4) badge = Field(0x02026A55) clock_adjustment = Field(0x02024F3C) per_day_random = Field(0x02026B0A) spray_time = WordField(0x02026AB6) safari_balls = ByteField(0x02038808) safari_time = WordField(0x0203880A) daycare_center_step_1 = ByteField(0x020287E0) daycare_center_step_2 = ByteField(0x020287E4) step_counter = ByteField(0x020287EA) exp_gain = SignedField(0x02024BEC, size=2) _iemfield = PokemonItemField(0) item_normal = ArrayField(0x02025C94, 0x14, _iemfield) item_keyitem = ArrayField(0x02025CE4, 0x14, _iemfield) item_pokeball = ArrayField(0x02025D34, 0x10, _iemfield) item_machine = ArrayField(0x02025D74, 0x40, _iemfield) item_berry = ArrayField(0x02025E74, 0x2E, _iemfield) item_pokeblock = ArrayField(0x02025F2C, 0x28, _iemfield)
class FireLeafJp(PointerGlobal): active_pokemon_count = 0 active_pokemon = ModelField(0x020241E4, PokemonStructActives) stored_pokemon = Field((0x03005050, 4)) dust = 0 decorate = 0 clock_adjustment = 0 per_day_random = 0 safari_balls = ByteField(0x0203990C) safari_time = WordField(0x0203990E) exp_gain = SignedField(0x02023CB0, size=2) class Inner(Model): _player_name = Field(0, bytes, 10) _player_id = Field(0x0A) xor_mask = Field(0x00000AF8) money = MaskedField(Field(0x00001234)) coin = MaskedField(WordField(0x00001238)) menu = Field(0x00001F89) badge = Field(0x00001F8A) spray_time = WordField(0x00001FE4) daycare_center_step_1 = ByteField(0x00003FAC) daycare_center_step_2 = ByteField(0x00004038) step_counter = ByteField(0x0000403E) _iemfield = PokemonItemField(0) item_normal = ArrayField(0x000012B4, 0x2A, _iemfield) item_keyitem = ArrayField(0x0000135C, 0x1E, _iemfield) item_pokeball = ArrayField(0x000013D4, 0x0D, _iemfield) item_machine = ArrayField(0x00001408, 0x3A, _iemfield) item_berry = ArrayField(0x000014F0, 0x2B, _iemfield) item_pokeblock = None inner = ModelPtrField(0x0300504C, Inner)
class Person(Model): SIZE = 0x70 prof = ByteField(0x021A0BD8, label="职业") figure = ByteField(0x021A0BD9, label="形象") level = WordField(0x021A0BDC, label="等级") level_max = ByteField(0x021A0BDE, label="等级上限") exp = WordField(0x021A0BE0, label="经验") hp = WordField(0x021A0BE4, label="当前HP") hpmax = WordField(0x021A0BE6, label="最大HP") battle_level = WordField(0x021A0BEE, label="战斗等级") drive_level = WordField(0x021A0BF0, label="驾驶等级") power = WordField(0x021A0C26, label="腕力") strength = WordField(0x021A0BEA, label="体力") speed = WordField(0x021A0BEC, label="速度") spirit = ByteField(0x021A0BF4, label="男子气概") scar = WordField(0x021A0BF2, label="伤痕") weapon_1 = WordField(0x021A0BF6, label="武器1") weapon_2 = WordField(0x021A0BF8, label="武器2") weapon_3 = WordField(0x021A0BFA, label="武器3") equip_head = WordField(0x021A0BFC, label="头部装备") equip_body = WordField(0x021A0BFE, label="上身装备") equip_hand = WordField(0x021A0C00, label="手部装备") equip_foot = WordField(0x021A0C02, label="脚部装备") equip_orn = WordField(0x021A0C04, label="装饰") skills = ArrayField(0x021A0C06, 9, ModelField(0, ItemInfo)) # (技能, 次数)数组 atk1 = WordField(0x021A0C20, label="武器1攻击力") atk2 = WordField(0x021A0C22, label="武器2攻击力") atk3 = WordField(0x021A0C24, label="武器3攻击力") defense = WordField(0x021A0C28, label="总防御力") resistance = ArrayField(0x021A0C30, 6, MinuendFieldPrep(100, WordField(0))) # 火光电声气冰
class RubySapphireJp(BaseGlobal): active_pokemon_count = Field(0x03004280) active_pokemon = ModelField(0x03004290, PokemonStructActives) stored_pokemon = Field(0x0202FDC0) _player_name = Field(0x02024C04, bytes, 10) _player_id = Field(0x02024C0E) xor_mask = 0 money = MaskedField(Field(0x02025924)) coin = MaskedField(WordField(0x02025928)) dust = WordField(0x02026864) menu = Field(0x020267B4) decorate = Field(0x02027B34) badge = Field(0x020267B5) clock_adjustment = Field(0x02024C9C) per_day_random = Field(0x0202681C) spray_time = WordField(0x02026816) safari_balls = ByteField(0x02038504) safari_time = WordField(0x02038506) daycare_center_step_1 = ByteField(0x02028540) daycare_center_step_2 = ByteField(0x02028544) step_counter = ByteField(0x0202854A) exp_gain = SignedField(0x0202494C, size=2) _iemfield = PokemonItemField(0) item_normal = ArrayField(0x020259F4, 0x14, _iemfield) item_keyitem = ArrayField(0x02025A44, 0x14, _iemfield) item_pokeball = ArrayField(0x02025A94, 0x10, _iemfield) item_machine = ArrayField(0x02025AD4, 0x40, _iemfield) item_berry = ArrayField(0x02025BD4, 0x2E, _iemfield) item_pokeblock = ArrayField(0x02025C8C, 0x28, _iemfield)
class Person(Model): SIZE = 0x48 prof = Field(4) level = ByteField(8) exp = ByteField(9) no = ByteField(11) moved = ByteField(12) posx = ByteField(14) posy = ByteField(15) hpmax = ByteField(16) hp = ByteField(17) power = ByteField(18) skill = ByteField(19) speed = ByteField(20) defense = ByteField(21) magicdef = ByteField(22) lucky = ByteField(23) physical_add = ByteField(24) move_add = ByteField(26) together = ByteField(27) # 同行人物序号 items = ArrayField(28, 5, ModelField(0, ItemSlot)) proficiency = ArrayField(38, 8, ByteField( 0)) # 武器熟练度(剑、枪、斧、弓、杖、理、光、暗 E级:01 D级:1F C级:47 B级:79 A级:B5 S级:FB) status = ByteField(46) # 状态种类 status_turn = ByteField(47) # 状态持续回合数 support = ArrayField(48, 10, ByteField(0)) # 支援等级
class BasePerson(Model): SIZE = 0x14C name = Field(0, bytes, 0xF) level = ByteField(0x0F) exp = Field(0x124) hpmax = WordField(0x34) epmax = WordField(0x36) hp = WordField(0x38) ep = WordField(0x3A) atk = WordField(0x3C) defense = WordField(0x3E) ground_power = WordField(0x48) ground_defense = WordField(0x4A) water_power = WordField(0x4C) water_defense = WordField(0x4E) fire_power = WordField(0x50) fire_defense = WordField(0x52) wind_power = WordField(0x54) wind_defense = WordField(0x56) speed = WordField(0x40) lucky = ByteField(0x42) skills = ArrayField(0x58, 32, ModelField(0, Skill)) items = ArrayField(0xD8, 15, ModelField(0, ItemSlot)) # djinni1 = Field(0xF8) # 精灵 # djinni2 = Field(0x108) # djinni3 = Field(0x118) # djinni4 = Field(0x11C) djinni_ground = Field(0xF8) # 地精灵 djinni_water = Field(0xFC) # 水精灵 djinni_fire = Field(0x100) # 火精灵 djinni_wind = Field(0x104) # 风精灵 djinni_ground_on = Field(0x108) # 地精灵附身状态 djinni_water_on = Field(0x10C) # 地精灵附身状态 djinni_fire_on = Field(0x110) # 地精灵附身状态 djinni_wind_on = Field(0x114) # 地精灵附身状态 djinni_ground_count = ByteField(0x118) # 拥有的精灵数 djinni_water_count = ByteField(0x119) djinni_fire_count = ByteField(0x11A) djinni_wind_count = ByteField(0x11B) djinni_ground_on_count = Field(0x11C) # 精灵附身数 djinni_water_on_count = Field(0x11D) djinni_fire_on_count = Field(0x11E) djinni_wind_on_count = Field(0x11F)
class EmeraldJp(PointerGlobal): NAME = "绿宝石(日文版)" active_pokemon_count = Field(0x0202418D) active_pokemon = ModelField(0x02024190, PokemonStructActives) stored_pokemon = Field((0x03005AF4, 4)) safari_balls = ByteField(0x02039D18) safari_time = WordField(0x02039D1A) exp_gain = SignedField(0x02023E94, size=2) class Inner(Model): _player_name = Field(0, bytes, 10) _player_id = Field(0x0A) xor_mask = Field(0x000000AC) money = MaskedField(Field(0x0000143C)) coin = MaskedField(WordField(0x00001440)) dust = WordField(0x000023D8) menu = Field(0x00002328) decorate = Field(0x000036E0) badge = Field(0x00002329) clock_adjustment = Field(0x00000098) per_day_random = Field(0x00002390) spray_time = WordField(0x0000238A) daycare_center_step_1 = ByteField(0x00004064) daycare_center_step_2 = ByteField(0x000040F0) step_counter = ByteField(0x000040F8) battle_points_current = WordField(0x00000EB8) battle_points_trainer_card = WordField(0x00000EBA) _iemfield = PokemonItemField(0) item_normal = ArrayField(0x0000150C, 0x1E, _iemfield) item_keyitem = ArrayField(0x00001584, 0x1E, _iemfield) item_pokeball = ArrayField(0x000015FC, 0x10, _iemfield) item_machine = ArrayField(0x0000163C, 0x40, _iemfield) item_berry = ArrayField(0x0000173C, 0x46, _iemfield) item_pokeblock = ArrayField(0x000017F4, 0x28, _iemfield) inner = ModelPtrField(0x03005AF0, Inner) # rom breed_list = ArrayField(0x082F0D54, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x002FA6D6) # ^ exp_list = ArrayField(0x082F00B4, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x0055CEE8) skill_list = Field(0x002ED220)
class SapphireEn(RubySapphireEn): NAME = "蓝宝石(英文版)" # rom breed_list = ArrayField(0x081FEBA8, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x00000000) # ^ exp_list = ArrayField(0x081FDF08, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x003C55BC) skill_list = Field(0x001FB0BC)
class FireEn(FireLeafEn): NAME = "火红(英文版)" # rom breed_list = ArrayField(0x08254784, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x0025E026) # ^ exp_list = ArrayField(0x08253AE4, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x003DB028) skill_list = Field(0x00250C04)
class LeafEn(FireLeafEn): NAME = "叶绿(英文版)" # rom breed_list = ArrayField(0x08254760, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x0025E006) # ^ exp_list = ArrayField(0x08253AC0, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x003DAE64) skill_list = Field(0x00250BE0)
class RubyJp(RubySapphireJp): NAME = "红宝石(日文版)" # rom breed_list = ArrayField(0x081D09CC, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x00000000) # ^ exp_list = ArrayField(0x081CFD2C, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x0039A648) skill_list = Field(0x001CCEE0)
class LeafJp(FireLeafJp): NAME = "叶绿(日文版)" # rom breed_list = ArrayField(0x08211168, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x0021AA0E) # ^ exp_list = ArrayField(0x082104C8, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x003A0568) skill_list = Field(0x0020D5E8)
class FireJp(FireLeafJp): NAME = "火红(日文版)" # rom breed_list = ArrayField(0x0821118C, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x0021AA2E) # ^ exp_list = ArrayField(0x082104EC, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x003A06F8) skill_list = Field(0x0020D60C)
class SapphireJp(RubySapphireJp): NAME = "蓝宝石(日文版)" # rom breed_list = ArrayField(0x081D095C, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x00000000) # ^ exp_list = ArrayField(0x081CFCBC, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x0039A62C) skill_list = Field(0x001CCE70)
class RubyEn(RubySapphireEn): NAME = "红宝石(英文版)" # rom breed_list = ArrayField(0x081FEC18, 412, ModelField(0, BreedListEntry)) deoxys_breed_abilities = Field(0x00000000) # ^ exp_list = ArrayField(0x081FDF78, 8, ArrayField(0, 0x65, Field(0))) item_list = Field(0x003C5564) skill_list = Field(0x001FB12C)
class Global(BaseGlobal): money = Field(0x0202AA50) turns = WordField(0x0202AA58) chapter = ByteField(0x0202AA56) person_addr = Field(0x02003114) curx = WordField(0x0202AA1C) cury = WordField(0x0202AA1E) persons = ArrayField(0x202AB78, 0xff, ModelField(0, Person)) train_items = ArrayField(0x02039430, 100, ModelField(0, ItemSlot)) # 运输队 # Hack code inf_move = ToggleFields( ToggleField(0x08017B80, size=2, enable=0x2000, disable=0x2002), ToggleField(0x08017EEA, size=2, enable=0x2100, disable=0x2102), ToggleField(0x0801B976, size=2, enable=0x2000, disable=0x2040), ToggleField(0x0802A0C8, size=2, enable=0x2000, disable=0x2040)) # 无限行动 item_count_keep = ToggleField(0x08016940, size=2, enable=0x46C0, disable=0x1812) # 武器耐久度不减 proficiency_max = ToggleField(0x080256CC, size=2, enable=0x22FB, disable=0x1C02) # 武器熟练度最大 ability_up_1 = ToggleField(0x080250CC, size=2, enable=0x2001, disable=0x1C20) # 全能力成长1点 ability_up_2 = ToggleField(0x080250CC, size=2, enable=0x2002, disable=0x1C20) # 全能力成长2点 got_100exp = ToggleField(0x080258D0, size=2, enable=0x2464, disable=0x1824) # 战后升级 # got_100exp = ToggleFields( # ToggleField(0x080258BA, size=2, enable=0x2064, disable=0x2001), # ToggleField(0x080258D0, size=2, enable=0x2464, disable=0x1824), # ToggleField(0x08025994, size=2, enable=0x46C0, disable=0xDD00), # ToggleField(0x080259C6, size=2, enable=0x2064, disable=0x200A) # ToggleField(0x080259CC, size=2, enable=0x3064, disable=0x300A) # ) support_quickly = ToggleField(0x08022B72, size=2, enable=0x7039, disable=0x7038) # 好感度快速提升
class Character(Model): health = WordField(0x1364, label="HP") health_max = WordField(0x1366, label="最大HP") coord = CoordField(0x30, label="坐标") # idle = Field(0x10E0) # target = Field(0x2DA4, label="目标") # ai = Field(0x2DA8, label="AI") # attack_reaction = Field(0x1358) # merce_kill_counter = Field(0x25BC) invincible = ToggleField(0x135C, label="无敌", enable=0, disable=1) items = ArrayField(0x21A8, 24, ModelField(0, IngameItem))
class Person(Model): SIZE = 0x3F0 prof = Field(0x00) # 职业指针 step=11C camp = Field(0x04) # 阵营?0x8064CDFC = 晓之团 no = ByteField(0x0C) # 角色编号 belong = ByteField(0x0D) # 所属 level = ByteField(0x0E) exp = ByteField(0x0F) posx = ByteField(0x12) # 横坐标(左上角开始) posy = ByteField(0x13) # 纵坐标 moved = ByteField(0x1F) # 1表示已经移动,0表示可以行动 hp = ByteField(0x24) # 当前hp physical_add = ByteField(0x25) move_add = ByteField(0x26) hp_add = ByteField(0x29) # hp增加值(最大hp=hp初始值+hp增加值) power_add = ByteField(0x2A) magic_add = ByteField(0x2B) skill_add = ByteField(0x2C) speed_add = ByteField(0x2D) lucky_add = ByteField(0x2E) defense_add = ByteField(0x2F) magicdef_add = ByteField(0x30) skills = ArrayField(0x3C, 12, ModelField(0, SkillSlot)) items = ArrayField(0xCC, 7, ModelField(0, ItemSlot)) # 24个字节 武器熟练度(剑、枪、斧、弓、短剑、打、炎、雷、风、光、暗、杖) A级[00B5] S级[00FB] SS级[014B] proficiency = ArrayField(0x01E4, 18, WordField(0)) support = ArrayField(0x210, 72, ByteField(0)) # 支援等级 72个字节 C级=32, B级=64, A级=96 biorhythm = WordField(0x288) # 生理节律,01是当前状态大好,08是曲线类型 def __setattr__(self, name, value): data = self.test_comlex_attr(name) if data: if data.attrs[0] == 'skills': skill = self.skills[data.attrs[1]] skill.skill = value skill.spec = 0x0002 return super().__setattr__(name, value)
class FireLeafEn(PointerGlobal): active_pokemon_count = 0 active_pokemon = ModelField(0x02024284, PokemonStructActives) stored_pokemon = Field((0x03005010, 4)) dust = 0 decorate = 0 clock_adjustment = 0 per_day_random = 0 safari_balls = ByteField(0x02039994) safari_time = WordField(0x02039996) exp_gain = SignedField(0x02023D50, size=2) Inner = FireLeafJp.Inner inner = ModelPtrField(0x0300500C, Inner)
class Chariot(Model): SIZE = 0x25C # name = Field(0x2196D0C, size=10, label="名字") sp = WordField(0x02196D1C, label="装甲") hole_type = ArrayField(0x02196D1F, 5, ByteField(0), label="炮穴类型") chassis = ModelField(0x02196D24, ChariotEquipInfo, label="底盘") equips = ArrayField(0x02196D38, 8, ModelField(0, ChariotEquipInfo), label="装备") # C装置,引擎,C装置2/引擎2,洞1~5 items = ArrayField(0x02196DD8, 9, ModelField(0, ChariotItemInfo), label="道具") special_bullets = ArrayField(0x02196F40, 15, ModelField(0, ItemInfo), label="特殊炮弹") exportable_fields = ('hole_type', 'double_type', 'equips', 'items', 'special_bullets') def health(self): for equip in self.equips: equip.status = 0 @classmethod def item_type(self, id): if 0x02F4 <= id < 0x0341: return 'item' elif 0x0341 <= id < 0x03BC: return 'engine' elif 0x03BC <= id < 0x03EF: return 'control' elif 0x03EF <= id < 0x0543: return 'weapon'
class Global(BaseGlobal): # chapter = ByteField(0x0202BCFA) # turns = WordField(0x0202BCFC) person_addr = Field(0x021986F4) curx = ByteField(0x02273BD4) # 0x02272EA4 # TODO cury = ByteField(0x02273BD5) # 0x02272EA5 # TODO # persons = ArrayField(0x202be48, 0xff, ModelField(0, Person)) train_items = ArrayField(0x021986D0, 100, ModelField(0, ItemSlot)) # 运输队 ourturn = ToggleField(0x021A9674, enable=0xE2812000, disable=0xE2812001) control_enemy = ToggleField(0x021B1830, enable=0xE1500000, disable=0xE1510000) upgrade_max = ToggleField(0x0203C474, enable=0xE1A09005, disable=0xB2899001) upgrade_all = ToggleField(0x0203C44C, enable=0xE1A00000, disable=0xAA000009) lv1_can_transfer = ToggleField(0x02049EE0, enable=0x00000001, disable=0xE350000A) can_train = ToggleField(0x021C6F7C, enable=0xE3A00002, disable=0xEBF9D152) can_visit = ToggleField(0x021ECB14, enable=0xE3A00002, disable=0xEBF98B4C) # TODO can_holddown = ToggleField(0x021C6E0C, enable=0xEBF9A61E, disable=0xEBF9D1AE) use_enemy_prof = ToggleField(0x021D4CEC, enable=0xEA000022, disable=0x1A000022) infinite_refine = ToggleField(0x02052618, size=2, enable=0, disable=0x0A01) item_consume = ToggleField(0x0203CDD0, size=2, enable=0x0000, disable=0x0001) enemy_item_drop = ToggleField(0x021D3114, size=8, enable=0xE3500000E1D006B0, disable=0xE3500020E5D10003) exp_rate = Field(0x021CFACC) pro_rate = Field(0x021CFC78) config = ModelPtrField(0x02198120, Config, 4) _iteminfos = ArrayField(0x022494E0, 0xff, ModelField(0, ItemInfo)) difficulty = ByteField(0x0227E6E5) # 0201FF8C E3A00000 always_level_up = ToggleField(0x021CFAC4, enable=0xE3A02064, disable=0xE5D1206B) @property def _offset(self): return self.handler.read32(0x021BD44C) - 0x022BEAA0 @property def iteminfos(self): self.field('_iteminfos').offset = self.handler.read32(0x0227A748 + self._offset) return self._iteminfos
class Global(Model): # 角色指针起始 # 4.0.2: 9: 0x00914EC0-0x3F0*9 # 5.x 9: 0x00930C80-0x3F0*9 persons = ArrayField(0x0092E910, 0xff, ModelField(0, Person)) turn = WordField(0x003AE34A) # 回合数 money1 = Field(0x003AE350) money2 = Field(0x003AE354) money3 = Field(0x003AE358) exp1 = Field(0x003AE35C, type=float) exp2 = Field(0x003AE360, type=float) exp3 = Field(0x003AE364, type=float) pedid = ByteField(0x003AC8FC) # 当前人物编号 curx = ByteField(0x003C88B1) # 当前光标x坐标 cury = ByteField(0x003C88B3) # 当前光标y坐标
class Character(Model): """角色""" id = Field((0x010C, 0x16), bytes, 6) health = WordField(0x0F10, label="生命值") health_max = WordField(0x0F12, label="生命值上限") invincible = ToggleField(0x0FC4, enable=0, disable=1, label="无敌") stamina = Field(0x3B00, float, label="体力") stamina_max = Field(0x3B04, float, label="体力上限") coord = CoordField(0x50, label="坐标") moving_speed = Field(0x54, float, label="移动速度") cur_item = ByteField(0x46D8) # 当前使用的物品序号(只读) items = ArrayField(0x46E0, 24, ModelField( 0, IngameItem)) # 水平武器: 0~6, 药丸: 7, 垂直武器: 8~12 其他物品: 15~23 rapid_fire = Field(0x4F4C, float, label="快速开火") fix_weapon_switch = Field(0x46D0, float) # 竖行武器切换至横行武器时的修正? is_wet = Field(0x2E34, label="是否湿了")
class Chariot(PersonChariot): sp = WordField(0x64E8) items = ArrayField(0x65CF, 8, ByteField(0)) equips = ArrayField(0x6627, 8, ModelField(0, ChariotEquip)) weight = WordField(0x64D2) defense = WordField(0x64FE) bullet = ByteField(0x651F) special_bullets = ArrayField(0x03003DE1, 8, ByteField(0)) # 特殊炮弹 special_bullets_count = ArrayField(0x03003E39, 8, ByteField(0)) # 特殊炮弹 main_bullets_count = ByteField(0x6535) # 主炮弹药 se_bullets_count = ByteField(0x654B) # SE弹药 def set_index(self, i): super().set_index(i) field = self.field('equips') field.offset = field.origin_offset + i self.equips.offset = field.offset
class Global(Model): hp = WordField(0x02039B52, label="HP") hpmax = WordField(0x02039C18, label="总HP") cpmax = WordField(0x02039C1A, label="总CP") exp = WordField(0x02039C20, label="EXP") mp = WordField(0x02039C94, label="M点数") dark = WordField(0x02039C1C, label="Dark点数") atk = WordField(0x02039C1E, label="攻击力") battle_hp = WordField(0x0203314C, label="战斗HP") battle_hpmax = WordField(0x0203314E, label="战斗总HP") # 全特技 # 02039CBC:FFFFFFFF # 02039CD0:FFFFFFFF # 02039CD4:FFFFFFFF skills = Field(0x02039C2C, bytes, 0x1C) map_cards = ArrayField(0x0203A830, 0x104, Field(0)) battle_cards = ArrayField(0x02039FF0, 0x232, ModelField(0, BattleCard)) event_book = Field(0x02039C54, bytes, 0x40) riku_enable = ToggleField(0x02039B28, enable=0x20, disable=0, label="利库篇开启")