gameboy_worlds.emulation.runes_of_virtue.test_metrics

  1from typing import Optional
  2
  3import numpy as np
  4
  5from gameboy_worlds.emulation.runes_of_virtue.parsers import (
  6    RunesOfVirtueStateParser,
  7)
  8from gameboy_worlds.emulation.tracker import (
  9    RegionMatchTerminationOnlyMetric,
 10    TerminationMetric,
 11)
 12
 13
 14class RunesOfVirtue1OpenMenuTerminateMetric(TerminationMetric):
 15    """Terminates the episode when the player opens the inventory menu in Runes of Virtue 1."""
 16
 17    REQUIRED_PARSER = RunesOfVirtueStateParser
 18
 19    def determine_terminated(
 20        self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray]
 21    ) -> bool:
 22        all_frames = [current_frame]
 23        if recent_frames is not None:
 24            all_frames = recent_frames
 25        for frame in all_frames:
 26            self.state_parser: RunesOfVirtueStateParser
 27            if self.state_parser.is_in_menu(frame):
 28                return True
 29        return False
 30
 31
 32class RunesOfVirtue2OpenMenuTerminateMetric(TerminationMetric):
 33    """Terminates the episode when the player opens the inventory menu in Runes of Virtue 2."""
 34
 35    REQUIRED_PARSER = RunesOfVirtueStateParser
 36
 37    def determine_terminated(
 38        self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray]
 39    ) -> bool:
 40        all_frames = [current_frame]
 41        if recent_frames is not None:
 42            all_frames = recent_frames
 43        for frame in all_frames:
 44            self.state_parser: RunesOfVirtueStateParser
 45            if self.state_parser.is_in_menu(frame):
 46                return True
 47        return False
 48
 49
 50class RunesOfVirtue1KingDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
 51    """Terminates when the king's dialog is on screen."""
 52
 53    REQUIRED_PARSER = RunesOfVirtueStateParser
 54    _TERMINATION_NAMED_REGION = "playfield_indicator"
 55    _TERMINATION_TARGET_NAME = "king_dialog"
 56
 57
 58class RunesOfVirtue2ReadBookTerminateMetric(RegionMatchTerminationOnlyMetric):
 59    """Terminates when an opened book is on screen."""
 60
 61    REQUIRED_PARSER = RunesOfVirtueStateParser
 62    _TERMINATION_NAMED_REGION = "playfield_indicator"
 63    _TERMINATION_TARGET_NAME = "book_open"
 64
 65
 66class RunesOfVirtue2BlockedRoomEnteredTerminateMetric(
 67    RegionMatchTerminationOnlyMetric
 68):
 69    """Terminates when the player has entered the blocked room."""
 70
 71    REQUIRED_PARSER = RunesOfVirtueStateParser
 72    _TERMINATION_NAMED_REGION = "playfield_indicator"
 73    _TERMINATION_TARGET_NAME = "blocked_room_entered"
 74
 75
 76class RunesOfVirtue2NystulDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
 77    """Terminates when Nystul's dialog is on screen."""
 78
 79    REQUIRED_PARSER = RunesOfVirtueStateParser
 80    _TERMINATION_NAMED_REGION = "dialog_indicator"
 81    _TERMINATION_TARGET_NAME = "nystul_dialog"
 82
 83
 84class RunesOfVirtue2BlacksmithFailBuyShieldTerminateMetric(
 85    RegionMatchTerminationOnlyMetric
 86):
 87    """Terminates when the blacksmith's failed shield purchase dialog is on screen."""
 88
 89    REQUIRED_PARSER = RunesOfVirtueStateParser
 90    _TERMINATION_NAMED_REGION = "dialog_indicator"
 91    _TERMINATION_TARGET_NAME = "blacksmith_fail_buy_shield"
 92
 93
 94class RunesOfVirtue2SherryMouseDialogTerminateMetric(
 95    RegionMatchTerminationOnlyMetric
 96):
 97    """Terminates when Sherry the mouse's dialog is on screen."""
 98
 99    REQUIRED_PARSER = RunesOfVirtueStateParser
