diff --git a/code/modules/antagonists/pirate/pirate_event.dm b/code/modules/antagonists/pirate/pirate_event.dm index 978dd5cf621..c516d86c4e3 100644 --- a/code/modules/antagonists/pirate/pirate_event.dm +++ b/code/modules/antagonists/pirate/pirate_event.dm @@ -37,24 +37,26 @@ //send message priority_announce("Incoming subspace communication. Secure channel opened at all communication consoles.", "Incoming Message", SSstation.announcer.get_rand_report_sound()) threat.answer_callback = CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(pirates_answered), threat, chosen_gang, payoff, world.time) - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(spawn_pirates), threat, chosen_gang, FALSE), RESPONSE_MAX_TIME) + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(spawn_pirates), threat, chosen_gang), RESPONSE_MAX_TIME) SScommunications.send_message(threat, unique = TRUE) /proc/pirates_answered(datum/comm_message/threat, datum/pirate_gang/chosen_gang, payoff, initial_send_time) if(world.time > initial_send_time + RESPONSE_MAX_TIME) - priority_announce(chosen_gang.response_too_late ,sender_override = chosen_gang.ship_name) + priority_announce(chosen_gang.response_too_late, sender_override = chosen_gang.ship_name) + return + if(!threat?.answered) return - if(threat?.answered) - var/datum/bank_account/plundered_account = SSeconomy.get_dep_account(ACCOUNT_CAR) - if(plundered_account) - if(plundered_account.adjust_money(-payoff)) - priority_announce(chosen_gang.response_received, sender_override = chosen_gang.ship_name) - else - priority_announce(chosen_gang.response_not_enough, sender_override = chosen_gang.ship_name) - spawn_pirates(threat, chosen_gang, TRUE) -/proc/spawn_pirates(datum/comm_message/threat, datum/pirate_gang/chosen_gang, skip_answer_check) - if(!skip_answer_check && threat?.answered == 1) + var/datum/bank_account/plundered_account = SSeconomy.get_dep_account(ACCOUNT_CAR) + if(plundered_account) + if(plundered_account.adjust_money(-payoff)) + chosen_gang.paid_off = TRUE + priority_announce(chosen_gang.response_received, sender_override = chosen_gang.ship_name) + else + priority_announce(chosen_gang.response_not_enough, sender_override = chosen_gang.ship_name) + +/proc/spawn_pirates(datum/comm_message/threat, datum/pirate_gang/chosen_gang) + if(chosen_gang.paid_off) return var/list/candidates = poll_ghost_candidates("Do you wish to be considered for pirate crew?", ROLE_TRAITOR) diff --git a/code/modules/antagonists/pirate/pirate_gangs.dm b/code/modules/antagonists/pirate/pirate_gangs.dm index 41d34b0c92b..a0a9a1caf56 100644 --- a/code/modules/antagonists/pirate/pirate_gangs.dm +++ b/code/modules/antagonists/pirate/pirate_gangs.dm @@ -45,6 +45,9 @@ GLOBAL_LIST_INIT(heavy_pirate_gangs, init_pirate_gangs(is_heavy = TRUE)) ///station pays the pirates... but doesn't have enough cash. var/response_not_enough = "Not enough Bungopoints have been added into my bank account, rebooting world..." + /// Have the pirates been paid off? + var/paid_off = FALSE + /datum/pirate_gang/New() . = ..() ship_name = pick(strings(PIRATE_NAMES_FILE, ship_name_pool))