Skip to content

Commit

Permalink
Syndie cargotele rework
Browse files Browse the repository at this point in the history
  • Loading branch information
TobleroneSwordfish committed Apr 18, 2023
1 parent abab59f commit 8211a76
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 11 deletions.
2 changes: 1 addition & 1 deletion code/datums/syndicate_buylist.dm
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ This is basically useless for anyone but miners.
item = /obj/item/cargotele/traitor
cost = 3
vr_allowed = 0
desc = "A modified cargo transporter which teleports containers to a random spot in space and welds them shut."
desc = "A modified cargo transporter which welds containers shut and sells their contents directly to the black market, swipe your ID to set the account. Any hapless crewmembers sold will be teleported to a random point in space and will reward cash bonuses based on their job."
job = list("Quartermaster","Miner","Engineer","Chief Engineer")
can_buy = UPLINK_TRAITOR | UPLINK_SPY_THIEF

Expand Down
58 changes: 48 additions & 10 deletions code/obj/mining.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,10 @@ TYPEINFO(/obj/item/cargotele)
/obj/item/cargotele/traitor
cost = 15
var/static/list/possible_targets = list()
///The account to credit for sales
var/datum/db_record/account = null
///The total amount earned from selling/stealing
var/total_earned = 0

New()
..()
Expand All @@ -2043,22 +2047,56 @@ TYPEINFO(/obj/item/cargotele)

finish_teleport(var/obj/cargo, var/mob/user)
if (!length(src.possible_targets))
CRASH("Tried to syndi-teleport [cargo] but the list of possible turf targets was empty.")
src.target = pick(src.possible_targets)
src.target = locate(rand(1,world.maxx), rand(1,world.maxy), 1)
else
src.target = pick(src.possible_targets)
boutput(user, "<span class='notice'>Teleporting [cargo]...</span>")
playsound(user.loc, 'sound/machines/click.ogg', 50, 1)

var/value = shippingmarket.appraise_value(cargo.contents, sell = FALSE)
// Logs for good measure (Convair880).
for (var/mob/M in cargo.contents)
logTheThing(LOG_STATION, user, "uses a Syndicate cargo transporter to send [cargo.name] with [constructTarget(M,"station")] inside to [log_loc(src.target)].")

cargo.set_loc(src.target)
for (var/atom/A in cargo.contents)
if (ismob(A))
var/mob/M = A
logTheThing(LOG_STATION, user, "uses a Syndicate cargo transporter to send [cargo.name] with [constructTarget(M,"station")] inside to [log_loc(src.target)].")
var/datum/job/job = find_job_in_controller_by_string(M.job)
value += job?.wages * 5
else
cargo.contents -= A
qdel(A)
if (length(cargo.contents)) //if there's a mob left inside chuck it somewhere in space
cargo.set_loc(src.target)
else
qdel(cargo)
src.total_earned += value
elecflash(src)
var/ret = SEND_SIGNAL(src, COMSIG_CELL_USE, cost)
if (ret & CELL_INSUFFICIENT_CHARGE)
boutput(user, "<span class='alert'>Transfer successful. The transporter is now out of charge.</span>")
boutput(user, "[bicon(src)] *beep*")
if (src.account)
account?["current_money"] += value
boutput(user, "[bicon(src)] The [src.name] beeps: transfer successful, [value] credits have been deposited into your bank account. You have [src.account["current_money"]] credits total.")
else
boutput(user, "<span class='notice'>Transfer successful.</span>")
boutput(user, "[bicon(src)] The [src.name] beeps: transfer successful, no account registered.")
if (ret & CELL_INSUFFICIENT_CHARGE)
boutput(user, "<span class='alert'>[src] is now out of charge.</span>")

attackby(obj/item/item, mob/user)
var/owner_name = null
if (istype(item, /obj/item/device/pda2))
var/obj/item/device/pda2/pda = item
owner_name = pda.registered
else if (istype(item, /obj/item/card/id))
var/obj/item/card/id/card = item
owner_name = card.registered
if (owner_name)
boutput(user, "<span class='notice'>You set [src]'s payout account.</span>")
src.account = data_core.bank.find_record("name", owner_name)
return
..()

get_desc()
. = ..()
if (src.total_earned)
. += "<br>There is a little counter on the side, it says: Total amount earned: [src.total_earned] credits.<br>"

/obj/item/oreprospector
name = "geological scanner"
Expand Down
2 changes: 2 additions & 0 deletions strings/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

(t)tue apr 18 23
(u)LeahTheTech
(*)The syndicate cargo transporter now rewards money for anything teleported using it.
(+)Objects sold via the syndicate cargo transporter will be dele- teleported to the syndicate, and humans sold will reward money based on their assigned job.
(*)Pods and cars now damage things (windows, tables, vending machines) they crash into, and also take slightly more damage from said crashes.
(u)Sord
(+)Engineering manufacturers now have some more items available for production
Expand Down

0 comments on commit 8211a76

Please sign in to comment.