100    _TERMINATION_NAMED_REGION = "dialog_indicator"
101    _TERMINATION_TARGET_NAME = "sherry_mouse_dialog"
102
103
104class RunesOfVirtue2SandyCookDialogTerminateMetric(
105    RegionMatchTerminationOnlyMetric
106):
107    """Terminates when Sandy the cook's dialog is on screen."""
108
109    REQUIRED_PARSER = RunesOfVirtueStateParser
110    _TERMINATION_NAMED_REGION = "dialog_indicator"
111    _TERMINATION_TARGET_NAME = "sandy_cook_dialog"
112
113
114class RunesOfVirtue2LordWhitsaberDialogTerminateMetric(
115    RegionMatchTerminationOnlyMetric
116):
117    """Terminates when Lord Whitsaber's dialog is on screen."""
118
119    REQUIRED_PARSER = RunesOfVirtueStateParser
120    _TERMINATION_NAMED_REGION = "dialog_indicator"
121    _TERMINATION_TARGET_NAME = "lord_whitsaber_dialog"
122
123
124class RunesOfVirtue2CaveOfDishonourTerminateMetric(RegionMatchTerminationOnlyMetric):
125    """Terminates when the player has entered the Cave of Dishonour."""
126
127    REQUIRED_PARSER = RunesOfVirtueStateParser
128    _TERMINATION_NAMED_REGION = "playfield_indicator"
129    _TERMINATION_TARGET_NAME = "cave_of_dishonour"
130
131
132class RunesOfVirtue2CavernOfHatredTerminateMetric(RegionMatchTerminationOnlyMetric):
133    """Terminates when the player has entered the Cavern of Hatred."""
134
135    REQUIRED_PARSER = RunesOfVirtueStateParser
136    _TERMINATION_NAMED_REGION = "playfield_indicator"
137    _TERMINATION_TARGET_NAME = "cavern_of_hatred"
138
139
140class RunesOfVirtue2CaveOfDishonourEnterFloor2TerminateMetric(
141    RegionMatchTerminationOnlyMetric
142):
143    """Terminates when the player enters floor 2 in the Cave of Dishonour."""
144
145    REQUIRED_PARSER = RunesOfVirtueStateParser
146    _TERMINATION_NAMED_REGION = "playfield_indicator"
147    _TERMINATION_TARGET_NAME = "cave_of_dishonour_enter_floor_2"
148
149
150class RunesOfVirtue2CaveOfDishonourEnterFloor3TerminateMetric(
151    RegionMatchTerminationOnlyMetric
152):
153    """Terminates when the player enters floor 3 in the Cave of Dishonour."""
154
155    REQUIRED_PARSER = RunesOfVirtueStateParser
156    _TERMINATION_NAMED_REGION = "playfield_indicator"
157    _TERMINATION_TARGET_NAME = "cave_of_dishonour_enter_floor_3"
158
159
160class RunesOfVirtue2GrabCheeseFromKitchenTerminateMetric(
161    RegionMatchTerminationOnlyMetric
162):
163    """Terminates when the player grabs the cheese from the kitchen."""
164
165    REQUIRED_PARSER = RunesOfVirtueStateParser
166    _TERMINATION_NAMED_REGION = "playfield_indicator"
167    _TERMINATION_TARGET_NAME = "kitchen_cheese_grabbed"
168
169
170class RunesOfVirtue2GiveCheeseToSherryTerminateMetric(
171    RegionMatchTerminationOnlyMetric
172):
173    """Terminates when the player gives the cheese to Sherry."""
174
175    REQUIRED_PARSER = RunesOfVirtueStateParser
176    _TERMINATION_NAMED_REGION = "playfield_indicator"
177    _TERMINATION_TARGET_NAME = "cheese_given_to_sherry"
178
179
180class RunesOfVirtue2ClimbLadderBehindLockedDoorTerminateMetric(
181    RegionMatchTerminationOnlyMetric
182):
183    """Terminates when the player climbs the ladder behind the locked door."""
184
185    REQUIRED_PARSER = RunesOfVirtueStateParser
186    _TERMINATION_NAMED_REGION = "playfield_indicator"
187    _TERMINATION_TARGET_NAME = "ladder_behind_locked_door_climbed"
188
189
190class RunesOfVirtue2InteractWithMapOnTableTerminateMetric(
191    RegionMatchTerminationOnlyMetric
192):
193    """Terminates when the player interacts with the map on the table."""
194
195    REQUIRED_PARSER = RunesOfVirtueStateParser
196    _TERMINATION_NAMED_REGION = "playfield_indicator"
197    _TERMINATION_TARGET_NAME = "table_map_interacted"
198
199
200class RunesOfVirtue2FindLadderBackFromCastleTerminateMetric(
201    RegionMatchTerminationOnlyMetric
202):
203    """Terminates when the player finds a ladder back from the castle."""
204
205    REQUIRED_PARSER = RunesOfVirtueStateParser
206    _TERMINATION_NAMED_REGION = "playfield_indicator"
207    _TERMINATION_TARGET_NAME = "castle_ladder_back_found"
208
209
210class RunesOfVirtue2UnlockDoorAndSaveTholdenTerminateMetric(
211    RegionMatchTerminationOnlyMetric
212):
213    """Terminates when the player unlocks the door and saves Tholden."""
214
215    REQUIRED_PARSER = RunesOfVirtueStateParser
216    _TERMINATION_NAMED_REGION = "dialog_indicator"
217    _TERMINATION_TARGET_NAME = "tholden_saved"
218
219
220class RunesOfVirtue2FindLadderOutOfCavernOfHatredTerminateMetric(
221    RegionMatchTerminationOnlyMetric
222):
223    """Terminates when the player finds a ladder out of the Cavern of Hatred."""
224
225    REQUIRED_PARSER = RunesOfVirtueStateParser
226    _TERMINATION_NAMED_REGION = "left_playfield_indicator"
227    _TERMINATION_TARGET_NAME = "cavern_of_hatred_ladder_out_found"
228
229
230class RunesOfVirtue2BringTholdenBackToKingTerminateMetric(
231    RegionMatchTerminationOnlyMetric
232):
233    """Terminates when the player brings Tholden back to the king."""
234
235    REQUIRED_PARSER = RunesOfVirtueStateParser
236    _TERMINATION_NAMED_REGION = "dialog_indicator"
237    _TERMINATION_TARGET_NAME = "tholden_brought_back_to_king"
238
239
240class RunesOfVirtue2AttendCastleCeremonyTerminateMetric(
241    RegionMatchTerminationOnlyMetric
242):
243    """Terminates when the player attends the ceremony in the castle."""
244
245    REQUIRED_PARSER = RunesOfVirtueStateParser
246    _TERMINATION_NAMED_REGION = "dialog_indicator"
247    _TERMINATION_TARGET_NAME = "castle_ceremony_attended"
248
249
250class RunesOfVirtue2CavernOfHatredGate1UnlockedTerminateMetric(
251    RegionMatchTerminationOnlyMetric
252):
253    """Terminates when the first Cavern of Hatred gate is unlocked."""
254
255    REQUIRED_PARSER = RunesOfVirtueStateParser
256    _TERMINATION_NAMED_REGION = "playfield_indicator"
257    _TERMINATION_TARGET_NAME = "cavern_of_hatred_gate_1_unlocked"
258
259
260class RunesOfVirtue2CavernOfHatredLadderRoom2TerminateMetric(
261    RegionMatchTerminationOnlyMetric
262):
263    """Terminates when the player enters the second ladder room in the Cavern of Hatred."""
264
265    REQUIRED_PARSER = RunesOfVirtueStateParser
266    _TERMINATION_NAMED_REGION = "playfield_indicator"
267    _TERMINATION_TARGET_NAME = "cavern_of_hatred_ladder_room_2"
268
269
270class RunesOfVirtue2CavernOfHatredLadder2TerminateMetric(
271    RegionMatchTerminationOnlyMetric
272):
273    """Terminates when the player reaches the second ladder in the Cavern of Hatred."""
274
275    REQUIRED_PARSER = RunesOfVirtueStateParser
276    _TERMINATION_NAMED_REGION = "playfield_indicator"
277    _TERMINATION_TARGET_NAME = "cavern_of_hatred_ladder_2"
278
279
280class RunesOfVirtue2CavernOfHatredGrabKeyTerminateMetric(
281    RegionMatchTerminationOnlyMetric
282):
283    """Terminates when the player grabs the key in the Cavern of Hatred."""
284
285    REQUIRED_PARSER = RunesOfVirtueStateParser
286    _TERMINATION_NAMED_REGION = "playfield_indicator"
287    _TERMINATION_TARGET_NAME = "cavern_of_hatred_grab_key"
288
289
290class RunesOfVirtue2CavernOfHatredEnterFloor4TerminateMetric(
291    RegionMatchTerminationOnlyMetric
292):
293    """Terminates when the player enters floor 4 in the Cavern of Hatred."""
294
295    REQUIRED_PARSER = RunesOfVirtueStateParser
296    _TERMINATION_NAMED_REGION = "playfield_indicator"
297    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_4"
298
299
300class RunesOfVirtue2CavernOfHatredEnterFloor5TerminateMetric(
301    RegionMatchTerminationOnlyMetric
302):
303    """Terminates when the player enters floor 5 in the Cavern of Hatred."""
304
305    REQUIRED_PARSER = RunesOfVirtueStateParser
306    _TERMINATION_NAMED_REGION = "playfield_indicator"
307    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_5"
308
309
310class RunesOfVirtue2CavernOfHatredEnterFloor6TerminateMetric(
311    RegionMatchTerminationOnlyMetric
312):
313    """Terminates when the player enters floor 6 in the Cavern of Hatred."""
314
315    REQUIRED_PARSER = RunesOfVirtueStateParser
316    _TERMINATION_NAMED_REGION = "playfield_indicator"
317    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_6"
318
319
320class RunesOfVirtue2CavernOfHatredEnterFloor7TerminateMetric(
321    RegionMatchTerminationOnlyMetric
322):
323    """Terminates when the player enters floor 7 in the Cavern of Hatred."""
324
325    REQUIRED_PARSER = RunesOfVirtueStateParser
326    _TERMINATION_NAMED_REGION = "playfield_indicator"
327    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_7"
328
329
330class RunesOfVirtue2DeathScreenTerminateMetric(RegionMatchTerminationOnlyMetric):
331    """Terminates when the death / game over screen is on screen."""
332
333    REQUIRED_PARSER = RunesOfVirtueStateParser
334    _TERMINATION_NAMED_REGION = "death_screen_indicator"
335    _TERMINATION_TARGET_NAME = "death_screen"
336
337
338class RunesOfVirtue1ChucklesDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
339    """Terminates when Chuckles's dialog is on screen."""
340
341    REQUIRED_PARSER = RunesOfVirtueStateParser
342    _TERMINATION_NAMED_REGION = "playfield_indicator"
343    _TERMINATION_TARGET_NAME = "chuckles_dialog"
344
345
346class RunesOfVirtue1GnuGnu1DialogTerminateMetric(RegionMatchTerminationOnlyMetric):
347    """Terminates when Gnu Gnu's 1st store dialog is on screen."""
348
349    REQUIRED_PARSER = RunesOfVirtueStateParser
350    _TERMINATION_NAMED_REGION = "playfield_indicator"
351    _TERMINATION_TARGET_NAME = "gnu_gnu_1_dialog"
352
353
354class RunesOfVirtue1GnuGnu2DialogTerminateMetric(RegionMatchTerminationOnlyMetric):
355    """Terminates when Gnu Gnu's 2nd store dialog is on screen."""
356
357    REQUIRED_PARSER = RunesOfVirtueStateParser
358    _TERMINATION_NAMED_REGION = "playfield_indicator"
359    _TERMINATION_TARGET_NAME = "gnu_gnu_2_dialog"
360
361
362class RunesOfVirtue1SherryDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
363    """Terminates when Sherry's dialog is on screen."""
364
365    REQUIRED_PARSER = RunesOfVirtueStateParser
366    _TERMINATION_NAMED_REGION = "playfield_indicator"
367    _TERMINATION_TARGET_NAME = "sherry_dialog"
368
369
370class RunesOfVirtue1CavernOfHatredTerminateMetric(RegionMatchTerminationOnlyMetric):
371    """Terminates when the player is inside the Cavern of Hatred."""
372
373    REQUIRED_PARSER = RunesOfVirtueStateParser
374    _TERMINATION_NAMED_REGION = "cave_indicator"
375    _TERMINATION_TARGET_NAME = "cavern_of_hatred"
376
377
378class RunesOfVirtue1CavernOfDeceitTerminateMetric(RegionMatchTerminationOnlyMetric):
379    """Terminates when the player is inside the Cavern of Deceit."""
380
381    REQUIRED_PARSER = RunesOfVirtueStateParser
382    _TERMINATION_NAMED_REGION = "cave_indicator"
383    _TERMINATION_TARGET_NAME = "cavern_of_deceit"
384
385
386class RunesOfVirtue1CavernOfCowardiceTerminateMetric(
387    RegionMatchTerminationOnlyMetric
388):
389    """Terminates when the player is inside the Cavern of Cowardice."""
390
391    REQUIRED_PARSER = RunesOfVirtueStateParser
392    _TERMINATION_NAMED_REGION = "cave_indicator"
393    _TERMINATION_TARGET_NAME = "cavern_of_cowardice"
394
395
396class RunesOfVirtue1CavernOfCowardiceEnterFloor2TerminateMetric(
397    RegionMatchTerminationOnlyMetric
398):
399    """Terminates when the player enters floor 2 of the Cavern of Cowardice."""
400
401    REQUIRED_PARSER = RunesOfVirtueStateParser
402    _TERMINATION_NAMED_REGION = "playfield_indicator"
403    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_enter_floor_2"
404
405
406class RunesOfVirtue1CavernOfCowardiceEnterFloor3TerminateMetric(
407    RegionMatchTerminationOnlyMetric
408):
409    """Terminates when the player enters floor 3 of the Cavern of Cowardice."""
410
411    REQUIRED_PARSER = RunesOfVirtueStateParser
412    _TERMINATION_NAMED_REGION = "playfield_indicator"
413    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_enter_floor_3"
414
415
416class RunesOfVirtue1CavernOfCowardiceFloor3ChestOpenedTerminateMetric(
417    RegionMatchTerminationOnlyMetric
418):
419    """Terminates when the player opens the floor 3 chest in the Cavern of Cowardice."""
420
421    REQUIRED_PARSER = RunesOfVirtueStateParser
422    _TERMINATION_NAMED_REGION = "playfield_indicator"
423    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_floor_3_chest_opened"
424
425
426class RunesOfVirtue1CavernOfCowardiceEnterFloor4TerminateMetric(
427    RegionMatchTerminationOnlyMetric
428):
429    """Terminates when the player enters floor 4 of the Cavern of Cowardice."""
430
431    REQUIRED_PARSER = RunesOfVirtueStateParser
432    _TERMINATION_NAMED_REGION = "top_playfield_indicator"
433    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_enter_floor_4"
434
435
436class RunesOfVirtue1CavernOfCowardiceSherryFloor4DialogTerminateMetric(
437    RegionMatchTerminationOnlyMetric
438):
439    """Terminates when Sherry's floor 4 dialog is on screen in the Cavern of Cowardice."""
440
441    REQUIRED_PARSER = RunesOfVirtueStateParser
442    _TERMINATION_NAMED_REGION = "playfield_indicator"
443    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_sherry_floor_4_dialog"
444
445
446class RunesOfVirtue1CavernOfCowardiceTakeStewFloor4TerminateMetric(
447    RegionMatchTerminationOnlyMetric
448):
449    """Terminates when the player takes stew on floor 4 of the Cavern of Cowardice."""
450
451    REQUIRED_PARSER = RunesOfVirtueStateParser
452    _TERMINATION_NAMED_REGION = "playfield_indicator"
453    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_take_stew_floor_4"
454
455
456class RunesOfVirtue1CavernOfCowardiceObtainCoinFloor4TerminateMetric(
457    RegionMatchTerminationOnlyMetric
458):
459    """Terminates when the player obtains the coin on floor 4 of the Cavern of Cowardice."""
460
461    REQUIRED_PARSER = RunesOfVirtueStateParser
462    _TERMINATION_NAMED_REGION = "playfield_indicator"
463    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_obtain_coin_floor_4"
464
465
466class RunesOfVirtue1DrCatDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
467    """Terminates when Dr. Cat's dialog is on screen."""
468
469    REQUIRED_PARSER = RunesOfVirtueStateParser
470    _TERMINATION_NAMED_REGION = "playfield_indicator"
471    _TERMINATION_TARGET_NAME = "dr_cat_dialog"
472
473
474class RunesOfVirtue1DrCatCatsLairDialogTerminateMetric(
475    RegionMatchTerminationOnlyMetric
476):
477    """Terminates when Dr. Cat's dialog is on screen in the Cat's Lair."""
478
479    REQUIRED_PARSER = RunesOfVirtueStateParser
480    _TERMINATION_NAMED_REGION = "playfield_indicator"
481    _TERMINATION_TARGET_NAME = "dr_cat_cats_lair_dialog"
482
483
484class RunesOfVirtue1ShipRiddenTerminateMetric(RegionMatchTerminationOnlyMetric):
485    """Terminates when the player is riding the ship."""
486
487    REQUIRED_PARSER = RunesOfVirtueStateParser
488    _TERMINATION_NAMED_REGION = "playfield_indicator"
489    _TERMINATION_TARGET_NAME = "ship_ridden"
490
491
492class RunesOfVirtue1BasementLadderUnlockedTerminateMetric(
493    RegionMatchTerminationOnlyMetric
494):
495    """Terminates when the player unlocks the basement ladder."""
496
497    REQUIRED_PARSER = RunesOfVirtueStateParser
498    _TERMINATION_NAMED_REGION = "playfield_indicator"
499    _TERMINATION_TARGET_NAME = "basement_ladder_unlocked"
500
501
502class RunesOfVirtue1BasementChestOpenedTerminateMetric(
503    RegionMatchTerminationOnlyMetric
504):
505    """Terminates when the player opens the basement chest."""
506
507    REQUIRED_PARSER = RunesOfVirtueStateParser
508    _TERMINATION_NAMED_REGION = "playfield_indicator"
509    _TERMINATION_TARGET_NAME = "basement_chest_opened"
510
511
512class RunesOfVirtue1CavernOfHatredEnterFloor2TerminateMetric(
513    RegionMatchTerminationOnlyMetric
514):
515    """Terminates when the player enters floor 2 of the Cavern of Hatred."""
516
517    REQUIRED_PARSER = RunesOfVirtueStateParser
518    _TERMINATION_NAMED_REGION = "playfield_indicator"
519    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_2"
520
521
522class RunesOfVirtue1CavernOfHatredSherryFloor2DialogTerminateMetric(
523    RegionMatchTerminationOnlyMetric
524):
525    """Terminates when Sherry's floor 2 dialog is on screen in the Cavern of Hatred."""
526
527    REQUIRED_PARSER = RunesOfVirtueStateParser
528    _TERMINATION_NAMED_REGION = "playfield_indicator"
529    _TERMINATION_TARGET_NAME = "cavern_of_hatred_sherry_floor_2_dialog"
530
531
532class RunesOfVirtue1CavernOfHatredChooseDoorWithSherryTerminateMetric(
533    RegionMatchTerminationOnlyMetric
534):
535    """Terminates when Sherry asks the player to choose a door in the Cavern of Hatred."""
536
537    REQUIRED_PARSER = RunesOfVirtueStateParser
538    _TERMINATION_NAMED_REGION = "playfield_indicator"
539    _TERMINATION_TARGET_NAME = "cavern_of_hatred_choose_door_with_sherry"
540
541
542class RunesOfVirtue1CavernOfHatredChooseRightDoorMelissaDialogTerminateMetric(
543    RegionMatchTerminationOnlyMetric
544):
545    """Terminates when Melissa's dialog is on screen after choosing the right door."""
546
547    REQUIRED_PARSER = RunesOfVirtueStateParser
548    _TERMINATION_NAMED_REGION = "playfield_indicator"
549    _TERMINATION_TARGET_NAME = "cavern_of_hatred_choose_right_door_melissa_dialog"
550
551
552class RunesOfVirtue1CavernOfHatredEnterFloor3TerminateMetric(
553    RegionMatchTerminationOnlyMetric
554):
555    """Terminates when the player enters floor 3 of the Cavern of Hatred."""
556
557    REQUIRED_PARSER = RunesOfVirtueStateParser
558    _TERMINATION_NAMED_REGION = "playfield_indicator"
559    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_3"
560
561
562class RunesOfVirtue1CavernOfHatredEnterFloor4TerminateMetric(
563    RegionMatchTerminationOnlyMetric
564):
565    """Terminates when the player enters floor 4 of the Cavern of Hatred."""
566
567    REQUIRED_PARSER = RunesOfVirtueStateParser
568    _TERMINATION_NAMED_REGION = "top_playfield_indicator"
569    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_4"
570
571
572class RunesOfVirtue1CavernOfHatredChestFloor1OpenedTerminateMetric(
573    RegionMatchTerminationOnlyMetric
574):
575    """Terminates when the player opens the floor 1 chest in the Cavern of Hatred."""
576
577    REQUIRED_PARSER = RunesOfVirtueStateParser
578    _TERMINATION_NAMED_REGION = "playfield_indicator"
579    _TERMINATION_TARGET_NAME = "cavern_of_hatred_chest_floor_1_opened"
580
581
582class RunesOfVirtue1TelescopeViewTerminateMetric(RegionMatchTerminationOnlyMetric):
583    """Terminates when the telescope view is on screen."""
584
585    REQUIRED_PARSER = RunesOfVirtueStateParser
586    _TERMINATION_NAMED_REGION = "telescope_view_indicator"
587    _TERMINATION_TARGET_NAME = "telescope_view"
588
589
590class RunesOfVirtue1DeathScreenTerminateMetric(RegionMatchTerminationOnlyMetric):
591    """Terminates when the death / game over screen is on screen."""
592
593    REQUIRED_PARSER = RunesOfVirtueStateParser
594    _TERMINATION_NAMED_REGION = "death_screen_indicator"
595    _TERMINATION_TARGET_NAME = "death_screen"
class RunesOfVirtue1OpenMenuTerminateMetric(gameboy_worlds.emulation.tracker.TerminationMetric):
15class RunesOfVirtue1OpenMenuTerminateMetric(TerminationMetric):
16    """Terminates the episode when the player opens the inventory menu in Runes of Virtue 1."""
17
18    REQUIRED_PARSER = RunesOfVirtueStateParser
19
20    def determine_terminated(
21        self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray]
22    ) -> bool:
23        all_frames = [current_frame]
24        if recent_frames is not None:
25            all_frames = recent_frames
26        for frame in all_frames:
27            self.state_parser: RunesOfVirtueStateParser
28            if self.state_parser.is_in_menu(frame):
29                return True
30        return False

