Standardize selecting a random chat message, update chat messages

This commit is contained in:
Kyle Coburn 2015-04-30 12:54:32 -07:00
parent 2eb88a1598
commit b673fafbde
3 changed files with 14 additions and 7 deletions

View File

@ -903,7 +903,7 @@ strategyFunctions.potionForMankey = function()
end
local curr_hp = Combat.hp()
if Control.yolo and curr_hp < healForDefense and curr_hp >= yoloHP then
Bridge.chat("Attempting to stay in range of red-bar by skipping potioning before Mankey...")
Bridge.chat("is attempting to stay in range of red-bar by skipping potioning before Mankey...")
end
end
return strategyFunctions.potion({hp=healForDefense, yolo=yoloHP})
@ -1579,7 +1579,7 @@ strategyFunctions.potionBeforeHypno = function()
local healTarget
if healthUnderRedBar >= 0 then
if Strategies.initialize("warned") then
Bridge.chat("Attempting to carry red-bar through Koga. Hypno has a 1 in 4 chance to end the run with Confusion here...")
Bridge.chat("is attempting to carry red-bar through Koga. Hypno has a 1 in 4 chance to end the run with Confusion here...")
end
healTarget = "HypnoHeadbutt"
if useRareCandy then

View File

@ -1361,7 +1361,7 @@ Strategies.functions = {
end,
epicCutscene = function()
local messages = {
Bridge.chatRandom(
" CUTSCENE HYPE!",
" Please, sit back and enjoy the cutscene.",
"is enjoying the scenery Kappa b",
@ -1373,9 +1373,10 @@ Strategies.functions = {
" *yawn*",
" :z",
" I think that ship broke the ocean.",
" Ah, lovely weather today in Vermilion City this time of year, isn't it?",
}
Bridge.chat(Utils.random(messages))
" Ah, lovely weather in Vermilion City this time of year, isn't it?",
" As a devout practicing member of the Church of Going Fast, I find the depiction of this unskippable cutscene offensive, frankly.",
" Anyone else feel cheated we didn't actually get to ride to some far off land in that boat?"
)
return true
end,

View File

@ -1,6 +1,8 @@
local Bridge = {}
local json = require("external.json")
local Utils = require "util.utils"
local json = require "external.json"
local socket
if INTERNAL then
@ -65,6 +67,10 @@ function Bridge.pollForName()
send("poll_name")
end
function Bridge.chatRandom(...)
return Bridge.chat(Utils.random(arg))
end
function Bridge.chat(message, suppressed, extra, newLine)
if not suppressed then
if extra then