SCRIPTS

MISSION roughMission
  AddOpponent "roughTrucker"
  SetDeckPreparationScript "meteor1Deck"
  SetSpecCondition "bet"
  INIT_BUILD
  BuildingHelpScript 500 "tutorialAdditionalConcepts"
  RESET shouldShowFlightTutorial
  ModifyOpponentsBuildSpeed 75
  SetShipType STI
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  FlightHelpScript "tutorialAdditionalFlightConcepts"
  EVALUATE_FLIGHT
  ShowDlgScene
  ShowChar roughtrucker left
  Delay 500
  IF wasBet
    IfMissionResultIs 1
      Say "Ay..."
      Say "El juego me va a arruinar."
      AddMissionCredits 3
      AddOpponentsCredits 1 -3
      Announce "Has recibido 3 créditos del camionero veterano."
      UnlockAchievement camp_bet
    ELSE
      IfMissionResultIs 0
        Say "¡He ganado! Creo que me debes algo, compañer[g(o|a)]."
        AddMissionCredits -3
        AddOpponentsCredits 1 3
        Announce "Entregas 3 créditos al camionero veterano."
      ELSE
        Say "Buf, vaya con la carrera. Ni tú ni yo la hemos terminado."
        Say "Eso significa que no hay ganador."
        Say "A ver si tenemos más suerte la próxima vez."
      END_OF_IF
    END_OF_IF
  ELSE
    IfMissionResultIs 1
      Say "Je, me alegro de no haber apostado."
    ELSE
      IfMissionResultIs 0
        Say "¡Ja, he ganado! Qué lástima no haber apostado."
      ELSE
        Say "Vaya con la carrera, ni tú ni yo la hemos terminado."
      END_OF_IF
    END_OF_IF
  END_OF_IF
  Delay 300
  HideChar roughtrucker
  Delay 200
  HideDlgScene
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

SCRIPT purpleSupportInfo

  ShowDlgScene
  ChangeChar ambassador campaign/ambassador-peek.png
  ShowChar ambassador right
  Delay 300
  Say "Por favor, reserve una buena cabina para el señor K'wwfrg. ¡Y no olvide conectar su módulo de soporte vital!"
  HideDlgScene
  AddInfoWindow "tutorial/infoPurpleLifeSupport.png"
  ShowInfoWindow "tutorial/infoPurpleLifeSupport.png"
  ShowDlgScene
  ChangeChar ambassador campaign/ambassador-peek.png
  ShowChar ambassador right
  Say "Muchas gracias, espero que llegue pronto a su planeta."
  Delay 300
  HideChar ambassador
  HideDlgScene
END_OF_SCRIPT

SCRIPT purpleAlienInfo

  AddInfoWindow "tutorial/infoPurpleAliens.png"
  ShowInfoWindow "tutorial/infoPurpleAliens.png"
END_OF_SCRIPT

SCRIPT brownInfo

  AddInfoWindow "tutorial/infoBrownLifeSupport.png"
  AddInfoWindow "tutorial/infoBrownAliens.png"
  ShowInfoWindow "tutorial/infoBrownLifeSupport.png"
  SET brownTutorial
END_OF_SCRIPT

MISSION purpleAlienEscort
  SUB_SCRIPT add2RandomOpponentsMedium
  SetDeckPreparationScript "originalDeck"
  SetSpecCondition "purplealien"
  INIT_BUILD
  BuildingHelpScript 1000 "purpleSupportInfo"
  SetAdvPile 1 3
  SetSecretAdvPile 1 3
  SetShipType STI
  SUB_SCRIPT stdParts
  AddPartToAsideSlot alienGun 2 1 2 0
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  AlienHelpScript "purpleAlienInfo"
  EVALUATE_FLIGHT
  IF_MISSION_WON
    ShowDlgScene
    ShowChar purpleGuard left
    Ask "¡Kzwrrr' kh! ¡Hr ghz trrzk! ¡TRRZK!"
    IfMissionResultMin 1
      MENU
        OPT "¡Calma, calma! Os traigo a un pulpo morado."
          Delay 300
          Say "¡Kzwrrr' kh! ¡Hr ghz trrzk! ¡TRRZK!"
          Delay 1000
          ShowChar purpleDipl right
          Delay 500
          Say "Zrrg. H-hrng khzz q Th'kzw-r..."
          Delay 300
          SayChar purpleGuard "Kh gz kwrr-g. Zhg."
          Delay 500
          HideChar purpleGuard
          Delay 300
          AskChar purpleDipl "Wrwg'gg kwrr-g. W'wg zhg-k."
          MENU
            OPT "Entonces... ¿Puedo aterrizar?"
              EXIT_MENU
            END_OF_OPT
          END_OF_MENU
          SayChar purpleDipl "Kzzh."
          Delay 300
          HideChar purpleDipl
          EXIT_MENU
        END_OF_OPT
      END_OF_MENU
    ELSE
      MENU
        OPT "Eh, ha sido un viaje complicado. ¿Ni siquiera vais a dejarme aterrizar?"
          Say "¡KHHH'WZ GHZ TRRZK!"
          EXIT_MENU
        END_OF_OPT
      END_OF_MENU
      MENU
        OPT "Algo me dice que ese mal genio se debe a que el pulpo morado no ha llegado."
          Say "¡TRRZK!"
          Delay 1000
          HideChar purpleGuard
          SetMissionAsFailed
          EXIT_MENU
        END_OF_OPT
      END_OF_MENU
    END_OF_IF
    HideDlgScene
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