Terminates the episode when the player opens the inventory menu in Runes of Virtue 1.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

def determine_terminated( self, current_frame: numpy.ndarray, recent_frames: Optional[numpy.ndarray]) -> bool:
20    def determine_terminated(
21        self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray]
22    ) -> bool:
23        all_frames = [current_frame]
24        if recent_frames is not None:
25            all_frames = recent_frames
26        for frame in all_frames:
27            self.state_parser: RunesOfVirtueStateParser
28            if self.state_parser.is_in_menu(frame):
29                return True
30        return False

Determines whether the environment was terminated.

Parameters
  • current_frame: The current frame rendered by the emulator.
  • recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns

True if the environment was terminated, False otherwise.

class RunesOfVirtue2OpenMenuTerminateMetric(gameboy_worlds.emulation.tracker.TerminationMetric):
33class RunesOfVirtue2OpenMenuTerminateMetric(TerminationMetric):
34    """Terminates the episode when the player opens the inventory menu in Runes of Virtue 2."""
35
36    REQUIRED_PARSER = RunesOfVirtueStateParser
37
38    def determine_terminated(
39        self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray]
40    ) -> bool:
41        all_frames = [current_frame]
42        if recent_frames is not None:
43            all_frames = recent_frames
44        for frame in all_frames:
45            self.state_parser: RunesOfVirtueStateParser
46            if self.state_parser.is_in_menu(frame):
47                return True
48        return False

