AVA2 unlock P7: talismans (ARMOR_PENDANT / WEAR_PENDANT, element enchants)

- ARMOR_PENDANT subtype, WEAR_PENDANT=27, APPLY_ENCHANT_ELEC..DARK (123-128)
  and POINT_ENCHANT_* (242-247); battle.cpp adds the enchant % vs element mobs
- port_pendant.cpp: talisman attribute pool (AVA2 item_attr pendant column),
  71302/53996 reroll and 71301/53997 add (max 5), MTPENDANT client messages
- switchbot skips talisman scrolls; tests for pendant + applies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-16 14:28:35 +09:00
co-authored by Claude Opus 5.5
parent 6199b2cbff
commit f09ffd8a35
17 changed files with 326 additions and 14 deletions
+8 -1
View File
@@ -21,14 +21,21 @@ constants=source('game/src/constants.cpp')
table=constants[constants.index('aApplyInfo[MAX_APPLY_NUM]'):]
table=table[table.index('{')+1:table.index('};')]
rows=re.findall(r'\{\s*(POINT_[A-Z_]+)',table)
assert len(rows)==141 and rows[139:]==['POINT_ATTBONUS_STONE','POINT_ATTBONUS_BOSS'] and set(rows[92:139])=={'POINT_NONE'},len(rows)
assert len(rows)==141 and rows[139:]==['POINT_ATTBONUS_STONE','POINT_ATTBONUS_BOSS'] and set(rows[92:123]+rows[129:139])=={'POINT_NONE'},len(rows)
ELEM=('ELEC','FIRE','ICE','WIND','EARTH','DARK')
# P7 talisman: APPLY_ENCHANT_* 123-128 (AVA2 names, ELECT for the db) -> POINT_ENCHANT_* 242-247
assert rows[123:129]==['POINT_ENCHANT_'+e for e in ELEM],rows[123:129]
assert names[123:129]==['APPLY_ENCHANT_'+('ELECT' if e=='ELEC' else e) for e in ELEM],names[123:129]
assert '"ATTBONUS_STONE",\tAPPLY_ATTBONUS_STONE' in constants and '"ATTBONUS_BOSS",\tAPPLY_ATTBONUS_BOSS' in constants
char=source('game/src/char.cpp')
apply=char[char.index('void CHARACTER::ApplyPoint('):char.index('void CHARACTER::MotionPacketEncode(')]
assert all('case APPLY_ENCHANT_%s:'%e in apply for e in ELEM)
assert 'case APPLY_ATTBONUS_STONE:' in apply and 'case APPLY_ATTBONUS_BOSS:' in apply
points=source('game/src/char.h')
assert all('POINT_ENCHANT_%s = %d,'%(e,242+i) in points for i,e in enumerate(ELEM)),'enchant points'
assert 'POINT_ATTBONUS_STONE = 240,' in points and 'POINT_ATTBONUS_BOSS = 241,' in points
battle=source('game/src/battle.cpp')
assert all('GetPoint(POINT_ENCHANT_%s)'%e in battle for e in ELEM) and 'RACE_FLAG_ATT_ICE' in battle
assert 'GetPoint(POINT_ATTBONUS_STONE)' in battle and 'GetPoint(POINT_ATTBONUS_BOSS)' in battle
print('PASS: stone/boss applies 139/140 in the db reader, aApplyInfo, apply names and ApplyPoint')