Skip to content

Commit

Permalink
Siberiad small update
Browse files Browse the repository at this point in the history
  • Loading branch information
savethetreez committed Apr 13, 2024
1 parent b3c0018 commit ec34c4c
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 122 deletions.
159 changes: 78 additions & 81 deletions code/game/objects/map_metadata/siberiad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
age = "1992"
faction_distribution_coeffs = list(AMERICAN = 0.5, RUSSIAN = 0.5)
battle_name = "Siberian Conflict"
mission_start_message = "<font size=4>The remnants of the <font color = 'blue'>Coalition</font color> and the <font color = red>Soviet Army</font> are fighting for the control of a <b>Military Industrial Complex</b> in the <b>MIDDLE</b> of the area of operations.<br>In order to win, a side has to hold the <b>Control Room</b> for<b>5 minutes</b>.<br>The battle will start in <b>5 minutes</b>.</font>"
mission_start_message = "<font size=4>The remnants of the Soviet Union are fighting the Coalition in a devastated Siberian town, home to a military research facility in the <b>MIDDLE</b>.<br>A helicopter transporting a high ranking officer has crashed in the <b>SOUTH-WEST</b> of the map.<br>Better retrieve the highly confidential documents in time before the enemy does...</font>"
faction1 = AMERICAN
faction2 = RUSSIAN
ordinal_age = 7
Expand Down Expand Up @@ -56,7 +56,7 @@
if (!(alive_n_of_side(faction1)) || !(alive_n_of_side(faction2)))
return 600
else
return 3000 // 5 minutes
return 1200 // 2 minutes

/obj/map_metadata/siberiad/long_win_time(faction)
if (!(alive_n_of_side(faction1)) || !(alive_n_of_side(faction2)))
Expand Down Expand Up @@ -105,72 +105,23 @@
return ""

/obj/map_metadata/siberiad/update_win_condition()
if (world.time >= next_win && next_win != -1)
if (win_condition_spam_check)
return FALSE
ticker.finished = TRUE
var/message = "The [battle_name ? battle_name : "battle"] has ended in a stalemate!"
if (current_winner && current_loser)
message = "The battle is over! The [current_winner] were victorious over the [current_loser][battle_name ? " in the [battle_name]" : ""]!"
world << "<font size = 4><span class = 'notice'>[message]</span></font>"
for (var/obj/structure/props/computerprops/tracking/siberiad/TS in world)
if (TS.active)
for (var/obj/structure/nuclear_missile/nuke in world)
nuke.activate()
switch (TS.destination)
if (1)
world << "<big> A nuclear missile is heading towards Seattle. The Coalition's capitol is about to turn to dust.</big>"
if (2)
world << "<big> A nuclear missile is heading towards Novosibirsk. The remnants of the Soviet Union are to be extinct.</big>"

win_condition_spam_check = TRUE
if (win_condition_spam_check)
return FALSE
// German major
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.33, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.33))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[1][1])] have captured the Control Room! They will win in {time} minute{s}."
next_win = world.time + short_win_time(roundend_condition_sides[2][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[1][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[2][1])
// German minor
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.01, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.01))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[1][1])] have captured the Control Room! They will win in {time} minute{s}."
next_win = world.time + long_win_time(roundend_condition_sides[2][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[1][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[2][1])
// Soviet major
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.33, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.33))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[2][1])] have secured the Control Room! They will win in {time} minute{s}."
next_win = world.time + short_win_time(roundend_condition_sides[1][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[2][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[1][1])
// Soviet minor
else if (win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[1]]), roundend_condition_sides[2], roundend_condition_sides[1], 1.01, TRUE))
if (!win_condition.check(typesof(roundend_condition_sides[roundend_condition_sides[2]]), roundend_condition_sides[1], roundend_condition_sides[2], 1.01))
if (last_win_condition != win_condition.hash)
current_win_condition = "The [roundend_condition_def2army(roundend_condition_sides[2][1])] have secured the Control Room! They will win in {time} minute{s}."
next_win = world.time + long_win_time(roundend_condition_sides[1][1])
announce_current_win_condition()
current_winner = roundend_condition_def2army(roundend_condition_sides[2][1])
current_loser = roundend_condition_def2army(roundend_condition_sides[1][1])

else
if (current_win_condition != no_winner && current_winner && current_loser)
world << "<font size = 3>The [current_winner] have lost control of the Control Room!</font>"
current_winner = null
current_loser = null
next_win = -1
current_win_condition = no_winner
win_condition.hash = 0
last_win_condition = win_condition.hash
for (var/obj/structure/props/computerprops/tracking/siberiad/TS in world)
if (TS.active)
ticker.finished = TRUE
var/message = "The operation is over! The nuclear missile has been launched!"
for (var/obj/structure/nuclear_missile/nuke in world)
nuke.activate()
switch (TS.destination)
if (1)
world << SPAN_NOTICE("<font size = 4>[message]</font>")
world << SPAN_NOTICE("<font size = 4>It is heading towards Seattle. The Coalition's capitol is about to turn to dust.</font>")
if (2)
world << SPAN_NOTICE("<font size = 4>[message]</font>")
world << SPAN_NOTICE("<font size = 4>It is heading towards Novosibirsk. The remnants of the Soviet Union are to be extinct.</font>")
win_condition_spam_check = TRUE
return FALSE
return TRUE