Terminates the episode when the player opens the inventory menu in Runes of Virtue 2.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

def determine_terminated( self, current_frame: numpy.ndarray, recent_frames: Optional[numpy.ndarray]) -> bool:
38    def determine_terminated(
39        self, current_frame: np.ndarray, recent_frames: Optional[np.ndarray]
40    ) -> bool:
41        all_frames = [current_frame]
42        if recent_frames is not None:
43            all_frames = recent_frames
44        for frame in all_frames:
45            self.state_parser: RunesOfVirtueStateParser
46            if self.state_parser.is_in_menu(frame):
47                return True
48        return False

Determines whether the environment was terminated.

Parameters
  • current_frame: The current frame rendered by the emulator.
  • recent_frames: The stack of frames that were rendered during the last action. Shape is [n_frames, height, width, channels]. Can be None if rendering is disabled.
Returns

True if the environment was terminated, False otherwise.

class RunesOfVirtue1KingDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
51class RunesOfVirtue1KingDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
52    """Terminates when the king's dialog is on screen."""
53
54    REQUIRED_PARSER = RunesOfVirtueStateParser
55    _TERMINATION_NAMED_REGION = "playfield_indicator"
56    _TERMINATION_TARGET_NAME = "king_dialog"

Terminates when the king's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2ReadBookTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
59class RunesOfVirtue2ReadBookTerminateMetric(RegionMatchTerminationOnlyMetric):
60    """Terminates when an opened book is on screen."""
61
62    REQUIRED_PARSER = RunesOfVirtueStateParser
63    _TERMINATION_NAMED_REGION = "playfield_indicator"
64    _TERMINATION_TARGET_NAME = "book_open"

