Skip to content

Commit

Permalink
More CI stuff for traders.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 authored and comma committed Oct 19, 2023
1 parent 0e51caf commit 436ff39
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 23 deletions.
4 changes: 2 additions & 2 deletions code/datums/trading/_trader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@
return (trade_flags & TRADER_BRIBABLE)

/datum/trader/proc/is_bribed(var/staylength)
return get_response(TRADER_BRIBE_REFUSAL, "How about.... no?")
return get_response(TRADER_BRIBE_REFUSAL, "How about... no?")

/datum/trader/proc/bribe_to_stay_longer(var/amt)
if(is_bribable())
return is_bribed(round(amt/100))
return get_response(TRADER_BRIBE_REFUSAL, "How about.... no?")
return get_response(TRADER_BRIBE_REFUSAL, "How about... no?")

/datum/trader/Destroy(force)
if(hub)
Expand Down
23 changes: 12 additions & 11 deletions code/datums/trading/traders/books.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@
)

speech = list(
TRADER_HAIL_GENERIC = "Yes hello hello! Many fine paperstacks for sale! Please buy!",
TRADER_HAIL_DENY = "Not in! I'm not here! Go away!!",
TRADER_INSULT_GOOD = "Zhat hurts friend!",
TRADER_INSULT_BAD = "Ohhhhhh!! Why you picking a fight?! You will lose!",
TRADER_COMPLIMENT_ACCEPT = "You make my ears red you do! Hehehe!",
TRADER_COMPLIMENT_DENY = "Haha! Nice try, but I am not falling for zhe smoozhy talk zhe fourzh time today!",
TRADER_HOW_MUCH = "Hmmmmm, I give zhis to you for maybe... " + TRADER_TOKEN_VALUE + " " + TRADER_TOKEN_CURRENCY + ".",
TRADER_TRADE_COMPLETE = "Yesssss zhank you for transactionings!",
TRADER_NO_BLACKLISTED = "Aaaaaa! No want, no want! Go away!",
TRADER_FOUND_UNWANTED = "Hmmm, no. Do not want.",
TRADER_NOT_ENOUGH = "Not enough! More! More!"
TRADER_HAIL_GENERIC = "Yes hello hello! Many fine paperstacks for sale! Please buy!",
TRADER_HAIL_DENY = "Not in! I'm not here! Go away!!",
TRADER_NO_GOODS = "No! No no no! Not goods! MONEY!",
TRADER_INSULT_GOOD = "Zhat hurts friend!",
TRADER_INSULT_BAD = "Ohhhhhh!! Why you picking a fight?! You will lose!",
TRADER_COMPLIMENT_ACCEPT = "You make my ears red you do! Hehehe!",
TRADER_COMPLIMENT_DENY = "Haha! Nice try, but I am not falling for zhe smoozhy talk zhe fourzh time today!",
TRADER_HOW_MUCH = "Hmmmmm, I give zhis to you for maybe... " + TRADER_TOKEN_VALUE + " " + TRADER_TOKEN_CURRENCY + ".",
TRADER_TRADE_COMPLETE = "Yesssss zhank you for transactionings!",
TRADER_NO_BLACKLISTED = "Aaaaaa! No want, no want! Go away!",
TRADER_NOT_ENOUGH = "Not enough! More! More!",
TRADER_BRIBE_REFUSAL = "Zhis is a station, stupid!"
)
3 changes: 3 additions & 0 deletions code/datums/trading/traders/goods.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ Sells devices, odds and ends, and medical stuff
TRADER_COMPLIMENT_ACCEPT = "Thank you. I needed that.",
TRADER_INSULT_GOOD = "No need to be upset, I believe we can do business.",
TRADER_INSULT_BAD = "I have traded dogs with more bark than that.",
TRADER_BRIBE_REFUSAL = "Uh, this is a station. I'm not going anywhere."
)

possible_wanted_items = list(
Expand Down Expand Up @@ -373,6 +374,7 @@ Sells devices, odds and ends, and medical stuff
TRADER_COMPLIMENT_ACCEPT = "Damn right I'm awesome, tell me more.",
TRADER_INSULT_GOOD = "Damn, pal, no need to get snippy.",
TRADER_INSULT_BAD = "*muffled laughter* Sorry, was that you trying to talk shit? Adorable.",
TRADER_BRIBE_REFUSAL = "Man I live here, I'm not leaving anytime soon."
)

possible_wanted_items = list(
Expand Down Expand Up @@ -432,6 +434,7 @@ Sells devices, odds and ends, and medical stuff
TRADER_COMPLIMENT_ACCEPT = "Thank you.",
TRADER_INSULT_GOOD = "Alright, we will reconsider the terms.",
TRADER_INSULT_BAD = "This is not acceptable, please cease.",
TRADER_BRIBE_REFUSAL = "This facility is not mobile. Payment is unnecessary."
)

