Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
PFGimenez committed Mar 5, 2019
1 parent 19c6f32 commit 0c14bac
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions 1rl.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ def main():

# scheduling
turns = sch.Scheduling()
turns.add_turn(0, const.TurnType.MSG, log.Msg("Go! You have 7 days left.", const.desat_green))
turns.add_turn(0, const.TurnType.MSG, log.Msg("They say the hardest part is actually choosing to make a game. So I guess I've already won?", const.desat_green))
turns.add_turn(3600*24, const.TurnType.MSG, log.Msg("You have 6 days left.", const.desat_green))
turns.add_turn(3600*24*2, const.TurnType.MSG, log.Msg("You have 5 days left. Keep going.", const.desat_green))
turns.add_turn(3600*24*3, const.TurnType.MSG, log.Msg("You have 4 days left. Remember to sleep correctly.", const.desat_orange))
turns.add_turn(3600*24*4, const.TurnType.MSG, log.Msg("You have 3 days left. That's less than half a week...", const.desat_orange))
turns.add_turn(3600*24*5, const.TurnType.MSG, log.Msg("You have 2 days left. Don't panic.", const.desat_orange))
turns.add_turn(3600*24*6, const.TurnType.MSG, log.Msg("You have 1 day left. Ok, it's maybe time to panic.", const.desat_red))
turns.add_turn(3600*24*6.5, const.TurnType.MSG, log.Msg("Only 12 hours left! You need to finish it now!", const.desat_red))
turns.add_turn(3600*24*6, const.TurnType.MSG, log.Msg("You have 1 day left. OK, maybe it's time to panic.", const.desat_red))
turns.add_turn(3600*24*6.5, const.TurnType.MSG, log.Msg("Only 12 hours left! You need to finish this now!", const.desat_red))
turns.add_turn(3600*24*7 - 3600, const.TurnType.MSG, log.Msg("1 hour left! Quick!", const.desat_red))
turns.add_turn(0, const.TurnType.PLAYER, player)
turns.add_turn(3600*24*7, const.TurnType.GAME_OVER, None)
Expand Down
2 changes: 1 addition & 1 deletion constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class MenuState(enum.Enum):
monster_success_rate = [0.7, 0.75, 0.8]
n_bugs_max = [[10,0,0],[15,2,0],[20,2,1]]

intro_strings = ["Welcome to 1RL","","You have 7 days to create", "your first roguelike!","","Complete your game by choosing its features","","Beware: unstable features generate bugs!","","Find the good combination of features", "and weapon ego", "", "Press ? to get command help"]
intro_strings = ["Welcome to 1RL","","You have 7 days to create", "your first roguelike!","","Complete your game by choosing its features.","","Beware: unstable features generate bugs!","","Find the good combination of feature", "and weapon egos.", "", "With stable features comes better resistance!", "", "Press ? to get command help."]
help_adjust = 35
help_adjust_name = 20
help_strings = ["Commands","",\
Expand Down
2 changes: 1 addition & 1 deletion entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def attack(self, player, turns):
if random.random() < self.success_rate:
r = player.resistances[self.fslot]
mul = const.resistance_mul[min(len(const.resistance_mul)-1, r)]
delta_malus = round(self.atk*r)
delta_malus = round(self.atk*mul)
return {"dmg": delta_malus}
else:
return {}
Expand Down
2 changes: 1 addition & 1 deletion game_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def make_map_bsp(self, turns, entities, player):
if turns.is_boss_ready():
(x, y) = self.random_cell()
self.place_boss_stairs(x,y)
self.place_boss_stairs(player.x,player.y) # TODO
# self.place_boss_stairs(player.x,player.y) # TODO
self.add_loot(turns, player, entities)
self.recompute_fov(player.x, player.y)

Expand Down
7 changes: 5 additions & 2 deletions render.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def render_popup(root_console, popup_panel, map_width, map_height, strings):
for s in strings:
tcod.console_print_ex(popup_panel, int(popup_panel.width / 2), y, tcod.BKGND_NONE, tcod.CENTER, s)
y += 1
popup_panel.blit(dest=root_console, dest_x = int(map_width/6), dest_y=int(map_height/6), bg_alpha=0.7)
popup_panel.blit(dest=root_console, dest_x = int(map_width/6), dest_y=int(map_height/6), bg_alpha=0.8)

def render_boss_hp(root_console, des_panel, map_height, boss):
"""
Expand Down Expand Up @@ -131,7 +131,10 @@ def render_sch(root_console, sch_panel, turns, map_width):
w = sch_panel.width
tcod.console_set_default_foreground(sch_panel, const.base0)
sch_panel.print_frame(0, 0, w, 3, string="Remaining time")
# tcod.console_set_default_foreground(sch_panel, const.red)
if remaining_d <= 1:
tcod.console_set_default_foreground(sch_panel, const.red)
elif remaining_d <= 3:
tcod.console_set_default_foreground(sch_panel, const.orange)
sch_panel.print_(int(w / 2), 1, str(remaining_d)+"d "+str(remaining_h)+"h "+str(remaining_m)+"m "+str(remaining_s)+"s", alignment=tcod.CENTER)
sch_panel.blit(dest=root_console, dest_x=map_width)

Expand Down
4 changes: 2 additions & 2 deletions scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def get_turn(self):
def is_boss_ready(self):
remaining = 7*24*60*60 - self.current_date
remaining_d = int(remaining / (24*60*60))
return True # TODO
# return remaining_d <= 2
# return True # TODO
return remaining_d <= 2

def get_remaining(self):
remaining = 7*24*60*60 - self.current_date
Expand Down

0 comments on commit 0c14bac

Please sign in to comment.