SCRIPT tutorialSideMeteors

  AddInfoWindow "tutorial/infoBigSideMeteor.png"
  ShowInfoWindow "tutorial/infoBigSideMeteor.png"
  SET wasTutorialSideMeteors
END_OF_SCRIPT

MISSION meteorsSide
  AddOpponent richGirl
  IF_PROB 50
    SetDeckPreparationScript "meteor1LeftDeck"
  ELSE
    SetDeckPreparationScript "meteor1RightDeck"
  END_OF_IF
  SetSpecCondition "tilesBet"
  INIT_BUILD
  BuildingHelpScript 500 "tutorialSideMeteors"
  SetShipType STI
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  IF_MISSION_WON
    ShowDlgScene
    ShowChar richgirl left
    IfMissionResultMin 0
      Delay 300
      IfMissionResultMin 1
        Say "Esta vez has tenido más suerte que yo."
      ELSE
        Say "Hemos empatado."
      END_OF_IF
      Say "Me has sorprendido. Eres casi tan buen[g(o|a)] como yo."
      IFNOT designSport1Unlocked
        Say "Toma, puedes usar mi diseño. Te lo has ganado."
        Delay 300
        HideChar richgirl
        Delay 200
        UnlockShipPlan "I-sport"
        SET designSport1Unlocked
        Announce "Has desbloqueado un nuevo modelo de Clase I."
        Delay 500
        SetAchievementProgress camp_design_sporty 1
        Delay 500
        HidePath "U1-4a"
        ShowPath "R1-4a1"
        IF class2
          HideButton bvip
          HideButton bvip2
          ShowButton brichgirl2
        END_OF_IF
      END_OF_IF
    ELSE
      Delay 300
      Say "He ganado."
      Say "Qué sorpresa… Espero que al menos hayas aprendido un par de trucos."
      Delay 500
      HideChar richgirl
    END_OF_IF
    HideDlgScene
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION meteorsSide2
  AddOpponent richGirl
  SetDeckPreparationScript "meteor2SidesDeck"
  SetSpecCondition "tilesBet"
  INIT_BUILD
  SetShipType STII
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  IF_MISSION_WON
    ShowDlgScene
    ShowChar richgirl left
    IfMissionResultMin 0
      Delay 300
      IfMissionResultMin 1
        Say "¡Venga ya! ¿Cómo has podido tener tanta suerte?"
      ELSE
        Say "¿De verdad hemos empatado?"
      END_OF_IF
      Say "No lo haces mal, para ser de la plebe."
      IFNOT designSport2Unlocked
        Say "Ten, toma este diseño. Sé que estará en buenas manos."
        Delay 300
        HideChar richgirl
        Delay 200
        UnlockShipPlan "II-sport"
        SET designSport2Unlocked
        Announce "Has desbloqueado un nuevo modelo de Clase II."
        Delay 500
        SetAchievementProgress camp_design_sporty 2
        Delay 500
      END_OF_IF
    ELSE
      Delay 300
      Say "He ganado."
      Say "No siempre se puede tener suerte. Oye, al menos lo has intentado."
      Delay 500
    END_OF_IF
    HideChar richgirl
    HideDlgScene
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION meteorsSideWithBot
  AddOpponent medium_safe
  IF_PROB 50
    SetDeckPreparationScript "meteor1LeftDeck"
  ELSE
    SetDeckPreparationScript "meteor1RightDeck"
  END_OF_IF
  INIT_BUILD
  SetShipType STI
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  ShowDlgScene
  ShowChar securitybot2 left
  Delay 300
  IF_MISSION_WON
    Say "LO HAS CONSEGUIDO. MENOS MAL."
  ELSE
    Say "TE LO DIJE."
  END_OF_IF
  Delay 300
  HideChar securitybot2
  Delay 300
  HideDlgScene
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

SCRIPT tutorialBooze

  ShowDlgScene
  ShowChar bartender left
  Say "Lo tengo todo a punto."
  Say "Te pagaré generosamente si entregas las botellas intactas. Si se rompen, serás tú quien tenga que pagarme para cubrir las pérdidas."
  Delay 100
  HideDlgScene
  AddInfoWindow "tutorial/infoFragileCargo.png"
  ShowInfoWindow "tutorial/infoFragileCargo.png"
  ShowDlgScene
  ChangeChar bartender campaign/bartender-warehouse.png
  ShowChar bartender left
  Delay 200
  Say "Vuela con cuidado. ¡Y añade cabinas para toda la tripulación que necesites!"
  Say "Conozco a más de un cliente que ha sufrido terribles accidentes por no llevar suficiente personal a bordo."
  HideChar bartender
  HideDlgScene
END_OF_SCRIPT

SCRIPT bartenderOverIntercom

  ChangeChar bartender campaign/bartender-overIntercom.png
  ShowChar bartender left
  Delay 100
  ChangeChar bartender campaign/bartender-overIntercom1.png
  Delay 100
  ChangeChar bartender campaign/bartender-overIntercom.png
  Delay 100
  ChangeChar bartender campaign/bartender-overIntercom1.png
  Delay 100
  ChangeChar bartender campaign/bartender-overIntercom.png
  Delay 100
  ChangeChar bartender campaign/bartender-overIntercom1.png
  Delay 200
  ChangeChar bartender campaign/bartender-overIntercom.png
  Delay 300
  ChangeChar bartender campaign/bartender-overIntercom1.png
  Delay 300
  ChangeChar bartender campaign/bartender-overIntercom.png
  Delay 300
