Merge pull request #18321 from Cruix/nukeops_war_fix

[s] Fixes nuke ops being able to fly to the station and then declare war
This commit is contained in:
oranges
2016-06-07 13:32:49 +12:00
3 changed files with 45 additions and 16 deletions
+1
View File
@@ -4,6 +4,7 @@ var/global/list/airlocks = list() //list of all airlocks
var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking.
var/global/list/shuttle_caller_list = list() //list of all communication consoles and AIs, for automatic shuttle calls when there are none.
var/global/list/machines = list() //NOTE: this is a list of ALL machines now. The processing machines list is SSmachine.processing !
var/global/list/syndicate_shuttle_boards = list() //important to keep track of for managing nukeops war declarations.
var/global/list/navbeacons = list() //list of all bot nagivation beacons, used for patrolling.
var/global/list/deliverybeacons = list() //list of all MULEbot delivery beacons.
var/global/list/deliverybeacontags = list() //list of all tags associated with delivery beacons.
@@ -13,32 +13,26 @@
var/declaring_war = 0
/obj/item/device/nuclear_challenge/attack_self(mob/living/user)
if(declaring_war)
return
if(player_list.len < CHALLENGE_MIN_PLAYERS)
user << "The enemy crew is too small to be worth declaring war on."
return
if(user.z != ZLEVEL_CENTCOM)
user << "You have to be at your base to use this."
return
if(world.time > CHALLENGE_TIME_LIMIT)
user << "It's too late to declare hostilities. Your benefactors are already busy with other schemes. You'll have to make do with what you have on hand."
if(!check_allowed(user))
return
declaring_war = 1
var/are_you_sure = alert(user, "Consult your team carefully before you declare war on [station_name()]]. Are you sure you want to alert the enemy crew?", "Declare war?", "Yes", "No")
declaring_war = 0
if(are_you_sure == "No")
user << "On second thought, the element of surprise isn't so bad after all."
declaring_war = 0
return
if(!check_allowed(user))
return
declaring_war = 1
var/war_declaration = "[user.real_name] has declared his intent to utterly destroy [station_name()] with a nuclear device, and dares the crew to try and stop them."
priority_announce(war_declaration, title = "Declaration of War", sound = 'sound/machines/Alarm.ogg')
user << "You've attracted the attention of powerful forces within the syndicate. A bonus bundle of telecrystals has been granted to your team. Great things await you if you complete the mission."
for(var/obj/machinery/computer/shuttle/syndicate/S in machines)
S.challenge = TRUE
for(var/V in syndicate_shuttle_boards)
var/obj/item/weapon/circuitboard/computer/syndicate_shuttle/board = V
board.challenge = TRUE
var/obj/item/device/radio/uplink/nuclear/U = new(get_turf(user))
U.hidden_uplink.owner = "[user.key]"
@@ -47,6 +41,24 @@
config.shuttle_refuel_delay = max(config.shuttle_refuel_delay, CHALLENGE_SHUTTLE_DELAY)
qdel(src)
/obj/item/device/nuclear_challenge/proc/check_allowed(mob/living/user)
if(declaring_war)
return 0
if(player_list.len < CHALLENGE_MIN_PLAYERS)
user << "The enemy crew is too small to be worth declaring war on."
return 0
if(user.z != ZLEVEL_CENTCOM)
user << "You have to be at your base to use this."
return 0
if(world.time > CHALLENGE_TIME_LIMIT)
user << "It's too late to declare hostilities. Your benefactors are already busy with other schemes. You'll have to make do with what you have on hand."
return 0
for(var/V in syndicate_shuttle_boards)
var/obj/item/weapon/circuitboard/computer/syndicate_shuttle/board = V
if(board.moved)
user << "The shuttle has already been moved! You have forfeit the right to declare war."
return 0
return 1
#undef CHALLENGE_TELECRYSTALS
#undef CHALLENGE_TIME_LIMIT
+18 -2
View File
@@ -2,12 +2,12 @@
/obj/machinery/computer/shuttle/syndicate
name = "syndicate shuttle terminal"
circuit = /obj/item/weapon/circuitboard/computer/syndicate_shuttle
icon_screen = "syndishuttle"
icon_keyboard = "syndie_key"
req_access = list(access_syndicate)
shuttleId = "syndicate"
possible_destinations = "syndicate_away;syndicate_z5;syndicate_ne;syndicate_nw;syndicate_n;syndicate_se;syndicate_sw;syndicate_s"
var/challenge = FALSE
/obj/machinery/computer/shuttle/syndicate/recall
name = "syndicate shuttle recall terminal"
@@ -16,11 +16,27 @@
/obj/machinery/computer/shuttle/syndicate/Topic(href, href_list)
if(href_list["move"])
if(challenge && world.time < SYNDICATE_CHALLENGE_TIMER)
var/obj/item/weapon/circuitboard/computer/syndicate_shuttle/board = circuit
if(board.challenge && world.time < SYNDICATE_CHALLENGE_TIMER)
usr << "<span class='warning'>You've issued a combat challenge to the station! You've got to give them at least [round(((SYNDICATE_CHALLENGE_TIMER - world.time) / 10) / 60)] more minutes to allow them to prepare.</span>"
return 0
board.moved = TRUE
..()
/obj/item/weapon/circuitboard/computer/syndicate_shuttle
name = "circuit board (Syndicate Shuttle)"
build_path = /obj/machinery/computer/shuttle/syndicate
var/challenge = FALSE
var/moved = FALSE
/obj/item/weapon/circuitboard/computer/syndicate_shuttle/New()
syndicate_shuttle_boards += src
..()
/obj/item/weapon/circuitboard/computer/syndicate_shuttle/Destroy()
syndicate_shuttle_boards -= src
return ..()
/obj/machinery/computer/shuttle/syndicate/drop_pod
name = "syndicate assault pod control"
icon = 'icons/obj/terminals.dmi'