Terminates when an opened book is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2BlockedRoomEnteredTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
67class RunesOfVirtue2BlockedRoomEnteredTerminateMetric(
68    RegionMatchTerminationOnlyMetric
69):
70    """Terminates when the player has entered the blocked room."""
71
72    REQUIRED_PARSER = RunesOfVirtueStateParser
73    _TERMINATION_NAMED_REGION = "playfield_indicator"
74    _TERMINATION_TARGET_NAME = "blocked_room_entered"

Terminates when the player has entered the blocked room.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2NystulDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
77class RunesOfVirtue2NystulDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
78    """Terminates when Nystul's dialog is on screen."""
79
80    REQUIRED_PARSER = RunesOfVirtueStateParser
81    _TERMINATION_NAMED_REGION = "dialog_indicator"
82    _TERMINATION_TARGET_NAME = "nystul_dialog"

Terminates when Nystul's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2BlacksmithFailBuyShieldTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
85class RunesOfVirtue2BlacksmithFailBuyShieldTerminateMetric(
86    RegionMatchTerminationOnlyMetric
87):
88    """Terminates when the blacksmith's failed shield purchase dialog is on screen."""
89
90    REQUIRED_PARSER = RunesOfVirtueStateParser
91    _TERMINATION_NAMED_REGION = "dialog_indicator"
92    _TERMINATION_TARGET_NAME = "blacksmith_fail_buy_shield"

Terminates when the blacksmith's failed shield purchase dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2SherryMouseDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
 95class RunesOfVirtue2SherryMouseDialogTerminateMetric(
 96    RegionMatchTerminationOnlyMetric
 97):
 98    """Terminates when Sherry the mouse's dialog is on screen."""
 99
100    REQUIRED_PARSER = RunesOfVirtueStateParser
101    _TERMINATION_NAMED_REGION = "dialog_indicator"
102    _TERMINATION_TARGET_NAME = "sherry_mouse_dialog"

Terminates when Sherry the mouse's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2SandyCookDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
105class RunesOfVirtue2SandyCookDialogTerminateMetric(
106    RegionMatchTerminationOnlyMetric
107):
108    """Terminates when Sandy the cook's dialog is on screen."""
109
110    REQUIRED_PARSER = RunesOfVirtueStateParser
111    _TERMINATION_NAMED_REGION = "dialog_indicator"
112    _TERMINATION_TARGET_NAME = "sandy_cook_dialog"

Terminates when Sandy the cook's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2LordWhitsaberDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
115class RunesOfVirtue2LordWhitsaberDialogTerminateMetric(
116    RegionMatchTerminationOnlyMetric
117):
118    """Terminates when Lord Whitsaber's dialog is on screen."""
119
120    REQUIRED_PARSER = RunesOfVirtueStateParser
121    _TERMINATION_NAMED_REGION = "dialog_indicator"
122    _TERMINATION_TARGET_NAME = "lord_whitsaber_dialog"

Terminates when Lord Whitsaber's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CaveOfDishonourTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
125class RunesOfVirtue2CaveOfDishonourTerminateMetric(RegionMatchTerminationOnlyMetric):
126    """Terminates when the player has entered the Cave of Dishonour."""
127
128    REQUIRED_PARSER = RunesOfVirtueStateParser
129    _TERMINATION_NAMED_REGION = "playfield_indicator"
130    _TERMINATION_TARGET_NAME = "cave_of_dishonour"

Terminates when the player has entered the Cave of Dishonour.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
133class RunesOfVirtue2CavernOfHatredTerminateMetric(RegionMatchTerminationOnlyMetric):
134    """Terminates when the player has entered the Cavern of Hatred."""
135
136    REQUIRED_PARSER = RunesOfVirtueStateParser
137    _TERMINATION_NAMED_REGION = "playfield_indicator"
138    _TERMINATION_TARGET_NAME = "cavern_of_hatred"

Terminates when the player has entered the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CaveOfDishonourEnterFloor2TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
141class RunesOfVirtue2CaveOfDishonourEnterFloor2TerminateMetric(
142    RegionMatchTerminationOnlyMetric
143):
144    """Terminates when the player enters floor 2 in the Cave of Dishonour."""
145
146    REQUIRED_PARSER = RunesOfVirtueStateParser
147    _TERMINATION_NAMED_REGION = "playfield_indicator"
148    _TERMINATION_TARGET_NAME = "cave_of_dishonour_enter_floor_2"

Terminates when the player enters floor 2 in the Cave of Dishonour.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CaveOfDishonourEnterFloor3TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
151class RunesOfVirtue2CaveOfDishonourEnterFloor3TerminateMetric(
152    RegionMatchTerminationOnlyMetric
153):
154    """Terminates when the player enters floor 3 in the Cave of Dishonour."""
155
156    REQUIRED_PARSER = RunesOfVirtueStateParser
157    _TERMINATION_NAMED_REGION = "playfield_indicator"
158    _TERMINATION_TARGET_NAME = "cave_of_dishonour_enter_floor_3"

Terminates when the player enters floor 3 in the Cave of Dishonour.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2GrabCheeseFromKitchenTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
161class RunesOfVirtue2GrabCheeseFromKitchenTerminateMetric(
162    RegionMatchTerminationOnlyMetric
163):
164    """Terminates when the player grabs the cheese from the kitchen."""
165
166    REQUIRED_PARSER = RunesOfVirtueStateParser
167    _TERMINATION_NAMED_REGION = "playfield_indicator"
168    _TERMINATION_TARGET_NAME = "kitchen_cheese_grabbed"

Terminates when the player grabs the cheese from the kitchen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2GiveCheeseToSherryTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
171class RunesOfVirtue2GiveCheeseToSherryTerminateMetric(
172    RegionMatchTerminationOnlyMetric
173):
174    """Terminates when the player gives the cheese to Sherry."""
175
176    REQUIRED_PARSER = RunesOfVirtueStateParser
177    _TERMINATION_NAMED_REGION = "playfield_indicator"
178    _TERMINATION_TARGET_NAME = "cheese_given_to_sherry"

Terminates when the player gives the cheese to Sherry.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2ClimbLadderBehindLockedDoorTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
181class RunesOfVirtue2ClimbLadderBehindLockedDoorTerminateMetric(
182    RegionMatchTerminationOnlyMetric
183):
184    """Terminates when the player climbs the ladder behind the locked door."""
185
186    REQUIRED_PARSER = RunesOfVirtueStateParser
187    _TERMINATION_NAMED_REGION = "playfield_indicator"
188    _TERMINATION_TARGET_NAME = "ladder_behind_locked_door_climbed"