possible_wanted_items = list(
Expand Down
13 changes: 10 additions & 3 deletions code/datums/trading/traders/unique.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
TRADER_COMPLIMENT_ACCEPT = "Yes... I suppose you're right.",
TRADER_INSULT_GOOD = "I... probably deserve that.",
TRADER_INSULT_BAD = "Maybe you should c-come here and say that. You'd be worth s-something then.",
TRADER_BRIBE_ACCEPT = "Okay. Fine. But... h-hurry. I can only stay another " + TRADER_TOKEN_TIME + "m-minutes."
TRADER_BRIBE_ACCEPT = "Okay. Fine. But... h-hurry. I can only stay another " + TRADER_TOKEN_TIME + "m-minutes.",
TRADER_BRIBE_REFUSAL = "No! N-no, they're getting closer- I have to, I h-have to go soon."
)
mob_transfer_message = "<span class='danger'>You are transported to " + TRADER_TOKEN_ORIGIN + ", and with a sickening thud, you fall unconscious, never to wake again.</span>"

Expand All @@ -79,13 +80,16 @@
TRADER_TRADE_COMPLETE = "Blub likes to trade!",
TRADER_NO_MONEY = "Boo try to give Blub paper. Blub does not want paper.",
TRADER_NOT_ENOUGH = "Blub hungry for bore than that.",
TRADER_NO_BLACKLISTED = "Blub not want that! No!",
TRADER_FOUND_UNWANTED = "Blub only wants bocks. Give bocks.",
TRADER_HOW_MUCH = "Blub wants bocks. Boo give bocks. Blub gives stuff blub found.",
TRADER_WHAT_WANT = "Blub wants bocks. Big bocks, small bocks. Shiny bocks!",
TRADER_COMPLIMENT_DENY = "Blub is just " + TRADER_TOKEN_MERCHANT + ". What do boo mean?",
TRADER_COMPLIMENT_ACCEPT = "Boo are a bood berson!",
TRADER_INSULT_GOOD = "Blub do not understand. Blub thought we were briends.",
TRADER_INSULT_BAD = "Blub feels bad now."
TRADER_INSULT_BAD = "Blub feels bad now.",
TRADER_BRIBE_ACCEPT = "Blub will stay for " + TRADER_TOKEN_TIME + " binutes bonger.",
TRADER_BRIBE_REFUSAL = "Blub must go. Blub's beople beed blem."
)

//probably could stick soem Howl references in here but like, eh. Haven't seen it in years.
Expand Down Expand Up @@ -134,7 +138,10 @@
TRADER_COMPLIMENT_DENY = "Like I haven't heard that one before!",
TRADER_COMPLIMENT_ACCEPT = "Haha! Aren't you nice.",
TRADER_INSULT_GOOD = "Naughty naughty.",
TRADER_INSULT_BAD = "Now where do you get off talking to me like that?"
TRADER_INSULT_BAD = "Now where do you get off talking to me like that?",
TRADER_BRIBE_ACCEPT = "Well, if you're not pulling the knob on my staff, I can stay for another " + TRADER_TOKEN_TIME + " minutes.",
TRADER_BRIBE_REFUSAL = "A wizard does not depart early or late, but precisely when they intend to. No.",
TRADER_NO_BLACKLISTED = "I cannot accept such a thing. No trade."
)

/datum/trader/ship/unique/wizard/New()
Expand Down
12 changes: 9 additions & 3 deletions code/datums/trading/traders/weaponry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
TRADER_COMPLIMENT_DENY = "If we were in the same room right now, I'd probably punch you.",
TRADER_COMPLIMENT_ACCEPT = "Ha! Good one!",
TRADER_INSULT_GOOD = "I expected better from you. I suppose in that, I was wrong.",
TRADER_INSULT_BAD = "If I had my gun I'd shoot you!"
TRADER_INSULT_BAD = "If I had my gun I'd shoot you!",
TRADER_BRIBE_ACCEPT = "For that much scratch, I can stay for another " + TRADER_TOKEN_TIME + " minutes.",
TRADER_BRIBE_REFUSAL = "Look, I've got places to be, I can't hang around shooting the shit."
)

possible_trading_items = list(
Expand Down Expand Up @@ -56,7 +58,10 @@
TRADER_COMPLIMENT_DENY = "If I was dumber I probably would have believed you.",
TRADER_COMPLIMENT_ACCEPT = "Yes, I am very smart.",
TRADER_INSULT_GOOD = "Energy weapons are TWICE the gun kinetic guns are!",
TRADER_INSULT_BAD = "That's... very mean. I won't think twice about blacklisting your channel, so stop."
TRADER_INSULT_BAD = "That's... very mean. I won't think twice about blacklisting your channel, so stop.",
TRADER_BRIBE_ACCEPT = "Look, I'm not supposed to, but I guess I can stay for " + TRADER_TOKEN_TIME + " minutes.",
TRADER_BRIBE_REFUSAL = "Sorry, no can do. I'm on a tight schedule."

)

