@@ -572,7 +572,7 @@ init -20 python in mas_island_event:
572572 )
573573 )
574574 IslandsDataDefinition(
575- " decal_house" ,
575+ " decal_house" ,# FIXME: clear and snow sprites appear to be of different sizes
576576 partial_disp = functools.partial(
577577 ParallaxDecal,
578578 x = 215 ,
@@ -744,6 +744,80 @@ init -20 python in mas_island_event:
744744 # on_click=True
745745 )
746746 )
747+ # D25 specific deco
748+ IslandsDataDefinition(
749+ " decal_bookshelf_lantern" ,
750+ filenames = (" d" , " n" , " s" ),
751+ partial_disp = functools.partial(
752+ ParallaxDecal,
753+ x = 387 ,
754+ y = 47 ,
755+ z = 7 ,
756+ on_click = True
757+ )
758+ )
759+ IslandsDataDefinition(
760+ " decal_circle_garland" ,
761+ filenames = (" d" , " n" , " s" ),
762+ partial_disp = functools.partial(
763+ ParallaxDecal,
764+ x = 234 ,
765+ y = 22 ,
766+ z = 2 ,
767+ on_click = True
768+ )
769+ )
770+ IslandsDataDefinition(
771+ " decal_hanging_lantern" ,
772+ filenames = (" d" , " n" , " s" ),
773+ partial_disp = functools.partial(
774+ ParallaxDecal,
775+ x = 210 ,
776+ y = 23 ,
777+ z = 2 ,
778+ on_click = True
779+ )
780+ )
781+ IslandsDataDefinition(
782+ " decal_rectangle_garland" ,
783+ filenames = (" d" , " n" , " s" ),
784+ partial_disp = functools.partial(
785+ ParallaxDecal,
786+ x = 320 ,
787+ y = 28 ,
788+ z = 2 ,
789+ on_click = True
790+ )
791+ )
792+ TREE_LIGHTS_FPS = (
793+ " other/tree_lights/d" ,
794+ " other/tree_lights/n_0" ,
795+ " other/tree_lights/n_1" ,
796+ " other/tree_lights/n_2" ,
797+ " other/tree_lights/s"
798+ )
799+ IslandsDataDefinition(
800+ " decal_tree_lights" ,
801+ fp_map = {},# TODO: move TREE_LIGHTS_FPS to fp_map
802+ partial_disp = functools.partial(
803+ ParallaxDecal,
804+ x = 140 ,
805+ y = - 168 ,
806+ z = 5 ,
807+ # on_click=True
808+ )
809+ )
810+ IslandsDataDefinition(
811+ " decal_wreath" ,
812+ filenames = (" d" , " n" , " s" ),
813+ partial_disp = functools.partial(
814+ ParallaxDecal,
815+ x = 294 ,
816+ y = 33 ,
817+ z = 2 ,
818+ on_click = True
819+ )
820+ )
747821
748822 # Objects
749823 IslandsDataDefinition(
@@ -1073,6 +1147,12 @@ init -25 python in mas_island_event:
10731147 (store.MASImageData(zip_file.read(fn), fn + " .png" ) for fn in GLITCH_FPS)
10741148 )
10751149
1150+ tree_lights_imgs = {}
1151+ for fn in TREE_LIGHTS_FPS:
1152+ k = fn.rpartition(" /" )[- 1 ]
1153+ raw_disp = store.MASImageData(zip_file.read(fn), fn + " .png" )
1154+ tree_lights_imgs[k] = raw_disp
1155+
10761156 # Audio is being loaded right away
10771157 isly_data = IslandsDataDefinition.getDataFor(" other_isly" )
10781158 if isly_data:
@@ -1086,7 +1166,15 @@ init -25 python in mas_island_event:
10861166
10871167 else :
10881168 # We loaded the images, now create dynamic displayables
1089- _build_displayables(island_map, decal_map, bg_map, overlay_map, interior_map, glitch_frames)
1169+ _build_displayables(
1170+ island_map,
1171+ decal_map,
1172+ bg_map,
1173+ overlay_map,
1174+ interior_map,
1175+ glitch_frames,
1176+ tree_lights_imgs
1177+ )
10901178
10911179 return True
10921180
@@ -1161,7 +1249,8 @@ init -25 python in mas_island_event:
11611249 bg_imgs_maps ,
11621250 overlay_imgs_maps ,
11631251 interior_imgs_map ,
1164- glitch_frames
1252+ glitch_frames ,
1253+ tree_lights_imgs
11651254 ):
11661255 """
11671256 Takes multiple maps with images and builds displayables from them, sets global vars
@@ -1175,6 +1264,8 @@ init -25 python in mas_island_event:
11751264 overlay_imgs_maps - the map from overlay ids to raw images map
11761265 interior_imgs_map - the map from the interior stuff to the raw images map
11771266 glitch_frames - tuple of glitch raw anim frames
1267+ tree_lights_imgs - map of images for the tree lights, format:
1268+ img_name: disp
11781269 """
11791270 global island_disp_map, decal_disp_map, other_disp_map
11801271 global bg_disp_map, overlay_disp_map, interior_disp_map
@@ -1245,6 +1336,23 @@ init -25 python in mas_island_event:
12451336 partial_disp = IslandsDataDefinition.getDataFor(" decal_glitch" ).partial_disp
12461337 decal_disp_map[" decal_glitch" ] = partial_disp(glitch_disp)
12471338
1339+ # Build tree lights disp
1340+ tree_lights_frames = tuple (
1341+ tree_lights_imgs.pop(" n_" + i)# don't need these in the map anymore
1342+ for i in " 012"
1343+ )
1344+ def _tree_lights_transform_func (transform , st , at ):
1345+ next_child = random.choice(tree_lights_frames)
1346+ transform .child = next_child
1347+ return 0.4
1348+
1349+ tree_lights_night_disp = Transform(child = tree_lights_frames[0 ], function = _tree_lights_transform_func)
1350+ tree_lights_imgs[" n" ] = tree_lights_night_disp
1351+
1352+ tree_lights_disp = _build_ifwd(tree_lights_imgs)
1353+ partial_disp = IslandsDataDefinition.getDataFor(" decal_tree_lights" ).partial_disp
1354+ decal_disp_map[" decal_tree_lights" ] = partial_disp(tree_lights_disp)
1355+
12481356 # Build chibi disp
12491357 partial_disp = IslandsDataDefinition.getDataFor(" other_shimeji" ).partial_disp
12501358 other_disp_map[" other_shimeji" ] = partial_disp()
@@ -1365,6 +1473,7 @@ init -25 python in mas_island_event:
13651473 _unlock(" other_shimeji" )
13661474 if not renpy.seen_label(" mas_monika_islands_final_reveal" ):
13671475 _unlock(" decal_glitch" )
1476+
13681477 _unlock(" decal_pumpkins" )
13691478 _unlock(" decal_skull" )
13701479
@@ -1383,23 +1492,33 @@ init -25 python in mas_island_event:
13831492 # This requires the 4th isld
13841493 if _is_unlocked(" island_4" ):
13851494 _unlock(" decal_bloodfall" )
1495+
13861496 # This requires the 5th isld
13871497 if _is_unlocked(" island_5" ):
13881498 _unlock(" decal_gravestones" )
13891499
13901500 def __unlocks_for_lvl_6 ():
13911501 _unlock(" decal_bushes" )
1502+
13921503 # Unlock everything from lvl 3
13931504 _unlock(" island_4" )
13941505 _unlock(" island_5" )
13951506
13961507 def __unlocks_for_lvl_7 ():
13971508 _unlock(" island_3" )
1509+
13981510 # Unlock only one, the rest at lvl 7
13991511 _unlock_one(" decal_bookshelf" , " decal_tree" )
1512+
14001513 # These require the tree
14011514 if _is_unlocked(" decal_tree" ):
14021515 _unlock_one(* (" decal_ghost_" + i for i in " 012" ))
1516+ _unlock(" decal_tree_lights" )
1517+
1518+ # This requires the bookshelf
1519+ if _is_unlocked(" decal_bookshelf" ):
1520+ _unlock(" decal_bookshelf_lantern" )
1521+
14031522 # Unlock everything from lvl 4
14041523 _unlock(" island_7" )
14051524 _unlock(" island_6" )
@@ -1408,18 +1527,30 @@ init -25 python in mas_island_event:
14081527 # Unlock everything from lvl 7
14091528 _unlock(" decal_bookshelf" )
14101529 _unlock(" decal_tree" )
1530+
14111531 # These require the tree
14121532 for i in " 012" :
14131533 _unlock(" decal_haunted_tree_" + i)
1534+ _unlock(" decal_tree_lights" )
1535+
1536+ # This requires the bookshelf
1537+ _unlock(" decal_bookshelf_lantern" )
14141538
14151539 def _final_unlocks ():
14161540 # TODO: update monika_why_spaceroom
14171541 # NOTE: NO SANITY CHECKS, use carefully
14181542 _unlock(" other_isly" )
14191543 _unlock(" decal_house" )
1544+
14201545 # These requires the house
14211546 _unlock(" decal_jack" )
14221547 _unlock(" decal_webs" )
1548+ _unlock(" decal_circle_garland" )
1549+ _unlock(" decal_hanging_lantern" )
1550+ _unlock(" decal_rectangle_garland" )
1551+ _unlock(" decal_wreath" )
1552+
1553+ # This should be removed once we have the house
14231554 _lock(" decal_glitch" )
14241555
14251556 def __unlocks_for_lvl_9 ():
@@ -1602,6 +1733,7 @@ init -25 python in mas_island_event:
16021733 global SHIMEJI_CHANCE
16031734
16041735 enable_o31_deco = persistent._mas_o31_in_o31_mode and not is_winter_weather()
1736+ enable_d25_deco = persistent._mas_d25_in_d25_mode and is_winter_weather()
16051737
16061738 def _reset_parallax_disp (disp ):
16071739 # Just in case we always remove all decals and readd them as needed
@@ -1638,7 +1770,7 @@ init -25 python in mas_island_event:
16381770 )
16391771 )
16401772
1641- # Now add all unlocked O31 decals
1773+ # Add all unlocked O31 decals
16421774 if enable_o31_deco:
16431775 # Basic decals
16441776 isld_to_decals_map = {
@@ -1674,6 +1806,21 @@ init -25 python in mas_island_event:
16741806 if store.mas_current_background.isFltNight() and _is_unlocked(" decal_bloodfall" ):
16751807 island_disp_map[" island_4" ].add_decals(decal_disp_map[" decal_bloodfall" ])
16761808
1809+ # Add all unlocked D25 decals
1810+ if enable_d25_deco:
1811+ isld_1_d25_decals = (
1812+ " decal_bookshelf_lantern" ,
1813+ " decal_circle_garland" ,
1814+ " decal_hanging_lantern" ,
1815+ " decal_rectangle_garland" ,
1816+ " decal_tree_lights" ,
1817+ " decal_wreath"
1818+ )
1819+ island_disp_map[" island_1" ].add_decals(
1820+ * (decal_disp_map[key ] for key in isld_1_d25_decals if _is_unlocked(key ))
1821+ )
1822+
1823+ # Add chibi
16771824 if _is_unlocked(" other_shimeji" ) and random.random() <= SHIMEJI_CHANCE:
16781825 shimeji_disp = other_disp_map[" other_shimeji" ]
16791826 _reset_parallax_disp(shimeji_disp)
0 commit comments