Skip to content

Commit

Permalink
Added the deadline game mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ra314 committed Nov 5, 2021
1 parent 3169c04 commit 9076fef
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
23 changes: 23 additions & 0 deletions Scenes/UI/Help Menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ custom_fonts/font = ExtResource( 1 )
text = "Drain"
flat = true

[node name="Deadline" type="Button" parent="VBoxContainer/Menu Display/Game Modes/ScrollContainer/Game Modes"]
margin_top = 133.0
margin_right = 637.0
margin_bottom = 262.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 1 )
text = "Deadline"
flat = true

[node name="Blitzkrieg" type="Button" parent="VBoxContainer/Menu Display/Game Modes/ScrollContainer/Game Modes"]
margin_left = 641.0
margin_top = 133.0
Expand Down Expand Up @@ -301,6 +310,20 @@ __meta__ = {
"_edit_use_anchors_": false
}

[node name="Deadline" type="Label" parent="VBoxContainer/Menu Display/Game Modes/Control"]
visible = false
margin_right = 1920.0
margin_bottom = 477.0
size_flags_horizontal = 3
custom_styles/normal = ExtResource( 4 )
custom_fonts/font = ExtResource( 3 )
text = "Deadline:
The player with the most countries at the end of round 10 wins. The first player wins in the case of a tie."
autowrap = true
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Fatigue" type="Label" parent="VBoxContainer/Menu Display/Game Modes/Control"]
visible = false
margin_right = 1920.0
Expand Down
27 changes: 21 additions & 6 deletions Scenes/UI/Mode Select.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ __meta__ = {
}

[node name="Drain" type="CheckBox" parent="VBoxContainer/Control"]
margin_left = 960.0
margin_left = 1088.0
margin_top = 264.0
margin_right = 1371.0
margin_right = 1499.0
margin_bottom = 395.0
rect_scale = Vector2( 0.5, 0.5 )
custom_icons/checked = ExtResource( 5 )
Expand All @@ -109,10 +109,25 @@ __meta__ = {
"_edit_use_anchors_": false
}

[node name="Blitzkrieg" type="CheckBox" parent="VBoxContainer/Control"]
[node name="Deadline" type="CheckBox" parent="VBoxContainer/Control"]
margin_left = 704.0
margin_top = 264.0
margin_right = 1290.0
margin_bottom = 395.0
rect_scale = Vector2( 0.5, 0.5 )
custom_icons/checked = ExtResource( 5 )
custom_icons/unchecked = ExtResource( 6 )
custom_fonts/font = ExtResource( 3 )
text = "Deadline"
align = 1
__meta__ = {
"_edit_use_anchors_": false
}

[node name="Blitzkrieg" type="CheckBox" parent="VBoxContainer/Control"]
margin_left = 1088.0
margin_top = 392.0
margin_right = 1315.0
margin_right = 1699.0
margin_bottom = 523.0
rect_scale = Vector2( 0.5, 0.5 )
custom_icons/checked = ExtResource( 5 )
Expand Down Expand Up @@ -199,9 +214,9 @@ __meta__ = {
}

[node name="Congestion" type="CheckBox" parent="VBoxContainer/Control"]
margin_left = 1088.0
margin_left = 704.0
margin_top = 392.0
margin_right = 1802.0
margin_right = 1418.0
margin_bottom = 523.0
rect_scale = Vector2( 0.5, 0.5 )
custom_icons/checked = ExtResource( 5 )
Expand Down
5 changes: 3 additions & 2 deletions Scripts/Levels/Level Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func _ready():
get_node("CanvasLayer/Show").connect("button_down", self, "toggle_denominator_visibility")
get_node("CanvasLayer/Show").visible = true
toggle_denominator_visibility()
if "deadline" in game_modes:
Phase.connect("ending_reinforcement", self, "round_max_end_game")

# Button to raze a country in raze mode
Expand Down Expand Up @@ -258,7 +259,7 @@ func set_host_color(color):
print("changing local button")
show_end_attack(true)
else:
print("changing other guyss button")
print("changing other guys button")
rpc_id(curr_player.network_id, "show_end_attack", true)

func is_attack_over():
Expand All @@ -278,7 +279,7 @@ func resign():
else:
rpc("end_game", curr_player.color)

const round_max = 10
const round_max = 2
func round_max_end_game():
if round_number <= round_max:
return
Expand Down
2 changes: 1 addition & 1 deletion Scripts/UI/Mode Select.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends Control

onready var _root: Main = get_tree().get_root().get_node("Main")
var mode_connections = [["Diffusion", "Fatigue"], ["Fatigue", "Raze"],\
["Resistance", "Raze"], ["Drain", "Blitzkrieg"], ["Drain", "Congestion"]]
["Resistance", "Raze"], ["Drain", "Blitzkrieg"], ["Drain", "Congestion"], ["Deadline", "Congestion"]]
# ["Classic", "Movement"], ["Movement", "Pandemic"], ["Pandemic", "Checkers"]]

# Called when the node enters the scene tree for the first time.
Expand Down

0 comments on commit 9076fef

Please sign in to comment.