END_OF_SCRIPT

MISSION booze2
  SUB_SCRIPT add3RandomOpponentsEasy
  SetDeckPreparationScript "boozeDeck"
  SetSpecCondition "booze"
  INIT_BUILD
  ModifyOpponentsBuildSpeed 75
  SetShipType STI
  SUB_SCRIPT stdParts
  AddPartToAsideSlot booze 2 1 2 0
  AddPartToAsideSlot booze 1 2 1 0
  BuildingHelpScript 500 "tutorialBooze"
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  ShowDlgScene
  IF_MISSION_WON
    SUB_SCRIPT bartenderOverIntercom
    IfMissionResultMin 2
      ADD totalBooze 2
      Say "¿Las dos cajas? ¡Fantástico! Aquí tienes, 5 créditos por cada una."
      AddMissionCredits 10
      Delay 500
      UnlockAchievement camp_booze
      Delay 500
    ELSE
      IfMissionResultMin 1
        ADD totalBooze 1
        Say "¿Has roto mis botellas? Bueno, al menos has entregado una de las cajas. Eso significa que estamos en paz."
      ELSE
        Say "¿Has roto mis botellas? Acordamos que cubrirías las pérdidas. Serán 5 créditos por cada caja."
        AddMissionCredits -10
      END_OF_IF
    END_OF_IF
  ELSE
    ChangeChar bartender campaign/bartender-warehouse.png
    ShowChar bartender left
    Delay 300
    IfMissionResultMin 2
      Say "¿Has dado media vuelta? Bueno, al menos no has roto nada."
    ELSE
      IfMissionResultMin 1
        Say "¿Has dado media vuelta? ¿Y encima has roto una caja? Lo siento, pero me debes 5 créditos."
        AddMissionCredits -5
      ELSE
        Say "¿Qué has hecho con mis botellas? Voy a necesitar 10 créditos para cubrir las pérdidas."
        AddMissionCredits -10
      END_OF_IF
    END_OF_IF
  END_OF_IF
  HideChar bartender
  HideDlgScene
  SET boozeQuestTried
  HidePath R1-3a2
  ShowPath R1-3a
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION booze1
  SUB_SCRIPT add3RandomOpponentsEasy
  SetDeckPreparationScript "boozeDeck"
  SetSpecCondition "booze"
  INIT_BUILD
  ModifyOpponentsBuildSpeed 75
  SetShipType STI
  SUB_SCRIPT stdParts
  AddPartToAsideSlot booze 2 1 2 0
  BuildingHelpScript 500 "tutorialBooze"
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  ShowDlgScene
  IF_MISSION_WON
    SUB_SCRIPT bartenderOverIntercom
    IfMissionResultMin 1
      ADD totalBooze 1
      Say "¿Has entregado la caja? ¡Fantástico! Ahora mismo te envío los 5 créditos."
      AddMissionCredits 5
    ELSE
      Say "¿Has roto la caja? Lo siento, pero me debes 5 créditos."
      AddMissionCredits -5
    END_OF_IF
  ELSE
    ChangeChar bartender campaign/bartender-warehouse.png
    ShowChar bartender left
    Delay 300
    IfMissionResultMin 1
      Say "¿Has dado media vuelta? Bueno, al menos no has roto nada."
    ELSE
      Say "¿Qué has hecho con mis botellas? Lo siento, pero me debes 5 créditos."
      AddMissionCredits -5
    END_OF_IF
  END_OF_IF
  HideChar bartender
  HideDlgScene
  SET boozeQuestTried
  HidePath R1-3a1
  ShowPath R1-3a
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION nobooze
  SUB_SCRIPT add3RandomOpponentsEasy
  SetDeckPreparationScript "boozeDeck"
  INIT_BUILD
  SetShipType STI
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

SCRIPT tutorialAdditionalFlightConcepts

  IFNOT shouldShowFlightTutorial
    RETURN
  END_OF_IF
  AddInfoWindow "tutorial/infoShipInfo.png"
  AddInfoWindow "tutorial/infoGivingUpFlight.png"
  AddInfoWindow "tutorial/infoGivingUpFlight2.png"
  ShowInfoWindow "tutorial/infoShipInfo.png"
END_OF_SCRIPT

SCRIPT tutorialAdditionalConcepts

  IF tutorialAdditional
    RETURN
  END_OF_IF
  IF_TUTORIAL_SEEN
    SET showAdditional
  ELSE
    IF tutorialRefused
      RESET showAdditional
    ELSE
      SET showAdditional
    END_OF_IF
  END_OF_IF
  IFNOT showAdditional
    RETURN
  END_OF_IF
  SET tutorialAdditional
  SET shouldShowFlightTutorial
  ShowDlgScene
  ShowChar tutor right
  Delay 300
  Say "¿Qué tal, novat[g(o|a)]? Aún hay un par de cosas que deberías saber sobre la construcción de naves."
  Say "Eh, abuelo. ¿Dónde has dejado las infografías?"
  HideChar tutor
  HideDlgScene
  AddInfoWindow "tutorial/infoAsideSlots.png"
  AddInfoWindow "tutorial/infoLookingAtCards.png"
  ShowInfoWindow "tutorial/infoAsideSlots.png"
  ShowDlgScene
  ShowChar tutor right
  Delay 300
  Say "Hm. Seguro que te preguntas dónde están esas cartas que deberías consultar."
  Say "Es fácil. Las cartas de aventura aparecen en la parte superior de la pantalla después de soldar tu primer componente."
  Say "Ahí las tienes. Buena suerte."
  HideChar tutor
  HideDlgScene