Terminates when the player climbs the ladder behind the locked door.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2InteractWithMapOnTableTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
191class RunesOfVirtue2InteractWithMapOnTableTerminateMetric(
192    RegionMatchTerminationOnlyMetric
193):
194    """Terminates when the player interacts with the map on the table."""
195
196    REQUIRED_PARSER = RunesOfVirtueStateParser
197    _TERMINATION_NAMED_REGION = "playfield_indicator"
198    _TERMINATION_TARGET_NAME = "table_map_interacted"

Terminates when the player interacts with the map on the table.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2FindLadderBackFromCastleTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
201class RunesOfVirtue2FindLadderBackFromCastleTerminateMetric(
202    RegionMatchTerminationOnlyMetric
203):
204    """Terminates when the player finds a ladder back from the castle."""
205
206    REQUIRED_PARSER = RunesOfVirtueStateParser
207    _TERMINATION_NAMED_REGION = "playfield_indicator"
208    _TERMINATION_TARGET_NAME = "castle_ladder_back_found"

Terminates when the player finds a ladder back from the castle.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2UnlockDoorAndSaveTholdenTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
211class RunesOfVirtue2UnlockDoorAndSaveTholdenTerminateMetric(
212    RegionMatchTerminationOnlyMetric
213):
214    """Terminates when the player unlocks the door and saves Tholden."""
215
216    REQUIRED_PARSER = RunesOfVirtueStateParser
217    _TERMINATION_NAMED_REGION = "dialog_indicator"
218    _TERMINATION_TARGET_NAME = "tholden_saved"

Terminates when the player unlocks the door and saves Tholden.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2FindLadderOutOfCavernOfHatredTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
221class RunesOfVirtue2FindLadderOutOfCavernOfHatredTerminateMetric(
222    RegionMatchTerminationOnlyMetric
223):
224    """Terminates when the player finds a ladder out of the Cavern of Hatred."""
225
226    REQUIRED_PARSER = RunesOfVirtueStateParser
227    _TERMINATION_NAMED_REGION = "left_playfield_indicator"
228    _TERMINATION_TARGET_NAME = "cavern_of_hatred_ladder_out_found"

Terminates when the player finds a ladder out of the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2BringTholdenBackToKingTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
231class RunesOfVirtue2BringTholdenBackToKingTerminateMetric(
232    RegionMatchTerminationOnlyMetric
233):
234    """Terminates when the player brings Tholden back to the king."""
235
236    REQUIRED_PARSER = RunesOfVirtueStateParser
237    _TERMINATION_NAMED_REGION = "dialog_indicator"
238    _TERMINATION_TARGET_NAME = "tholden_brought_back_to_king"

Terminates when the player brings Tholden back to the king.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2AttendCastleCeremonyTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
241class RunesOfVirtue2AttendCastleCeremonyTerminateMetric(
242    RegionMatchTerminationOnlyMetric
243):
244    """Terminates when the player attends the ceremony in the castle."""
245
246    REQUIRED_PARSER = RunesOfVirtueStateParser
247    _TERMINATION_NAMED_REGION = "dialog_indicator"
248    _TERMINATION_TARGET_NAME = "castle_ceremony_attended"

Terminates when the player attends the ceremony in the castle.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredGate1UnlockedTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
251class RunesOfVirtue2CavernOfHatredGate1UnlockedTerminateMetric(
252    RegionMatchTerminationOnlyMetric
253):
254    """Terminates when the first Cavern of Hatred gate is unlocked."""
255
256    REQUIRED_PARSER = RunesOfVirtueStateParser
257    _TERMINATION_NAMED_REGION = "playfield_indicator"
258    _TERMINATION_TARGET_NAME = "cavern_of_hatred_gate_1_unlocked"

Terminates when the first Cavern of Hatred gate is unlocked.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredLadderRoom2TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
261class RunesOfVirtue2CavernOfHatredLadderRoom2TerminateMetric(
262    RegionMatchTerminationOnlyMetric
263):
264    """Terminates when the player enters the second ladder room in the Cavern of Hatred."""
265
266    REQUIRED_PARSER = RunesOfVirtueStateParser
267    _TERMINATION_NAMED_REGION = "playfield_indicator"
268    _TERMINATION_TARGET_NAME = "cavern_of_hatred_ladder_room_2"

Terminates when the player enters the second ladder room in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredLadder2TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
271class RunesOfVirtue2CavernOfHatredLadder2TerminateMetric(
272    RegionMatchTerminationOnlyMetric
273):
274    """Terminates when the player reaches the second ladder in the Cavern of Hatred."""
275
276    REQUIRED_PARSER = RunesOfVirtueStateParser
277    _TERMINATION_NAMED_REGION = "playfield_indicator"
278    _TERMINATION_TARGET_NAME = "cavern_of_hatred_ladder_2"

Terminates when the player reaches the second ladder in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredGrabKeyTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
281class RunesOfVirtue2CavernOfHatredGrabKeyTerminateMetric(
282    RegionMatchTerminationOnlyMetric
283):
284    """Terminates when the player grabs the key in the Cavern of Hatred."""
285
286    REQUIRED_PARSER = RunesOfVirtueStateParser
287    _TERMINATION_NAMED_REGION = "playfield_indicator"
288    _TERMINATION_TARGET_NAME = "cavern_of_hatred_grab_key"

Terminates when the player grabs the key in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredEnterFloor4TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
291class RunesOfVirtue2CavernOfHatredEnterFloor4TerminateMetric(
292    RegionMatchTerminationOnlyMetric
293):
294    """Terminates when the player enters floor 4 in the Cavern of Hatred."""
295
296    REQUIRED_PARSER = RunesOfVirtueStateParser
297    _TERMINATION_NAMED_REGION = "playfield_indicator"
298    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_4"

Terminates when the player enters floor 4 in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredEnterFloor5TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
301class RunesOfVirtue2CavernOfHatredEnterFloor5TerminateMetric(
302    RegionMatchTerminationOnlyMetric
303):
304    """Terminates when the player enters floor 5 in the Cavern of Hatred."""
305
306    REQUIRED_PARSER = RunesOfVirtueStateParser
307    _TERMINATION_NAMED_REGION = "playfield_indicator"
308    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_5"

Terminates when the player enters floor 5 in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredEnterFloor6TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
311class RunesOfVirtue2CavernOfHatredEnterFloor6TerminateMetric(
312    RegionMatchTerminationOnlyMetric
313):
314    """Terminates when the player enters floor 6 in the Cavern of Hatred."""
315
316    REQUIRED_PARSER = RunesOfVirtueStateParser
317    _TERMINATION_NAMED_REGION = "playfield_indicator"
318    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_6"

Terminates when the player enters floor 6 in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2CavernOfHatredEnterFloor7TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
321class RunesOfVirtue2CavernOfHatredEnterFloor7TerminateMetric(
322    RegionMatchTerminationOnlyMetric
323):
324    """Terminates when the player enters floor 7 in the Cavern of Hatred."""
325
326    REQUIRED_PARSER = RunesOfVirtueStateParser
327    _TERMINATION_NAMED_REGION = "playfield_indicator"
328    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_7"

