Skip to content

Commit

Permalink
Belly lost per turn
Browse files Browse the repository at this point in the history
  • Loading branch information
theCapypara committed Jun 11, 2021
1 parent 4fa928c commit 4090868
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 44 deletions.
113 changes: 69 additions & 44 deletions skytemple/module/lists/controller/misc_settings.glade
Expand Up @@ -52,7 +52,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<!-- n-columns=2 n-rows=17 -->
<!-- n-columns=2 n-rows=18 -->
<object class="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
Expand Down Expand Up @@ -111,7 +111,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">9</property>
<property name="top-attach">10</property>
<property name="width">2</property>
</packing>
</child>
Expand All @@ -129,7 +129,7 @@
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">13</property>
<property name="top-attach">14</property>
<property name="width">2</property>
</packing>
</child>
Expand Down Expand Up @@ -248,7 +248,7 @@ Exclusive Move-User:</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">14</property>
<property name="top-attach">15</property>
</packing>
</child>
<child>
Expand All @@ -262,7 +262,7 @@ Item Master:</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">15</property>
<property name="top-attach">16</property>
</packing>
</child>
<child>
Expand All @@ -274,7 +274,7 @@ Item Master:</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">14</property>
<property name="top-attach">15</property>
</packing>
</child>
<child>
Expand All @@ -286,7 +286,7 @@ Item Master:</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">15</property>
<property name="top-attach">16</property>
</packing>
</child>
<child>
Expand All @@ -295,21 +295,7 @@ Item Master:</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Belly points lost when
walking through walls:</property>
<property name="justify">right</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">1/1000 belly points lost when
walking through walls:</property>
walking through walls, per turn:</property>
<property name="justify">right</property>
</object>
<packing>
Expand All @@ -324,18 +310,6 @@ walking through walls:</property>
<property name="valign">center</property>
<signal name="changed" handler="on_entry_belly_lost_wtw_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry_belly_lost_wtw_1000">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
<signal name="changed" handler="on_entry_belly_lost_wtw_1000_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">7</property>
Expand All @@ -351,7 +325,7 @@ walking through walls:</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">16</property>
<property name="top-attach">17</property>
</packing>
</child>
<child>
Expand All @@ -363,7 +337,7 @@ walking through walls:</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">16</property>
<property name="top-attach">17</property>
</packing>
</child>
<child>
Expand All @@ -377,7 +351,7 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
Expand All @@ -389,7 +363,7 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
<property name="top-attach">9</property>
</packing>
</child>
<child>
Expand All @@ -402,7 +376,7 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">10</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
Expand All @@ -415,7 +389,7 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">11</property>
<property name="top-attach">12</property>
</packing>
</child>
<child>
Expand All @@ -428,7 +402,7 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">12</property>
<property name="top-attach">13</property>
</packing>
</child>
<child>
Expand All @@ -440,7 +414,7 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">10</property>
<property name="top-attach">11</property>
</packing>
</child>
<child>
Expand All @@ -452,7 +426,7 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">11</property>
<property name="top-attach">12</property>
</packing>
</child>
<child>
Expand All @@ -464,7 +438,58 @@ a move's power by 3 (%):</property>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">12</property>
<property name="top-attach">13</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">Belly points lost, per turn:</property>
<property name="justify">right</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry_belly_lost">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
<signal name="changed" handler="on_entry_belly_lost_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">6</property>
</packing>
</child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">end</property>
<property name="label" translatable="yes">1/1000 belly points lost when
walking through walls, per turn:</property>
<property name="justify">right</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">8</property>
</packing>
</child>
<child>
<object class="GtkEntry" id="entry_belly_lost_wtw_1000">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="valign">center</property>
<signal name="changed" handler="on_entry_belly_lost_wtw_1000_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">8</property>
</packing>
</child>
</object>
Expand Down
10 changes: 10 additions & 0 deletions skytemple/module/lists/controller/misc_settings.py
Expand Up @@ -84,6 +84,15 @@ def on_entry_stolen_spawn_delay_changed(self, widget, *args):
self.module.project.modify_binary(BinaryName.OVERLAY_10, lambda bin: HardcodedSpawnRate.set_stolen_spawn_rate(val, bin, static_data))
self.module.mark_misc_settings_as_modified()

def on_entry_belly_lost_changed(self, widget, *args):
try:
val = float(widget.get_text())
except ValueError:
return
static_data = self.module.project.get_rom_module().get_static_data()
self.module.project.modify_binary(BinaryName.OVERLAY_29, lambda bin: HardcodedDungeonMisc.set_belly_loss_turn(val, bin, static_data))
self.module.mark_misc_settings_as_modified()

def on_entry_belly_lost_wtw_changed(self, widget, *args):
try:
val = int(widget.get_text())
Expand Down Expand Up @@ -184,6 +193,7 @@ def _init_values(self):
self.builder.get_object('cb_main_menu_music').set_active(HardcodedMainMenuMusic.get_main_menu_music(ov00, static_data))
self.builder.get_object('entry_normal_spawn_delay').set_text(str(HardcodedSpawnRate.get_normal_spawn_rate(ov10, static_data)))
self.builder.get_object('entry_stolen_spawn_delay').set_text(str(HardcodedSpawnRate.get_stolen_spawn_rate(ov10, static_data)))
self.builder.get_object('entry_belly_lost').set_text(str(HardcodedDungeonMisc.get_belly_loss_turn(ov29, static_data)))
self.builder.get_object('entry_belly_lost_wtw').set_text(str(HardcodedDungeonMisc.get_belly_loss_walk_through_walls(ov29, static_data)))
self.builder.get_object('entry_belly_lost_wtw_1000').set_text(str(HardcodedDungeonMisc.get_belly_loss_1000ile_walk_through_walls(ov29, static_data)))
self.builder.get_object('entry_ginseng_3_chance').set_text(str(HardcodedDungeonMisc.get_ginseng_increase_by_3_chance(ov10, static_data)))
Expand Down

0 comments on commit 4090868

Please sign in to comment.