/obj/map_metadata/siberiad/check_caribbean_block(var/mob/living/human/H, var/turf/T)
Expand All @@ -194,25 +145,71 @@
name = "launch terminal"
desc = "A terminal used to control the missile silo."
var/active = FALSE
var/destination = 1
var/unlocked = FALSE
var/destination = 0

/obj/structure/props/computerprops/tracking/siberiad/attack_hand(var/mob/living/human/H as mob)
if (map && map.ID == MAP_SIBERIAD)
var/obj/map_metadata/siberiad/SD = map
if (src.active)
to_chat(H, SPAN_WARNING("The nuclear missile has already been activated."))
to_chat(H, SPAN_WARNING("The nuclear missile has already been activated and calibrated."))
return
var/code = input(H, "Enter the activation code:", "Access Termninal") as num
if (code == SD.activation_code)
src.visible_message(SPAN_NOTICE("\icon[src] Initiliazing protocols... Please wait."))
spawn(100)
src.active = TRUE
src.visible_message(SPAN_WARNING("\icon[src] Nuclear missile activated."))
if (H.faction_text == RUSSIAN)
if (!src.unlocked)
var/code = input(H, "Enter the activation code:", "Access Termninal") as num
if (code != SD.activation_code)
to_chat(H, SPAN_WARNING("\icon[src] Wrong password."))
return
src.visible_message(SPAN_NOTICE("\icon[src] Initiliazing protocols... Please wait."))
spawn(100)
src.visible_message(SPAN_WARNING("\icon[src] Security protocol terminated. Please insert the trajectory path disk."))
src.unlocked = TRUE

/obj/structure/props/computerprops/tracking/siberiad/attackby(obj/item/O as obj, mob/living/human/user as mob)
if (!istype(O, /obj/item/weapon/disk/siberiad))
return
if (src.active)
to_chat(user, SPAN_WARNING("The nuclear missile has already been activated and calibrated."))
return
if (!unlocked)
to_chat(user, SPAN_WARNING("Activate the console using the security code first."))
return
else
if (istype(O, /obj/item/weapon/disk/siberiad/soviet))
destination = 1
else if (istype(O, /obj/item/weapon/disk/siberiad/nato))
destination = 2
src.visible_message(SPAN_NOTICE("\icon[src] Calibrating trajectory... Please wait."))
spawn(100)
src.active = TRUE
src.visible_message(SPAN_WARNING("\icon[src] Nuclear missile activated."))
switch(destination)
if (1)
src.visible_message(SPAN_WARNING("\icon[src] Target destination: SEATTLE <br>(LAT: 47.608013, LONG: -122.335167)."))
destination = 1
else
if (2)
src.visible_message(SPAN_WARNING("\icon[src] Target destination: NOVOSIBIRSK <br>(LAT: 55.018803, LONG: 82.933952)."))
destination = 2
else
to_chat(H, SPAN_WARNING("\icon[src] Wrong password."))

/obj/item/weapon/disk/siberiad
name = "ballistic trajectory diskette"
desc = "A diskette containing protocols for setting up the ballistic trajectory a missile."
icon_state = "disk_black"
item_state = "disk_black"
attackby(obj/item/W, mob/living/M)
return

/obj/item/weapon/disk/siberiad/soviet
name = "Soviet ballistic trajectory diskette"
icon_state = "disk_red"
item_state = "disk_red"

/obj/item/weapon/disk/siberiad/nato
name = "Coalition ballistic trajectory diskette"
icon_state = "disk_blue"
item_state = "disk_blue"

/obj/item/weapon/paper/official/activation_code
name = "confidential document"
New()
..()
if (map && map.ID == MAP_SIBERIAD)
var/obj/map_metadata/siberiad/SD = map
info = "<p><strong>TOP SECRET</strong></p><br><p><em>Ministry of Defense of the USSR</em></p><br><p><strong>Activation code: [SD.activation_code]</strong></p><br><p><strong>Activation Instructions:</strong></p><br><ol><li>Enter the above code into the activation console.</li><br><li>Await verification protocols.</li><br><li>Once verified, insert the ballistic trajectory diskette.</li><br><li>Await missile calibration.</li><br><li>Initiate missile launch.</li><br></ol>"
Loading

0 comments on commit ec34c4c

Please sign in to comment.