[READY] Syndicate Contracts (#44420)

* Emag bounty computer to show contract connection

* Corrupted text helper

* WIP on corrupted text

* Randomly corrupt text when looking at connect screen

* Barebones accessible Syndicate bounties screen

* Contract barebones and Synd UI work

* Further text changes, antag checks

* Further UI changes, full contract generation with areas/target

* dropoff point checks, and move to uplink item for requesting bounties

* WIP contract uplink item

* Contract uplink and continued contract improvements

* Completed contract uplink, and continued contract work

* Droppod WIP

* Further droppod work

* Mob WIP

* Further mob WIP

* No mob

* Callback for putting in mob

* Further WIP with pod checks

* Better location picking and signal fix

* Further pod changes, WIP of payouts

* Overall finished payment/contract system

* Code cleanup


Revert changes to bounty console


Remove debug messages

* Small refactor

* Add kit with set and randomised items.

* Fix box

* Very minor flavor text for inserting into pod, plus roundend text

* Pod return sound

* Contract uplink slight styling changes

* We don't keep giving telecrystals until they literally can't hold anymore

* Ship them off to ninja base instead

* Nerf bring them dead, but give a nice boost for bring them alive

Overall this is a nerf, so we also throw in an agent card to the bundle

* Ship them back

* Minor text changes and slight TC change

* Always give the black and red variant space suit

* Error sounds

* Dropoff area locator

There's sometimes duplicates, i.e. security office - but only one of them will work. This shows you where to go.

* Small fixes

* Bugfix, further changing of TC

* Ransom wip

* Ransom system

* Few changes

* Properly pay for ransoms and appropriate logic for dropoffs

* Terminal sounds

* Talk on command channel when ransom is given, or if they were too late

* Change to announce system

* Announcements/auto pay ransom

* Proper wait

* Name pods properly

* Don't send blacklisted items

* fix

* Improvements

* Announcements are less huge...

* Not a file...

* Improvement

* Drop them not in a wall

* Halves eye blur and styles payment vend

* No memes allowed
This commit is contained in:
Akrilla
2019-06-17 20:32:46 +02:00
committed by AnturK
parent dd8b9fee3a
commit 041680be63
18 changed files with 689 additions and 39 deletions
@@ -0,0 +1,135 @@
/datum/computer_file/program/contract_uplink
filename = "contract uplink"
filedesc = "Syndicate Contract Uplink"
program_icon_state = "hostile"
extended_desc = "A standard, Syndicate issued system for handling important contracts while on the field."
size = 10
requires_ntnet = 0
available_on_ntnet = 0
unsendable = 1
undeletable = 1
tgui_id = "synd_contract"
ui_style = "syndicate"
ui_x = 600
ui_y = 600
var/error = ""
/datum/computer_file/program/contract_uplink/run_program(var/mob/living/user)
. = ..(user)
/datum/computer_file/program/contract_uplink/ui_act(action, params)
if(..())
return 1
var/mob/living/user = usr
var/obj/item/computer_hardware/hard_drive/small/syndicate/hard_drive = computer.all_components[MC_HDD]
switch(action)
if("PRG_contract-accept")
var/contract_id = text2num(params["contract_id"])
// Set as the active contract
hard_drive.traitor_data.assigned_contracts[contract_id].status = CONTRACT_STATUS_ACTIVE
hard_drive.traitor_data.current_contract = hard_drive.traitor_data.assigned_contracts[contract_id]
return 1
if("PRG_login")
var/datum/antagonist/traitor/traitor_data = user.mind.has_antag_datum(/datum/antagonist/traitor)
// Bake their data right into the hard drive, or we don't allow non-antags gaining access to unused
// contract system.
// We also create their contracts at this point.
if (traitor_data)
traitor_data.create_contracts()
hard_drive.traitor_data = traitor_data
else
error = "Incorrect login details."
return 1
if("PRG_call_extraction")
if (hard_drive.traitor_data.current_contract.status != CONTRACT_STATUS_EXTRACTING)
if (hard_drive.traitor_data.current_contract.handle_extraction(user))
user.playsound_local(user, 'sound/effects/confirmdropoff.ogg', 75, 1)
hard_drive.traitor_data.current_contract.status = CONTRACT_STATUS_EXTRACTING
else
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
else
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
return 1
if("PRG_contract_abort")
var/contract_id = hard_drive.traitor_data.current_contract.id
hard_drive.traitor_data.current_contract = null
hard_drive.traitor_data.assigned_contracts[contract_id].status = CONTRACT_STATUS_ABORTED
return 1
if("PRG_redeem_TC")
if (hard_drive.traitor_data.contract_TC_to_redeem)
var/obj/item/stack/telecrystal/crystals = new /obj/item/stack/telecrystal(get_turf(user),
hard_drive.traitor_data.contract_TC_to_redeem)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.put_in_hands(crystals))
to_chat(H, "<span class='notice'>Your payment materializes into your hands!</span>")
else
to_chat(user, "<span class='notice'>Your payment materializes onto the floor.</span>")
hard_drive.traitor_data.contract_TC_payed_out += hard_drive.traitor_data.contract_TC_to_redeem
hard_drive.traitor_data.contract_TC_to_redeem = 0
return 1
else
user.playsound_local(user, 'sound/machines/uplinkerror.ogg', 50)
return 1
/datum/computer_file/program/contract_uplink/ui_data(mob/user)
var/list/data = list()
var/obj/item/computer_hardware/hard_drive/small/syndicate/hard_drive = computer.all_components[MC_HDD]
if (hard_drive && hard_drive.traitor_data != null)
var/datum/antagonist/traitor/traitor_data = hard_drive.traitor_data
error = ""
data = get_header_data()
if (traitor_data.current_contract)
data["ongoing_contract"] = TRUE
if (traitor_data.current_contract.status == CONTRACT_STATUS_EXTRACTING)
data["extraction_enroute"] = TRUE
data["logged_in"] = TRUE
data["station_name"] = GLOB.station_name
data["redeemable_tc"] = traitor_data.contract_TC_to_redeem
for (var/datum/syndicate_contract/contract in traitor_data.assigned_contracts)
data["contracts"] += list(list(
"target" = contract.contract.target,
"payout" = contract.contract.payout,
"payout_bonus" = contract.contract.payout_bonus,
"dropoff" = contract.contract.dropoff,
"id" = contract.id,
"status" = contract.status
))
var/direction
if (traitor_data.current_contract)
var/turf/curr = get_turf(user)
var/turf/dropoff_turf
data["current_location"] = "[get_area_name(curr, TRUE)]"
for (var/turf/content in traitor_data.current_contract.contract.dropoff.contents)
if (isturf(content))
dropoff_turf = content
break
if(curr.z == dropoff_turf.z) //Direction calculations for same z-level only
direction = uppertext(dir2text(get_dir(curr, dropoff_turf))) //Direction text (East, etc). Not as precise, but still helpful.
if(get_area(user) == traitor_data.current_contract.contract.dropoff)
direction = "LOCATION CONFIRMED"
else
direction = "???"
data["dropoff_direction"] = direction
else
data["error"] = error
data["logged_in"] = FALSE
return data