END_OF_SCRIPT

MISSION firstMission
  SUB_SCRIPT add2RandomOpponentsEasy
  SetDeckPreparationScript "firstMissionDeck"
  INIT_BUILD
  BuildingHelpScript 500 "tutorialAdditionalConcepts"
  RESET shouldShowFlightTutorial
  ModifyOpponentsBuildSpeed 75
  SetShipType STI
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  FlightHelpScript "tutorialAdditionalFlightConcepts"
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

SCRIPT merchantGivesUp

  IF merchForcedFail
    RETURN
  END_OF_IF
  ShowDlgScene
  ChangeChar merchant campaign/merch-disappointed.png
  ShowChar merchant left
  Say "Las cosas no han salido como yo pensaba."
  Say "Será mejor que regresemos. Lo volveremos a intentar otro día."
  SetMissionAsFailed
  SET merchForcedFail
  HideChar merchant
  HideDlgScene
END_OF_SCRIPT

MISSION merchantProtection
  AddOpponent merchant
  SetDeckPreparationScript "merchantDeck"
  RESET merchForcedFail
  INIT_BUILD
  SetAdvPile 1 3
  SetSecretAdvPile 1 3
  SetShipType STI
  SUB_SCRIPT stdParts
  SetSpecCondition "merchantProtect"
  START_BUILDING
  AddPartToShip 1 7 alienEngine 3333 0
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  IF_MISSION_WON
    IfMissionResultMin 3
      ShowDlgScene
      ShowChar merchant left
      Say "¡Sí, lo hemos conseguido! ¡Y tenemos un montón de mercancía!"
      Say "Ha sido un placer trabajar contigo."
      Say "Aquí tienes tu parte: [missionResult] créditos."
      AddMissionCreditsByResult
      SubOpponentCreditsByResult
      HideButton bmerchant
      Delay 500
      SetAchievementProgress camp_merchant 1
      Delay 300
      HidePath U1-9a
      ShowPath R1-9a
      ShowPath R1-9b
    ELSE
      ShowDlgScene
      ShowChar merchant left
      Say "Lo hemos conseguido, pero me falta mercancía."
      Say "No merece la pena aterrizar. No me llegaría ni para cubrir la tarifa del puerto."
      Say "Será mejor que regresemos. Lo volveremos a intentar otro día."
      AllShipsGiveUp
      SET merchantFailed
      HidePath U1-9a
      SetFocus bmerchant
    END_OF_IF
    HideChar merchant
    HideDlgScene
  ELSE
    SET merchantFailed
    HidePath U1-9a
    SetFocus bmerchant
    IFNOT merchForcedFail
      ShowDlgScene
      ChangeChar merchant campaign/merch-disappointed.png
      ShowChar merchant left
      Say "¿Me abandonas? Es peligroso que siga yo solo."
      Say "Volveré contigo. Puede que nos vaya mejor la próxima vez."
      AllShipsGiveUp
      HideChar merchant
      HideDlgScene
    END_OF_IF
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION merchantProtection2
  AddOpponent merchant
  SetDeckPreparationScript "merchantDeck2"
  RESET merchForcedFail
  INIT_BUILD
  SetAdvPile 1 1
  SetAdvPile 2 3
  SetSecretAdvPile 1 1
  SetSecretAdvPile 2 3
  SetShipType STII
  SUB_SCRIPT stdParts
  SetSpecCondition "merchantProtect"
  IF brownUnlocked
    IFNOT brownTutorial
      BuildingHelpScript 500 brownInfo
    END_OF_IF
  END_OF_IF
  START_BUILDING
  AddPartToShip 1 17 alienEngine 3333 0
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  IF_MISSION_WON
    IfMissionResultMin 5
      ShowDlgScene
      ShowChar merchant left
      Say "¡Sí, lo hemos conseguido! ¡Y tenemos un montón de mercancía!"
      Say "Ha sido un placer trabajar contigo de nuevo."
      Say "Aquí tienes tu parte: [missionResult] créditos."
      AddMissionCreditsByResult
      SubOpponentCreditsByResult
      Delay 500
      SetAchievementProgress camp_merchant 2
      Delay 300
      HidePath U2-19a
      ShowPath R2-19a
      ShowPath R2-19b
      Say "Oh… Y el permiso de nuestros amiguitos marrones."
      Say "Lo he tenido en mi bolsillo todo el tiempo."
      SUB_SCRIPT merchantLaughA
      Announce "Has conseguido un permiso para naves de Clase III firmado por los alienígenas marrones."
      SET brownLicenseApproval
      SUB_SCRIPT licenseApprovalCheck
      ShowButton bcyanmerch
    ELSE
      ShowDlgScene
      ShowChar merchant left
      Say "Lo hemos conseguido, pero me falta mercancía."
      Say "No merece la pena aterrizar. No me llegaría ni para cubrir la tarifa del puerto."
      Say "Será mejor que regresemos. Lo volveremos a intentar otro día."
      AllShipsGiveUp
      SET merchantFailed
    END_OF_IF
    HideChar merchant
    HideDlgScene
  ELSE
    SET merchantFailed
    IFNOT merchForcedFail
      ShowDlgScene
      ChangeChar merchant campaign/merch-disappointed.png
      ShowChar merchant left
      Say "¿Me abandonas? Es peligroso que siga yo solo."
      Say "Volveré contigo. Puede que nos vaya mejor la próxima vez."
      AllShipsGiveUp
      HideChar merchant
      HideDlgScene
    END_OF_IF
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION merchantProtection3
  AddOpponent merchant
  SetDeckPreparationScript "merchantDeck3"
  RESET merchForcedFail
  INIT_BUILD
  SetAdvPile 1 1
  SetAdvPile 2 1
  SetAdvPile 3 3
  SetSecretAdvPile 1 1
  SetSecretAdvPile 2 1
  SetSecretAdvPile 3 3
  SetShipType STIII
  SUB_SCRIPT stdParts
  SetSpecCondition "merchantProtect"
  START_BUILDING
  AddPartToShip 1 22 alienEngine 3333 0
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  IF_MISSION_WON
    ShowDlgScene
    ShowChar merchant left
    Say "¡Sí, hemos salido de territorio alienígena!"
    IfMissionResultIs 0
      Say "Puede que no tenga ni una mísera caja de mercancía, pero ¿a quién le importa? Estamos vivos."
    ELSE
      IfMissionResultMin 8
        Say "¡Y encima tengo un montón de mercancía!"
      ELSE
        IfMissionResultMin 4
          Say "¡Y encima he recogido algunas cosas por el camino!"
        ELSE
          Say "Y encima he recogido un par de cosas por el camino."
        END_OF_IF
      END_OF_IF
      Say "Aquí tienes tu parte: [missionResult] créditos."
      AddMissionCreditsByResult
      SubOpponentCreditsByResult
    END_OF_IF
    Delay 500
    SetAchievementProgress camp_merchant 3
    Delay 300
    HidePath U3-29a
    ChangeChar merchant campaign/merch-inviting.png
    Say "Toma, es una carta de recomendación. Nadie se la merece más que tú."
    SET recommendationMerchant
    SET recommendationMerchantUntold
    Announce "Recibes una carta de recomendación del hombre de negocios."
    SUB_SCRIPT recommendationCheck
    Say "Muchas gracias por todo. ¡Buf, qué aventura!"
    SUB_SCRIPT merchantLaughB
    Say "Cuídate."
    HideChar merchant
    HideDlgScene
  ELSE
    SET merchant3Failed
    IFNOT merchForcedFail
      ShowDlgScene
      ChangeChar merchant campaign/merch-disappointed.png
      ShowChar merchant left
      Say "¿Me abandonas? Es peligroso que siga yo solo."
      Say "Volveré contigo. Puede que nos vaya mejor la próxima vez."
      AllShipsGiveUp
      HideChar merchant
      HideDlgScene
    END_OF_IF
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION alienPlanets
  IF_PROB 50
    AddOpponent purple2
  ELSE
    AddOpponent brown2
  END_OF_IF
  IF_PROB 75
    IF_PROB 50
      AddOpponent purple2
    ELSE
      AddOpponent brown2
    END_OF_IF
    IF_PROB 50
      IF_PROB 50
        AddOpponent purple2
      ELSE
        AddOpponent brown2
      END_OF_IF
    END_OF_IF
  END_OF_IF
  SetDeckPreparationScript "digitalDeck"
  INIT_BUILD
  SetShipType STI
  SUB_SCRIPT stdParts
  IF brownUnlocked
    IFNOT brownTutorial
      BuildingHelpScript 500 brownInfo
    END_OF_IF
  END_OF_IF
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION alienPlanets2brown
  IF_PROB 50
    AddOpponent cyan2
  ELSE
    AddOpponent brown2
  END_OF_IF
  IF_PROB 75
    IF_PROB 50
      AddOpponent cyan2
    ELSE
      AddOpponent brown2
    END_OF_IF
    IF_PROB 50
      IF_PROB 50
        AddOpponent cyan2
      ELSE
        AddOpponent brown2
      END_OF_IF
    END_OF_IF
  END_OF_IF
  SetDeckPreparationScript "digitalDeck"
  INIT_BUILD
  SetShipType STII
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION alienPlanets2purple
  IF_PROB 50
    AddOpponent cyan2
  ELSE
    AddOpponent purple2
  END_OF_IF
  IF_PROB 75
    IF_PROB 50
      AddOpponent cyan2
    ELSE
      AddOpponent purple2
    END_OF_IF
    IF_PROB 50
      IF_PROB 50
        AddOpponent cyan2
      ELSE
        AddOpponent purple2
      END_OF_IF
    END_OF_IF
  END_OF_IF
  SetDeckPreparationScript "digitalDeck"
  INIT_BUILD
  SetShipType STII
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION warriorTest
  AddOpponent purple2
  AddOpponent purple2
  AddOpponent purple2
  SetDeckPreparationScript "battleZones"
  INIT_BUILD
  SetShipType STII
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  IF_MISSION_WON
    ShowDlgScene
    ShowChar purple left
    Delay 300
    Say "¡Zh wrrzk-hrrg krz'h!"
    Delay 300
    ShowChar purple2 right
    Delay 300
    Say "¡Ghrrk-zhr ww'gh wrrzk-hrrg krz'h!"
    Delay 300
    Announce "El alienígena violeta te entrega un permiso firmado para naves de Clase III."
    SET purpleLicenseApproval
    SUB_SCRIPT licenseApprovalCheck
    HideChar purple2
    Delay 300
    HideChar purple
    HideDlgScene
    HidePath U2-20a
    ShowPath R2-20a
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION noMerchant
  SUB_SCRIPT add2RandomOpponentsMedium
  SetDeckPreparationScript "merchantDeck"
  INIT_BUILD
  SetShipType STI
  SUB_SCRIPT stdParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

