mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
+37






![tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>](/assets/img/avatar_default.png)


Alexis
GitHub
tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
ArcaneMusic
MrMelbert
Rhials
rageguy505
LemonInTheDark
John Willard
Aliceee2ch
Time-Green
Tsar-Salat
SmArtKar
Maxipat
SyncIt21
deltanedas
SimplyLogan
loganuk
Leland Kemble
FalloutFalcon
Roxy
Lucy
siliconOpossum
Isratosh
TheRyeGuyWhoWillNowDie
Neocloudy
Alexander V.
ElGitificador
Twaticus
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bloop
Cameron Lennox
Tim
Iamgoofball
Layzu666
Arturlang
_0Steven
mrmanlikesbt
Ben10Omintrix
John F. Kennedy
Cursor
Josh
Josh Powell
Yobrocharlie
Hardly3D
shayoki
LT3
21b4095dfd
Upstream 04/17/2026 fixes https://github.com/Bubberstation/Bubberstation/issues/5549 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com> Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com> Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com> Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com> Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com> Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com> Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com> Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com> Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com> Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com> Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com> Co-authored-by: loganuk <fakeemail123@aol.com> Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com> Co-authored-by: Lucy <lucy@absolucy.moe> Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com> Co-authored-by: Isratosh <Isratosh@hotmail.com> Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com> Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com> Co-authored-by: Alexander V. <volas@ya.ru> Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com> Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com> Co-authored-by: Tim <timothymtorres@gmail.com> Co-authored-by: Iamgoofball <iamgoofball@gmail.com> Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com> Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com> Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com> Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com> Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com> Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com> Co-authored-by: Josh <josh.adam.powell@gmail.com> Co-authored-by: Josh Powell <josh.powell@softwire.com> Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com> Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com> Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com> Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
89 lines
2.8 KiB
Plaintext
89 lines
2.8 KiB
Plaintext
/datum/bounty/item
|
|
///How many items have to be shipped to complete the bounty
|
|
var/required_count = 1
|
|
///How many items have been shipped for the bounty so far
|
|
var/shipped_count = 0
|
|
///Types accepted|denied by the bounty. (including all subtypes, unless include_subtypes is set to FALSE)
|
|
var/list/wanted_types
|
|
///Set to FALSE to make the bounty not accept subtypes of the wanted_types
|
|
var/include_subtypes = TRUE
|
|
|
|
/datum/bounty/item/New()
|
|
..()
|
|
wanted_types = string_assoc_list(zebra_typecacheof(wanted_types, only_root_path = !include_subtypes))
|
|
|
|
/datum/bounty/item/print_required()
|
|
return "[shipped_count]/[required_count]"
|
|
|
|
/datum/bounty/item/can_claim()
|
|
return shipped_count >= required_count
|
|
|
|
/datum/bounty/item/applies_to(obj/shipped)
|
|
if(!is_type_in_typecache(shipped, wanted_types))
|
|
return FALSE
|
|
if(shipped.flags_1 & HOLOGRAM_1)
|
|
return FALSE
|
|
return shipped_count < required_count
|
|
|
|
/datum/bounty/item/ship(obj/shipped)
|
|
if(!applies_to(shipped))
|
|
return FALSE
|
|
if(istype(shipped,/obj/item/stack))
|
|
var/obj/item/stack/shipped_is_a_stack = shipped
|
|
shipped_count += shipped_is_a_stack.amount
|
|
else
|
|
shipped_count += 1
|
|
return TRUE
|
|
|
|
/datum/bounty/item/get_total()
|
|
return shipped_count
|
|
|
|
/datum/bounty/item/get_max()
|
|
return required_count
|
|
|
|
|
|
/**
|
|
* Debug item because it took less time to code this than it did to roll ONE toolbox bounty.
|
|
*/
|
|
/obj/item/bounty_voucher
|
|
name = "bounty voucher"
|
|
desc = "A certificate for ONE FREE BOUNTY of your choice! Wow!"
|
|
icon = 'icons/obj/service/bureaucracy.dmi'
|
|
icon_state = "paperslip_words"
|
|
|
|
/obj/item/bounty_voucher/attack_self(mob/user, modifiers)
|
|
. = ..()
|
|
if(!isliving(user))
|
|
return
|
|
var/mob/living/living_user = user
|
|
var/obj/item/card/id/id = living_user.get_idcard()
|
|
if(!id?.registered_account)
|
|
return
|
|
var/choice = tgui_input_list(living_user, "Choose a bounty.", "New Bounty", subtypesof(/datum/bounty))
|
|
var/datum/bounty/new_chore = text2path("[choice]")
|
|
id.registered_account.set_bounty(new new_chore, id)
|
|
balloon_alert(user, "new bounty acquired!")
|
|
playsound(src, 'sound/effects/coin2.ogg', 30, TRUE)
|
|
qdel(src)
|
|
|
|
/// As above, but it spawns a global bounty for testing.
|
|
/obj/item/bounty_voucher/stationwide
|
|
name = "stationwide bounty voucher"
|
|
desc = "A certificate for ONE FREE BOUNTY of your choice! For everyone! Wowzers!"
|
|
color = "#ff8800"
|
|
|
|
/obj/item/bounty_voucher/stationwide/attack_self(mob/user, modifiers)
|
|
. = ..()
|
|
if(!isliving(user))
|
|
return
|
|
var/mob/living/living_user = user
|
|
var/choice = tgui_input_list(living_user, "Choose a bounty.", "New Bounty", subtypesof(/datum/bounty))
|
|
var/datum/bounty/new_chore = text2path("[choice]")
|
|
if(new_chore.global_exempt)
|
|
to_chat(user, span_warning("Can't use that one, try another!"))
|
|
return
|
|
GLOB.shared_crew_bounties += new_chore
|
|
balloon_alert(user, "new bounty provided to the crew!")
|
|
playsound(src, 'sound/effects/coin2.ogg', 30, TRUE)
|
|
qdel(src)
|