Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legalize Nuclear Bombs (Nuke fixes and QOL) #3880

Merged
merged 13 commits into from
Jul 25, 2023
4 changes: 2 additions & 2 deletions code/datums/supply_packs/operations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@
group = "Operations"

/datum/supply_packs/nuclearbomb
name = "Operational Nuke"
name = "Decrypted Operational Nuke"
cost = 0
containertype = /obj/structure/machinery/nuclearbomb
buyable = 0
group = "Operations"
iteration_needed = null

/datum/supply_packs/technuclearbomb
name = "Intel Operational Nuke"
name = "Encrypted Operational Nuke"
cost = 0
containertype = /obj/structure/machinery/nuclearbomb/tech
buyable = 0
Expand Down
3 changes: 2 additions & 1 deletion code/game/machinery/nuclearbomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var/bomb_set = FALSE
var/timing = FALSE
var/deployable = FALSE
var/explosion_time = null
var/timeleft = 4800
var/timeleft = 8 MINUTES
var/safety = TRUE
var/being_used = FALSE
var/end_round = TRUE
Expand Down Expand Up @@ -152,6 +152,7 @@ var/bomb_set = FALSE
data["command_lockout"] = command_lockout
data["allowed"] = allowed
data["being_used"] = being_used
data["decryption_complete"] = TRUE //this is overriden by techweb nuke UI_data later, this just makes it default to true

return data

Expand Down
24 changes: 24 additions & 0 deletions code/modules/admin/tabs/event_tab.dm
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,29 @@

give_jelly_award(last_hive_checked, as_admin=TRUE)

/client/proc/give_nuke()
if(!check_rights(R_ADMIN))
return
var/nuketype = "Decrypted Operational Nuke"
var/encrypt = tgui_alert(src, "Do you want the nuke to be already decrypted?", "Nuke Type", list("Encrypted", "Decrypted"), 20 SECONDS)
if(encrypt == "Encrypted")
nuketype = "Encrypted Operational Nuke"
var/prompt = tgui_alert(src, "THIS CAN BE USED TO END THE ROUND. Are you sure you want to spawn a nuke? The nuke will be put onto the ASRS Lift.", "DEFCON 1", list("No", "Yes"), 30 SECONDS)
if(prompt != "Yes")
return

var/datum/supply_order/new_order = new()
new_order.ordernum = supply_controller.ordernum
supply_controller.ordernum++
new_order.object = supply_controller.supply_packs[nuketype]
new_order.orderedby = MAIN_AI_SYSTEM
new_order.approvedby = MAIN_AI_SYSTEM
supply_controller.shoppinglist += new_order

marine_announcement("A nuclear device has been supplied and will be delivered to requisitions via ASRS.", "NUCLEAR ARSENAL ACQUIRED", 'sound/misc/notice2.ogg')
message_admins("[key_name_admin(usr)] admin-spawned a [encrypt] nuke.")
log_game("[key_name_admin(usr)] admin-spawned a [encrypt] nuke.")

/client/proc/turn_everyone_into_primitives()
var/random_names = FALSE
if (alert(src, "Do you want to give everyone random numbered names?", "Confirmation", "Yes", "No") == "Yes")
Expand Down Expand Up @@ -685,6 +708,7 @@
<B>Misc</B><BR>
<A href='?src=\ref[src];[HrefToken()];events=medal'>Award a medal</A><BR>
<A href='?src=\ref[src];[HrefToken()];events=jelly'>Award a royal jelly</A><BR>
<A href='?src=\ref[src];[HrefToken()];events=nuke'>Spawn a nuke</A><BR>
<A href='?src=\ref[src];[HrefToken()];events=pmcguns'>Toggle PMC gun restrictions</A><BR>
<A href='?src=\ref[src];[HrefToken()];events=monkify'>Turn everyone into monkies</A><BR>
<BR>
Expand Down
2 changes: 2 additions & 0 deletions code/modules/admin/topic/topic_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
owner.award_medal()
if("jelly")
owner.award_jelly()
if("nuke")
owner.give_nuke()
if("pmcguns")
owner.toggle_gun_restrictions()
if("monkify")
Expand Down
7 changes: 4 additions & 3 deletions code/modules/cm_tech/techs/marine/tier4/nuke.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
tier = /datum/tier/four

announce_name = "NUCLEAR ARSENAL ACQUIRED"
announce_message = "A nuclear device has been purchased and will be delivered to requisitions via ASRS."
announce_message = "A nuclear device has been authorized and will be delivered to requisitions via ASRS."

flags = TREE_FLAG_MARINE

Expand All @@ -20,11 +20,12 @@
/datum/tech/nuke/on_unlock()
. = ..()

var/datum/supply_order/new_order = new /datum/supply_order()
var/datum/supply_order/new_order = new()
new_order.ordernum = supply_controller.ordernum
supply_controller.ordernum++
new_order.object = supply_controller.supply_packs["Intel Operational Nuke"]
new_order.object = supply_controller.supply_packs["Encrypted Operational Nuke"]
new_order.orderedby = MAIN_AI_SYSTEM
new_order.approvedby = MAIN_AI_SYSTEM

supply_controller.shoppinglist += new_order

Expand Down
2 changes: 1 addition & 1 deletion tgui/packages/tgui/interfaces/NuclearBomb.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const NuclearBomb = (_props, context) => {
{data.decryption_complete
? 'Decryption complete.'
: `Decryption time left :
${data.decryption_time} seconds`}
${data.decryption_time} minutes`}
</NoticeBox>
</Stack.Item>
<Stack.Item>
Expand Down