SCRIPT tutorialEpidemy

  ShowDlgScene
  ShowChar mech right
  Delay 200
  Say "Hola, soy yo de nuevo."
  ChangeChar mech campaign/mech-explaining.png
  Say "He oído que hay un virus rondando por ahí."
  Ask "Procura no tener dos cabinas directamente conectadas en tu nave. Es solo por precaución. De lo contrario, alguien podría enfermar."
  MENU
    OPT "A la orden. Tranquila, tendré cuidado."
      EXIT_MENU
    END_OF_OPT
  END_OF_MENU
  Delay 300
  ChangeChar mech campaign/mech-thumbup.png
  Delay 300
  Say "Genial. Gracias de nuevo, ¡y buena suerte!"
  HideChar mech
  HideDlgScene
END_OF_SCRIPT

MISSION peopleDelivery
  SUB_SCRIPT add2RandomOpponentsMedium
  SetDeckPreparationScript "epidemyDeck"
  INIT_BUILD
  IFNOT wasTutorialEpidemy
    SET wasTutorialEpidemy
    BuildingHelpScript 1000 tutorialEpidemy
  END_OF_IF
  SetShipType STI
  SUB_SCRIPT stdParts
  SetSpecCondition "peopleDelivery"
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  IF_MISSION_WON
    ShowDlgScene
    ShowChar mech right
    IFNOT nextPeopleDelivery
      Say "Bienvenid[g(o|a)] a la fábrica espacial. ¿Me has traído a alguien?"
    ELSE
      Say "¡Me alegro de verte! ¿Has traído a más gente?"
    END_OF_IF
    IfMissionResultMin 0
      ChangeChar mech campaign/mech-explaining.png
      IfMissionResultMin 10
        Say "¡Cuánta gente! ¿¡Y todos están bien!? ¡Eres [g(el|la)] mejor!"
        Delay 300
        ChangeChar mech campaign/mech-kiss.png
        Delay 300
        Say "*muac*"
        Delay 300
        ChangeChar mech campaign/mech.png
        Delay 600
        ChangeChar mech campaign/mech-blush.png
        Delay 300
        Say "Lo siento, ha sido un desliz. La emoción del momento…"
        UnlockAchievement camp_kiss
        Delay 300
        ChangeChar mech campaign/mech.png
        SET wasKiss
      ELSE
        IfMissionResultMin 8
          Say "¡Cuánta gente! ¿Y todos estám bien? ¡Eres [g(el|la)] mejor!"
          Delay 200
          ChangeChar mech campaign/mech-blush.png
          Delay 200
          IFNOT wasKiss
            Say "Vaya, me ha hecho tanta ilusión que casi te doy un beso."
          ELSE
            Say "Vaya, casi tengo otro desliz."
          END_OF_IF
          Delay 300
          ChangeChar mech campaign/mech.png
        ELSE
          IfMissionResultMin 6
            Say "Buen trabajo, chic[g(o|a)]. Me alegro de que todos estén bien."
          ELSE
            Say "¿Ya está? ¿Eso es todo? Bueno, al menos nadie ha salido herido."
          END_OF_IF
        END_OF_IF
      END_OF_IF
      IFNOT nextPeopleDelivery
        Say "Toma, aquí tienes tus [missionResult] créditos. Gracias."
        AddMissionCreditsByResult
        Say "La próxima vez que vengas hacía aquí, pasa por los muelles de Régula y comprueba si alguno de mis chicos necesita que lo traigas."
        Say "No sé si podré pagarte, pero estoy segura de que trabajarán para cubrir el dinero del pasaje."
        SET nextPeopleDelivery
        HidePath "U1-7a"
        ShowPath "R1-7a"
        ShowPath "R1-7b"
      ELSE
        Say "Muchas gracias, no estaba segura de que pudiera pagarte…"
        IfMissionResultMin 8
          Say "Toma, sobreviviré sin estos 3 créditos. Te los has ganado."
          AddMissionCredits 3
        ELSE
          IfMissionResultMin 5
            Say "Aquí tienes 2 créditos por las molestias."
            AddMissionCredits 2
          ELSE
            Say "Aquí tienes 1 crédito por haberlo intentado."
            AddMissionCredits 1
          END_OF_IF
        END_OF_IF
        Say "Traeme a más gente la próxima que te pases por aquí, ¿vale?"
      END_OF_IF
    ELSE
      SET peopleDeliveryFailed
      IfMissionResultMin -2
        Say "Creo… que falta alguien."
      ELSE
        IfMissionResultMin -4
          Say "Oh, no. ¿Qué ha pasado con los demás?"
        ELSE
          Say "¡Oh, no! ¡Ha sido una masacre!"
        END_OF_IF
      END_OF_IF
      IFNOT nextPeopleDelivery
        Say "¡Esto es una tragedia!"
        MENU
          OPT "¡Lo siento mucho!"
            EXIT_MENU
          END_OF_OPT
        END_OF_MENU
        ChangeChar mech campaign/mech.png
        Say "Lo sé, lo sé. Lo has intentado."
        ChangeChar mech campaign/mech-f.png
        Say "¿Qué hago ahora? Tendré que volver a Régula para buscar a más gente."
        ChangeChar mech campaign/mech.png
        Ask "¿Puedes llevarme?"
        MENU
          OPT "Claro, si sirve de algo..."
            Say "Gracias."
            SetMissionAsFailed
            EXIT_MENU
          END_OF_OPT
        END_OF_MENU
      ELSE
        Say "Estoy segura de que has intentado protegerlos."
        Say "La próxima vez… ¡Ten más cuidado!"
      END_OF_IF
    END_OF_IF
    HideChar mech
    HideDlgScene
  ELSE
    IFNOT nextPeopleDelivery
      ShowDlgScene
      ChangeChar mech campaign/mech-intercom.png
      ShowChar mech right
      Ask "¿Qué ocurre?"
      IfMissionResultMin 0
        MENU
          OPT "Volvemos a Régula. Tranquila, todos estamos bien."
            EXIT_MENU
          END_OF_OPT
        END_OF_MENU
      ELSE
        MENU
          OPT "No quieres saberlo."
            EXIT_MENU
          END_OF_OPT
        END_OF_MENU
      END_OF_IF
      Say "Ya, estas cosas pasan. Será mejor que yo también vaya a Régula."
      SET peopleDeliveryFailed
      HideChar mech
      HideDlgScene
    END_OF_IF
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION universalEpidemic
  SUB_SCRIPT addRandomOpponentsMedium
  SetDeckPreparationScript "epidemyDeck"
  INIT_BUILD
  SetShipType STI
  SUB_SCRIPT universalParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION universalSabotages
  SUB_SCRIPT addRandomOpponentsMedium
  SetDeckPreparationScript "boozeDeck"
  INIT_BUILD
  SetShipType STI
  SUB_SCRIPT universalParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

