Fixing more stuff
Mint machine compile fixes and the syndicate contractor program.
This commit is contained in:
@@ -4,94 +4,144 @@
|
||||
var/datum/objective/contract/contract = new()
|
||||
var/target_rank
|
||||
var/ransom = 0
|
||||
var/payout_type = null
|
||||
var/payout_type
|
||||
var/wanted_message
|
||||
|
||||
var/list/victim_belongings = list()
|
||||
|
||||
/datum/syndicate_contract/New(contract_owner, blacklist, type=CONTRACT_PAYOUT_SMALL)
|
||||
contract.owner = contract_owner
|
||||
payout_type = type
|
||||
|
||||
generate(blacklist)
|
||||
|
||||
/datum/syndicate_contract/proc/generate(blacklist)
|
||||
contract.find_target(null, blacklist)
|
||||
|
||||
var/datum/data/record/record
|
||||
if(contract.target)
|
||||
if (contract.target)
|
||||
record = find_record("name", contract.target.name, GLOB.data_core.general)
|
||||
if(record)
|
||||
|
||||
if (record)
|
||||
target_rank = record.fields["rank"]
|
||||
else
|
||||
target_rank = "Unknown"
|
||||
if(payout_type == CONTRACT_PAYOUT_LARGE)
|
||||
|
||||
if (payout_type == CONTRACT_PAYOUT_LARGE)
|
||||
contract.payout_bonus = rand(9,13)
|
||||
else if(payout_type == CONTRACT_PAYOUT_MEDIUM)
|
||||
else if (payout_type == CONTRACT_PAYOUT_MEDIUM)
|
||||
contract.payout_bonus = rand(6,8)
|
||||
else
|
||||
contract.payout_bonus = rand(2,4)
|
||||
|
||||
contract.payout = rand(0, 2)
|
||||
contract.generate_dropoff()
|
||||
|
||||
ransom = 100 * rand(18, 45)
|
||||
|
||||
var/base = pick_list(WANTED_FILE, "basemessage")
|
||||
var/verb_string = pick_list(WANTED_FILE, "verb")
|
||||
var/noun = pick_list_weighted(WANTED_FILE, "noun")
|
||||
var/location = pick_list_weighted(WANTED_FILE, "location")
|
||||
wanted_message = "[base] [verb_string] [noun] [location]."
|
||||
|
||||
/datum/syndicate_contract/proc/handle_extraction(var/mob/living/user)
|
||||
if (contract.target && contract.dropoff_check(user, contract.target.current))
|
||||
|
||||
var/turf/free_location = find_obstruction_free_location(3, user, contract.dropoff)
|
||||
if(free_location) // We've got a valid location, launch.
|
||||
|
||||
if (free_location)
|
||||
// We've got a valid location, launch.
|
||||
launch_extraction_pod(free_location)
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
// Launch the pod to collect our victim.
|
||||
/datum/syndicate_contract/proc/launch_extraction_pod(turf/empty_pod_turf)
|
||||
var/obj/structure/closet/supplypod/extractionpod/empty_pod = new()
|
||||
|
||||
RegisterSignal(empty_pod, COMSIG_ATOM_ENTERED, .proc/enter_check)
|
||||
|
||||
empty_pod.stay_after_drop = TRUE
|
||||
empty_pod.reversing = TRUE
|
||||
empty_pod.explosionSize = list(0,0,0,1)
|
||||
empty_pod.leavingSound = 'sound/effects/podwoosh.ogg'
|
||||
new /obj/effect/abstract/DPtarget(empty_pod_turf, empty_pod)
|
||||
|
||||
new /obj/effect/DPtarget(empty_pod_turf, empty_pod)
|
||||
|
||||
/datum/syndicate_contract/proc/enter_check(datum/source, sent_mob)
|
||||
if(istype(source, /obj/structure/closet/supplypod/extractionpod))
|
||||
if(isliving(sent_mob))
|
||||
var/mob/living/M = sent_mob
|
||||
var/datum/antagonist/traitor/traitor_data = contract.owner.has_antag_datum(/datum/antagonist/traitor)
|
||||
|
||||
if(M == contract.target.current)
|
||||
traitor_data.contractor_hub.contract_TC_to_redeem += contract.payout
|
||||
traitor_data.contractor_hub.contracts_completed += 1
|
||||
|
||||
if(M.stat != DEAD)
|
||||
traitor_data.contractor_hub.contract_TC_to_redeem += contract.payout_bonus
|
||||
|
||||
status = CONTRACT_STATUS_COMPLETE
|
||||
|
||||
if(traitor_data.contractor_hub.current_contract == src)
|
||||
traitor_data.contractor_hub.current_contract = null
|
||||
|
||||
traitor_data.contractor_hub.contract_rep += 2
|
||||
else
|
||||
status = CONTRACT_STATUS_ABORTED // Sending a target that wasn't even yours is as good as just aborting it
|
||||
|
||||
if(traitor_data.contractor_hub.current_contract == src)
|
||||
traitor_data.contractor_hub.current_contract = null
|
||||
|
||||
if(iscarbon(M))
|
||||
for(var/obj/item/W in M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(W == H.w_uniform || W == H.shoes)
|
||||
continue //So all they're left with are shoes and uniform.
|
||||
if(W == H.w_uniform)
|
||||
continue //So all they're left with are shoes and uniform.
|
||||
if(W == H.shoes)
|
||||
continue
|
||||
|
||||
|
||||
M.transferItemToLoc(W)
|
||||
victim_belongings.Add(W)
|
||||
|
||||
var/obj/structure/closet/supplypod/extractionpod/pod = source
|
||||
pod.send_up(pod) // Handle the pod returning
|
||||
|
||||
// Handle the pod returning
|
||||
pod.send_up(pod)
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/target = M // After we remove items, at least give them what they need to live.
|
||||
var/mob/living/carbon/human/target = M
|
||||
|
||||
// After we remove items, at least give them what they need to live.
|
||||
target.dna.species.give_important_for_life(target)
|
||||
handleVictimExperience(M) // After pod is sent we start the victim narrative/heal.
|
||||
var/points_to_check = SSshuttle.points // This is slightly delayed because of the sleep calls above to handle the narrative. We don't want to tell the station instantly.
|
||||
|
||||
// After pod is sent we start the victim narrative/heal.
|
||||
handleVictimExperience(M)
|
||||
|
||||
// This is slightly delayed because of the sleep calls above to handle the narrative.
|
||||
// We don't want to tell the station instantly.
|
||||
var/points_to_check
|
||||
if(points_to_check >= ransom)
|
||||
SSshuttle.points -= ransom
|
||||
else
|
||||
SSshuttle.points -= points_to_check
|
||||
priority_announce("One of your crew was captured by a rival organisation - we've needed to pay their ransom to bring them back. \
|
||||
As is policy we've taken a portion of the station's funds to offset the overall cost.", null, "attention", null, "Nanotrasen Asset Protection")
|
||||
|
||||
/datum/syndicate_contract/proc/handleVictimExperience(var/mob/living/M) // They're off to holding - handle the return timer and give some text about what's going on.
|
||||
addtimer(CALLBACK(src, .proc/returnVictim, M), 4 MINUTES) // Ship 'em back - dead or alive... 4 minutes wait.
|
||||
if(M.stat != DEAD) //Even if they weren't the target, we're still treating them the same.
|
||||
M.reagents.add_reagent(/datum/reagent/medicine/regen_jelly, 20) // Heal them up - gets them out of crit/soft crit. -- now 100% toxinlover friendly!!
|
||||
priority_announce("One of your crew was captured by a rival organisation - we've needed to pay their ransom to bring them back. \
|
||||
As is policy we've taken a portion of the station's funds to offset the overall cost.", null, 'sound/ai/attention.ogg', null, "Nanotrasen Asset Protection")
|
||||
|
||||
// They're off to holding - handle the return timer and give some text about what's going on.
|
||||
/datum/syndicate_contract/proc/handleVictimExperience(var/mob/living/M)
|
||||
// Ship 'em back - dead or alive, 4 minutes wait.
|
||||
// Even if they weren't the target, we're still treating them the same.
|
||||
addtimer(CALLBACK(src, .proc/returnVictim, M), (60 * 10) * 4)
|
||||
|
||||
if (M.stat != DEAD)
|
||||
M.reagents.add_reagent(/datum/reagent/medicine/regen_jelly, 20)
|
||||
|
||||
M.flash_act()
|
||||
M.confused += 10
|
||||
M.blur_eyes(5)
|
||||
@@ -116,13 +166,18 @@
|
||||
M.Dizzy(15)
|
||||
M.confused += 20
|
||||
|
||||
/datum/syndicate_contract/proc/returnVictim(var/mob/living/M) // We're returning the victim
|
||||
// We're returning the victim
|
||||
/datum/syndicate_contract/proc/returnVictim(var/mob/living/M)
|
||||
var/list/possible_drop_loc = list()
|
||||
|
||||
for(var/turf/possible_drop in contract.dropoff.contents)
|
||||
if(!is_blocked_turf(possible_drop))
|
||||
possible_drop_loc.Add(possible_drop)
|
||||
if(!isspaceturf(possible_drop) && !isclosedturf(possible_drop))
|
||||
if(!is_blocked_turf(possible_drop))
|
||||
possible_drop_loc.Add(possible_drop)
|
||||
|
||||
if(possible_drop_loc.len > 0)
|
||||
var/pod_rand_loc = rand(1, possible_drop_loc.len)
|
||||
|
||||
var/obj/structure/closet/supplypod/return_pod = new()
|
||||
return_pod.bluespace = TRUE
|
||||
return_pod.explosionSize = list(0,0,0,0)
|
||||
@@ -132,8 +187,10 @@
|
||||
for(var/obj/item/W in M)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(W == H.w_uniform || W == H.shoes)
|
||||
if(W == H.w_uniform)
|
||||
continue //So all they're left with are shoes and uniform.
|
||||
if(W == H.shoes)
|
||||
continue
|
||||
M.dropItemToGround(W)
|
||||
for(var/obj/item/W in victim_belongings)
|
||||
W.forceMove(return_pod)
|
||||
@@ -142,7 +199,7 @@
|
||||
M.blur_eyes(30)
|
||||
M.Dizzy(35)
|
||||
M.confused += 20
|
||||
new /obj/effect/abstract/DPtarget(possible_drop_loc[pod_rand_loc], return_pod)
|
||||
new /obj/effect/DPtarget(possible_drop_loc[pod_rand_loc], return_pod)
|
||||
else
|
||||
to_chat(M, "<span class='reallybig hypnophrase'>A million voices echo in your head... <i>\"Seems where you got sent here from won't \
|
||||
be able to handle our pod... You will die here instead.\"</i></span>")
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
/obj/machinery/mineral
|
||||
var/input_dir = NORTH
|
||||
var/output_dir = SOUTH
|
||||
var/needs_item_input
|
||||
|
||||
/obj/machinery/mineral/proc/unload_mineral(atom/movable/S)
|
||||
S.forceMove(drop_location())
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
input_dir = EAST
|
||||
ui_x = 300
|
||||
ui_y = 250
|
||||
needs_item_input = TRUE
|
||||
|
||||
var/produced_coins = 0 // how many coins the machine has made in it's last cycle
|
||||
var/processing = FALSE
|
||||
@@ -35,19 +34,16 @@
|
||||
chosen = SSmaterials.GetMaterialRef(chosen)
|
||||
|
||||
|
||||
/obj/machinery/mineral/mint/pickup_item(datum/source, atom/movable/target, atom/oldLoc)
|
||||
if(!istype(target, /obj/item/stack))
|
||||
return
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/obj/item/stack/S = target
|
||||
|
||||
if(materials.insert_item(S))
|
||||
qdel(S)
|
||||
|
||||
/obj/machinery/mineral/mint/process()
|
||||
var/turf/T = get_step(src, input_dir)
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
|
||||
for(var/obj/item/stack/O in T)
|
||||
var/inserted = materials.insert_item(O)
|
||||
if(inserted)
|
||||
qdel(O)
|
||||
|
||||
if(processing)
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
var/datum/material/M = chosen
|
||||
|
||||
if(!M)
|
||||
@@ -63,7 +59,7 @@
|
||||
for(var/coin_to_make in 1 to 5)
|
||||
create_coins()
|
||||
produced_coins++
|
||||
else
|
||||
else
|
||||
var/found_new = FALSE
|
||||
for(var/datum/material/inserted_material in materials.materials)
|
||||
var/amount = materials.get_material_amount(inserted_material)
|
||||
@@ -71,34 +67,34 @@
|
||||
if(amount)
|
||||
chosen = inserted_material
|
||||
found_new = TRUE
|
||||
|
||||
|
||||
if(!found_new)
|
||||
processing = FALSE
|
||||
else
|
||||
end_processing()
|
||||
icon_state = "coinpress0"
|
||||
|
||||
/obj/machinery/mineral/mint/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Mint", name, ui_x, ui_y, master_ui, state)
|
||||
ui = new(user, src, ui_key, "mint", name, ui_x, ui_y, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/mineral/mint/ui_data()
|
||||
var/list/data = list()
|
||||
data["inserted_materials"] = list()
|
||||
data["chosen_material"] = null
|
||||
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
|
||||
for(var/datum/material/inserted_material in materials.materials)
|
||||
var/amount = materials.get_material_amount(inserted_material)
|
||||
|
||||
if(!amount)
|
||||
continue
|
||||
|
||||
data["inserted_materials"] += list(list(
|
||||
"material" = inserted_material.name,
|
||||
"amount" = amount,
|
||||
"amount" = amount
|
||||
))
|
||||
|
||||
if(chosen == inserted_material)
|
||||
data["chosen_material"] = inserted_material.name
|
||||
|
||||
@@ -108,25 +104,18 @@
|
||||
return data;
|
||||
|
||||
/obj/machinery/mineral/mint/ui_act(action, params, datum/tgui/ui)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(action == "startpress")
|
||||
if (!processing)
|
||||
produced_coins = 0
|
||||
processing = TRUE
|
||||
begin_processing()
|
||||
return TRUE
|
||||
if (action == "stoppress")
|
||||
processing = FALSE
|
||||
end_processing()
|
||||
return TRUE
|
||||
if (action == "changematerial")
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
for(var/datum/material/mat in materials.materials)
|
||||
if (params["material_name"] == mat.name)
|
||||
chosen = mat
|
||||
return TRUE
|
||||
switch(action)
|
||||
if ("startpress")
|
||||
if (!processing)
|
||||
produced_coins = 0
|
||||
processing = TRUE
|
||||
if ("stoppress")
|
||||
processing = FALSE
|
||||
if ("changematerial")
|
||||
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
|
||||
for(var/datum/material/mat in materials.materials)
|
||||
if (params["material_name"] == mat.name)
|
||||
chosen = mat
|
||||
|
||||
/obj/machinery/mineral/mint/proc/create_coins()
|
||||
var/turf/T = get_step(src,output_dir)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
status_flags = CANUNCONSCIOUS|CANPUSH
|
||||
|
||||
var/heat_protection = 0.5
|
||||
heat_protection = 0.5
|
||||
var/leaping = 0
|
||||
gib_type = /obj/effect/decal/cleanable/blood/gibs/xeno
|
||||
unique_name = 1
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
/datum/computer_file/program/arcade/proc/game_check(mob/user)
|
||||
sleep(5)
|
||||
user?.mind?.adjust_experience(/datum/skill/gaming, 1)
|
||||
if(boss_hp <= 0)
|
||||
heads_up = "You have crushed [boss_name]! Rejoice!"
|
||||
playsound(computer.loc, 'sound/arcade/win.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
@@ -36,7 +35,6 @@
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
ticket_count += 1
|
||||
user?.mind?.adjust_experience(/datum/skill/gaming, 50)
|
||||
sleep(10)
|
||||
else if(player_hp <= 0 || player_mp <= 0)
|
||||
heads_up = "You have been defeated... how will the station survive?"
|
||||
@@ -45,7 +43,6 @@
|
||||
program_icon_state = "arcade_off"
|
||||
if(istype(computer))
|
||||
computer.update_icon()
|
||||
user?.mind?.adjust_experience(/datum/skill/gaming, 10)
|
||||
sleep(10)
|
||||
|
||||
/datum/computer_file/program/arcade/proc/enemy_check(mob/user)
|
||||
@@ -101,13 +98,11 @@
|
||||
if(computer)
|
||||
printer = computer.all_components[MC_PRINT]
|
||||
|
||||
var/gamerSkillLevel = usr.mind?.get_skill_level(/datum/skill/gaming)
|
||||
var/gamerSkill = usr.mind?.get_skill_modifier(/datum/skill/gaming, SKILL_RANDS_MODIFIER)
|
||||
switch(action)
|
||||
if("Attack")
|
||||
var/attackamt = 0 //Spam prevention.
|
||||
if(pause_state == FALSE)
|
||||
attackamt = rand(2,6) + rand(0, gamerSkill)
|
||||
attackamt = rand(2,6)
|
||||
pause_state = TRUE
|
||||
heads_up = "You attack for [attackamt] damage."
|
||||
playsound(computer.loc, 'sound/arcade/hit.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
@@ -120,10 +115,8 @@
|
||||
var/healamt = 0 //More Spam Prevention.
|
||||
var/healcost = 0
|
||||
if(pause_state == FALSE)
|
||||
healamt = rand(6,8) + rand(0, gamerSkill)
|
||||
healamt = rand(6,8)
|
||||
var/maxPointCost = 3
|
||||
if(gamerSkillLevel >= SKILL_LEVEL_JOURNEYMAN)
|
||||
maxPointCost = 2
|
||||
healcost = rand(1, maxPointCost)
|
||||
pause_state = TRUE
|
||||
heads_up = "You heal for [healamt] damage."
|
||||
@@ -137,7 +130,7 @@
|
||||
if("Recharge_Power")
|
||||
var/rechargeamt = 0 //As above.
|
||||
if(pause_state == FALSE)
|
||||
rechargeamt = rand(4,7) + rand(0, gamerSkill)
|
||||
rechargeamt = rand(4, 7)
|
||||
pause_state = TRUE
|
||||
heads_up = "You regain [rechargeamt] magic power."
|
||||
playsound(computer.loc, 'sound/arcade/mana.ogg', 50, TRUE, extrarange = -3, falloff = 10)
|
||||
|
||||
@@ -275,13 +275,13 @@
|
||||
departments = list("CentCom" = get_all_centcom_jobs())
|
||||
else if(isnull(departments))
|
||||
departments = list(
|
||||
CARDCON_DEPARTMENT_COMMAND = list("Captain"),//lol
|
||||
CARDCON_DEPARTMENT_COMMAND = list("Captain"),
|
||||
CARDCON_DEPARTMENT_ENGINEERING = GLOB.engineering_positions,
|
||||
CARDCON_DEPARTMENT_MEDICAL = GLOB.medical_positions,
|
||||
CARDCON_DEPARTMENT_SCIENCE = GLOB.science_positions,
|
||||
CARDCON_DEPARTMENT_SECURITY = GLOB.security_positions,
|
||||
CARDCON_DEPARTMENT_SUPPLY = GLOB.supply_positions,
|
||||
CARDCON_DEPARTMENT_SERVICE = GLOB.service_positions
|
||||
CARDCON_DEPARTMENT_SERVICE = GLOB.civilian_positions
|
||||
)
|
||||
data["jobs"] = list()
|
||||
for(var/department in departments)
|
||||
|
||||
@@ -81,13 +81,13 @@
|
||||
if(air.total_moles())
|
||||
for(var/gasid in air.gases)
|
||||
gasdata.Add(list(list(
|
||||
"name"= air.gases[gasid][GAS_META][META_GAS_NAME],
|
||||
"amount" = round(100*air.gases[gasid][MOLES]/air.total_moles(),0.01))))
|
||||
"name"= GLOB.meta_gas_names[gasid],
|
||||
"amount" = round(100*air.gases[gasid]/air.total_moles(),0.01))))
|
||||
|
||||
else
|
||||
for(var/gasid in air.gases)
|
||||
gasdata.Add(list(list(
|
||||
"name"= air.gases[gasid][GAS_META][META_GAS_NAME],
|
||||
"name"= GLOB.meta_gas_names[gasid],
|
||||
"amount" = 0)))
|
||||
|
||||
data["gases"] = gasdata
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
QDEL_NULL(soundloop)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/port_gen/should_have_node()
|
||||
return anchored
|
||||
|
||||
/obj/machinery/power/port_gen/connect_to_network()
|
||||
if(!anchored)
|
||||
return FALSE
|
||||
|
||||
@@ -385,4 +385,4 @@
|
||||
var/target = base_area ? base_area : src
|
||||
for(var/obj/machinery/power/apc/APC in GLOB.apcs_list)
|
||||
if(APC.area == target)
|
||||
return APC
|
||||
return APC
|
||||
|
||||
@@ -72,6 +72,6 @@
|
||||
to_chat(user, "<span class='notice'>You fried the consoles ID checking system.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/shuttle/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
/obj/machinery/computer/shuttle/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
if(port && (shuttleId == initial(shuttleId) || override))
|
||||
shuttleId = port.id
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
current_user.client.images -= remove_images
|
||||
current_user.client.images += add_images
|
||||
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/proc/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
/obj/machinery/computer/camera_advanced/shuttle_docker/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock, idnum, override=FALSE)
|
||||
if(port && (shuttleId == initial(shuttleId) || override))
|
||||
shuttleId = port.id
|
||||
shuttlePortId = "[port.id]_custom"
|
||||
|
||||
Reference in New Issue
Block a user