possible_trading_items = list(
Expand Down Expand Up @@ -86,7 +91,8 @@
TRADER_COMPLIMENT_DENY = "Thank you for... that quality... COMPLIMENT... from me!",
TRADER_COMPLIMENT_ACCEPT = "Thank you for... that quality... COMPLIMENT... from me!",
TRADER_INSULT_GOOD = "Thank you for... that quality... INSULT... from me!",
TRADER_INSULT_BAD = "Thank you for... that quality... INSULT... from me!"
TRADER_INSULT_BAD = "Thank you for... that quality... INSULT... from me!",
TRADER_BRIBE_REFUSAL = "Your... BLATANT BRIBERY... is... UNNECESSARY!"
)
compliment_increase = 0
insult_drop = 0
Expand Down
7 changes: 5 additions & 2 deletions code/unit_tests/traders.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
// This will default to generic if unset, doesn't matter.
TRADER_HAIL_SILICON,
// This token can be used to respond 'I don't want anything' which is valid.
TRADER_WHAT_WANT
TRADER_WHAT_WANT,
// This token has bespoke validity checking and can't go into any of the above lists.
TRADER_NO_BLACKLISTED
)

/datum/unit_test/trader_subtypes_shall_have_all_needed_speech_values/start_test()
Expand All @@ -55,6 +57,8 @@
if(trader.name_language && !ispath(trader.name_language, /decl/language))
LAZYDISTINCTADD(failures[trader_type], "- non-/decl/language-subtype non-null name_language value")

var/list/check_tokens = list()

// Bespoke blacklist check because life is pain.
var/has_token = (TRADER_NO_BLACKLISTED in trader.speech)
var/has_blacklist = length(trader.blacklisted_trade_items)
Expand All @@ -63,7 +67,6 @@
else if(!has_token && has_blacklist)
LAZYDISTINCTADD(failures[trader_type], "- '[TRADER_NO_BLACKLISTED]' response is unset but blacklisted_trade_items is populated")

var/list/check_tokens = list()
for(var/token in trader.speech)

// Simple validity checks.
Expand Down
8 changes: 6 additions & 2 deletions mods/species/vox/datum/trader.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
name_language = /decl/language/vox
compliment_increase = 0
trade_flags = TRADER_GOODS | TRADER_BRIBABLE
var/hailed_vox = FALSE //Whether we have been hailed by a vox. negatives mean pariah, positives mean regular.
blacklisted_trade_items = null

speech = list(
Expand All @@ -19,8 +18,11 @@
TRADER_COMPLIMENT_ACCEPT = "Kikikikiki! Trade is better than talk, yes?",
TRADER_INSULT_GOOD = "Bah! Why does it have to deal with you?",
TRADER_INSULT_BAD = "All you meat is the same! Fuck the off!",
TRADER_BRIBE_ACCEPT = "Skhhhhhk... fine. " + TRADER_TOKEN_TIME + " minutes, no more!",
TRADER_BRIBE_REFUSAL = "No! It is getting impatient with this meat!"
)

var/hailed_vox = FALSE //Whether we have been hailed by a vox. negatives mean pariah, positives mean regular.
var/list/visited_vox_speech = list(
TRADER_HAIL_GENERIC = "SKREEEEE! You friend of the Shoal? You trade with, yes?",
TRADER_HAIL_SILICON = "YOU KNOW THE SHOAL? Yes is good, yes yes, " + TRADER_TOKEN_MOB + ". Trade GOOD!",
Expand All @@ -33,7 +35,9 @@
TRADER_COMPLIMENT_DENY = "You know better than that!",
TRADER_COMPLIMENT_ACCEPT = "You butter it up? Should know better than that.",
TRADER_INSULT_GOOD = "Where this come from? Is trade no good?",
TRADER_INSULT_BAD = "If you say all this at home, you be dead!"
TRADER_INSULT_BAD = "If you say all this at home, you be dead!",
TRADER_BRIBE_ACCEPT = "It can stay for " + TRADER_TOKEN_TIME + " minutes, for most beloved kin as you.",
TRADER_BRIBE_REFUSAL = "Krrkkrhkkhh! You ask too much! It must be moving on."
)
possible_wanted_items = list(
/obj/item/ = TRADER_SUBTYPES_ONLY,
Expand Down

0 comments on commit 436ff39

Please sign in to comment.