Skip to content

Commit

Permalink
reserved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
wylyandrews committed Feb 8, 2020
2 parents 4fcfb96 + ae0e1f5 commit d336278
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 39 deletions.
1 change: 1 addition & 0 deletions game/common/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class DisasterLevel:
level_one = 1
level_two = 2
level_three = 3
level_four = 4


class EventType:
Expand Down
63 changes: 42 additions & 21 deletions game/common/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,22 @@ class GameStats:
DisasterLevel.level_zero: 400,
DisasterLevel.level_one: 800,
DisasterLevel.level_two: 1350,
DisasterLevel.level_three: 2200
DisasterLevel.level_three: 2200,
DisasterLevel.level_four: 2200,
},
DisasterType.blizzard: {
DisasterLevel.level_zero: 600,
DisasterLevel.level_one: 1350,
DisasterLevel.level_two: 2025,
DisasterLevel.level_three: 3300
DisasterLevel.level_three: 3300,
DisasterLevel.level_four: 3300,
},
DisasterType.monster: {
DisasterLevel.level_zero: 800,
DisasterLevel.level_one: 1800,
DisasterLevel.level_two: 3300,
DisasterLevel.level_three: 5600
DisasterLevel.level_three: 5600,
DisasterLevel.level_four: 5600,
},
}

Expand All @@ -116,37 +119,43 @@ class GameStats:
DisasterLevel.level_zero: 1,
DisasterLevel.level_one: 1,
DisasterLevel.level_two: 1,
DisasterLevel.level_three: 1
DisasterLevel.level_three: 1,
DisasterLevel.level_four: 2,
},
DisasterType.tornado: {
DisasterLevel.level_zero: 25,
DisasterLevel.level_one: 50,
DisasterLevel.level_two: 75,
DisasterLevel.level_three: 100
DisasterLevel.level_three: 100,
DisasterLevel.level_four: 150,
},
DisasterType.blizzard: {
DisasterLevel.level_zero: 3,
DisasterLevel.level_one: 3,
DisasterLevel.level_two: 3,
DisasterLevel.level_three: 3
DisasterLevel.level_three: 3,
DisasterLevel.level_four: 6,
},
DisasterType.earthquake: {
DisasterLevel.level_zero: 50,
DisasterLevel.level_one: 100,
DisasterLevel.level_two: 200,
DisasterLevel.level_three: 300
DisasterLevel.level_three: 300,
DisasterLevel.level_four: 400,
},
DisasterType.monster: {
DisasterLevel.level_zero: 10,
DisasterLevel.level_one: 10,
DisasterLevel.level_two: 10,
DisasterLevel.level_three: 10
DisasterLevel.level_three: 10,
DisasterLevel.level_four: 20,
},
DisasterType.ufo: {
DisasterLevel.level_zero: 50,
DisasterLevel.level_one: 100,
DisasterLevel.level_two: 200,
DisasterLevel.level_three: 400
DisasterLevel.level_three: 400,
DisasterLevel.level_four: 698,
},
}

Expand All @@ -156,37 +165,43 @@ class GameStats:
DisasterLevel.level_zero: 2,
DisasterLevel.level_one: 2,
DisasterLevel.level_two: 2,
DisasterLevel.level_three: 2
DisasterLevel.level_three: 2,
DisasterLevel.level_four: 4,
},
DisasterType.tornado: {
DisasterLevel.level_zero: 12,
DisasterLevel.level_one: 25,
DisasterLevel.level_two: 37,
DisasterLevel.level_three: 50
DisasterLevel.level_three: 50,
DisasterLevel.level_four: 75,
},
DisasterType.blizzard: {
DisasterLevel.level_zero: 6,
DisasterLevel.level_one: 6,
DisasterLevel.level_two: 6,
DisasterLevel.level_three: 6
DisasterLevel.level_three: 6,
DisasterLevel.level_four: 12,
},
DisasterType.earthquake: {
DisasterLevel.level_zero: 25,
DisasterLevel.level_one: 50,
DisasterLevel.level_two: 100,
DisasterLevel.level_three: 150
DisasterLevel.level_three: 150,
DisasterLevel.level_four: 250
},
DisasterType.monster: {
DisasterLevel.level_zero: 5,
DisasterLevel.level_one: 5,
DisasterLevel.level_two: 5,
DisasterLevel.level_three: 5
DisasterLevel.level_three: 5,
DisasterLevel.level_four: 10,
},
DisasterType.ufo: {
DisasterLevel.level_zero: 100,
DisasterLevel.level_one: 200,
DisasterLevel.level_two: 400,
DisasterLevel.level_three: 800
DisasterLevel.level_three: 800,
DisasterLevel.level_four: 1396,
},
}

Expand All @@ -196,37 +211,43 @@ class GameStats:
DisasterLevel.level_zero: 0,
DisasterLevel.level_one: 250,
DisasterLevel.level_two: 500,
DisasterLevel.level_three: 750
DisasterLevel.level_three: 750,
DisasterLevel.level_four: 1300,
},
DisasterType.tornado: {
DisasterLevel.level_zero: 0,
DisasterLevel.level_one: 300,
DisasterLevel.level_two: 600,
DisasterLevel.level_three: 900
DisasterLevel.level_three: 900,
DisasterLevel.level_four: 1400,
},
DisasterType.blizzard: {
DisasterLevel.level_zero: 0,
DisasterLevel.level_one: 500,
DisasterLevel.level_two: 750,
DisasterLevel.level_three: 1000
DisasterLevel.level_three: 1000,
DisasterLevel.level_four: 1475,
},
DisasterType.earthquake: {
DisasterLevel.level_zero: 0,
DisasterLevel.level_one: 550,
DisasterLevel.level_two: 850,
DisasterLevel.level_three: 1150
DisasterLevel.level_three: 1150,
DisasterLevel.level_four: 1550,
},
DisasterType.monster: {
DisasterLevel.level_zero: 0,
DisasterLevel.level_one: 750,
DisasterLevel.level_two: 1000,
DisasterLevel.level_three: 1250
DisasterLevel.level_three: 1250,
DisasterLevel.level_four: 1625,
},
DisasterType.ufo: {
DisasterLevel.level_zero: 0,
DisasterLevel.level_one: 800,
DisasterLevel.level_two: 1100,
DisasterLevel.level_three: 1400
DisasterLevel.level_three: 1400,
DisasterLevel.level_four: 1700,
},
}