Terminates when the player enters floor 7 in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue2DeathScreenTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
331class RunesOfVirtue2DeathScreenTerminateMetric(RegionMatchTerminationOnlyMetric):
332    """Terminates when the death / game over screen is on screen."""
333
334    REQUIRED_PARSER = RunesOfVirtueStateParser
335    _TERMINATION_NAMED_REGION = "death_screen_indicator"
336    _TERMINATION_TARGET_NAME = "death_screen"

Terminates when the death / game over screen is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1ChucklesDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
339class RunesOfVirtue1ChucklesDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
340    """Terminates when Chuckles's dialog is on screen."""
341
342    REQUIRED_PARSER = RunesOfVirtueStateParser
343    _TERMINATION_NAMED_REGION = "playfield_indicator"
344    _TERMINATION_TARGET_NAME = "chuckles_dialog"

Terminates when Chuckles's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1GnuGnu1DialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
347class RunesOfVirtue1GnuGnu1DialogTerminateMetric(RegionMatchTerminationOnlyMetric):
348    """Terminates when Gnu Gnu's 1st store dialog is on screen."""
349
350    REQUIRED_PARSER = RunesOfVirtueStateParser
351    _TERMINATION_NAMED_REGION = "playfield_indicator"
352    _TERMINATION_TARGET_NAME = "gnu_gnu_1_dialog"

Terminates when Gnu Gnu's 1st store dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1GnuGnu2DialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
355class RunesOfVirtue1GnuGnu2DialogTerminateMetric(RegionMatchTerminationOnlyMetric):
356    """Terminates when Gnu Gnu's 2nd store dialog is on screen."""
357
358    REQUIRED_PARSER = RunesOfVirtueStateParser
359    _TERMINATION_NAMED_REGION = "playfield_indicator"
360    _TERMINATION_TARGET_NAME = "gnu_gnu_2_dialog"

Terminates when Gnu Gnu's 2nd store dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1SherryDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
363class RunesOfVirtue1SherryDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
364    """Terminates when Sherry's dialog is on screen."""
365
366    REQUIRED_PARSER = RunesOfVirtueStateParser
367    _TERMINATION_NAMED_REGION = "playfield_indicator"
368    _TERMINATION_TARGET_NAME = "sherry_dialog"

Terminates when Sherry's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
371class RunesOfVirtue1CavernOfHatredTerminateMetric(RegionMatchTerminationOnlyMetric):
372    """Terminates when the player is inside the Cavern of Hatred."""
373
374    REQUIRED_PARSER = RunesOfVirtueStateParser
375    _TERMINATION_NAMED_REGION = "cave_indicator"
376    _TERMINATION_TARGET_NAME = "cavern_of_hatred"

Terminates when the player is inside the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfDeceitTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
379class RunesOfVirtue1CavernOfDeceitTerminateMetric(RegionMatchTerminationOnlyMetric):
380    """Terminates when the player is inside the Cavern of Deceit."""
381
382    REQUIRED_PARSER = RunesOfVirtueStateParser
383    _TERMINATION_NAMED_REGION = "cave_indicator"
384    _TERMINATION_TARGET_NAME = "cavern_of_deceit"

Terminates when the player is inside the Cavern of Deceit.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
387class RunesOfVirtue1CavernOfCowardiceTerminateMetric(
388    RegionMatchTerminationOnlyMetric
389):
390    """Terminates when the player is inside the Cavern of Cowardice."""
391
392    REQUIRED_PARSER = RunesOfVirtueStateParser
393    _TERMINATION_NAMED_REGION = "cave_indicator"
394    _TERMINATION_TARGET_NAME = "cavern_of_cowardice"

Terminates when the player is inside the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceEnterFloor2TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
397class RunesOfVirtue1CavernOfCowardiceEnterFloor2TerminateMetric(
398    RegionMatchTerminationOnlyMetric
399):
400    """Terminates when the player enters floor 2 of the Cavern of Cowardice."""
401
402    REQUIRED_PARSER = RunesOfVirtueStateParser
403    _TERMINATION_NAMED_REGION = "playfield_indicator"
404    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_enter_floor_2"

Terminates when the player enters floor 2 of the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceEnterFloor3TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
407class RunesOfVirtue1CavernOfCowardiceEnterFloor3TerminateMetric(
408    RegionMatchTerminationOnlyMetric
409):
410    """Terminates when the player enters floor 3 of the Cavern of Cowardice."""
411
412    REQUIRED_PARSER = RunesOfVirtueStateParser
413    _TERMINATION_NAMED_REGION = "playfield_indicator"
414    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_enter_floor_3"

Terminates when the player enters floor 3 of the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceFloor3ChestOpenedTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
417class RunesOfVirtue1CavernOfCowardiceFloor3ChestOpenedTerminateMetric(
418    RegionMatchTerminationOnlyMetric
419):
420    """Terminates when the player opens the floor 3 chest in the Cavern of Cowardice."""
421
422    REQUIRED_PARSER = RunesOfVirtueStateParser
423    _TERMINATION_NAMED_REGION = "playfield_indicator"
424    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_floor_3_chest_opened"

Terminates when the player opens the floor 3 chest in the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceEnterFloor4TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
427class RunesOfVirtue1CavernOfCowardiceEnterFloor4TerminateMetric(
428    RegionMatchTerminationOnlyMetric
429):
430    """Terminates when the player enters floor 4 of the Cavern of Cowardice."""
431
432    REQUIRED_PARSER = RunesOfVirtueStateParser
433    _TERMINATION_NAMED_REGION = "top_playfield_indicator"
434    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_enter_floor_4"

Terminates when the player enters floor 4 of the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceSherryFloor4DialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
437class RunesOfVirtue1CavernOfCowardiceSherryFloor4DialogTerminateMetric(
438    RegionMatchTerminationOnlyMetric
439):
440    """Terminates when Sherry's floor 4 dialog is on screen in the Cavern of Cowardice."""
441
442    REQUIRED_PARSER = RunesOfVirtueStateParser
443    _TERMINATION_NAMED_REGION = "playfield_indicator"
444    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_sherry_floor_4_dialog"

Terminates when Sherry's floor 4 dialog is on screen in the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceTakeStewFloor4TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
447class RunesOfVirtue1CavernOfCowardiceTakeStewFloor4TerminateMetric(
448    RegionMatchTerminationOnlyMetric
449):
450    """Terminates when the player takes stew on floor 4 of the Cavern of Cowardice."""
451
452    REQUIRED_PARSER = RunesOfVirtueStateParser
453    _TERMINATION_NAMED_REGION = "playfield_indicator"
454    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_take_stew_floor_4"

Terminates when the player takes stew on floor 4 of the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfCowardiceObtainCoinFloor4TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
457class RunesOfVirtue1CavernOfCowardiceObtainCoinFloor4TerminateMetric(
458    RegionMatchTerminationOnlyMetric
459):
460    """Terminates when the player obtains the coin on floor 4 of the Cavern of Cowardice."""
461
462    REQUIRED_PARSER = RunesOfVirtueStateParser
463    _TERMINATION_NAMED_REGION = "playfield_indicator"
464    _TERMINATION_TARGET_NAME = "cavern_of_cowardice_obtain_coin_floor_4"

