@@ -142,6 +142,42 @@ int BP_spell_owner(x86_reg_t *regs, json_t *bp_info)
142
142
return 1 ;
143
143
}
144
144
145
+ char th185_spell_id[8 ] = {};
146
+
147
+ int BP_th185_spell_id (x86_reg_t * regs, json_t * bp_info) {
148
+ *th185_spell_id = 0 ;
149
+ const char * sub_name = (char *)json_object_get_immediate (bp_info, regs, " sub_name" );
150
+ if (strcmp (sub_name, " Boss01tBossCard1" ) == 0 ) {
151
+ strcpy (th185_spell_id, " 0_1" );
152
+ return breakpoint_cave_exec_flag (bp_info);
153
+ }
154
+ if (strlen (sub_name) != 15
155
+ || strncmp (sub_name, " Boss" , 4 )
156
+ || strncmp (sub_name + 6 , " BossCard" , 8 )
157
+ || sub_name[4 ] > ' 9' || sub_name[4 ] < ' 0'
158
+ || sub_name[5 ] > ' 9' || sub_name[5 ] < ' 0'
159
+ || sub_name[14 ] > ' 9' || sub_name[14 ] < ' 0' ) {
160
+ return breakpoint_cave_exec_flag (bp_info);
161
+ }
162
+ char * p = th185_spell_id;
163
+ if (sub_name[4 ] > ' 0' )
164
+ *p++ = sub_name[4 ];
165
+ *p++ = sub_name[5 ];
166
+ *p++ = ' _' ;
167
+ *p++ = sub_name[14 ];
168
+ return breakpoint_cave_exec_flag (bp_info);
169
+ }
170
+
171
+ int BP_th185_spell_name (x86_reg_t * regs, json_t * bp_info) {
172
+ if (*th185_spell_id) {
173
+ json_t * spell_name = json_object_get (jsondata_game_get (" spells.js" ), th185_spell_id);
174
+ if (json_is_string (spell_name))
175
+ *json_object_get_pointer (bp_info, regs, " spell_name" ) = (size_t )json_string_value (spell_name);
176
+ *th185_spell_id = 0 ;
177
+ }
178
+ return breakpoint_cave_exec_flag (bp_info);
179
+ }
180
+
145
181
void spells_mod_init (void )
146
182
{
147
183
jsondata_game_add (" spells.js" );
0 commit comments