private static Table BuildHostageList(HostageDetail hostageDetail) { Table hostageList = new Table("hostageList"); List <Hostage> hostages = hostageDetail.hostages; HostageMetadata meta = hostageDetail.hostageMetadata; string scaredCommand = @"{id = ""SetForceScared"", scared=true, ever=true }"; string braveCommand = @"{id = ""SetHostage2Flag"", flag=""disableScared"", on=true }"; string injuredCommand = @"{id = ""SetHostage2Flag"", flag=""disableFulton"",on=true }"; string untiedCommand = @"{id = ""SetHostage2Flag"", flag=""unlocked"", on=true,}"; if (hostages.Count == 0) { hostageList.Add(@" nil "); } else { foreach (Hostage hostage in hostages) { hostageList.Add($@" {{ hostageName = ""{hostage.GetObjectName()}"", isFaceRandom = true, isTarget = {hostage.isTarget.ToString().ToLower()}, voiceType = {{""hostage_a"", ""hostage_b"", {(hostage.language.Equals("english") ? @" ""hostage_c"", ""hostage_d""," : "")}}}, langType = ""{hostage.language}"", {(hostage.staffType.Equals("NONE") ? "" : $@" staffTypeId = TppDefine.STAFF_TYPE_ID.{hostage.staffType},")} {(hostage.skill.Equals("NONE") ? "" : $@" skill = ""{hostage.skill}"", ")} bodyId = {NPCBodyInfo.GetBodyInfo(meta.hostageBodyName).gameId},
public void SetMetadata(HostageMetadata meta, string[] bodyNames, string cpName) { comboBox_Body.Items.Clear(); comboBox_Body.Items.AddRange(bodyNames); if (comboBox_Body.Items.Contains(meta.hostageBodyName)) { comboBox_Body.Text = meta.hostageBodyName; } else if (comboBox_Body.Items.Count > 0) { comboBox_Body.SelectedIndex = 0; } comboBox_ObjType.Text = meta.objectiveType; /* * if (cpName != "NONE") * { * checkBox_intrgt.Enabled = true; */ checkBox_intrgt.Checked = meta.canInterrogate; /* * checkBox_intrgt.Text = "Interrogate For Whereabouts"; * } * else * { * checkBox_intrgt.Enabled = false; * checkBox_intrgt.Checked = false; * checkBox_intrgt.Text = "Interrogate For Whereabouts [Requires Quest CP]"; * }*/ }
public HostageBox(Hostage qObject, HostageMetadata meta) { InitializeComponent(); ID = qObject.ID; groupBox_main.Text = qObject.GetObjectName(); textBox_xcoord.Text = qObject.position.coords.xCoord; textBox_ycoord.Text = qObject.position.coords.yCoord; textBox_zcoord.Text = qObject.position.coords.zCoord; textBox_rot.Text = qObject.position.rotation.GetDegreeRotY(); checkBox_target.Checked = qObject.isTarget; checkBox_untied.Checked = qObject.isUntied; checkBox_injured.Checked = qObject.isInjured; comboBox_scared.Items.AddRange(new string[] { "NORMAL", "ALWAYS", "NEVER" }); comboBox_scared.Text = qObject.scared; comboBox_lang.Text = qObject.language; // Note: h_combobox_lang has the male languages prelisted in the designer RefreshLanguage(meta.hostageBodyName); comboBox_staff.Items.AddRange(NPCMtbsInfo.Staff_Type_ID); comboBox_staff.Text = qObject.staffType; comboBox_skill.Items.AddRange(NPCMtbsInfo.skills); comboBox_skill.Text = qObject.skill; }
public static void AddQuestEntities(HostageDetail hDetails, DataSet dataSet, List <Fox2EntityClass> entityList) { List <Hostage> hostages = hDetails.hostages; HostageMetadata hMetadata = hDetails.hostageMetadata; BodyInfoEntry hostageBodies = NPCBodyInfo.GetBodyInfo(hMetadata.hostageBodyName); if (hostages.Count() > 0) { GameObject gameObjectTppHostageUnique = new GameObject("GameObjectTppHostageUnique", dataSet, "TppHostageUnique2", hostages.Count(), hostages.Count()); TppHostage2Parameter hostageParameter = new TppHostage2Parameter(gameObjectTppHostageUnique, hostageBodies.partsPath); gameObjectTppHostageUnique.SetParameter(hostageParameter); entityList.Add(gameObjectTppHostageUnique); entityList.Add(hostageParameter); foreach (Hostage hostage in hostages) { GameObjectLocator hostageLocator = new GameObjectLocator(hostage.GetObjectName(), dataSet, "TppHostageUnique2"); Transform hostageTransform = new Transform(hostageLocator, hostage.position); TppHostage2LocatorParameter hostageLocatorParameter = new TppHostage2LocatorParameter(hostageLocator); hostageLocator.SetTransform(hostageTransform); hostageLocator.SetParameter(hostageLocatorParameter); entityList.Add(hostageLocator); entityList.Add(hostageTransform); entityList.Add(hostageLocatorParameter); } } }
private void RefreshHostageLanguage() { HostageMetadata meta = (HostageMetadata)GetMetadataFromControl(); foreach (HostageBox hBox in flowPanel.Controls.OfType <HostageBox>()) { hBox.RefreshLanguage(meta.hostageBodyName); } }
public static void GetMain(HostageDetail hostageDetail, MainLua mainLua) { List <Hostage> hostages = hostageDetail.hostages; HostageMetadata meta = hostageDetail.hostageMetadata; mainLua.AddToQuestTable(BuildHostageList(hostageDetail)); if (hostages.Count > 0) { if (meta.canInterrogate) { mainLua.AddToAuxiliary(InterCall_hostage_pos01); mainLua.AddToAuxiliary(questCpInterrogation); mainLua.AddToAuxiliary(SwitchEnableQuestHighIntTable); //mainLua.AddToAuxiliary($"local hostageCount = {hostages.Count}"); unnecessary if MarkerChangeToEnable message isn't a static readonly mainLua.AddToAuxiliary("local hostagei = 0"); // only used for MarkerChangeToEnable's function mainLua.AddToQStep_Main(new QStep_Message("Marker", @"""ChangeToEnable""", $@"function(arg0, arg1) if arg0 == StrCode32(""Hostage_0"") then hostagei = hostagei + 1 if hostagei >= {hostages.Count} then this.SwitchEnableQuestHighIntTable(false, CPNAME, this.questCpInterrogation) end end end")); // could be a static readonly message, but a total hostage count would have to be an auxiliary variable mainLua.AddToQStep_Start_OnEnter("this.SwitchEnableQuestHighIntTable(true, CPNAME, this.questCpInterrogation)"); mainLua.AddToOnTerminate("this.SwitchEnableQuestHighIntTable(false, CPNAME, this.questCpInterrogation)"); } mainLua.AddToQStep_Main(QStep_MainCommonMessages.genericTargetMessages); mainLua.AddToQStep_Start_OnEnter(WarpHostages); mainLua.AddToAuxiliary(WarpHostages); mainLua.AddToQStep_Start_OnEnter(SetHostageAttributes); mainLua.AddToAuxiliary(SetHostageAttributes); if (hostages.Any(hostage => hostage.isTarget)) { CheckQuestGenericEnemy hostageCheck = new CheckQuestGenericEnemy(mainLua, CheckIsHostage, meta.objectiveType); foreach (Hostage hostage in hostages) { if (hostage.isTarget) { mainLua.AddToTargetList(hostage.GetObjectName()); } } } } }
public HostageDetail(List <Hostage> hostageList, HostageMetadata hostageMeta) { hostages = hostageList; hostageMetadata = hostageMeta; }