MISSION universal3long
  SUB_SCRIPT addRandomOpponentsMedium
  SetDeckPreparationScript "digitalDeck"
  INIT_BUILD
  SetAdvPile 1 1
  SetAdvPile 2 1
  SetAdvPile 3 3
  SetSecretAdvPile 1 1
  SetSecretAdvPile 2 1
  SetSecretAdvPile 3 3
  SetShipType STIII
  SUB_SCRIPT universalParts
  START_BUILDING
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

SCRIPT ingotsIntro

  ShowDlgScene
  ShowChar foreman left
  Delay 750
  IF ingotsFailedDelivery
    ChangeChar foreman campaign/foreman-no.png
    Say "Oye, me han dicho que la última vez no salió bien."
    ChangeChar foreman campaign/foreman.png
    Say "Tranquil[g(o|a)], te daré otra oportunidad porque soy un buen tipo."
    Say "(¿Quién más querría este trabajo?)"
    RESET ingotsFailedDelivery
  ELSE
    ChangeChar foreman campaign/foreman-whatsup.png
    IF oneingot
      IF ing3
        Say "Aquí lo tienes: un lingote megamasivo del más puro acero cósmico."
        ChangeChar foreman campaign/foreman-smile.png
        Say "No te olvides de conectarlo a tu nave."
      ELSE
        Say "Marchando otro lingote de acero cósmico. ¿A que es una preciosidad?"
      END_OF_IF
    END_OF_IF
    IF twoingots
      Say "Marchando dos relucientes lingotes de acero cósmico. Cuida bien de ellos."
    END_OF_IF
    IF threeingots
      Say "¡Ay, amig[g(o|a)]! ¡Tres lingotes de acero cósmico! ¡No encontrarás nada más hermoso!"
      ChangeChar foreman campaign/foreman-smile.png
      Say "He soldado uno a tu nave, espero que no te importe."
    END_OF_IF
  END_OF_IF
  HideDlgScene
  AddInfoWindow "tutorial/infoHeavyCargo.png"
  ShowInfoWindow "tutorial/infoHeavyCargo.png"
  ShowDlgScene
  ShowChar foreman left
  Delay 500
  ChangeChar foreman campaign/foreman-hello.png
  Say "Ten mucho cuidado."
  HideChar foreman
  HideDlgScene
