#include "game.lua" #include "script/common.lua" #include "ui_extensions.lua" local FONT_SIZE = 24 gTime = 0 gTimeLast = 0 gFrame = 0 gFadeToBlack = 0 blink = nil talk = nil top = 0 middle = 0 bottom = 0 top1 = 0 bottom1 = 0 top2 = 0 bottom2 = 0 image2 = 0 fade = 0 color1 = nil color2 = nil color3 = nil color4 = nil font1 = nil font2 = nil font3 = nil font4 = nil size1 = nil size2 = nil size3 = nil size4 = nil gCurrentShow = nil shakeX = nil shakeY = nil shakeDx = nil shakeDy = nil talkTimer = nil gShows = {} textBreakingPrevious = nil tickerPos = nil hideticker = nil randomStudio = nil randomReporter = nil alpha = nil eventLength = nil bgimage = nil bgsound = nil function justPassed(t) return gTime >= t and gTimeLast < t end function getFirst(str,splitt) splitt = splitt or " " local i = string.find(str, splitt) if i then return string.sub(str, 1, i-1) else return str end end function getSecond(str, splitt) splitt = splitt or " " local i = string.find(str, splitt) if i then return string.sub(str, i+1, string.len(str)) end return "" end function split (inputstr, sep) if sep == nil then sep = "%s" end local t={} --print("****************\n") for str in string.gmatch(inputstr, "([^"..sep.."]+)") do --print("str: " .. str .. " | " .. sep) table.insert(t, str) end --print("****************\n") return t end function UiTextAligned(str) UiPush() for line in str:gmatch("[^\n]+") do local _, h = GetTextSize(line) UiText(line) UiTranslate(0, h) end UiPop() end -------------------------------------------------------------------------------------------------------------------- function pause(dt, params) return gTime < params.length end -------------------------------------------------------------------------------------------------------------------- function newsIntro(dt, params) local textBreaking = GetTranslatedStringByKey("UI_TEXT_BREAKING") local textNews = GetTranslatedStringByKey("UI_TEXT_NEWS") local playSound = true if textBreakingPrevious ~= textBreaking and gTime ~= 0 then gTime = 0 playSound = false end if gTime == 0 then logo = 0 breaking = -400 news = 800 white = 0 if playSound then UiSound("tv/news-intro.ogg") end textBreakingPrevious = textBreaking end local scale = 3.0 UiFont("bold.ttf", FONT_SIZE) local breakingWidth = GetTextSize(textBreaking) * scale local newsWidth = GetTextSize(textNews) * scale local spaceWidth = GetTextSize(" ") * scale local contentSize = breakingWidth + newsWidth + spaceWidth local freeWidth = UiWidth() - contentSize local leftOffset = 190 local rightOffset = 110 local breakingPos = leftOffset local newsPos = UiWidth() - newsWidth - spaceWidth - rightOffset if freeWidth > UiWidth() / 2.0 or freeWidth < leftOffset + rightOffset then breakingPos = freeWidth / 2.0 newsPos = breakingPos + breakingWidth end if justPassed(0.2) then SetValue("logo", 7, "bounce", 1) end if justPassed(1.3) then SetValue("breaking", breakingPos, "easeout", 0.4) end if justPassed(1.5) then SetValue("news", newsPos, "easeout", 0.4) end if justPassed(1.9) then white = 0.5 SetValue("white", 0, "linear", 1.4) end UiPush() UiTranslate(UiCenter(), UiMiddle()) UiColor(0.5,0,0) UiPush() UiTranslate(0, -50) UiScale(logo) UiAlign("center middle") UiText("loc@UI_TEXT_LCN") UiPop() UiTranslate(-UiCenter(), 0) UiPush() UiTranslate(breaking, 70) UiScale(scale) UiText(textBreaking) UiPop() UiPush() UiTranslate(news, 70) UiScale(scale) UiText(" " .. textNews) UiPop() UiPop() UiColor(1,1,1,white) UiRect(640, 480) return gTime < 4.0 end function newsOutro(dt, params) local host = "loc@TXT_HOST_CATLYN" if gTime == 0 then logo = 0 breaking = -400 news = 400 white = 0 UiSound("tv/news-outro.ogg") end UiImage("tv/news_end.jpg") UiPush() UiFont("bold.ttf", FONT_SIZE) UiAlign("middle") UiTranslate(0, 380) UiColor(1,1,1, 0.5) UiRect(GetTextSize(host) + 20, 30) UiColor(0,0,0) UiTranslate(10, 0) UiText(host) UiPop() if justPassed(0.2) then SetValue("logo", 7, "bounce", 1) end UiPush() UiTranslate(UiCenter(), UiMiddle()) UiFont("bold.ttf", FONT_SIZE) UiColor(0.5,0,0) UiPush() UiTranslate(0, -50) UiScale(logo) UiAlign("center middle") UiText("loc@UI_TEXT_LCN") UiPop() UiPop() UiColor(1,1,1,white) UiRect(640, 480) return gTime < 4.0 end -------------------------------------------------------------------------------------------------------------------- function mysteryIntro(dt, params) local lengthTime = 8 if gTime == 0 then creep = 500 SetValue("creep", 0, "easeout", 1.4) UiSound("tv/mystery.ogg") sia1 = 0 sia2 = 0 sia3 = 0 sia4 = 0 sis1 = 0 sis2 = 0 sis3 = 0 sis4 = 0 end --subimage1 if justPassed(0.5) then SetValue("sia1", 1, "easein", 1) SetValue("sis1", 4, "linear", 4) end if justPassed(2.5) then SetValue("sia1", 0, "easeout", 3) end --subimage2 if justPassed(1.5) then SetValue("sia2", 1, "easein", 1) SetValue("sis2", 4, "linear", 4) end if justPassed(3.5) then SetValue("sia2", 0, "easeout", 3) end --subimage3 if justPassed(2.5) then SetValue("sia3", 1, "easein", 1) SetValue("sis3", 4, "linear", 4) end if justPassed(4.5) then SetValue("sia3", 0, "easeout", 3) end --subimage4 if justPassed(3.5) then SetValue("sia4", 1, "easein", 1) SetValue("sis4", 4, "linear", 4) end if justPassed(5.5) then SetValue("sia4", 0, "easeout", 3) end UiPush() local subImageSizeFactor = 0.5 local subImageMoveLength = UiWidth() / (lengthTime*2) -- BG eye UiPush() UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) UiColorFilter(1,1,1,gTime) UiScale(1+gTime*0.1) UiImage("tv/mystery-eye.jpg") UiPop() -- Subimage1 UiPush() UiAlign("center middle") UiTranslate(UiCenter() + sis1*subImageMoveLength, UiMiddle() + sis1*subImageMoveLength) UiColorFilter(1,1,1,sia1) UiScale(sis1*subImageSizeFactor) UiImage("tv/mystery-ankh.png") UiPop() -- Subimage1 UiPush() UiAlign("center middle") UiTranslate(UiCenter() + sis2*subImageMoveLength, UiMiddle() - sis2*subImageMoveLength) UiColorFilter(1,1,1,sia2) UiScale(sis2*subImageSizeFactor) UiImage("tv/mystery-ufo.png") UiPop() -- Subimage3 UiPush() UiAlign("center middle") UiTranslate(UiCenter() - sis3*subImageMoveLength, UiMiddle() - sis3*subImageMoveLength) UiColorFilter(1,1,1,sia3) UiScale(sis3*subImageSizeFactor) UiImage("tv/mystery-ufonews.png") UiPop() -- Subimage4 UiPush() UiAlign("center middle") UiTranslate(UiCenter() - sis4*subImageMoveLength, UiMiddle() + sis4*subImageMoveLength) UiColorFilter(1,1,1,sia4) UiScale(sis4*subImageSizeFactor) UiImage("tv/mystery-pyramids.png") UiPop() UiColor(0.5, 0, 0, 1) UiFont("bold.ttf", 96) UiTranslate(0, creep) UiPush() UiTranslate(UiCenter() - 160 + math.sin(gTime*2.2) * 12, UiMiddle() - 120 + math.sin(gTime*2) * 20) UiText("loc@UI_TEXT_T") UiPop() UiPush() UiTranslate(UiCenter() - 80 - math.sin(gTime*1.8) * 16, UiMiddle() - 120 - math.sin(gTime*2.4) * 14) UiText("loc@UI_TEXT_H") UiPop() UiPush() UiTranslate(UiCenter() + 0 + math.sin(gTime*2.6) * 18, UiMiddle() - 120 + math.sin(gTime*1.8) * 16) UiText("loc@UI_TEXT_E") UiPop() UiPush() UiTranslate(UiCenter() - 280 + math.sin(gTime*2.2) * 12, UiMiddle() + math.sin(gTime*2) * 20) UiText("loc@UI_TEXT_M") UiPop() UiPush() UiTranslate(UiCenter() - 160 - math.sin(gTime*1.8) * 12, UiMiddle() - math.sin(gTime*2.4) * 14) UiText("loc@UI_TEXT_Y") UiPop() UiPush() UiTranslate(UiCenter() - 80 + math.sin(gTime*2.6) * 20, UiMiddle() + math.sin(gTime*1.8) * 14) UiText("loc@UI_TEXT_S") UiPop() UiPush() UiTranslate(UiCenter() - 0 - math.sin(gTime*2.8) * 8, UiMiddle() - math.sin(gTime*3) * 10) UiText("loc@UI_TEXT_T") UiPop() UiPush() UiTranslate(UiCenter() + 80 + math.sin(gTime*1.1) * 13, UiMiddle() + math.sin(gTime*1.5) * 18) UiText("loc@UI_TEXT_E") UiPop() UiPush() UiTranslate(UiCenter() + 160 - math.sin(gTime*3.2) * 18, UiMiddle() - math.sin(gTime*2.2) * 12) UiText("loc@UI_TEXT_R") UiPop() UiPush() UiTranslate(UiCenter() + 240 + math.sin(gTime*2.3) * 14, UiMiddle() + math.sin(gTime*2.8) * 6) UiText("loc@UI_TEXT_Y") UiPop() UiPush() UiTranslate(UiCenter() - 80 + math.sin(gTime*2.2) * 12, UiMiddle() + 120 + math.sin(gTime*2) * 18) UiText("loc@UI_TEXT_S") UiPop() UiPush() UiTranslate(UiCenter() - 0 - math.sin(gTime*1.8) * 10, UiMiddle() + 120 - math.sin(gTime*2.4) * 14) UiText("loc@UI_TEXT_H") UiPop() UiPush() UiTranslate(UiCenter() + 80 + math.sin(gTime*2.6) * 16, UiMiddle() + 120 + math.sin(gTime*1.8) * 20) UiText("loc@UI_TEXT_O") UiPop() UiPush() UiTranslate(UiCenter() + 160 + math.sin(gTime*2.6) * 14, UiMiddle() + 120 + math.sin(gTime*1.8) * 12) UiText("loc@UI_TEXT_W") UiPop() UiPop() return gTime < lengthTime end -------------------------------------------------------------------------------------------------------------------- function diyIntro(dt, params) local lengthTime = 8 if gTime == 0 then creep = 500 SetValue("creep", 0, "easeout", 1.4) UiSound("tv/diy-intro.ogg") sia1 = 0 sia2 = 0 sia3 = 0 sia4 = 0 sis1 = 0 sis2 = 0 sis3 = 0 sis4 = 0 end --subimage1 if justPassed(0.5) then SetValue("sia1", 1, "easein", 1) SetValue("sis1", 4, "linear", 4) end if justPassed(2.5) then SetValue("sia1", 0, "easeout", 3) end --subimage2 if justPassed(1.5) then SetValue("sia2", 1, "easein", 1) SetValue("sis2", 4, "linear", 4) end if justPassed(3.5) then SetValue("sia2", 0, "easeout", 3) end --subimage3 if justPassed(2.5) then SetValue("sia3", 1, "easein", 1) SetValue("sis3", 4, "linear", 4) end if justPassed(4.5) then SetValue("sia3", 0, "easeout", 3) end --subimage4 if justPassed(3.5) then SetValue("sia4", 1, "easein", 1) SetValue("sis4", 4, "linear", 4) end if justPassed(5.5) then SetValue("sia4", 0, "easeout", 3) end UiPush() local subImageSizeFactor = 0.5 local subImageMoveLength = UiWidth() / (lengthTime*2) -- BG eye UiPush() UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) UiColorFilter(1,1,1,gTime) UiScale(1+gTime*0.1) UiImage("tv/diybg.jpg") UiPop() -- Subimage1 UiPush() UiAlign("center middle") UiTranslate(UiCenter() + sis1*subImageMoveLength, UiMiddle() + sis1*subImageMoveLength) UiColorFilter(1,1,1,sia1) UiScale(sis1*subImageSizeFactor) UiImage("tv/diy1.png") UiPop() -- Subimage1 UiPush() UiAlign("center middle") UiTranslate(UiCenter() + sis2*subImageMoveLength, UiMiddle() - sis2*subImageMoveLength) UiColorFilter(1,1,1,sia2) UiScale(sis2*subImageSizeFactor) UiImage("tv/diy2.png") UiPop() -- Subimage3 UiPush() UiAlign("center middle") UiTranslate(UiCenter() - sis3*subImageMoveLength, UiMiddle() - sis3*subImageMoveLength) UiColorFilter(1,1,1,sia3) UiScale(sis3*subImageSizeFactor) UiImage("tv/diy3.png") UiPop() -- Subimage4 UiPush() UiAlign("center middle") UiTranslate(UiCenter() - sis4*subImageMoveLength, UiMiddle() + sis4*subImageMoveLength) UiColorFilter(1,1,1,sia4) UiScale(sis4*subImageSizeFactor) UiImage("tv/diy4.png") UiPop() UiPop() return gTime < lengthTime end -------------------------------------------------------------------------------------------------------------------- function newsShow(dt, params) local reporter = params.reporter or "reporter" local public = params.public or "man" if gTime == 0 then tickerPos = 900 done = false hideticker = 1 event = 0 eventTimer = 0.0 eventTime = 0.0 randomStudio = math.random(0,3) randomReporter = math.random(0,3) end if justPassed(1.0) then SetValue("hideticker", 0, "easeout", 0.4) end if eventTimer <= 0.0 then event = event + 1 if event > #params.events then event = 1 end eventTimer = 5.0 eventTime = 0.0 end if event > 0 then local prevFirst = "" local prevSecond = "" if event > 1 then prevFirst = getFirst(params.events[event-1]) prevSecond = getSecond(params.events[event-1]) end local nextFirst = "" local nextSecond = "" if event < #params.events-1 then nextFirst = getFirst(params.events[event+1]) nextSecond = getSecond(params.events[event+1]) end if prevFirst == "reporter" or prevFirst == "interview" then prevSecond = "" end if nextFirst == "reporter" or nextFirst == "interview" then nextSecond = "" end local e = params.events[event] local first = getFirst(e) local second = getSecond(e) if first == "studio" then if blink then UiImage("tv/news_blink.jpg") else if talk then UiImage("tv/news_talk.jpg") else UiImage("tv/news.jpg") end end if second ~= "" then UiPush() local t = 1.0 if second == prevSecond and eventTime < 0.5 then t = eventTime*2.0 end if second == nextSecond and eventTimer < 0.5 then t = eventTimer*2.0 end UiTranslate(320*t, 70*t) UiScale(1.0-0.6*t) UiImage(second) UiPop() end elseif first == "still" then UiImage(second) elseif first == "zoom" then UiPush() UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) UiScale(1 + eventTime*0.03) UiImage(second) UiPop() elseif first == "shake" then UiPush() UiTranslate(UiCenter() + shakeX*10, UiMiddle() + shakeY*10) UiAlign("center middle") UiScale(1.05) UiPush() UiRotate(math.deg((shakeX+shakeY)*0.005)) UiImage(second) UiPop() UiTranslate(-shakeX*5, -shakeY*5) UiRotate(math.deg((shakeX+shakeY)*0.002)) if gFrame%130 < 5 then UiImage("tv/" .. reporter .. "_blink.png") else if talk then UiImage("tv/" .. reporter .. "_talk.png") else UiImage("tv/" .. reporter .. ".png") end end UiPop() elseif first == "reporter" then UiPush() UiTranslate(UiCenter() + shakeX*10, UiMiddle() + shakeY*10) UiAlign("center middle") UiScale(1.05) UiPush() UiRotate(math.deg((shakeX+shakeY)*0.005)) UiImage(second) UiPop() UiTranslate(-shakeX*5, -shakeY*5) UiRotate(math.deg((shakeX+shakeY)*0.002)) if reporter ~= "" then if blink then UiImage("tv/" .. reporter .. "_blink.png") else if talk then UiImage("tv/" .. reporter .. "_talk.png") else UiImage("tv/" .. reporter .. ".png") end end end UiPop() elseif first == "interview" then UiPush() UiTranslate(UiCenter() + shakeX*10, UiMiddle() + shakeY*10) UiAlign("center middle") UiScale(1.05) UiPush() UiRotate(math.deg((shakeX+shakeY)*0.005)) UiImage(second) UiPop() UiTranslate(-shakeX*5, -shakeY*5) UiImage("tv/" .. public .. ".png") UiTranslate(-shakeX*5, -shakeY*5) UiRotate(math.deg((shakeX+shakeY)*0.002)) if reporter ~= "" then if blink then UiImage("tv/" .. reporter .. "_blink.png") else if talk then UiImage("tv/" .. reporter .. "_talk.png") else UiImage("tv/" .. reporter .. ".png") end end end UiPop() end if first == "reporter" or first == "interview" then UiSoundLoop("tv/reporter" .. randomReporter .. ".ogg", .5) else UiSoundLoop("tv/studio" .. randomStudio .. ".ogg", .5) end end eventTimer = eventTimer - dt eventTime = eventTime + dt UiPush() UiTranslate(0, 390 + 120*hideticker) UiColor(0.3, 0.0, 0.0) UiRect(640, 60) UiPush() UiFont("bold.ttf", FONT_SIZE) UiAlign("left middle") UiTranslate(0, -15) UiColor(1,1,1, 0.5) local w, _ = GetTextSize(params.title) UiRect(w + 20, 30) UiColor(0,0,0) UiTranslate(10, 0) UiText(params.title) UiPop() UiColor(1,1,1) UiTranslate(tickerPos, 30) tickerPos = tickerPos - dt*170 UiFont("bold.ttf", FONT_SIZE) UiScale(2.0) UiAlign("left middle") w, _ = UiText(params.ticker) if tickerPos + w*2.0 < 0 then done = true end UiPop() UiPush() local FONT_SIZE = 24 UiFont("bold.ttf", FONT_SIZE) local text = "loc@UI_TEXT_LCN" local sizeX = GetTextSize(text) UiAlign("right") UiTranslate(UiWidth(), 12) UiColor(1, 1, 1, 0.5) UiRect(sizeX + 20, 26) UiTranslate(-10, 20) UiColor(0.5, 0, 0, 1) UiText(text) UiPop() return not done end -------------------------------------------------------------------------------------------------------------------- function mystery(dt, params) local subs = false if gTime == 0 then done = false event = 0 eventTimer = 0.0 eventTime = 0.0 alpha = 3 eventLength = params.eventlength bgimage = params.bgimage bgsound = params.bgsound end UiPush() if eventTimer <= 0.0 then event = event + 1 if event > #params.events then done = true event = #params.events end eventLength = getSecond(getFirst(params.events[event],"|"),"*") if eventLength == nil then eventLength = 4.0 end eventTimer = eventLength eventTime = 0.0 end if event > 0 and event <= #params.events then UiSoundLoop(bgsound) local e = params.events[event] local first = getFirst(getFirst(e,"|"),"*") local second = getSecond(e,"|") local images = split(second) if first == "title" then UiPush() UiPush() UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) if params.bgzoom > 0 then UiScale(1 + gTime*0.05) end UiImage(bgimage) UiPop() UiAlign("center middle") UiTranslate(UiWidth()/2,UiHeight()/2) UiScale(1+eventTime*0.1) UiFont("bold.ttf", 48) UiText(second) UiPop() elseif first == "outro" then alpha = alpha - dt UiColorFilter(1,1,1,alpha) UiPush() UiPush() UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) if params.bgzoom > 0 then UiScale(1 + gTime*0.05) end UiImage(bgimage) UiPop() UiAlign("center middle") UiTranslate(UiWidth()/2,UiHeight()/2) --UiScale(1+eventTime*0.1) UiFont("bold.ttf", 48) local referencePadding = 130 local w, _ = GetTextSize(second) local initialScale = (UiWidth() - 2 * referencePadding) / w -- Initial scaling local finalScale = (UiWidth()) / w -- Final scaling -- Animate the scaling factor from initialScale to finalScale local t = eventTime / eventLength -- Normalized time from 0 to 1 local scale = lerp(initialScale, finalScale, t) UiScale(scale) UiText(second) UiPop() else UiPush() UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) if params.bgzoom > 0 then UiScale(1 + gTime*0.05) end UiImage(bgimage) UiPop() if #images > 1 then local timePerImage = eventLength/(#images) for i= 0, math.floor(eventTime/(timePerImage)),1 do UiPush() --if i == 0 then -- UiColorFilter(1,1,1,1) --else UiColorFilter(1,1,1,eventTime-timePerImage*i) --end --UiColorFilter(1,1,1,eventTimer) UiAlign("center middle") UiTranslate(UiWidth()/2,UiHeight()/2) UiImage(images[i+1]) UiPop() end else UiPush() UiAlign("center middle") UiTranslate(UiWidth()/2,UiHeight()/2) if #images == 1 then UiScale(1+eventTime*0.1) end UiImage(images[1]) UiPop() end if eventTime > 0.5 and eventTime < eventLength-0.5 then subs = true else subs = false end if subs then UiPush() local margin = 20 local padding = 10 UiColor(0, 0, 0, 1) UiAlign("top center") UiTextAlignment("center") UiFont("bold.ttf", 32) UiWordWrap(UiWidth() - 2 * margin) local textW, textH = GetTextSize(first) textW = math.min(textW + padding * 2, UiWidth()) UiTranslate(UiWidth()/2, UiHeight() - textH - 50) UiColor(0.0,0.0,0.0,0.5) UiRect(textW, textH + padding) UiColor(1, 1, 1, 1) UiTranslate(0, padding) UiText(first) UiPop() end end UiPop() end eventTimer = eventTimer - dt eventTime = eventTime + dt return not done end -------------------------------------------------------------------------------------------------------------------- function commercial1(dt, params) if gTime == 0 then UiSound("tv/auction.ogg") top = 0 middle = 0 bottom = 0 end if justPassed(1.0) then SetValue("top", 1, "linear", 0.3) end if justPassed(2.0) then SetValue("middle", 1, "linear", 0.3) end if justPassed(3.0) then SetValue("bottom", 1, "linear", 0.3) end UiImage(params.image) UiAlign("center middle") UiFont("bold.ttf", FONT_SIZE) if params.top then UiPush() local a = top UiTranslate(UiCenter(), UiMiddle()-100 - (1.0-a)*200) UiScale(2.0) UiTextOutline(0, 0, 0, a, 0.2) UiColor(1, 1, 1, a) UiText(params.top) UiPop() end if params.middle then UiPush() local a = middle UiTranslate(UiCenter(), 240) UiScale(2.0*a) UiTextOutline(0, 0, 0, a, 0.2) UiColor(0.5, 1, 1, a) UiText(params.middle) UiPop() end if params.bottom then UiPush() local a = bottom UiTranslate(UiCenter(), UiMiddle()+100 + (1.0-a)*200) UiScale(1.75) UiTextOutline(0, 0, 0, a, 0.2) UiColor(1, 1, 0, a) UiText(params.bottom) UiPop() end return gTime < 8 end -------------------------------------------------------------------------------------------------------------------- function commercial(dt, params) if gTime == 0 then UiSound(params.audio) top1 = 0 bottom1 = 0 top2 = 0 bottom2 = 0 image2 = 0 fade = 1 color1 = params.color1 or {r=1, g=1, b=1} color2 = params.color2 or {r=1, g=1, b=1} color3 = params.color3 or {r=1, g=1, b=1} color4 = params.color4 or {r=1, g=1, b=1} font1 = params.font1 or "bold.ttf" font2 = params.font2 or "bold.ttf" font3 = params.font3 or "bold.ttf" font4 = params.font4 or "bold.ttf" size1 = params.size1 or 22 size2 = params.size2 or FONT_SIZE size3 = params.size3 or FONT_SIZE size4 = params.size4 or FONT_SIZE end local textScale = 2.0 local commercialText = function(txt, width) local w,_ = GetTextSize(txt) w = w * textScale if w > UiWidth() then local scale = width / w UiScale(scale) UiText(txt) else UiText(txt) end end if justPassed(1.0) then SetValue("top1", 1, "linear", 0.3) end if justPassed(2.0) then SetValue("bottom1", 1, "linear", 0.3) end if justPassed(4.8) then SetValue("fade", 0, "easeout", 0) end if justPassed(5.0) then SetValue("top2", 1, "linear", 0.3) end if justPassed(6.0) then SetValue("bottom2", 1, "linear", 0.3) end if gTime >= 5.0 then UiPush() if params.zoom2 then UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) UiScale(1 + gTime*0.03) end UiImage(params.image2) UiPop() UiAlign("center middle") end if params.text3 then UiPush() local a = top2 UiFont(font3, size3) UiTranslate(UiCenter(), UiMiddle()-150 - (1.0-a)*200) UiScale(textScale) UiTextOutline(0, 0, 0, a, 0.3) UiColor(color3.r, color3.g, color3.b, a) commercialText(params.text3, 560) UiPop() end if params.text4 then UiPush() local a = bottom2 UiFont(font4, size4) UiTranslate(UiCenter(), UiMiddle()+150 + (1.0-a)*200) UiScale(textScale) UiTextOutline(0, 0, 0, a, 0.3) UiColor(color4.r, color4.g, color4.b, a) UiAlign("center") commercialText(params.text4, UiWidth() - 40) UiPop() end if gTime < 5.0 then UiPush() if params.zoom1 then UiAlign("center middle") UiTranslate(UiCenter(), UiMiddle()) UiScale(1 + gTime*0.03) end UiImage(params.image1) UiPop() UiAlign("center middle") if params.text1 then UiPush() local a = top1 UiFont(font1, size1) UiTranslate(UiCenter(), UiMiddle()-150 - (1.0-a)*200) UiScale(textScale) UiTextOutline(0, 0, 0, a, 0.3) UiColor(color1.r, color1.g, color1.b, a) UiAlign("center") UiText(params.text1) UiPop() end if params.text2 then UiPush() local a = bottom1 UiFont(font2, size2) UiTranslate(UiCenter(), UiMiddle()+150 + (1.0-a)*200) UiScale(textScale) UiTextOutline(0, 0, 0, a, 0.3) UiColor(color2.r, color2.g, color2.b, a) UiTextAligned(params.text2) UiPop() end end return gTime < 11 end -------------------------------------------------------------------------------------------------------------------- function addShow(showFunc, showParams) gShows[#gShows+1] = {func = showFunc, params = showParams} end function isMissionCompleted(missionId) return GetInt("savegame.mission."..missionId..".score") > 0 end function init() gTime = 0 gTimeLast = 0 gFrame = 0 gFadeToBlack = 0 gShows = {} addShow(pause, {length = 1}) local lastCompleted = GetString("savegame.lastcompleted") if not isMissionCompleted("mall_intro") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_WRECKED_REVENUES", ticker = "loc@TICKER_THE_DEMOLITION", events = { "studio", "studio tv/demochart.jpg", "still tv/demochart.jpg", "still tv/demochart.jpg", "studio tv/tracy-mugshot.jpg", "studio", "studio", } } ) addShow(newsShow, { title = "loc@TITLE_LEE_CHEMICALS_IN_THE_BLACK", ticker = "loc@TICKER_LEE_CHEMICALS_SHOWED_FIGURES", events = { "studio", "studio tv/lee.jpg", "zoom tv/lee.jpg", "studio", } } ) addShow(newsOutro) end if isMissionCompleted("mall_intro") and not isMissionCompleted("lee_computers") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_CULTURAL_HERITAGE_SITE_DESTROYED", ticker = "loc@TICKER_THE_LOCALLY", events = { "zoom tv/mall-intro-intro.jpg", "studio tv/mall-intro-intro.jpg", "studio tv/mall-intro-bg.jpg", "interview tv/mall-intro-bg.jpg", "zoom tv/mall-intro1.jpg", "studio tv/mall-intro1.jpg", "studio", } } ) addShow(newsShow, { title = "loc@TITLE_LEE_CHEMICALS_MARINA_MOVE", ticker = "loc@TICKER_LEE_CHEMICALS_IS_MOVING", public="lawrence-lee-jr", events = { "studio tv/lee2.jpg", "zoom tv/lee2.jpg", "interview tv/lee1.jpg", "interview tv/lee1.jpg", "interview tv/lee1.jpg", "studio tv/lee1.jpg", "studio", "studio", } } ) addShow(newsOutro) end if isMissionCompleted("lee_computers") and not isMissionCompleted("lee_login") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_HIT_AND_RUN_NO_FUN_FOR_LEE_SON", ticker = "loc@TICKER_THERE_HAS", public = "lawrence-lee-jr", events = { "studio", "reporter tv/lee.jpg", "studio tv/lee.jpg", "interview tv/destroyed.jpg", "studio tv/lee-in-office.jpg", "zoom tv/lee-in-office.jpg", "studio", } } ) addShow(newsOutro) addShow(commercial1, { image="tv/auction.jpg", top="loc@TXT_BLACK_RIVER_AU_TITLE", middle="loc@TXT_BLACK_RIVER_AU_MIDDLE", bottom="loc@TXT_BLACK_RIVER_AU_BOTTOM" }) end if isMissionCompleted("lee_login") and not isMissionCompleted("marina_demolish") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_BURGLARS_GAIN_ACCESS_TO_GAIN_ACCESS", ticker = "loc@TICKER_LEE_CHEMICALS_WAS_HIT", events = { "studio", "studio tv/lee-login4.jpg", "studio tv/lee-login5.jpg", "studio tv/lee-login6.jpg", "zoom tv/lee-login4.jpg", "zoom tv/lee-login5.jpg", "zoom tv/lee-login6.jpg", "studio", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/gubbgrill.ogg", image1 = "tv/ad-gubbgrill1.jpg", zoom1 = true, text1 = "loc@TEXT1_DECENT_FOOD", text2 = "loc@TEXT2_DECENT_PRICES", image2 = "tv/ad-gubbgrill2.jpg", text3 = "loc@TEXT3_IN_WESTPOINT", text4 = "loc@TEXT4_TRY_OUR", size1 = 18, size2 = 18, size3 = 18, size4 = 18, color1 = {r=1, g=0, b=0}, color2 = {r=1, g=1, b=0}, color3 = {r=1, g=0, b=0}, color4 = {r=1, g=1, b=0}, } ) end if isMissionCompleted("marina_demolish") and not isMissionCompleted("marina_cars") then addShow(mysteryIntro) addShow(mystery, { eventlength = 6, bgimage = "tv/mystery-eye.jpg", bgsound="tv/mystery2.ogg", bgzoom = 1, events = { "title*4|" .. "loc@TITLE_THE_GHOST_CABIN", "loc@TXT_THE_GHOST_CABIN_1" .. "*6|tv/mystery-cabinphoto.jpg", "loc@TXT_THE_GHOST_CABIN_2" .. "*8|tv/mystery-4cabins.png tv/mystery-5cabins.png", "loc@TXT_THE_GHOST_CABIN_3" .. "*6|tv/mystery-document1.png tv/mystery-document2.png tv/mystery-document3.png tv/mystery-document4.png tv/mystery-document5.png tv/mystery-document6.png", "loc@TXT_THE_GHOST_CABIN_4" .. "*6|tv/mystery-ghostcabin.png tv/mystery-questionmarks.png", "outro*6|" .. "loc@OUTRO_THE_GHOST_CABIN" } } ) end if lastCompleted == "marina_cars" then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_AGED_AUTOMOBILES_ABDUCTED", ticker = "loc@TICKER_TWO_CLASSIC", events = { "studio", "studio tv/lee-cars-intro.jpg", "still tv/lee-cars-intro.jpg", "zoom tv/lee-cars1.jpg", "zoom tv/lee-cars2.jpg", "studio tv/lee-cars-intro.jpg", } } ) addShow(newsOutro) end if lastCompleted == "marina_gps" then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_GPS_UNITS_STOLEN", ticker = "loc@TICKER_THE_MARINA", events = { "studio", "studio tv/marina-gps-intro.jpg", "still tv/marina-gps-intro.jpg", "zoom tv/marina-gps1.jpg", "zoom tv/marina-gps2.jpg", "studio tv/marina-gps-intro.jpg", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/expensive-kitchenware.ogg", image1 = "tv/ad-knife1.jpg", zoom1 = true, text1 = "loc@TEXT1_SHARP", text2 = "loc@TEXT2_SIMPLE", image2 = "tv/ad-knife2.jpg", text3 = "loc@TEXT3_EXPENSIVE", text4 = "loc@TEXT4_KNIVES", color1= {r=0, g=0, b=0}, color2= {r=0, g=0, b=0}, color3= {r=0, g=0, b=0}, color4= {r=0, g=0, b=0}, } ) end if lastCompleted == "mansion_pool" then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_VILLA_GORDON_VANDALIZED", ticker = "loc@TICKER_RETURNING_FROM", events = { "studio", "studio tv/carwash-intro.jpg", "still tv/carwash-intro.jpg", "zoom tv/carwash1.jpg", "zoom tv/carwash2.jpg", "studio", "studio", } } ) end if lastCompleted == "lee_safe" then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_SPECTACULAR_BREAKIN_AT_LEE", ticker = "loc@TICKER_LEE_CHEMICALS_SUFFERED", events = { "studio", "studio tv/lee-safe1.jpg", "still tv/lee-safe1.jpg", "zoom tv/lee-safe2.jpg", "studio tv/lee-safe2.jpg", "still tv/lee-safe3.jpg", "studio tv/lee-safe3.jpg", } } ) end if isMissionCompleted("marina_cars") and not isMissionCompleted("lee_tower") then addShow(newsShow, { title = "loc@TITLE_LEE_TOWER_75TH_ANNIVERSARY", ticker = "loc@TICKER_THIS_WEEKEND", public = "lawrence-lee-jr", events = { "studio", "studio tv/towerdocu-3.jpg", "reporter tv/towerdocu-bg.jpg", "studio tv/lee-grandfather.jpg", "interview tv/towerdocu-bg.jpg", "zoom tv/towerdocu-1.jpg", "zoom tv/towerdocu-6.jpg", "zoom tv/towerdocu-5.jpg", "zoom tv/towerdocu-9.jpg", "studio tv/lee-chemicals-logo.jpg", "studio", } } ) addShow(newsOutro) end if isMissionCompleted("lee_tower") and not isMissionCompleted("mansion_art") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_LEE_TOWER_TOPPLED", ticker = "loc@TICKER_LEE_CHEMICALS_FAMOUS_TOWER", public="lawrence-lee-jr", events = { "zoom tv/lee-tower-intro.jpg", "studio tv/lee-tower-intro.jpg", "studio tv/lee-tower1.jpg", "zoom tv/lee-tower2.jpg", "zoom tv/lee-tower3.jpg", "zoom tv/lee-tower4.jpg", "interview tv/lee-tower-bg.jpg", "studio tv/lee-tower-bg.jpg", "studio", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/parade.ogg", text1 = "loc@TEXT1_LCKELLE_CELEBRATIONS", image1 = "tv/ad-parade1.jpg", text2 = "loc@TEXT2_HOME_GUARD", image2 = "tv/ad-parade2.jpg", zoom2 = true, text3 = "loc@TEXT3_LIVE_MUSIC", text4 = "loc@TEXT4_SEE_YOU", } ) end if lastCompleted == "marina_tools" then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_TOOLS_MISSING_FROM_THE_MARINA", ticker = "loc@TICKER_SEVERAL_EXPENSIVE", events = { "studio tv/tools-intro.jpg", "zoom tv/tools-intro.jpg", "studio tv/tools1.jpg", "studio tv/tools2.jpg", "studio", } } ) end if isMissionCompleted("mansion_art") and not isMissionCompleted("marina_art_back") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_THUNDERSTORM_APPROACHING", ticker = "loc@TICKER_A_MASSIVE", events = { "studio", "studio tv/weather3.jpg", "still tv/weather3.jpg", "still tv/weather6.jpg", "studio tv/weather6.jpg", "studio tv/weather6.jpg", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/bayran.ogg", image1 = "tv/ad-bayrans1.jpg", zoom1 = true, text1 = "loc@TEXT1_WHEN_YOU", text2 = "loc@TXT_COMERCIAL_1", image2 = "tv/ad-bayrans2.jpg", text3 = "loc@TEXT3_CHOOSE", color3= {r=0, g=0, b=0}, text4 = "loc@TEXT4_BAYRANS", size4 = 42, color4= {r=0, g=0, b=0}, } ) end if lastCompleted == "mansion_fraud" then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_NOISE_AT_VILLA_GORDON", ticker = "loc@TICKER_LOUD_NOISES", events = { "zoom tv/fraud4.jpg", "still tv/fraud2.jpg", "studio tv/fraud2.jpg", "zoom tv/fraud1.jpg", "studio tv/fraud1.jpg", "studio tv/fraud3.jpg", "studio", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/bluetide.ogg", image1 = "tv/ad-bluetide1.jpg", image2 = "tv/ad-bluetide3.jpg", zoom1 = true, text1 = "loc@TEXT1_BLUETIDE", size1 = 36, text2 = "loc@TEXT2_IT'S_A", } ) end if isMissionCompleted("marina_art_back") and not isMissionCompleted("caveisland_computers") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_MARINA_STRUCK_BY_LIGHTNING", ticker = "loc@TICKER_SEVERAL_BUILDINGS", events = { "studio tv/thunder1.jpg", "zoom tv/thunder4.jpg", "zoom tv/thunder5.jpg", "zoom tv/thunder2.jpg", "studio tv/thunder2.jpg", "zoom tv/thunder6.jpg", "zoom tv/thunder3.jpg", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/russian-caviar.ogg", image1 = "tv/ad-caviar1.jpg", zoom1 = true, text1 = "loc@TEXT1_WANT_TO", text2 = "loc@TEXT2_WANT_TO", image2 = "tv/ad-caviar2.jpg", text3 = "loc@TEXT3_RUSSIAN_CAVIAR", color3= {r=1, g=0, b=0}, text4 = "loc@TEXT4_GOES_WELL", } ) end if isMissionCompleted("caveisland_computers") and not isMissionCompleted("mansion_safe") then addShow(diyIntro) addShow(mystery, { eventlength = 6, bgimage = "tv/black.jpg", bgsound="tv/diy.ogg", bgzoom = 0, events = { "title*4|" .. "loc@TITLE_PORTABLE_SHED", "loc@TXT_PORTABLE_SHED_1" .. "*6|tv/waterproof-rain.jpg tv/waterproof-precious.png", "loc@TXT_PORTABLE_SHED_2" .. "*9|tv/w1.jpg tv/w3.jpg tv/w4.jpg", "loc@TXT_PORTABLE_SHED_3" .. "*6|tv/w5.jpg tv/w5.jpg", "loc@TXT_PORTABLE_SHED_4" .. "*16|tv/white.jpg tv/w6s.png tv/w7s.png tv/w8s.png tv/w9s.png tv/w10s.png tv/w11s.png tv/w12s.png tv/w13s.png tv/w14s.png", "loc@TXT_PORTABLE_SHED_5" .. "*5| tv/waterproof-precious.png", "outro*6|" .. "loc@OUTRO_PORTABLE_SHED" } } ) end if isMissionCompleted("mansion_safe") and not isMissionCompleted("lee_powerplant") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_INCREASE_IN_VANDALISM", ticker = "loc@TICKER_BREAKUP_GORDON_WOO", events = { "studio", "studio", "studio tv/gordon-office.jpg", "studio tv/mansion-safe2.jpg", "zoom tv/mansion-safe2.jpg", "still tv/mansion-safe1.jpg", "studio tv/mansion-safe1.jpg", "studio", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/expensive-kitchenware.ogg", image1 = "tv/ad-foodprocessor1.jpg", zoom1 = true, text1 = "loc@TEXT1_MIX", text2 = "loc@TEXT2_BLEND", image2 = "tv/ad-foodprocessor2.jpg", text3 = "loc@TEXT3_EXPENSIVE", text4 = "loc@TEXT4_FOOD_PROCESSOR", color1= {r=0, g=0, b=0}, color2= {r=0, g=0, b=0}, color3= {r=0, g=0, b=0}, color4= {r=0, g=0, b=0}, } ) end if lastCompleted == "caveisland_propane" then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_LOUD_BANGS_IN_ARCHIPELAGO", ticker = "loc@TICKER_SEVERAL_REPORTS", public = "troch", events = { "studio", "studio tv/propane2.jpg", "studio tv/propane1.jpg", "zoom tv/propane1.jpg", "interview tv/propane3.jpg", "interview tv/propane3.jpg", "studio", } } ) addShow(newsOutro) end if isMissionCompleted("lee_powerplant") and not isMissionCompleted("caveisland_dishes") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_RESERVOIR_DAM_BREAKS", ticker = "loc@TICKER_A_SUDDEN", public="keen", events = { "studio", "studio tv/dam3.jpg", "zoom tv/dam1.jpg", "interview tv/dam2.jpg", "studio tv/dam2.jpg", "studio", } } ) addShow(newsOutro) end if isMissionCompleted("caveisland_dishes") and not isMissionCompleted("lee_flooding") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_SUDDEN_SATELLITE_COVERAGE", ticker = "loc@TICKER_SINCE_THIS", public="stolop", events = { "studio", "studio tv/satelite2.jpg", "still tv/satelite2.jpg", "interview tv/satelite1.jpg", "interview tv/satelite1.jpg", "studio tv/satelite1.jpg", "studio tv/ntc.jpg", "studio", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/bluetide.ogg", image1 = "tv/ad-bluetide2.jpg", text2 = "loc@TEXT2_IT'S_A", image2 = "tv/ad-bluetide4.jpg", zoom2 = true, text3 = "loc@TEXT3_BLUETIDE_EXTRA", text4 = "loc@TXT_LIMITED_EDITTION", } ) end if isMissionCompleted("lee_flooding") and not isMissionCompleted("frustrum_chase") then addShow(commercial, { audio = "tv/bluetide.ogg", image1 = "tv/ad-bluetide2.jpg", text2 = "loc@TEXT2_IT'S_A", image2 = "tv/ad-bluetide4.jpg", zoom2 = true, text3 = "loc@TEXT3_BLUETIDE_EXTRA", text4 = "loc@TXT_LIMITED_EDITTION", } ) addShow(commercial, { audio = "tv/expensive-kitchenware.ogg", image1 = "tv/ad-foodprocessor1.jpg", zoom1 = true, text1 = "loc@TEXT1_MIX", text2 = "loc@TEXT2_BLEND", image2 = "tv/ad-foodprocessor2.jpg", text3 = "loc@TEXT3_EXPENSIVE", text4 = "loc@TEXT4_FOOD_PROCESSOR", color1= {r=0, g=0, b=0}, color2= {r=0, g=0, b=0}, color3= {r=0, g=0, b=0}, color4= {r=0, g=0, b=0}, } ) end -------------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- --- -- PART 2 --- -------------------------------------------------------- -------------------------------------------------------- -------------------------------------------------------- if isMissionCompleted("frustrum_chase") and not isMissionCompleted("factory_espionage") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_LEE_CHEMICALS_DECOMMISSIONED", ticker = "loc@TICKER_FOLLOWING_THE", events = { "studio tv/lee-convicted3.jpg", "studio tv/lee-demolish3.jpg", "zoom tv/lee-demolish3.jpg", "still tv/lee-demolish2.jpg", "studio tv/lee-demolish1.jpg", "studio tv/lee-for-sale1.jpg", "zoom tv/lee-for-sale1.jpg", "still tv/lee-for-sale1.jpg", } } ) addShow(newsOutro) end if isMissionCompleted("factory_espionage") and not isMissionCompleted("caveisland_ingredients") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_GORDON_WOO_BUYS_LEE_PLOT", ticker = "loc@TICKER_WOO_ANNOUNCED", public = "gordon-office-solo", reporter = "", events = { "studio", "studio tv/evertides1.jpg", "interview tv/evertides-breakin2.jpg", "interview tv/evertides-breakin2.jpg", "still tv/gordon-buys-lee1.jpg", "still tv/gordon-buys-lee2.jpg", "zoom tv/gordon-buys-lee2.jpg", "studio tv/gordon-buys-lee2.jpg", "studio", } } ) addShow(newsOutro) end if isMissionCompleted("caveisland_ingredients") and not isMissionCompleted("frustrum_tornado") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_FRUSTRUM_EVAC", ticker = "loc@TICKER_FRUSTRUM_EVAC", events = { "studio tv/frustrum-evacuated1.jpg", "studio tv/frustrum-evacuated2.jpg", "still tv/nimbuson-tornado.jpg", "studio tv/nimbuson-tornado.jpg", "studio", "studio", } } ) addShow(newsShow, { title = "loc@TITLE_BLUETIDE_SHORTAGE", ticker = "loc@TICKER_BLUETIDE_SHORTAGE", events = { "studio tv/bluetide-shortage6.jpg", "studio tv/bluetide-shortage2.jpg", "zoom tv/bluetide-shortage3.jpg", "still tv/bluetide-shortage4.jpg", "zoom tv/bluetide-shortage4.jpg", "studio tv/bluetide-shortage5.jpg", "studio", } } ) addShow(newsOutro) end if isMissionCompleted("frustrum_tornado") and not isMissionCompleted("mall_shipping") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_TORNADO_STRIKES", ticker = "loc@TICKER_TORNADO_STRIKES", events = { "studio tv/tornado-damage2.jpg", "studio tv/tornado-damage3.jpg", "reporter tv/tornado-damage1.jpg", "studio tv/tornado-damage4.jpg", "studio tv/tornado-damage5.jpg", } } ) addShow(newsOutro) end if isMissionCompleted("mall_shipping") and not isMissionCompleted("carib_alarm") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_BREAKIN_EVERTIDES", ticker = "loc@TICKER_BREAKIN_EVERTIDES", public = "erin-gregorius", events = { "studio tv/evertides-breakin1.jpg", "still tv/evertides-breakin1.jpg", "interview tv/evertides-breakin2.jpg", "interview tv/evertides-breakin2.jpg", "still tv/evertides-breakin3.jpg", "zoom tv/evertides-breakin3.jpg", "studio tv/evertides-breakin3.jpg", } } ) addShow(newsOutro) --new song addShow(commercial, { audio = "tv/bayran.ogg", image1 = "tv/sunnymax2.jpg", zoom1 = true, zoom2 = true, text1 = "loc@TEXT1_SUN_IN", text2 = "loc@TEXT2_ELECTRIC_KIND", image2 = "tv/sunnymax3.jpg", text3 = "loc@TEXT3_SUNNYMAX_SOLARIUM", text4 = "loc@TEXT4_LIKE_THE", color1= {r=214/255, g=208/255, b=53/255}, color2= {r=214/255, g=208/255, b=53/255}, color3= {r=214/255, g=208/255, b=53/255}, color4= {r=214/255, g=208/255, b=53/255}, } ) end --more images of woonderland if isMissionCompleted("carib_alarm") and not isMissionCompleted("frustrum_vehicle") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_TRUCK_STUCK", ticker = "loc@TICKER_A_MILITARY", public = "oliver-funke", events = { "studio", "studio tv/stuck-in-muck1.jpg", "still tv/stuck-in-muck1.jpg", "interview tv/truck-missing2.jpg", "still tv/stuck-in-muck1.jpg", "zoom tv/stuck-in-muck1.jpg", "still tv/stuck-in-muck2.jpg", "zoom tv/stuck-in-muck2.jpg", "studio tv/stuck-in-muck2.jpg", "studio", } } ) addShow(newsShow, { title = "loc@TITLE_NEW_THEME_PARK", ticker = "loc@TICKER_NEW_THEME_PARK", events = { "still tv/visit-woonderland2.jpg", "still tv/visit-woonderland3.jpg", "zoom tv/visit-woonderland3.jpg", "still tv/visit-woonderland1.jpg", "still tv/visit-woonderland4.jpg", "zoom tv/visit-woonderland4.jpg", } } ) addShow(newsOutro) end if isMissionCompleted("frustrum_vehicle") and not isMissionCompleted("mall_radiolink") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITlE_MILITARY_TRUCK", ticker = "loc@TICKER_THE_TRUCK", public = "oliver-funke", events = { "studio", "studio tv/truck-missing1.jpg", "still tv/truck-missing1.jpg", "interview tv/truck-missing2.jpg", "zoom tv/truck-missing1.jpg", "studio tv/truck-missing1.jpg", } } ) addShow(newsOutro) --new song addShow(commercial, { audio = "tv/bayran.ogg", image1 = "tv/evertides-christmas1.jpg", zoom1 = true, zoom2 = true, text1 = "loc@TEXT1_EXCITED_FOR", text2 = "loc@TEXT2_SO_ARE", image2 = "tv/evertides-christmas2.jpg", text3 = "loc@TEXT3_GET_IN", text4 = "loc@TXT_AT_MALL", color2= {r=169/255, g=57/255, b=62/255}, color1= {r=62/255, g=149/255, b=62/255}, color4= {r=169/255, g=57/255, b=62/255}, color3= {r=62/255, g=149/255, b=62/255}, } ) end if isMissionCompleted("mall_radiolink") and not isMissionCompleted("factory_robot") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_EVERTIDES_STRUCK", ticker = "loc@TICKER_THE_MALL", public = "erin-gregorius", reporter = "", events = { "studio tv/evertides-vandals1.jpg", "still tv/evertides-vandals1.jpg", "studio tv/evertides-vandals1.jpg", "studio tv/evertides-vandals2.jpg", "interview tv/evertides-vandals1.jpg", "still tv/evertides-vandals2.jpg", "studio tv/evertides-vandals2.jpg", "studio tv/evertides-vandals3.jpg", "still tv/evertides-vandals3.jpg", "zoom tv/evertides-vandals3.jpg", } } ) addShow(newsOutro) --new song addShow(commercial, { audio = "tv/bayran.ogg", image1 = "tv/visit-woonderland3.jpg", zoom1 = true, zoom2 = true, text1 = "loc@TEXT1_SPEED_EXCITEMENT", text2 = "loc@TEXT2_GRAND_OPENING", image2 = "tv/visit-woonderland4.jpg", text3 = "loc@TEXT3_TREAT_YOURSELVES", text4 = "loc@TXT_VISIT_WONDERLAND", color1= {r=149/255, g=57/255, b=62/255}, color2= {r=196/255, g=196/255, b=196/255}, color3= {r=149/255, g=57/255, b=62/255}, color4= {r=196/255, g=196/255, b=196/255}, } ) end if lastCompleted == "lee_woonderland" then addShow(newsShow, { title = "loc@TITLE_WOO_BANKRUPT", ticker = "loc@TICKER_RACING_ENTHUSIAST", events = { "studio", "studio tv/woonderland-vandals1.jpg", "studio tv/woonderland-vandals2.jpg", "studio tv/woonderland-vandals3.jpg", "studio tv/woonderland-vandals4.jpg", } } ) end if isMissionCompleted("factory_robot") and not isMissionCompleted("factory_explosive") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_OVERDOSE", ticker = "loc@TICKER_A_TEENAGER", events = { "studio", "studio tv/teenager1.jpg", "still tv/teenager1.jpg", "studio tv/teenager1.jpg", "studio tv/teenager3.jpg", "zoom tv/teenager4.jpg", "studio tv/teenager4.jpg", } } ) addShow(newsOutro) addShow(commercial, { audio = "tv/bayran.ogg", image1 = "tv/robot-ad2.jpg", zoom1 = true, text1 = "loc@TEXT1_YOU_HAVE", image2 = "tv/robot-ad1.jpg", text3 = "loc@TEXT3_TO_RECIEVE", text4 = "loc@TXT_QUILEZ_MODEL", color1= {r=149/255, g=40/255, b=40/255}, color3= {r=1, g=1, b=1}, color4= {r=1, g=1, b=1}, } ) end --rewrite and add a rock expert? make a new show? if isMissionCompleted("factory_explosive") and not isMissionCompleted("caveisland_roboclear") then addShow(newsShow, { title = "loc@TITLE_SOLID_SCIENCE", ticker = "loc@TICKER_THEY_ARE", events = { "studio", "studio tv/cliff1.jpg", "still tv/cliff1.jpg", "zoom tv/cliff2.jpg", "still tv/cliff3.jpg", "zoom tv/cliff3.jpg", "zoom tv/cliff4.jpg", "zoom tv/cliff5.jpg", } } ) end if isMissionCompleted("caveisland_roboclear") and not isMissionCompleted("cullington_bomb") then addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_STRANGE_VEHICLE", ticker = "loc@TICKER_A_HEAVY", public = "kenneth-rippe", events = { "studio tv/truxterminator1.jpg", "still tv/truxterminator1.jpg", "still tv/truxterminator2.jpg", "studio tv/truxterminator2.jpg", "interview tv/truxterminator3.jpg", "interview tv/truxterminator3.jpg", "interview tv/truxterminator3.jpg", "still tv/truxterminator2.jpg", "studio tv/truxterminator2.jpg", } } ) addShow(newsOutro) end --add amanatides if isMissionCompleted("cullington_bomb") then --addShow(newsIntro) addShow(newsShow, { title = "loc@TITLE_BLUETIDE_BOSS", ticker = "loc@TICKER_BLUETIDE_BOSS", events = { "studio tv/raid4.jpg", "still tv/raid5.jpg", "zoom tv/raid8.jpg", "still tv/raid7.jpg", "zoom tv/raid6.jpg", "studio tv/raid1.jpg", "still tv/raid1.jpg", "still tv/raid2.jpg", "studio tv/raid2.jpg", "studio tv/raid3.jpg", "zoom tv/raid3.jpg", "studio tv/raid3.jpg", } } ) addShow(newsOutro) end gCurrentShow = 1 shakeX = 0 shakeY = 0 shakeDx = 0 shakeDy = 0 talk = false talkTimer = 10 end function update() gFrame = gFrame + 1 shakeDx = (shakeDx + math.random(-100,100)*0.0003) * 0.9 shakeDy = (shakeDy + math.random(-100,100)*0.0003) * 0.9 shakeX = (shakeX + shakeDx) * 0.99 shakeY = (shakeY + shakeDy) * 0.99 if shakeX > 1.0 then shakeX = 1.0; shakeDx = 0.0 end if shakeX < -1.0 then shakeX = -1.0; shakeDx = 0.0 end if shakeY > 1.0 then shakeY = 1.0; shakeDy = 0.0 end if shakeY < -1.0 then shakeY = -1.0; shakeDy = 0.0 end talkTimer = talkTimer - 1 if talkTimer <= 0 then talk = not talk talkTimer = math.random(2, 10) end blink = (gFrame%130) < 5 end function draw() if UiHeight() ~= 480 then UiPush() UiColor(0.2, 0.2, 0.2) UiRect(UiWidth(), UiHeight()) UiPop() UiTranslate(UiCenter(), UiMiddle()) UiAlign("center middle") UiWindow(640, 480, true) UiAlign("left") UiPush() UiColor(0,0,0) UiRect(UiWidth(), UiHeight()) UiPop() end local dt = GetTimeStep() UiPush() local isDone = not gShows[gCurrentShow].func(dt, gShows[gCurrentShow].params) UiPop() if isDone then gFadeToBlack = gFadeToBlack + dt*3.0 if gFadeToBlack >= 1.0 then gCurrentShow = gCurrentShow + 1 if gCurrentShow > #gShows then gCurrentShow = 1 end gTime = 0.0 gTimeLast = 0.0 end else if gFadeToBlack > 0.0 then gFadeToBlack = gFadeToBlack - dt*3.0 if gFadeToBlack < 0.0 then gFadeToBlack = 0 end end gTimeLast = gTime gTime = gTime + dt end if gFadeToBlack > 0.0 then UiColor(0, 0, 0, gFadeToBlack) UiRect(640, 480) end end