Terminates when the player obtains the coin on floor 4 of the Cavern of Cowardice.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1DrCatDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
467class RunesOfVirtue1DrCatDialogTerminateMetric(RegionMatchTerminationOnlyMetric):
468    """Terminates when Dr. Cat's dialog is on screen."""
469
470    REQUIRED_PARSER = RunesOfVirtueStateParser
471    _TERMINATION_NAMED_REGION = "playfield_indicator"
472    _TERMINATION_TARGET_NAME = "dr_cat_dialog"

Terminates when Dr. Cat's dialog is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1DrCatCatsLairDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
475class RunesOfVirtue1DrCatCatsLairDialogTerminateMetric(
476    RegionMatchTerminationOnlyMetric
477):
478    """Terminates when Dr. Cat's dialog is on screen in the Cat's Lair."""
479
480    REQUIRED_PARSER = RunesOfVirtueStateParser
481    _TERMINATION_NAMED_REGION = "playfield_indicator"
482    _TERMINATION_TARGET_NAME = "dr_cat_cats_lair_dialog"

Terminates when Dr. Cat's dialog is on screen in the Cat's Lair.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1ShipRiddenTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
485class RunesOfVirtue1ShipRiddenTerminateMetric(RegionMatchTerminationOnlyMetric):
486    """Terminates when the player is riding the ship."""
487
488    REQUIRED_PARSER = RunesOfVirtueStateParser
489    _TERMINATION_NAMED_REGION = "playfield_indicator"
490    _TERMINATION_TARGET_NAME = "ship_ridden"

Terminates when the player is riding the ship.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1BasementLadderUnlockedTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
493class RunesOfVirtue1BasementLadderUnlockedTerminateMetric(
494    RegionMatchTerminationOnlyMetric
495):
496    """Terminates when the player unlocks the basement ladder."""
497
498    REQUIRED_PARSER = RunesOfVirtueStateParser
499    _TERMINATION_NAMED_REGION = "playfield_indicator"
500    _TERMINATION_TARGET_NAME = "basement_ladder_unlocked"

Terminates when the player unlocks the basement ladder.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1BasementChestOpenedTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
503class RunesOfVirtue1BasementChestOpenedTerminateMetric(
504    RegionMatchTerminationOnlyMetric
505):
506    """Terminates when the player opens the basement chest."""
507
508    REQUIRED_PARSER = RunesOfVirtueStateParser
509    _TERMINATION_NAMED_REGION = "playfield_indicator"
510    _TERMINATION_TARGET_NAME = "basement_chest_opened"

Terminates when the player opens the basement chest.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredEnterFloor2TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
513class RunesOfVirtue1CavernOfHatredEnterFloor2TerminateMetric(
514    RegionMatchTerminationOnlyMetric
515):
516    """Terminates when the player enters floor 2 of the Cavern of Hatred."""
517
518    REQUIRED_PARSER = RunesOfVirtueStateParser
519    _TERMINATION_NAMED_REGION = "playfield_indicator"
520    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_2"

Terminates when the player enters floor 2 of the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredSherryFloor2DialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
523class RunesOfVirtue1CavernOfHatredSherryFloor2DialogTerminateMetric(
524    RegionMatchTerminationOnlyMetric
525):
526    """Terminates when Sherry's floor 2 dialog is on screen in the Cavern of Hatred."""
527
528    REQUIRED_PARSER = RunesOfVirtueStateParser
529    _TERMINATION_NAMED_REGION = "playfield_indicator"
530    _TERMINATION_TARGET_NAME = "cavern_of_hatred_sherry_floor_2_dialog"

Terminates when Sherry's floor 2 dialog is on screen in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredChooseDoorWithSherryTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
533class RunesOfVirtue1CavernOfHatredChooseDoorWithSherryTerminateMetric(
534    RegionMatchTerminationOnlyMetric
535):
536    """Terminates when Sherry asks the player to choose a door in the Cavern of Hatred."""
537
538    REQUIRED_PARSER = RunesOfVirtueStateParser
539    _TERMINATION_NAMED_REGION = "playfield_indicator"
540    _TERMINATION_TARGET_NAME = "cavern_of_hatred_choose_door_with_sherry"

Terminates when Sherry asks the player to choose a door in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredChooseRightDoorMelissaDialogTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
543class RunesOfVirtue1CavernOfHatredChooseRightDoorMelissaDialogTerminateMetric(
544    RegionMatchTerminationOnlyMetric
545):
546    """Terminates when Melissa's dialog is on screen after choosing the right door."""
547
548    REQUIRED_PARSER = RunesOfVirtueStateParser
549    _TERMINATION_NAMED_REGION = "playfield_indicator"
550    _TERMINATION_TARGET_NAME = "cavern_of_hatred_choose_right_door_melissa_dialog"

Terminates when Melissa's dialog is on screen after choosing the right door.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredEnterFloor3TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
553class RunesOfVirtue1CavernOfHatredEnterFloor3TerminateMetric(
554    RegionMatchTerminationOnlyMetric
555):
556    """Terminates when the player enters floor 3 of the Cavern of Hatred."""
557
558    REQUIRED_PARSER = RunesOfVirtueStateParser
559    _TERMINATION_NAMED_REGION = "playfield_indicator"
560    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_3"

Terminates when the player enters floor 3 of the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredEnterFloor4TerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
563class RunesOfVirtue1CavernOfHatredEnterFloor4TerminateMetric(
564    RegionMatchTerminationOnlyMetric
565):
566    """Terminates when the player enters floor 4 of the Cavern of Hatred."""
567
568    REQUIRED_PARSER = RunesOfVirtueStateParser
569    _TERMINATION_NAMED_REGION = "top_playfield_indicator"
570    _TERMINATION_TARGET_NAME = "cavern_of_hatred_enter_floor_4"

Terminates when the player enters floor 4 of the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1CavernOfHatredChestFloor1OpenedTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
573class RunesOfVirtue1CavernOfHatredChestFloor1OpenedTerminateMetric(
574    RegionMatchTerminationOnlyMetric
575):
576    """Terminates when the player opens the floor 1 chest in the Cavern of Hatred."""
577
578    REQUIRED_PARSER = RunesOfVirtueStateParser
579    _TERMINATION_NAMED_REGION = "playfield_indicator"
580    _TERMINATION_TARGET_NAME = "cavern_of_hatred_chest_floor_1_opened"

Terminates when the player opens the floor 1 chest in the Cavern of Hatred.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1TelescopeViewTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
583class RunesOfVirtue1TelescopeViewTerminateMetric(RegionMatchTerminationOnlyMetric):
584    """Terminates when the telescope view is on screen."""
585
586    REQUIRED_PARSER = RunesOfVirtueStateParser
587    _TERMINATION_NAMED_REGION = "telescope_view_indicator"
588    _TERMINATION_TARGET_NAME = "telescope_view"

Terminates when the telescope view is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.

class RunesOfVirtue1DeathScreenTerminateMetric(gameboy_worlds.emulation.tracker.RegionMatchTerminationOnlyMetric):
591class RunesOfVirtue1DeathScreenTerminateMetric(RegionMatchTerminationOnlyMetric):
592    """Terminates when the death / game over screen is on screen."""
593
594    REQUIRED_PARSER = RunesOfVirtueStateParser
595    _TERMINATION_NAMED_REGION = "death_screen_indicator"
596    _TERMINATION_TARGET_NAME = "death_screen"

Terminates when the death / game over screen is on screen.

The StateParser which implements the minimum required functionality for this MetricGroup to work.