Scripts/IR-main-script.js |
this.name = "IR-main-script.js";
this.author = "Ramirez";
this.copyright = "February 2014";
this.description = "Iron Raven main world script";
this.version = "1.4.2.1";
this.startUp = function()
{this.addIRinterface();
if(!missionVariables.IR_screen_log)
missionVariables.IR_screen_log = ""
if(!missionVariables.IR_screen_location)
missionVariables.IR_screen_location = ""}
this.addIRinterface = function()
{
player.ship.dockedStation.setInterface("IR_log",{
title: "Iron Raven - Mission Log",
category: "Mission",
summary: "Use this to access previous conversations relating to the Iron Raven mission.",
callback: this.showIRlog.bind(this)});
if(missionVariables.IR_status == "IR_IBANEZ_4")
{player.ship.dockedStation.setInterface("IR_questions",{
title: "Iron Raven - Questions",
category: "Mission",
summary: "Use this to interrogate contacts to aid your investigation.",
callback: this.questionScreens.bind(this)});}
}
this.questionScreens = function()
{
if(system.ID == 23) // Maenes
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_MAENES_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_MAENES_QUESTIONS"}
}
if(system.ID == 171) // Yokohama
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_YOKOHAMA_QUESTIONS"}
}
if(system.ID == 232) //Janes
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Janes's Shipyard Intelligence", background: "IR_janes_logo.png", messageKey: "IR_JANES_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_JANES_QUESTIONS"}
}
if(system.ID == 240) // Pirate Cove
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{ if(!missionVariables.IR_alsto)
{this._runScreen({title: " ", messageKey: "IR_PIRATE_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
missionVariables.IR_alsto = "MET"}
else
{this._runScreen({title: " ", messageKey: "IR_PIRATE_intro_alt", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"}
}
}
if(system.ID == 119) // PleasureWorld
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "PleasureWorld", background: "IR_pw_logo.png", messageKey: "IR_PW_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PW_QUESTIONS"}
}
if(system.ID == 180) // NWE
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_NWE_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_NWE_QUESTIONS"}
}
if(system.ID == 219) // GSE
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"}
}
if(system.ID == 31) // KORSHKOV
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_KORSHKOV_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"}
}
}
this.showIRlog = function()
{
//need to do length - 2 to get the number of the latest array element, as first element is actually [0] and the last element is a blank
this.IRlogArray = missionVariables.IR_screen_log.split(",")
this.IRlocationArray = missionVariables.IR_screen_location.split(",")
this.IRlogArrayTotal = this.IRlogArray.length - 1
this.logCounter = this.IRlogArray.length - 1
mission.runScreen({title: "Location: "+this.IRlocationArray[this.logCounter-1] + " Entry "+this.logCounter+" of "+this.IRlogArrayTotal, messageKey: this.IRlogArray[this.logCounter-1], choicesKey: "IR_log_choices"}, this.logChoices);
}
this.logChoices = function(choice)
{
if(choice == 1)
{
if(this.logCounter != 1)
{--this.logCounter}
mission.runScreen({title: "Location: "+this.IRlocationArray[this.logCounter-1] + " Entry "+this.logCounter+" of "+this.IRlogArrayTotal, messageKey: this.IRlogArray[this.logCounter-1], choicesKey: "IR_log_choices"}, this.logChoices);
}
if(choice == 2)
{
if(this.logCounter != this.IRlogArray.length - 1)
{++this.logCounter}
mission.runScreen({title: "Location: "+this.IRlocationArray[this.logCounter-1] + " Entry "+this.logCounter+" of "+this.IRlogArrayTotal, messageKey: this.IRlogArray[this.logCounter-1], choicesKey: "IR_log_choices"}, this.logChoices);
}
if(choice == 3)
{return;}
}
this._runScreen = function(params, callback)
{
if(callback)
mission.runScreen(params, callback);
else
mission.runScreen(params);
if(params.messageKey == "IR_negative_answer" || params.messageKey == "IR_no_more_answer")
return;
if(params.messageKey.indexOf("intro") != -1)
return;
//log(params.messageKey)
missionVariables.IR_screen_log = missionVariables.IR_screen_log + params.messageKey + ","
missionVariables.IR_screen_location = missionVariables.IR_screen_location + system.name +","}
this.shipWillDockWithStation = function(station)
{
if(missionVariables.offering) missionVariables.offering = null;
}
this.shipDockedWithStation = function(station)
{ this.addIRinterface()
if(missionVariables.IR_status == "IR_epilogue" && clock.days > missionVariables.IR_epilogue_deadline)
{this._runScreen({messageKey: "IR_final", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({background: "IR_title.png", messageKey: "IR_theend"});
missionVariables.IR_status = "IR_completed"
mission.setInstructionsKey(null)
missionVariables.IR_epilogue_deadline = null
missionVariables.IR_shipment_quest = null
missionVariables.IR_SDF_quest = null
missionVariables.IR_SDF_question_no = null
missionVariables.IR_SDF_question_key = null
missionVariables.IR_SDF_question_string = null
missionVariables.IR_defences_quest = null
missionVariables.IR_defences_question_no = null
missionVariables.IR_defences_question_key = null
missionVariables.IR_defences_question_string = null
missionVariables.IR_finance_quest = null
missionVariables.IR_finance_question_no = null
missionVariables.IR_finance_question_key = null
missionVariables.IR_finance_question_string = null
missionVariables.IR_shipment_quest_method = null
missionVariables.IR_shipment_question_no = null
missionVariables.IR_shipment_question_key = null
missionVariables.IR_shipment_question_string = null
missionVariables.IR_GSE_loan = null
missionVariables.IR_wife_status = null
missionVariables.IR_alsto = null
missionVariables.IR_count = null
missionVariables.IR_defences_kill_count = null
missionVariables.IR_SDF_quest_location = null
missionVariables.IR_SDF_quest_location_name = null
missionVariables.IR_KORSHKOV_deadline = null
missionVariables.IR_asked_question = null
missionVariables.IR_question_settings = null
missionVariables.IR_screen_log = null
missionVariables.IR_screen_location = null}
});
}
if(player.ship.docked && galaxyNumber == 7)
this.missionScreens();
}
this.missionScreens = function()
{
if(guiScreen == "GUI_SCREEN_MISSION" || !player.ship.docked)
return;
if(player.ship.dockedStation.hasRole("IR-luft-core"))
{
if(missionVariables.IR_SDF_quest == "JACOB" || missionVariables.IR_SDF_quest == "LUFTSLOTTE")
{this._runScreen({title: "Luftslotte 6", messageKey: "IR_SDF_quest_4"})
missionVariables.IR_SDF_quest = "KRAIT"}
}
if(player.ship.dockedStation.isMainStation && missionVariables.IR_offer == null)
{
if(missionVariables.IR_status == null)
{this._runScreen({background: "IR_title.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_IBANEZ_1"});
mission.setInstructionsKey("IR_IBANEZ_INFO")
missionVariables.IR_status = "IR_IBANEZ_1"}});
}
if(missionVariables.IR_finance_quest == "REPROCESSED" && clock.days >= missionVariables.IR_KORSHKOV_deadline) //this is 20 days
{this._runScreen({title: "Jane's Shipyard Intelligence", messageKey: "IR_finance_quest_4"});
missionVariables.IR_finance_quest = "JANES_NEWS"
missionVariables.IR_KORSHKOV_deadline = null
player.incrementFinanceStatus()}
if(missionVariables.IR_SDF_quest == "ADDRESS" && clock.days >= missionVariables.IR_SDF_deadline)
{this._runScreen({messageKey: "IR_SDF_quest_2"});
missionVariables.IR_SDF_quest = "JACOB"
player.incrementSDFStatus()}
if(missionVariables.IR_SDF_quest == "POD_SCOOPED")
{this._runScreen({messageKey: "IR_SDF_quest_5"});
player.ship.useSpecialCargo("WARNING: Radiation detected in cargo hold")
missionVariables.IR_SDF_quest = "KORSHKOV"
player.incrementSDFStatus()}
if(missionVariables.IR_SDF_quest == "PHOTO" && clock.days >= missionVariables.IR_SDF_deadline)
{this._runScreen({messageKey: "IR_SDF_quest_8a", background: "IR_kinnaird.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_SDF_quest_8b", background: "IR_match.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_SDF_quest_8c"});
missionVariables.IR_SDF_quest = "COMPLETED"
player.clearSDFStatus()
missionVariables.IR_SDF_status_no = null
missionVariables.IR_SDF_deadline = null
++missionVariables.IR_quest_count}
});
});
}
if(missionVariables.IR_finance_quest == "WAIT3" && clock.days >= missionVariables.IR_KORSHKOV_deadline)
{this._runScreen({title: " ", background: "IR_bloomberg.png", messageKey: "IR_finance_quest_10"});
missionVariables.IR_KORSHKOV_deadline = null
player.clearFinanceStatus()
missionVariables.IR_finance_status_no = null
missionVariables.IR_finance_quest = "COMPLETED"
++missionVariables.IR_quest_count
}
if(missionVariables.IR_shipment_quest == "SUCCESS")
{this._runScreen({messageKey: "IR_shipment_success"});
player.clearShipmentStatus()
missionVariables.IR_shipment_status_no = null
missionVariables.IR_shipment_quest = "COMPLETED"
missionVariables.IR_YOKOHAMA_deadline = null
++missionVariables.IR_quest_count
missionVariables.IR_tipoff_deadline = clock.days + 10
}
if(missionVariables.IR_shipment_quest == "DISPATCHED")
{this._runScreen({messageKey: "IR_shipment_failure"});
player.clearShipmentStatus()
missionVariables.IR_shipment_status_no = null
missionVariables.IR_shipment_quest = "FAILED"
++missionVariables.IR_quest_count
missionVariables.IR_YOKOHAMA_deadline = null}
if(missionVariables.IR_shipment_quest == "COMPLETED")
{if(clock.days >= missionVariables.IR_tipoff_deadline)
{this._runScreen({messageKey: "IR_tipoff"});
missionVariables.IR_tipoff_deadline = null
missionVariables.IR_shipment_quest = "TIPPEDOFF"
}
}
if(missionVariables.IR_loan_deadline)
{if(clock.days >= missionVariables.IR_loan_deadline)
{this._runScreen({title: "First Galactic Bank", messageKey: "IR_GSE_loan_warning"});
mission.setInstructionsKey(null)
missionVariables.IR_loan_deadline = null
missionVariables.IR_load_remaining = null
player.credits -= 550000
missionVariables.IR_GSE_loan = "DEFAULTED"
}
}
if(missionVariables.IR_defences_quest == "DEMO_6" && clock.days > missionVariables.IR_defences_quest_deadline)
{this._runScreen({messageKey: "IR_defences_quest_6"});
++missionVariables.IR_quest_count
missionVariables.IR_defences_quest = "COMPLETED"
missionVariables.IR_defences_quest_deadline = null
missionVariables.IR_defences_status_no = null
player.clearDefencesStatus()}
if(missionVariables.IR_status == "IR_KINNAIRD_2")
{this._runScreen({messageKey: "IR_kinnaird_3alt"});}
if(missionVariables.IR_status == "IR_LEXICON_1" && clock.days > missionVariables.IR_LEXICON_deadline)
{this._runScreen({messageKey: "IR_LEXICON_2"});
missionVariables.IR_status = "IR_LEXICON_2"
mission.setInstructionsKey("IR_LEXICON_brief_2")
missionVariables.IR_LEXICON_deadline = null}
if(missionVariables.IR_status == "IR_CHERKASOVA_1") // briefing with Cherkasova
{ this._runScreen({messageKey: "IR_CHERKASOVA_1a", background: "IR_KSR_logo.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_CHERKASOVA_1b", background: "IR_KSR_logo.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_CHERKASOVA_1c", background: "IR_KSR_logo.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_CHERKASOVA_1d", background: "IR_KSR_logo.png", choicesKey: "IR_cherkasova_choices"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_LOA_1", background: "IR_KSR_logo.png"})
mission.setInstructionsKey("IR_LOA_brief_1")
missionVariables.IR_status = "IR_LOA_1"
mission.setInstructionsKey("IR_LOA_brief_1")
missionVariables.IR_cherkasova_deadline = null
}
if(choice == 2)
{this._runScreen({messageKey: "IR_sources_1", background: "IR_KSR_logo.png"}) //screen fails to run
mission.setInstructionsKey("IR_LEXICON_brief_1")
missionVariables.IR_status = "IR_sources_1"
missionVariables.IR_cherkasova_deadline = null
mission.setInstructionsKey("IR_LEXICON_brief_1")
missionVariables.IR_sources_deadline = clock.days + 15}
});
});
});
});
}
if(missionVariables.IR_status == "IR_sources_1" && clock.days > missionVariables.IR_sources_deadline)
{this._runScreen({messageKey: "IR_sources_2"});
missionVariables.IR_status = "IR_sources_2"
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_sources_deadline = clock.days + 7}
if(missionVariables.IR_status == "IR_sources_2" && clock.days > missionVariables.IR_sources_deadline)
{this._runScreen({messageKey: "IR_sources_3"});
missionVariables.IR_status = "IR_sources_3"
missionVariables.IR_sources_deadline = null
mission.setInstructionsKey("IR_sources_brief_1")}
if(missionVariables.IR_status == "IR_LOA_4" && clock.days > missionVariables.IR_attack_deadline)
{this._runScreen({messageKey: "IR_LOA_5"});
missionVariables.IR_status = "IR_LOA_5"
missionVariables.IR_attack_deadline = null
mission.setInstructionsKey("IR_LOA_brief_4")}
if(missionVariables.IR_status == "IR_LOA_7" && clock.days > missionVariables.IR_epilogue_deadline)
{this._runScreen({messageKey: "IR_LOA_7"});
missionVariables.IR_status = "IR_LOA_8"
missionVariables.IR_epilogue_deadline = clock.days + 10}
if(missionVariables.IR_status == "IR_LOA_8" && clock.days > missionVariables.IR_epilogue_deadline)
{this._runScreen({messageKey: "IR_LOA_8"});
missionVariables.IR_status = "IR_LOA_9"
missionVariables.IR_epilogue_deadline = clock.days + 7}
if(missionVariables.IR_status == "IR_LOA_9" && clock.days > missionVariables.IR_epilogue_deadline)
{this._runScreen({messageKey: "IR_invite"});
missionVariables.IR_status = "IR_invite"
mission.setInstructionsKey("IR_invite_brief")
missionVariables.IR_epilogue_deadline = null}
if(missionVariables.IR_status == "IR_sources_6" && clock.days > missionVariables.IR_epilogue_deadline)
{this._runScreen({messageKey: "IR_sources_6"});
missionVariables.IR_status = "IR_sources_7"
missionVariables.IR_epilogue_deadline = clock.days + 15}
if(missionVariables.IR_status == "IR_sources_7" && clock.days > missionVariables.IR_epilogue_deadline)
{this._runScreen({messageKey: "IR_invite"});
missionVariables.IR_status = "IR_invite"
mission.setInstructionsKey("IR_invite_brief")
missionVariables.IR_epilogue_deadline = null}
//Location Specific
if(system.ID == 7) //Vegedius
{ if(missionVariables.IR_status == "IR_IBANEZ_1")
{this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_2a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_2b", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_2c"});
missionVariables.IR_status = "IR_IBANEZ_2"
mission.setInstructionsKey("IR_RAAED_INFO")}
});
});
}
if(missionVariables.IR_status == "IR_RAAED_1") //return to Ibanez
{this._runScreen({title: "Galcop High Command", messageKey: "IR_IBANEZ_3"})
missionVariables.IR_status = "IR_IBANEZ_3"
mission.setInstructionsKey("IR_JANES_INFO")}
if(missionVariables.IR_status == "IR_JANES_1") // return to Ibanez for big briefing
{this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_4a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_4b", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_4c", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_4d"});
missionVariables.IR_status = "IR_IBANEZ_4"
mission.setInstructionsKey(null)
this.setupQuestions()
this.setupStatus()
missionVariables.IR_quest_count = 0
this.addIRinterface();}
});
});
});
}
if(missionVariables.IR_status == "IR_IBANEZ_4" && missionVariables.IR_quest_count == 4)
{ missionVariables.IR_quest_count = null
if(missionVariables.IR_shipment_quest_method == "YOKOHAMA_AMBUSH")
{this._runScreen({messageKey: "IR_IBANEZ_5a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({background: "IR_title.png", messageKey: "IR_theend"});
missionVariables.IR_status = "IR_completed"
mission.setInstructionsKey(null)
missionVariables.IR_epilogue_deadline = null
missionVariables.IR_shipment_quest = null
missionVariables.IR_SDF_quest = null
missionVariables.IR_defences_quest = null
missionVariables.IR_finance_quest = null
missionVariables.IR_shipment_quest_method = null}
});
}
if(missionVariables.IR_shipment_quest == "FAILED")
{this._runScreen({messageKey: "IR_IBANEZ_5b", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({background: "IR_title.png", messageKey: "IR_theend"});
missionVariables.IR_status = "IR_completed"
mission.setInstructionsKey(null)
missionVariables.IR_epilogue_deadline = null
missionVariables.IR_shipment_quest = null
missionVariables.IR_SDF_quest = null
missionVariables.IR_defences_quest = null
missionVariables.IR_finance_quest = null
missionVariables.IR_shipment_quest_method = null}
});
}
else
this._runScreen({title: "GalCop High Command", messageKey: "IR_IBANEZ_5", choicesKey: "IR_IBANEZ_choices"}, function(choice)
{if(choice == "IR_IBANEZ_A_weiss")
{this._runScreen({title: "GalCop High Command", messageKey: "IR_weiss_1"});
missionVariables.IR_status = "IR_WEISS_1"
mission.setInstructionsKey("IR_weiss_brief_1")}
if(choice == "IR_IBANEZ_B_kinnaird")
{this._runScreen({title: "GalCop High Command", messageKey: "IR_kinnaird_1"});
missionVariables.IR_status = "IR_KINNAIRD_1"
mission.setInstructionsKey("IR_kinnaird_brief_1")}
if(choice == "IR_IBANEZ_C_moreinfo")
{this._runScreen({title: "GalCop High Command", messageKey: "IR_LEXICON_1"});
missionVariables.IR_status = "IR_LEXICON_1"
mission.setInstructionsKey("IR_LEXICON_1")
missionVariables.IR_LEXICON_deadline = clock.days + 15}
});
}
if(missionVariables.IR_status == "IR_WEISS_4" || missionVariables.IR_status == "IR_KINNAIRD_4" )
{this._runScreen({title: "Galcop High Command", messageKey: "IR_IBANEZ_5_debrief"})
missionVariables.IR_status = "IR_IBANEZ_5"
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_cherkasova_deadline = clock.days + 20}
if(missionVariables.IR_status == "IR_invite" && clock.days > missionVariables.IR_epilogue_deadline)
{this._runScreen({messageKey: "IR_reward_a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_reward_b", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_reward_c", choicesKey: "IR_continue", background: "IR_maenesmedal.png"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_reward_d", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_reward_e"});
missionVariables.IR_status = "IR_epilogue"
missionVariables.IR_epilogue_deadline = clock.days + 5
player.credits += 50000
mission.setInstructionsKey(null)}
});
});
});
});
}
}
if(system.ID == 230) // RAAED
{ if(missionVariables.IR_status == "IR_IBANEZ_2")
{this._runScreen({messageKey: "IR_RAAED_1a", background: "IR_forest.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({background: "IR_invoice.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_RAAED_1c", background: "IR_forest.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_RAAED_1d", choicesKey: "IR_continue", background: "IR_forest.png"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_RAAED_1e", background: "IR_forest.png"});
missionVariables.IR_status = "IR_RAAED_1"
mission.setInstructionsKey("IR_IBANEZ_INFO")}
});
});
});
});
}
}
if(system.ID == 232) // Janes
{ if(missionVariables.IR_status == "IR_IBANEZ_3") // quick visit to Janes
{this._runScreen({messageKey: "IR_JANES_1a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_JANES_1b", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_JANES_1c"});
missionVariables.IR_status = "IR_JANES_1"
mission.setInstructionsKey("IR_IBANEZ_INFO")}
});
});
}
if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Janes's Shipyard Intelligence", background: "IR_janes_logo.png", messageKey: "IR_JANES_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_JANES_QUESTIONS"}
}
if(system.ID == 171) // Yokohama
{if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_YOKOHAMA_QUESTIONS"}
}
if(missionVariables.IR_convoy_exited == "TRUE" && missionVariables.IR_alsto == "HELP_ACCEPTED")
{this._runScreen({messageKey: "IR_shipment_contact_report"});
player.incrementShipmentStatus()
missionVariables.IR_alsto = "INFORMED"
missionVariables.IR_convoy_exited = null}
if(system.ID == 240) // Pirate Cove
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{ if(!missionVariables.IR_alsto)
{this._runScreen({title: " ", messageKey: "IR_PIRATE_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
missionVariables.IR_alsto = "MET"}
else
{this._runScreen({title: " ", messageKey: "IR_PIRATE_intro_alt", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"}
}
if(missionVariables.IR_status == "IR_LOA_1")
{
if(missionVariables.IR_alsto)
missionVariables.IR_LOA_text = "known"
if(missionVariables.IR_alsto == "INFORMED")
missionVariables.IR_LOA_text = "helped"
if(!missionVariables.IR_alsto)
missionVariables.IR_LOA_text = "unknown"
this._runScreen({messageKey: "IR_LOA_"+[missionVariables.IR_LOA_text]+"_2a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_LOA_"+[missionVariables.IR_LOA_text]+"_2b", choicesKey: "IR_continue", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_LOA_2c", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_LOA_2d"})
missionVariables.IR_status = "IR_LOA_2"
mission.setInstructionsKey("IR_LOA_brief_2")
missionVariables.IR_alsto = null
missionVariables.IR_LOA_text = null
}
});
});
});
} }
if(system.ID == 119) // PleasureWorld
{if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "PleasureWorld", background: "IR_pw_logo.png", messageKey: "IR_PW_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PW_QUESTIONS"}
if(missionVariables.IR_status == "IR_WEISS_3")
{this._runScreen({title: "PleasureWord", background: "IR_pw_logo.png", messageKey: "IR_weiss_3a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({background: "IR_pw_logo.png", messageKey: "IR_weiss_3b"})
missionVariables.IR_status = "IR_WEISS_4"
mission.setInstructionsKey("IR_weiss_brief_3")
});
}
if(missionVariables.IR_status == "IR_KINNAIRD_3")
{this._runScreen({title: "PleasureWord", background: "IR_pw_logo.png", messageKey: "IR_kinnaird_4a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_kinnaird_4b"})
missionVariables.IR_status = "IR_KINNAIRD_4"
mission.setInstructionsKey("IR_kinnaird_brief_4")
});
}
if(missionVariables.IR_status == "IR_LEXICON_2")
{this._runScreen({messageKey: "IR_LEXICON_3a", background: "IR_nightclub.png", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_LEXICON_3b", background: "IR_nightclub.png", choicesKey: "IR_launch_choice"}, function(choice)
{if(choice == 1)
{missionVariables.IR_status = "IR_LEXICON_4"
player.ship.launch()}
});
});
}
if(missionVariables.IR_status == "IR_weiss_scooped")
{this._runScreen({messageKey: "IR_LEXICON_4a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({messageKey: "IR_LEXICON_4b"})
missionVariables.IR_status = "IR_IBANEZ_5"
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_cherkasova_deadline = clock.days + 20
});
}
}
if(system.ID == 180) // NWE
{if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_NWE_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_NWE_QUESTIONS"}
if(missionVariables.IR_defences_quest == "DEMO_2")
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_defences_quest_2a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_defences_quest_2b"});
missionVariables.IR_defences_quest_deadline = clock.days + 7
missionVariables.IR_defences_quest = "DEMO_3"
player.incrementDefencesStatus()}
});}
if(missionVariables.IR_defences_quest == "DEMO_3" && clock.days > missionVariables.IR_defences_quest_deadline)
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_defences_quest_3"});
missionVariables.IR_defences_quest_deadline = null
missionVariables.IR_defences_quest = "DEMO_4"
player.incrementDefencesStatus()
}
}
if(system.ID == 82) // Inorle
{if(missionVariables.IR_SDF_quest == "JACOB")
{this._runScreen({messageKey: "IR_SDF_quest_3"})
missionVariables.IR_SDF_quest = "LUFTSLOTTE"}
}
if(system.ID == 219) // GSE
{ if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"}
if(missionVariables.IR_finance_quest == "JANES_NEWS")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_finance_quest_6a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_finance_quest_6b"});
player.incrementFinanceStatus()
missionVariables.IR_offer = null
missionVariables.IR_finance_quest = "WIFE"}
});
}
if(missionVariables.IR_finance_quest == "WIFE_MET")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_finance_quest_8", choicesKey: "IR_wife_choices"}, function(choice)
{if(choice == "IR_wife_yes")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_finance_quest_9_confirm"});
missionVariables.IR_wife_status = "AFFAIR_CONFIRMED"}
if(choice == "IR_wife_no")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_finance_quest_9_deny"});
missionVariables.IR_wife_status = "AFFAIR_DENIED"}
player.incrementFinanceStatus()
missionVariables.IR_finance_quest = "WAIT3"
missionVariables.IR_KORSHKOV_deadline = clock.days + 10
missionVariables.IR_offer = null
});
}
}
if(system.ID == 31) // KORSHKOV
{ if(missionVariables.IR_finance_quest == "WAIT" && clock.days >= missionVariables.IR_KORSHKOV_deadline)
{this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_finance_quest_1"});
player.incrementFinanceStatus()
missionVariables.IR_finance_quest = "COLLECTION"
missionVariables.IR_KORSHKOV_deadline = null
return;}
if(missionVariables.IR_finance_quest == "COLLECTION")
{
this.checkManifest()
if(missionVariables.IR_manifestOK == "TRUE")
{this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_finance_quest_2"});
player.incrementFinanceStatus()
missionVariables.IR_KORSHKOV_deadline = clock.days + 10
missionVariables.IR_finance_quest = "WAIT2"
player.ship.manifest.radioactives -= 10
player.ship.manifest.alloys =-5
player.ship.manifest.minerals -=2
player.ship.manifest.alienItems -=2
player.ship.manifest.platinum -=1
missionVariables.IR_manifestOK = null
return;}
if(missionVariables.IR_manifestOK != "TRUE")
this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_finance_quest_3alt"});
else return;
}
if(missionVariables.IR_finance_quest == "WAIT2" && clock.days >= missionVariables.IR_KORSHKOV_deadline)
{
this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_finance_quest_3"});
player.incrementFinanceStatus()
missionVariables.IR_KORSHKOV_deadline = null
missionVariables.IR_finance_quest = "IRRADIATE"
return;
}
if(missionVariables.IR_SDF_quest == "KORSHKOV")
{this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_SDF_quest_6"});
player.incrementSDFStatus()
missionVariables.IR_SDF_deadline = clock.days + 10
missionVariables.IR_SDF_quest = "ANALYSIS"
player.ship.removeAllCargo()
missionVariables.IR_cargoCount = null
return;}
if(missionVariables.IR_SDF_quest == "ANALYSIS" && clock.days >= missionVariables.IR_SDF_deadline)
{this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_SDF_quest_7a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_SDF_quest_7b"});
missionVariables.IR_SDF_quest = "DATA"
player.incrementSDFStatus()
this.incrementSDFQuestion()
missionVariables.IR_SDF_location = null
missionVariables.IR_SDF_location_name = null}
});
return;}
if(missionVariables.IR_status == "IR_IBANEZ_4")
{this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_KORSHKOV_intro", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"
return;}
}
if(system.ID == 142) // Tibiri bar
{ if(missionVariables.IR_finance_quest == "WIFE_DOCKED")
{this._runScreen({messageKey: "IR_finance_quest_7a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_finance_quest_7b"});
player.incrementFinanceStatus()
player.credits += 1000
missionVariables.IR_offer = null
missionVariables.IR_finance_quest = "WIFE_MET"}
});
}
if(missionVariables.IR_finance_quest == "WIFE" || missionVariables.IR_finance_quest == "WIFE_IDENTIFIED")
this._runScreen({messageKey: "IR_finance_quest_7alt"})
}
if(system.ID == 23) // Maenes
{
if(missionVariables.IR_defences_question_no == 3 && !missionVariables.IR_defences_quest)
{
if(!missionVariables.IR_Maenes_visit)
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_defences_quest_1_alt"});
missionVariables.IR_defences_quest = "DEMO_1"}
if(missionVariables.IR_Maenes_visit == "TRUE")
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_defences_quest_1"});
missionVariables.IR_defences_quest = "DEMO_1"
missionVariables.IR_Maenes_visit = null}
}
if(missionVariables.IR_defences_quest == "DEMO_4")
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_defences_quest_4"});
missionVariables.IR_defences_quest = "DEMO_5"}
if(missionVariables.IR_defences_quest == "SABOTAGED")
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_defences_quest_5a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_defences_quest_5b"});
player.incrementDefencesStatus()
missionVariables.IR_defences_quest = "DEMO_6"
missionVariables.IR_defences_quest_deadline = clock.days + 15}
});
}
if(missionVariables.IR_status == "IR_sources_5")
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_sources_5a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_sources_5b"});
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_status = "IR_sources_6"
missionVariables.IR_epilogue_deadline = clock.days + 10}
});
}
if(missionVariables.IR_status == "IR_LOA_6")
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_LOA_6"});
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_status = "IR_LOA_7"
missionVariables.IR_epilogue_deadline = clock.days + 10}
}
if(system.ID == 35 && missionVariables.IR_status == "IR_KINNAIRD_1") //Atanon
{this._runScreen({messageKey: "IR_kinnaird_2"});
missionVariables.IR_status = "IR_KINNAIRD_2"}
if(system.ID == 41 && missionVariables.IR_status == "IR_KINNAIRD_2") //Orlaroor
{this._runScreen({messageKey: "IR_kinnaird_3"});
missionVariables.IR_status = "IR_KINNAIRD_3"
mission.setInstructionsKey("IR_kinnaird_brief_3")}
if(system.ID == 149 && missionVariables.IR_status == "IR_LOA_3") //Arenxeon
{this._runScreen({messageKey: "IR_LOA_4a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_LOA_4b"});
missionVariables.IR_status = "IR_LOA_4"
missionVariables.IR_attack_deadline = clock.days + 10
mission.setInstructionsKey("IR_waitforinfo_brief")}
});
}
if(system.ID == 63 && missionVariables.IR_status == "IR_sources_3") //Edsoan
{this._runScreen({messageKey: "IR_sources_4a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this._runScreen({messageKey: "IR_sources_4b"});
missionVariables.IR_status = "IR_sources_4"
mission.setInstructionsKey("IR_sources_brief_2")}
});
}
//keep brackets
}
}
this.checkManifest = function()
{
var radioactivesAmount=player.ship.manifest.radioactives;
var alloysAmount=player.ship.manifest.alloys;
var mineralsAmount=player.ship.manifest.minerals;
var alienItemsAmount=player.ship.manifest.alien_items; // 16.06.2020 Milo: changed from alienItems because Oolite v1.82 removed that alias
var platinumAmount=player.ship.manifest.platinum;
//log('manifest checked')
if(alloysAmount >= 5 && mineralsAmount >=2 && alienItemsAmount >= 2 && radioactivesAmount >=10 && platinumAmount >=1)
missionVariables.IR_manifestOK = "TRUE"
}
this.choiceEvaluation = function(choice)
{
switch(missionVariables.IR_offer)
{ case "IR_GSE_QUESTIONS":
{ if(choice == "IR_B_finance_question_key")
{ if(missionVariables.IR_finance_question_no == 1)
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_finance_answer_1a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this.incrementFinanceQuestion()
this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_finance_answer_1b", choicesKey: "IR_questions"},this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"}
});
break;}
if(missionVariables.IR_finance_question_no > 1)
{ missionVariables.IR_asked_question = missionVariables.IR_finance_question_string
this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
}
if(choice == "IR_A_shipment_question_key")
{ if(missionVariables.IR_shipment_question_no == 2 && !missionVariables.IR_GSE_loan)
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_offer", choicesKey: "IR_loan_choices"}, function(choice)
{if(choice == "IR_loan_yes")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_agreed"});
missionVariables.IR_GSE_loan = "ACCEPTED"
player.credits += 500000
missionVariables.IR_loan_deadline = clock.days + 60
missionVariables.IR_loan_remaining = missionVariables.IR_loan_deadline - clock.days
mission.setInstructionsKey("IR_loan_amount")
missionVariables.IR_offer = null}
if(choice == "IR_loan_no")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_rejected", choicesKey: "IR_questions"},this.choiceEvaluation);
missionVariables.IR_offer = null
missionVariables.IR_GSE_loan = "REJECTED"}
if(choice == "IR_loan_defer")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_deferred", choicesKey: "IR_questions"},this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
missionVariables.IR_GSE_loan = "DEFERRED"}
});
break;}
if(missionVariables.IR_GSE_loan == "DEFERRED")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_repeat_offer", choicesKey: "IR_loan_choices"}, function(choice)
{if(choice == "IR_loan_yes")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_agreed"});
missionVariables.IR_GSE_loan = "ACCEPTED"
player.credits += 500000
missionVariables.IR_loan_deadline = clock.days + 60
missionVariables.IR_loan_remaining = missionVariables.IR_loan_deadline - clock.days
mission.setInstructionsKey("IR_loan_amount")
missionVariables.IR_offer = null}
if(choice == "IR_loan_no")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_rejected", choicesKey: "IR_questions"},this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
missionVariables.IR_GSE_loan = "REJECTED"}
if(choice == "IR_loan_defer")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_deferred", choicesKey: "IR_questions"},this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
missionVariables.IR_GSE_loan = "DEFERRED"}
});
break;}
if(missionVariables.IR_GSE_loan == "ACCEPTED")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_loan_demand", choicesKey: "IR_pay_choices"}, function(choice)
{if(choice == "IR_pay_yes")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_pay_accepted", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_GSE_loan = "PAID"
player.credits -= 550000
missionVariables.IR_loan_deadline = null
missionVariables.IR_loan_remaining = null
mission.setInstructionsKey(null)
missionVariables.IR_offer = "IR_GSE_QUESTIONS"}
if(choice == "IR_pay_no")
{this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_GSE_pay_deferred", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"}
});
break;}
}
if(choice == "IR_E_exit_question_key")
return;
else
this._runScreen({title: "Galactic Stock Exchange", background: "IR_GSE_logo.png", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
break;
}
case "IR_KORSHKOV_QUESTIONS":
{ if(choice == "IR_B_finance_question_key")
{ if(missionVariables.IR_finance_question_no == 2)
{this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_KORSHKOV_finance_answer_1a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this.incrementFinanceQuestion()
this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_KORSHKOV_finance_answer_1b"});
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"
missionVariables.IR_KORSHKOV_deadline = clock.days + 5
player.incrementFinanceStatus()
missionVariables.IR_offer = null
missionVariables.IR_finance_quest = "WAIT"}
});
break;
}
if(missionVariables.IR_finance_question_no > 2)
{ missionVariables.IR_asked_question = missionVariables.IR_finance_question_string
this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;
}
}
if(choice == "IR_E_exit_question_key")
{
return;}
else
this._runScreen({title: "OKB Korshkov", background: "IR_korshlogo.png", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"
break;
}
case "IR_JANES_QUESTIONS":
{ if(choice == "IR_A_shipment_question_key")
{this._runScreen({title: "Jane's Shipyard Intelligence", background: "IR_janes_logo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
if(choice == "IR_C_SDF_question_key")
{
if(missionVariables.IR_SDF_question_no == 1)
{this.incrementSDFQuestion()
this._runScreen({title: "Jane's Shipyard Intelligence", background: "IR_janes_logo.png", messageKey: "IR_JANES_SDF_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
if(missionVariables.IR_SDF_question_no > 1)
{this._runScreen({title: "Jane's Shipyard Intelligence", background: "IR_janes_logo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
}
if(choice == "IR_D_defences_question_key")
{this._runScreen({title: "Jane's Shipyard Intelligence", background: "IR_janes_logo.png", messageKey: "IR_JANES_defences_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
if(choice == "IR_E_exit_question_key")
return;
else
this._runScreen({title: "Jane's Shipyard Intelligence", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_JANES_QUESTIONS"
break;
}
case "IR_PIRATE_QUESTIONS":
{ if(choice == "IR_A_shipment_question_key")
{
if(missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_shipment_quest == "SET")
{ this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_answer", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_offer", choicesKey: "IR_pirate_choices"}, function(choice)
{if(choice == "IR_pirate_yes")
{this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_accepted"});
missionVariables.IR_alsto = "HELP_ACCEPTED"
player.credits -= 250000
player.incrementShipmentStatus()
missionVariables.IR_offer = null
}
if(choice == "IR_pirate_no")
{this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_declined"});
missionVariables.IR_offer = null
missionVariables.IR_alsto = "HELP_DECLINED"
}
});
});
break;}
if(missionVariables.IR_shipment_question_no == 1)
{this._runScreen({title: " ", messageKey: "IR_negative_answer", choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
break;}
if(missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_alsto == "HELP_ACCEPTED")
this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_confirm_help"});
if(missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_alsto == "HELP_DECLINED")
{this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_deferred_help", choicesKey: "IR_pirate_choices"}, function(choice)
{if(choice == "IR_pirate_yes")
{this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_accepted"});
missionVariables.IR_alsto = "HELP_ACCEPTED"
player.credits -= 250000
player.incrementShipmentStatus()
missionVariables.IR_offer = null
}
if(choice == "IR_pirate_no")
{this._runScreen({title: " ", messageKey: "IR_PIRATE_shipment_declined"});
missionVariables.IR_offer = null
missionVariables.IR_alsto = "HELP_DECLINED"
}
});
if(missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_shipment_quest != "SET")
{missionVariables.IR_asked_question = missionVariables.IR_shipment_question_string
this._runScreen({title: " ", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
}
}
if(choice == "IR_C_SDF_question_key")
{
if(missionVariables.IR_SDF_question_no < 2)
this._runScreen({title: " ", messageKey: "IR_PIRATE_SDF_answer_1", choicesKey: "IR_questions"}, this.choiceEvaluation);
if(missionVariables.IR_SDF_question_no == 2)
this._runScreen({title: " ", messageKey: "IR_PIRATE_SDF_answer_2", choicesKey: "IR_questions"}, this.choiceEvaluation);
if(missionVariables.IR_SDF_question_no > 2)
{this._runScreen({title: " ", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);}
break;
}
if(choice == "IR_E_exit_question_key")
return;
else
this._runScreen({title: " ", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
break;
}
case "IR_YOKOHAMA_QUESTIONS":
{ if(choice == "IR_A_shipment_question_key")
{ if(missionVariables.IR_shipment_question_no == 1)
{
this.incrementShipmentQuestion()
this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_shipment_answer_1"});
missionVariables.IR_YOKOHAMA_deadline = clock.days + 30
missionVariables.IR_shipment_quest = "SET"
missionVariables.IR_offer = null
player.incrementShipmentStatus()
break;
}
if(missionVariables.IR_shipment_question_no == 2 && clock.days < missionVariables.IR_YOKOHAMA_deadline)
{
this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_shipment_answer_2", choicesKey: "IR_YOKOHAMA_choices"}, function(choice)
{if(choice == "IR_YOKOHAMA_yes")
{ if(player.credits >= 1000000)
{this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_shipment_agreed"});
missionVariables.IR_shipment_quest = "SUCCESS"
missionVariables.IR_shipment_quest_method = "PURCHASED"
missionVariables.IR_YOKOHAMA_deadline = null
++missionVariables.IR_quest_count
this.incrementShipmentQuestion()
player.clearShipmentStatus()
missionVariables.IR_offer = null
player.credits -= 1000000}
else
{this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_shipment_nomoney"});
missionVariables.IR_offer = null}
}
if(choice == "IR_YOKOHAMA_no")
{this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_shipment_declined"});
missionVariables.IR_shipment_quest = "ENROUTE"
this.incrementShipmentQuestion()
missionVariables.IR_offer = null
if(missionVariables.IR_alsto)
{player.incrementShipmentStatus()}
}
if(choice == "IR_YOKOHAMA_defer")
{this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_shipment_defer"});
missionVariables.IR_offer = null}
});
break;}
if(missionVariables.IR_shipment_question_no == 2 && clock.days > missionVariables.IR_YOKOHAMA_deadline)
{this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_YOKOHAMA_shipment_toolate"});
missionVariables.IR_shipment_quest = "DISPATCHED"
player.clearShipmentStatus()
missionVariables.IR_offer = null
break;}
if(missionVariables.IR_shipment_question_no > 2)
{
missionVariables.IR_asked_question = missionVariables.IR_shipment_question_string
this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
}
if(choice == "IR_E_exit_question_key")
return;
else
this._runScreen({title: "Yokohama Exports", background: "IR_yk_logo.png", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_YOKOHAMA_QUESTIONS"
break;
}
case "IR_PW_QUESTIONS":
{
if(choice == "IR_C_SDF_question_key")
{
if(missionVariables.IR_SDF_question_no == 2)
{this._runScreen({title: "PleasureWorld", background: "IR_pw_logo.png", messageKey: "IR_PW_SDF_answer_1", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this.incrementSDFQuestion()
this._runScreen({title: " ", messageKey: "IR_SDF_quest_1"});
missionVariables.IR_SDF_quest = "ADDRESS"
missionVariables.IR_SDF_deadline = clock.days + 10}
});
break;}
if(missionVariables.IR_SDF_question_no == 3)
{this._runScreen({title: "PleasureWorld", background: "IR_pw_logo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
if(missionVariables.IR_SDF_question_no == 5)
{this._runScreen({title: "PleasureWorld", background: "IR_devries.png", messageKey: "IR_PW_SDF_answer_2"});
this.incrementSDFQuestion()
missionVariables.IR_SDF_quest = "PHOTO"
missionVariables.IR_SDF_deadline = clock.days + 35
}
else
{this._runScreen({title: "PleasureWorld", background: "IR_pw_logo.png", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);}
break;}
if(choice == "IR_E_exit_question_key")
{missionVariables.IR_offer = "IR_ASKED"
return;}
else
this._runScreen({title: "PleasureWorld", background: "IR_pw_logo.png", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PW_QUESTIONS"
break;
}
case "IR_NWE_QUESTIONS":
{
if(choice == "IR_C_SDF_question_key")
{
if(missionVariables.IR_SDF_question_no == 4)
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_NWE_SDF_answer_1a", choicesKey: "IR_continue"}, function(choice)
{if(choice == 1)
{this.incrementSDFQuestion()
this._runScreen({title: " ", background: "IR_NWE_logo.png", messageKey: "IR_NWE_SDF_answer_1b"});}
missionVariables.IR_offer = null});
}
if(missionVariables.IR_SDF_question_no < 4 || missionVariables.IR_SDF_question_no > 4)
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);}
break;}
if(choice == "IR_D_defences_question_key")
{ if(missionVariables.IR_defences_question_no < 3)
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_NWE_defences_answer_1"});
missionVariables.IR_defences_question_no = 3
missionVariables.IR_offer = null
player.incrementDefencesStatus()
break;}
if(missionVariables.IR_defences_question_no == 3)
{this._runScreen({title: "Naval Weapons Establishment", background: "IR_NWE_logo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
}
if(choice == "IR_E_exit_question_key")
return;
else
this._runScreen({title: "Naval Weapons Establishment", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_NWE_QUESTIONS"
break;
}
case "IR_MAENES_QUESTIONS":
{
if(choice == "IR_D_defences_question_key")
{
if(missionVariables.IR_defences_question_no == 1)
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_MAENES_defences_answer_1"});
this.incrementDefencesQuestion()
missionVariables.IR_offer = null
missionVariables.IR_Maenes_visit = "TRUE"
break;}
if(missionVariables.IR_defences_question_no >= 2)
{this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
break;}
}
if(choice == "IR_E_exit_question_key")
return;
else
this._runScreen({title: "QuiCo Pharmaceuticals", background: "IR_quico_logo.png", messageKey: "IR_negative_answer",
choicesKey: "IR_questions"}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_MAENES_QUESTIONS"
break;
}
}
}
this.setupQuestions = function()
{ missionVariables.IR_shipment_question_no = 1
missionVariables.IR_shipment_question_key = "shipment_question_"+[missionVariables.IR_shipment_question_no]
missionVariables.IR_shipment_question_string = expandDescription("[shipment_question_string_"+[missionVariables.IR_shipment_question_no]+"]")
missionVariables.IR_SDF_question_no = 1
missionVariables.IR_SDF_question_key = "SDF_question_"+[missionVariables.IR_SDF_question_no]
missionVariables.IR_SDF_question_string = expandDescription("[SDF_question_string_"+[missionVariables.IR_SDF_question_no]+"]")
missionVariables.IR_finance_question_no = 1
missionVariables.IR_finance_question_key = "finance_question_"+[missionVariables.IR_finance_question_no]
missionVariables.IR_finance_question_string = expandDescription("[finance_question_string_"+[missionVariables.IR_finance_question_no]+"]")
missionVariables.IR_defences_question_no = 1
missionVariables.IR_defences_question_key = "defences_question_"+[missionVariables.IR_defences_question_no]
missionVariables.IR_defences_question_string = expandDescription("[defences_question_string_"+[missionVariables.IR_defences_question_no]+"]")
missionVariables.IR_question_settings = "SET"
}
this.setupStatus = function()
{ missionVariables.IR_shipment_status_no = 0
missionVariables.IR_finance_status_no = 0
missionVariables.IR_SDF_status_no = 0
missionVariables.IR_defences_status_no = 0
player.setShipmentStatus()
player.setSDFStatus()
player.setFinanceStatus()
player.setDefencesStatus()}
this.incrementShipmentQuestion = function()
{ ++missionVariables.IR_shipment_question_no
missionVariables.IR_shipment_question_key = "shipment_question_"+[missionVariables.IR_shipment_question_no]
missionVariables.IR_shipment_question_string = expandDescription("[shipment_question_string_"+[missionVariables.IR_shipment_question_no]+"]")
}
this.incrementFinanceQuestion = function()
{ ++missionVariables.IR_finance_question_no
missionVariables.IR_finance_question_key = "finance_question_"+[missionVariables.IR_finance_question_no]
missionVariables.IR_finance_question_string = expandDescription("[finance_question_string_"+[missionVariables.IR_finance_question_no]+"]")
}
this.incrementSDFQuestion = function()
{ ++missionVariables.IR_SDF_question_no
missionVariables.IR_SDF_question_key = "SDF_question_"+[missionVariables.IR_SDF_question_no]
missionVariables.IR_SDF_question_string = expandDescription("[SDF_question_string_"+[missionVariables.IR_SDF_question_no]+"]")
}
this.incrementDefencesQuestion = function()
{ ++missionVariables.IR_defences_question_no
missionVariables.IR_defences_question_key = "defences_question_"+[missionVariables.IR_Defences_question_no]
missionVariables.IR_defences_question_string = expandDescription("[defences_question_string_"+[missionVariables.IR_defences_question_no]+"]")
}
this.shipTargetAcquired = function (target)
{
if(missionVariables.IR_finance_quest == "WIFE")
{
var isabella = system.shipsWithRole("IR-isabella")[0]
if(player.ship.target == isabella)
{player.commsMessage("That must be Isabella King's ship. It looks like she's planning to dock at the station.")
missionVariables.IR_finance_quest = "WIFE_IDENTIFIED"}
}
if(missionVariables.IR_shipment_quest == "ENROUTE" && missionVariables.IR_alsto == "HELP_ACCEPTED")
{ var transport = system.shipsWithRole("IR-transport")[0]
if(player.ship.target == transport && !missionVariables.IR_comms)
{player.commsMessage("OK, that's one of the transports. I need shadow the convoy as it leaves the system.", 6)
missionVariables.IR_comms = "TRUE"}
}
if(missionVariables.IR_shipment_quest == "AMBUSH")
{ var transport = system.shipsWithRole("IR-transport-alternate")[0]
if(player.ship.target == transport && !missionVariables.IR_comms)
{ missionVariables.IR_comms = "TRUE"
if(missionVariables.IR_alsto == "INFORMED")
player.commsMessage("Alsto Abonlo: It looks like the convoy's picked up more escorts. You'll need all the help you can get!", 6)
else
player.commsMessage("Oh no, it looks like the convoy's picked up even more escorts. This is going to be tough!", 6)
}
}
var krait = system.shipsWithRole("IR-krait")[0]
if(player.ship.target == krait && !missionVariables.IR_comms)
{ if(missionVariables.IR_SDF_quest == "KRAIT")
{player.commsMessage("That's strange, what's a renegade Krait doing around here?", 6)
krait.reactToAIMessage("PREPARE_JUMP")
missionVariables.IR_comms = "TRUE"}
if(missionVariables.IR_SDF_quest == "JUMPED")
{player.commsMessage("There's the Krait again. Better follow him and see what he does next.", 6)
krait.reactToAIMessage("PREPARE_EJECT")
missionVariables.IR_SDF_quest_location = system.ID
missionVariables.IR_SDF_quest_location_name = System.infoForSystem(7,[missionVariables.IR_SDF_quest_location]).name
missionVariables.IR_comms = "TRUE"}
}
var weiss = system.shipsWithRole("IR-quico-transporter")[0]
if(player.ship.target == weiss && !missionVariables.IR_comms)
{if(missionVariables.IR_status == "IR_WEISS_1")
{player.commsMessage("Weiss is probably on board that transport; I'll need to follow it.", 6)
weiss.reactToAIMessage("HEAD_FOR_AEGIS")
missionVariables.IR_comms = "TRUE"}
}
}
this.shipBeingAttacked = function()
{
if(missionVariables.IR_defences_quest == "DEPLOYED")
{if(!this.DefencesTimer)
{player.ship.fuelLeakRate = 15
player.commsMessage("Help! I'm under attack!", 6)
missionVariables.IR_count = 70
this.DefencesTimer = new Timer(this, this.DefencesReply, null, 1);}
else
{this.DefencesTimer.start();}
}
}
this.DefencesReply = function()
{
--missionVariables.IR_count
if(missionVariables.IR_count == 80)
{player.commsMessage("Colonel Ruiz: What's happening, Commander? The defence cannons have targetted your ship! Can you hold on while we try to shut them down?", 6)}
if(missionVariables.IR_count == 70)
{player.commsMessage("Colonel, I've suffered system damage and I've lost my fuel reserves. Hurry up!", 6)}
if(missionVariables.IR_count == 45)
{player.commsMessage("Colonel Ruiz: We're trying to access the shutdown veto - the system's gone into self-defence mode. Hold on!", 6)}
if(missionVariables.IR_count == 20)
{player.commsMessage("Colonel Ruiz: OK, we're ready to initiate the shutdown veto. It shouldn't be long now.", 6)}
if(missionVariables.IR_count <= 10)
{player.consoleMessage("Maenes Defence Control: System shutdown in "+missionVariables.IR_count+" seconds", 1)}
if(missionVariables.IR_count == 0)
{player.consoleMessage("Maenes Defence Control: System shutdown complete", 6)
this.DefencesTimer.stop()
delete this.DefencesTimer;
missionVariables.IR_count = null
missionVariables.IR_defences_quest = "SABOTAGED"
var cannons = system.shipsWithRole("IR-cannon-core")
for (var i=0; i<cannons.length; i++)
{cannons[i].setAI("dumbAI.plist")}}
}
// ship encounters
this.shipWillLaunchFromStation = function()
{ missionVariables.IR_offer = null
if(galaxyNumber == 7)
{
if(missionVariables.IR_status == "IR_IBANEZ_5" && clock.days > missionVariables.IR_cherkasova_deadline)
{if(system.countShipsWithRole("IR-cherkasova-alt") == 0)
{system.legacy_addSystemShips("IR-cherkasova-alt", 1, 1.0)}
}
if(system.ID == 171) // Aletius
{
if(missionVariables.IR_shipment_quest == "ENROUTE")
{if(system.countShipsWithRole("IR-transport") == 0)
{system.legacy_addSystemShips("IR-transport", 4, 1.0)
player.commsMessage("Aletius Control: Transport ATC-43 you are cleared to proceed. Have a nice trip!", 6)
missionVariables.IR_transport_kill_count = 0}
}
}
if(system.ID == 114) //Releleat
{
if(system.countShipsWithRole("IR-fuelprocessor") == 0)
{system.legacy_addSystemShips("IR-fuelprocessor", 1, 0.75)}
}
if(system.ID == 82) //Inorle
{
if(system.countShipsWithRole("IR-luft-core") == 0)
{system.legacy_addShipsAtPrecisely("IR-luft-core", 1, "pwm", [104399.93, 209.23, -11641.69])}
if(missionVariables.IR_SDF_quest == "KRAIT")
{if(system.countShipsWithRole("IR-krait") == 0)
{system.legacy_addShipsWithinRadius("IR-krait", 1, "pwm", [104399.93, 209.23, -11641.69], 25000)}
}
}
if(system.ID == 23) //Maenes
{ if(system.countShipsWithRole("IR-cannon-core") == 0)
{system.legacy_addShipsWithinRadius("IR-cannon-core", 40, "pwm", [23038, -39901, 102398], 20000)
system.legacy_addShipsWithinRadius("IR-cannon-core", 10, "pwm", [23038, -39901, 102398], 10000)
}
if(missionVariables.IR_defences_quest == "DEMO_1")
{
if(system.countShipsWithRole("IR-target-drone") == 0)
{system.legacy_addShipsAtPrecisely("IR-target-drone", 10, "pwm", [52000, -35898, 84329])
player.commsMessage("Colonel Ruiz: Commander, a group of ten Gecko target drones will approach the from the direction of the sun.")
missionVariables.IR_defences_kill_count = 0
player.incrementDefencesStatus()}
}
if(missionVariables.IR_defences_quest == "DEMO_5")
{if(system.countShipsWithRole("IR-target-drone") == 0)
{system.legacy_addShipsAtPrecisely("IR-target-drone", 10, "pwm", [52000, -35898, 84329])
player.commsMessage("Colonel Ruiz: Commander, another group of ten Gecko target drones has been launched.")}
}
if(missionVariables.IR_status == "IR_LOA_5")
{if(system.countShipsWithRole("IR-cherkasova") == 0)
{system.legacy_addSystemShips("IR-cherkasova", 1, 1.0)
system.legacy_addSystemShips("IR-sdf-imperator", 1, 0.9)
system.legacy_addSystemShips("IR-sdf-transporter", 8, 0.9)
missionVariables.IR_lander_kill_count = 0
var cannons = system.shipsWithRole("IR-cannon-core")
for (var i=0; i<cannons.length; i++)
{cannons[i].setAI("IR-dumb-cannonAI.plist")}
if(!this.MaenesTimer)
{
missionVariables.IR_count = 0
this.MaenesTimer = new Timer(this, this.MaenesReply, null, 1);}
else
{this.MaenesTimer.start();}
}
}
}
if(system.ID == 119) //Laxesori
{
if(missionVariables.IR_status == "IR_LEXICON_4")
{if(system.countShipsWithRole("IR-weiss-shuttle") == 0)
{system.legacy_addSystemShips("IR-weiss-shuttle", 1, 1.0)
system.legacy_addSystemShips("IR-kinnaird", 1, 1.0)
system.legacy_addSystemShips("police", 5, 1.0)
system.legacy_addSystemShips("pirate", 10, 1.0)}
}
}
if(system.ID == 240) //Pirate cove
{
if(missionVariables.IR_status == "IR_LOA_2")
{if(system.countShipsWithRole("IR-starstrike") == 0)
{system.legacy_addSystemShips("IR-starstrike", 5, 1.0)
system.legacy_addSystemShips("IR-anarchypython", 10, 1.0)
system.legacy_addSystemShips("IR-cherkasova", 1, 1.0)
system.legacy_addSystemShips("IR-comray", 10, 1.0)
system.legacy_addSystemShips("IR-giantray", 1, 1.0)
player.commsMessage("Major Cherkasova: This is Zarya-1. The anarchists have 10 python cruisers; they must all be destroyed.")
system.legacy_addSystemShips("pirate", 10, 1.0)
var pirates = system.shipsWithRole("pirate")
for (var i=0; i<pirates.length; i++)
{pirates[i].setAI("IR-piratepatrolAI.plist")
pirates[i].bounty = 100}
}
}
}
}
}
this.shipExitedWitchspace = function()
{
missionVariables.IR_comms = null
if(galaxyNumber == 7)
{
if(missionVariables.IR_finance_quest == "WIFE_IDENTIFIED")
missionVariables.IR_finance_quest = "WIFE"
if(system.ID == 142)
{if(missionVariables.IR_finance_quest == "WIFE")
system.legacy_addSystemShips("IR-isabella", 1, 0.8)}
if(missionVariables.IR_shipment_quest == "ENROUTE")
{missionVariables.IR_shipment_quest = "AMBUSH"
missionVariables.IR_convoy_exited = null
missionVariables.IR_transport_kill_count = 0}
if(missionVariables.IR_shipment_quest == "AMBUSH" && !missionVariables.IR_alsto)
{++missionVariables.IR_jumpcount
if(missionVariables.IR_jumpcount > 1)
{missionVariables.IR_shipment_quest = "DISPATCHED"
missionVariables.IR_jumpcount = null}
}
if(missionVariables.IR_shipment_quest == "ATMALA")
missionVariables.IR_shipment_quest = "DISPATCHED"
if(missionVariables.IR_loan_deadline)
{if(missionVariables.IR_loan_deadline > clock.days)
{missionVariables.IR_loan_remaining = missionVariables.IR_loan_deadline - clock.days
mission.setInstructionsKey("IR_loan_amount")}
else
mission.setInstructionsKey("IR_loan_due")
}
if(system.ID == 112) //Atmala
{if(missionVariables.IR_shipment_quest == "AMBUSH")
{
system.legacy_addShipsAt("IR-transport-alternate", 4, "wpu", [0, 0, 0.1])
system.legacy_addShipsAt("IR-sdf-asp", 4, "wpu", [0, 0, 0.1])
missionVariables.IR_transport_kill_count = 0
missionVariables.IR_comms = null
missionVariables.IR_shipment_quest = "ATMALA"
if(missionVariables.IR_alsto == "INFORMED")
{player.commsMessage("Alsto Abonlo: Commander, our fleet has taken up position across the main space lane. Get ready to ambush the convoy.", 6)
system.legacy_addShipsAt("pirate", 40, "wpu", [0, 0, 0.6])
var pirates = system.shipsWithRole("pirate")
for (var i=0; i<40; i++)
{pirates[i].setAI("IR-pirateAI.plist")}}
}
}
if(system.ID == 114) //Releleat
{system.legacy_addSystemShips("IR-fuelprocessor", 1, 0.75)}
if(missionVariables.IR_shipment_quest == "COMPLETED" || missionVariables.IR_shipment_quest == "TIPPEDOFF")
{ var randomNumber = (Math.random())
if(randomNumber < 0.5)
{system.legacy_addSystemShips("IR-sdf-asp", 3, 0.1)
var sdf = system.shipsWithRole("IR-sdf-asp")
for (var i=0; i<sdf.length; i++)
{sdf[i].setAI("pirateAI.plist")}
}
}
if(system.ID == 82) //Inorle
{
if(system.countShipsWithRole("IR-luft-core") == 0)
{system.legacy_addShipsAtPrecisely("IR-luft-core", 1, "pwm", [104399.93, 209.23, -11641.69])}
if(missionVariables.IR_SDF_quest == "JUMPED" || missionVariables.IR_SDF_quest == "CONTAMINATED")
{if(system.countShipsWithRole("IR-krait") == 0)
{system.legacy_addShipsWithinRadius("IR-krait", 1, "pwm", [104399.93, 209.23, -11641.69], 25000)}}
}
if(system.ID == 23) //Maenes
{ if(system.countShipsWithRole("IR-scannon-core") == 0)
{system.legacy_addShipsWithinRadius("IR-cannon-core", 40, "pwm", [23038, -39901, 102398], 20000)}
if(missionVariables.IR_status == "IR_LOA_5")
{if(system.countShipsWithRole("IR-cherkasova") == 0)
{system.legacy_addSystemShips("IR-cherkasova", 1, 0.85)
system.legacy_addSystemShips("IR-sdf-imperator", 1, 0.85)
system.legacy_addSystemShips("IR-sdf-transporter", 8, 0.85)
missionVariables.IR_lander_kill_count = 0
var cannons = system.shipsWithRole("IR-cannon-core")
for (var i=0; i<cannons.length; i++)
{cannons[i].setAI("IR-dumb-cannonAI.plist")}
if(!this.MaenesTimer)
{
missionVariables.IR_count = 0
this.MaenesTimer = new Timer(this, this.MaenesReply, null, 1);}
else
{this.MaenesTimer.start();}
}
}
}
if(missionVariables.IR_status == "IR_WEISS_2a")
{missionVariables.IR_status = "IR_WEISS_2b"}
if(system.ID == 175) //Reenated
{ if(missionVariables.IR_status == "IR_WEISS_2b")
{var weiss = system.shipsWithRole("IR-quico-transporter")[0]
weiss.remove()
player.ship.spawn("IR-quico-transporter", 1)}
}
if(system.ID == 119) //Laxesori
{ if(missionVariables.IR_status == "IR_WEISS_3")
{var weiss = system.shipsWithRole("IR-quico-transporter")[0]
weiss.remove()
if(!this.LaxesoriTimer)
{
this.LaxesoriTimer = new Timer(this, this.LaxesoriReply, 10, -1);
}
else
{this.LaxesoriTimer.start();}
}
}
if(system.ID == 240) //Pirate Cove
{ system.legacy_addSystemShips("IR-anarchypython", 10, 1.0)}
if(system.ID == 130 && missionVariables.IR_status == "IR_sources_4") //Tiatza
{ missionVariables.IR_tanker_kill_count = 0
player.ship.spawn("IR-cherkasova", 1)
if(!this.JulietTimer)
{
missionVariables.IR_count = 0
this.JulietTimer = new Timer(this, this.JulietReply, null, 1);}
else
{this.JulietTimer.start();}
}
}
}
this.shipEnteredStationAegis = function()
{ if(system.ID == 31 && missionVariables.IR_SDF_quest == "KORSHKOV" && galaxyNumber == 7)
{ player.commsMessage("Calling Aarzari Station: Have sustained major radiation damage, requesting immediate assistance, over!", 6)
if(!this.KorshkovTimer)
{
this.KorshkovTimer = new Timer(this, this.KorshkovReply, null, 10);
}
else
{this.KorshkovTimer.start();}
}
if(system.ID == 23 && missionVariables.IR_status == "IR_WEISS_1" && galaxyNumber == 7)
{if(system.countShipsWithRole("IR-quico-transporter") == 0)
{system.legacy_addSystemShips("IR-quico-transporter", 1, 1.0)
player.commsMessage("Quico Transporter: Flight QC272, setting course for departure...")
}
}
}
this.LaxesoriReply = function()
{
this.LaxesoriTimer.stop();
delete this.LaxesoriTimer;
player.commsMessage("No sign of the transport - maybe it's gone on ahead to Laxesori Station.", 6);
}
this.KorshkovReply = function()
{
this.KorshkovTimer.stop();
delete this.KorshkovTimer;
player.commsMessage("Aarzari Station: Message received and understood. Emergency facilities are on standby. Proceed when ready.", 6);
}
this.playerBoughtNewShip = function()
{
if(missionVariables.IR_shipment_quest == "TIPPEDOFF")
missionVariables.IR_shipment_quest = null
}
this.playerJumpFailed = function()
{ if(missionVariables.IR_status == "IR_IBANEZ_5")
{if(system.shipsWithRole("IR-cherkasova-alt") != 0)
{
var cherkasova = system.shipsWithRole("IR-cherkasova-alt")[0]
cherkasova.setAI("IR-cherkasova-enterAI.plist")
missionVariables.IR_status = "IR_CHERKASOVA_1"
}
}
}
this.shipWillDockWithStation = function()
{
if(missionVariables.IR_status == "IR_CHERKASOVA_1")
{if(system.shipsWithRole("IR-cherkasova-alt") != 0)
{
var cherkasova = system.shipsWithRole("IR-cherkasova-alt")[0]
cherkasova.remove()}
}
}
//ingame conversations
this.JulietReply = function()
{
++missionVariables.IR_count
var cherkasova = system.shipsWithRole("IR-cherkasova")[0]
if(missionVariables.IR_status == "IR_sources_4")
{
if(missionVariables.IR_count == 5)
{cherkasova.commsMessage("This is Zarya-1 checking in.")}
if(missionVariables.IR_count == 12)
{player.commsMessage("Copy that, Zarya-1. Run a long range scan - let's see if anyone's here.", 6)}
if(missionVariables.IR_count == 22)
{cherkasova.commsMessage("Nothing - no sign of the SDF yet. What about the Task Force?")}
if(missionVariables.IR_count == 30)
{player.commsMessage("Hold on, I'll check what's happening.", 6)}
if(missionVariables.IR_count == 40)
{player.commsMessage("This is Sunray calling Juliet 1-0. Come in, over.", 8)}
if(missionVariables.IR_count == 50)
{player.commsMessage("Repeat, Sunray calling Juliet 1-0. Come in, over.", 8)}
if(missionVariables.IR_count == 65)
{player.commsMessage("Damn, it looks like they're running late.", 6)}
if(missionVariables.IR_count == 78)
{cherkasova.commsMessage("Hold on, Commander. I'm picking up an energy distortion near the witchspace beacon. Get ready")}
if(missionVariables.IR_count == 90)
{system.addShipsToRoute("IR-sdf-imperator", 1, 0.01, "wp")}
if(missionVariables.IR_count == 98)
{system.addShipsToRoute("IR-sirius-tanker", 6, 0.01, "wp")}
if(missionVariables.IR_count == 98)
{system.addShipsToRoute("IR-sdf-transporter", 8, 0.01, "wp")}
if(missionVariables.IR_count == 110)
{player.commsMessage("So that's the SDF fleet. Looks like they mean business.", 8)}
if(missionVariables.IR_count == 122)
{cherkasova.commsMessage("Commander, we're no match for them alone. Suggest we shadow the fleet until the navy arrives.")}
if(missionVariables.IR_count == 130)
{player.commsMessage("Roger that, Zarya-1.")}
if(missionVariables.IR_count == 150)
{var leader = system.shipsWithRole("IR-sdf-imperator")[0]
{leader.setAI("route1traderAI.plist")
leader.commsMessage("Sections Echo and Delta, begin fuel transfer. Fleet will hyperspace in t-10 minutes.")}
}
if(missionVariables.IR_count == 160)
{cherkasova.commsMessage("Did you hear that? We only have ten minutes before the fleet leaves for Maenes. We need to hold them here until backup arrives.")}
if(missionVariables.IR_count == 170)
{player.commsMessage("We don't have the firepower to engage the whole fleet. What do you suggest?", 8)}
if(missionVariables.IR_count == 180)
{cherkasova.commsMessage("Concentrate on the tankers - they're unarmed and the fleet won't be able to hyperspace without refuelling. I'll draw fire away from the capital ships.")
var leader = system.shipsWithRole("IR-sdf-imperator")[0]
cherkasova.target = leader
cherkasova.AIState = "ATTACK_SHIP"}
if(missionVariables.IR_count == 190)
{player.commsMessage("Are you sure?", 6)}
if(missionVariables.IR_count == 200)
{cherkasova.commsMessage("Got any better ideas? Come on, let's go!")}
if(missionVariables.IR_count == 800)
{leader.commsMessage("SDF Flagship: Engaging hyperspace...")
var leader = system.shipsWithRole("IR-sdf-imperator")[0]
{leader.exitSystem()
missionVariables.IR_status = "IR_interceptionfail_A"}
}
}
if(missionVariables.IR_status == "IR_interceptionfail_A")
{missionVariables.IR_count = 0
missionVariables.IR_status = "IR_interceptionfail_B"
return;}
if(missionVariables.IR_status == "IR_interceptionfail_B")
{
if(missionVariables.IR_count == 15)
{player.commsMessage("The SDF Flagship has left the system - we've blown our chance to intercept the fleet before it reaches Maenes!", 8)}
}
if(missionVariables.IR_status == "IR_tankers")
{missionVariables.IR_count = 0
missionVariables.IR_status = "IR_tankers_B"
return;}
if(missionVariables.IR_status == "IR_tankers_B")
{
if(missionVariables.IR_count == 15)
{player.commsMessage("Major Cherkasova: Good work, Commander. Now we just need to stay alive until backup arrives!", 8)}
if(missionVariables.IR_count == 25)
system.legacy_addSystemShips("IR-navy-frigate", 5, 0.0)
if(missionVariables.IR_count == 40)
player.commsMessage("Juliet 1-0, this is Sunray. What took you so long? We need immediate assistance!", 8)
if(missionVariables.IR_count == 50)
player.commsMessage("Juliet Leader: Understood, Sunray. We're engaging the enemy now.", 8)
}
if(missionVariables.IR_status == "IR_imperator")
{missionVariables.IR_count = 0
missionVariables.IR_status = "IR_imperator_B"
return;}
if(missionVariables.IR_status == "IR_imperator_B")
{if(missionVariables.IR_count == 10)
player.commsMessage("Major Cherkasova: Quick, someone's trying to escape from the wreckage - we think it's Kinnaird. Stop him!", 8)
}
if(missionVariables.IR_status == "IR_courier")
{missionVariables.IR_count = 0
missionVariables.IR_status = "IR_courier_B"
return;}
if(missionVariables.IR_status == "IR_courier_B")
{if(missionVariables.IR_count == 5)
{player.commsMessage("Major Cherkasova: OK, Kinnaird's ship has been disabled - we'll leave him to the navy. Let's meet up at Maenes Station!", 8)
mission.setInstructionsKey("IR_sources_brief_3")
missionVariables.IR_status = "IR_sources_5"}
}
}
this.MaenesReply = function()
{
++missionVariables.IR_count
var cherkasova = system.shipsWithRole("IR-cherkasova")[0]
if(missionVariables.IR_status == "IR_LOA_5")
{
if(missionVariables.IR_count == 10)
{player.commsMessage("Zarya-1, this is Sunray. Do you read, over?", 8)}
if(missionVariables.IR_count == 20)
{player.commsMessage("Major Cherkasova: Copy that Sunray, this is Zarya-1. The attack's already in progress - we need your help!", 8)}
if(missionVariables.IR_count == 30)
{player.commsMessage("What happened to the navy? Are they on their way?", 8)}
if(missionVariables.IR_count == 40)
{player.commsMessage("Major Cherkasova: I don't know! We have a mass of hostile ships and the Maenes defence grid is out of action. They're completely overwhemled!", 8)}
if(missionVariables.IR_count == 50)
{player.commsMessage("Hold on, Zarya-1, I'm on my way.", 8)}
if(missionVariables.IR_count == 80)
{player.commsMessage("Major Cherkasova: Concentrate on the enemy transporters. They've been tasked to assault Maenes Station.", 8)}
if(missionVariables.IR_count == 90)
{player.commsMessage("Roger that. Maenes Station, this is the police. Patch me through to Colonez Ruiz immediately!", 8)}
if(missionVariables.IR_count == 105)
{player.commsMessage("Colonel Ruiz: Help us, Commander. Our systems have been sabotaged - we can't defend ourselves.", 8)}
if(missionVariables.IR_count == 115)
{player.commsMessage("Can you bring the defence system back on-line?", 8)}
if(missionVariables.IR_count == 125)
{player.commsMessage("Colonel Ruiz: We're trying! We have the targets on our radar but we can't get the cannons to engage.", 8)}
if(missionVariables.IR_count == 135)
{player.commsMessage("We have to get them firing if we're to defend Maenes!", 8)}
if(missionVariables.IR_count == 255)
{player.commsMessage("Colonel Ruiz: We think we've regained control of the cannons - hold on!")}
if(missionVariables.IR_count == 285)
{player.commsMessage("Colonel Ruiz: We've managed to get the defence systems back on-line. Watch out for cannon fire!")
missionVariables.IR_maenes_cannon = "TRUE"
var cannons = system.shipsWithRole("IR-cannon-core")
for (var i=0; i<cannons.length; i++)
{cannons[i].setAI("IR-cannonAI.plist")}}
}
if(missionVariables.IR_status == "IR_landers")
{
missionVariables.IR_count = 0
missionVariables.IR_status = "IR_landers_B"
return;
}
if(missionVariables.IR_status == "IR_landers_B")
{
if(missionVariables.IR_count == 15)
{player.commsMessage("Major Cherkasova: Good work, Commander. Now let's finish off the rest of the SDF fleet.")}
if(missionVariables.IR_count == 65 && missionVariables.IR_maenes_cannon != "TRUE")
{player.commsMessage("Colonel Ruiz: We think we've regained control of the cannons - hold on!")}
if(missionVariables.IR_count == 120 && missionVariables.IR_maenes_cannon != "TRUE")
{player.commsMessage("Colonel Ruiz: We've managed to get the defence systems back on-line. Watch out for cannon fire!")
var cannons = system.shipsWithRole("IR-cannon-core")
for (var i=0; i<cannons.length; i++)
{cannons[i].setAI("IR-cannonAI.plist")}}
}
if(missionVariables.IR_status == "IR_imperator_alt")
{missionVariables.IR_count = 0
missionVariables.IR_status = "IR_imperator_alt_B"
return;}
if(missionVariables.IR_status == "IR_imperator_alt_B")
{if(missionVariables.IR_count == 10)
{player.commsMessage("Major Cherkasova: Well done, we've destroyed the SDF's flagship. Let's meet back at Maenes Station.", 8)
mission.setInstructionsKey("IR_sources_brief_3")
missionVariables.IR_status = "IR_LOA_6"}
}
}
|