Expand Down
4 changes: 3 additions & 1 deletion game/utils/generate_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ def generate():
for turn, info in disaster_rates.items():
for disaster in info['disasters']:
level = DisasterLevel.level_zero
if turn >= GameStats.disaster_level_markers[disaster][DisasterLevel.level_three]:
if turn >= GameStats.disaster_level_markers[disaster][DisasterLevel.level_four]:
level = DisasterLevel.level_four
elif turn >= GameStats.disaster_level_markers[disaster][DisasterLevel.level_three]:
level = DisasterLevel.level_three
elif turn >= GameStats.disaster_level_markers[disaster][DisasterLevel.level_two]:
level = DisasterLevel.level_two
Expand Down
Binary file added game/visualizer/assets/forecast_assets/pluto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 8 additions & 11 deletions game/visualizer/forecast_sprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, turn, display_size, log_parser, assets):

# Forecast Holder
fore_sprite = self.images['forecast_hold']
fore_sprite.position = 660, 662
fore_sprite.position = 640, 662
self.add(fore_sprite)

# Generates list of future and past turns given the current turn and saves it as 'forecast'
Expand Down Expand Up @@ -44,11 +44,11 @@ def __init__(self, turn, display_size, log_parser, assets):
if item == 0 and key is "5":
spr = self.images['ufo'][i]
if self.turn < 2:
spr.position = self.display[0]/2+(i+3)*64-172, self.display[1]-50
spr.position = self.display[0]/2+(i+3)*64-192, self.display[1]-50
elif self.turn < 3:
spr.position = self.display[0]/2+(i+2)*64-172, self.display[1]-50
spr.position = self.display[0]/2+(i+2)*64-192, self.display[1]-50
else:
spr.position = self.display[0]/2+(i+1)*64-172, self.display[1]-50
spr.position = self.display[0]/2+(i+1)*64-192, self.display[1]-50
self.add(spr)


Expand All @@ -75,13 +75,10 @@ def __init__(self, turn, display_size, log_parser, assets):
spr = self.images['gold'][i]
elif level == 3:
spr = self.images['uranium'][i]

if self.turn < 2:
spr.position = self.display[0] / 2 + (i + 3) * 64 - 172, self.display[1] - 72
elif self.turn < 3:
spr.position = self.display[0] / 2 + (i + 2) * 64 - 172, self.display[1] - 72
else:
spr.position = self.display[0] / 2 + (i + 1) * 64 - 150, self.display[1] - 72
elif level == 4:
spr = self.images['pluto'][i]

spr.position = self.display[0] / 2 + (i + 1) * 64 - 170, self.display[1] - 72
self.add(spr)

# 682, 648
8 changes: 3 additions & 5 deletions game/visualizer/input_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ def __init__(self):
)
self.speed_label.position = 1280 - 70, 16
self.add(self.speed_label)
self.speed_label.visible = False

def on_key_press(self, key, modifiers):
# Up arrow, increases playback speed
if key == 65362:
self.global_stats.turn_speed = max(0.25, self.global_stats.turn_speed - 0.25)
self.show_time_change()
self.update_speed_label()
# Down arrow, decreases playback speed
elif key == 65364:
self.global_stats.turn_speed = min(4, self.global_stats.turn_speed + 0.25)
self.show_time_change()
self.update_speed_label()
# Z key, skip to end screen
elif key == 122:
self.global_stats.turn_num = -1

def show_time_change(self):
def update_speed_label(self):
self.speed_label.element.text = f'{1/self.global_stats.turn_speed:.2f}x'
self.speed_label.visible = True
3 changes: 3 additions & 0 deletions game/visualizer/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,20 @@ def load(temp, section=1):
assets['disaster_level']['silver'] = list()
assets['disaster_level']['gold'] = list()
assets['disaster_level']['uranium'] = list()
assets['disaster_level']['pluto'] = list()

for i in range(5):
# Disaster Level Assets
bronze = cocos.sprite.Sprite(find_image("game/visualizer/assets/forecast_assets/bronze.png"))
silver = cocos.sprite.Sprite(find_image("game/visualizer/assets/forecast_assets/silver.png"))
gold = cocos.sprite.Sprite(find_image("game/visualizer/assets/forecast_assets/gold.png"))
uranium = cocos.sprite.Sprite(find_image("game/visualizer/assets/forecast_assets/uranium.png"))
pluto = cocos.sprite.Sprite(find_image("game/visualizer/assets/forecast_assets/pluto.png"))
assets['disaster_level']['bronze'].append(bronze)
assets['disaster_level']['silver'].append(silver)
assets['disaster_level']['gold'].append(gold)
assets['disaster_level']['uranium'].append(uranium)
assets['disaster_level']['pluto'].append(pluto)

elif section == 9:
clean_up()
Expand Down
2 changes: 1 addition & 1 deletion wrapper/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v = '1.0.5'
v = '1.1.0'

0 comments on commit d336278

Please sign in to comment.