END_OF_SCRIPT

MISSION ingotDelivery
  SUB_SCRIPT add2RandomOpponentsMedium
  SetDeckPreparationScript "ingotDeck"
  INIT_BUILD
  SetSpecCondition "ingots"
  BuildingHelpScript 1000 ingotsIntro
  SetShipType STII
  SUB_SCRIPT stdParts
  START_BUILDING
  IF ing2
    AddPartToAsideSlot ingot2 2 1 0 0
  END_OF_IF
  IF ing3
    AddPartToAsideSlot ingot3 3 2 0 0
  END_OF_IF
  IF ing4
    AddPartToAsideSlot ingot4 2 3 2 0
  END_OF_IF
  IF ing5
    AddPartToAsideSlot ingot5 1 3 1 0
  END_OF_IF
  IF ing6
    AddPartToAsideSlot ingot4 1 3 2 3
  END_OF_IF
  IF ing8
    AddPartToAsideSlot ingot4 2 1 2 0
  END_OF_IF
  IF twoingots
    IF ing2
      AddPartToAsideSlot ingot2 3 0 3 0
    END_OF_IF
    IF ing3
      AddPartToAsideSlot ingot3 1 2 1 0
    END_OF_IF
    IF ing4
      AddPartToAsideSlot ingot4  3 0 3 0
    END_OF_IF
  END_OF_IF
  IF threeingots
    IF ing2
      AddPartToAsideSlot ingot2 1 3 2 0
      AddPartToShip 0 17 ingot2 2323 0
    END_OF_IF
    IF ing3
      AddPartToAsideSlot ingot3 3 2 3 0
      AddPartToShip 0 17 ingot3 1212 0
    END_OF_IF
  END_OF_IF
  END_BUILDING
  INIT_FLIGHT
  START_FLIGHT
  EVALUATE_FLIGHT
  RESET allok
  RESET somemissing
  RESET allmissing
  IF_MISSION_WON
    IfMissionResultMin 1
      IfMissionResultMin 2
        IfMissionResultMin 3
          SET allok
        ELSE
          IF threeingots
            SET somemissing
          ELSE
            SET allok
          END_OF_IF
        END_OF_IF
      ELSE
        IF oneingot
          SET allok
        ELSE
          SET allmissing
        END_OF_IF
      END_OF_IF
    END_OF_IF
    ShowDlgScene
    ShowChar mech right
    Delay 500
    IFNOT ingotDeliveryAttempt
      Say "Tú debes de ser [g(el camionero|la camionera)]. Me llamo... ¡Oh, qué sorpresa! ¡Si eres tú!"
      ChangeChar mech campaign/mech-explaining.png
      Say "Me alegro de volver a verte. Me han pedido que inspeccione estas entregas."
      SET ingotDeliveryAttempt
    ELSE
      ChangeChar mech campaign/mech-explaining.png
      Say "¡Hola, me alegro de verte!"
    END_OF_IF
    IF allok
      ChangeChar mech campaign/mech-thumbup.png
      Say "Sí, el cargamento parece intacto."
      Say "Esto es para ti:"
      HideAllPaths forge workshop
      ShowPath R2-13a
      RESET ingotsPending
      SET ingotsFulfilledOnce
      IF oneingot
        IF ing3
          AddMissionCredits 9
          Announce "Recibes 9 créditos."
          SetAchievementAttempt camp_ingots 9
        END_OF_IF
        IF ing5
          AddMissionCredits 12
          Announce "Recibes 12 créditos."
          SetAchievementAttempt camp_ingots 12
        END_OF_IF
        IF ing6
          AddMissionCredits 15
          Announce "Recibes 15 créditos."
          SetAchievementAttempt camp_ingots 15
        END_OF_IF
        IF ing8
          AddMissionCredits 18
          Announce "Recibes 18 créditos."
          SetAchievementAttempt camp_ingots 18
        END_OF_IF
      END_OF_IF
      IF twoingots
        IF ing2
          AddMissionCredits 12
          Announce "Recibes 12 créditos."
          SetAchievementAttempt camp_ingots 12
        END_OF_IF
        IF ing3
          AddMissionCredits 18
          Announce "Recibes 18 créditos."
          SetAchievementAttempt camp_ingots 18
        END_OF_IF
        IF ing4
          AddMissionCredits 22
          Announce "Recibes 22 créditos."
          SetAchievementAttempt camp_ingots 22
        END_OF_IF
      END_OF_IF
      IF threeingots
        IF ing2
          AddMissionCredits 21
          Announce "Recibes 21 créditos."
          SetAchievementAttempt camp_ingots 21
        END_OF_IF
        IF ing3
          AddMissionCredits 30
          Announce "Recibes 30 créditos."
          SetAchievementProgress camp_ingots 30
        END_OF_IF
      END_OF_IF
    ELSE
      IF somemissing
        ChangeChar mech campaign/mech-f.png
        Say "Hm… Aquí faltan cosas."
        Say "Lo siento, pero no puedo validar un envío incompleto."
        ChangeChar mech campaign/mech-explaining-f.png
        Ask "Son las reglas. Vienen directas de Régula."
      ELSE
        ChangeChar mech campaign/mech-f.png
        Say "Espera... ¿dónde está el cargamento?"
        ChangeChar mech campaign/mech-explaining-f.png
        Ask "Mira, necesitamos esos lingotes. No podemos parar las máquinas porque no nos ha llegado el material."
      END_OF_IF
      MENU
        SET ingotsFailedDelivery
        OPT "Lo entiendo, volveré a intentarlo."
          SetMissionAsFailed
          ChangeChar mech campaign/mech-thumbup.png
          Say "Te lo agradezco. Sé que no es fácil cargar con esos lingotes."
          EXIT_MENU
        END_OF_OPT
      END_OF_MENU
    END_OF_IF
    Delay 300
    HideChar mech
    HideDlgScene
  ELSE
    SET ingotsFailed
  END_OF_IF
  END_FLIGHT
  FINISH_MISSION
END_OF_MISSION

END_OF_SCRIPTS
