public void SetObject(WitnessData witness)
    {
        CaseData openedCase = InvestigationManager.GetCase();

        GetComponent <CanvasGroup>().alpha = 1;
        string fullDescription = "";

        fullDescription += "IDADE: " + witness.age + "\n";
        fullDescription += "PROFISSÃO: " + witness.job + "\n";
        fullDescription += "RUMORES:";
        Files files = Files.Load();

        int witnessIndex = openedCase.GetWitnessIndexFromData(witness);

        foreach (Rumor r in files.GetCaseStatus().rumors)
        {
            if (r.target == witnessIndex)
            {
                RumorData rd = openedCase.GetRumorData(r);
                print(r.from + "/" + r.target);
                fullDescription += "\n" + "* " + rd.from.witnessName + ": " + rd.description;
            }
        }
        description.text = fullDescription;
        title.text       = witness.witnessName;
        icon.sprite      = witness.image;
    }
 public void SetObject(WitnessData data)
 {
     GetComponent <CanvasGroup>().alpha = 1;
     description.text = data.witnessName;//rumores com ela como alvo
     title.text       = data.witnessName;
     icon.sprite      = data.image;
 }
Exemple #3
0
 public void SetInfo(WitnessData data)
 {
     witnessData      = data;
     witnessName.text = data.witnessName;
     age.text         = data.age + " anos";
     job.text         = data.job;
     icon.sprite      = data.image;
 }
Exemple #4
0
    public RumorData GetRumorData(Rumor info)
    {
        WitnessData witness = GetWitnessData(info.from);

        foreach (RumorData r in witness.rumors)
        {
            if (r.target == GetWitnessData(info.target))
            {
                return(r);
            }
        }
        return(null);
    }
Exemple #5
0
    public TestimonyData GetTestimonyData(Testimony info)
    {
        WitnessData witness = GetWitnessData(info.from);

        foreach (TestimonyData t in witness.testimonys)
        {
            if (t.clue == GetClueData(info.clue))
            {
                return(t);
            }
        }
        return(null);
    }
Exemple #6
0
    public void Ask(WitnessData witness)
    {
        CaseData openedCase = InvestigationManager.GetCase();

        foreach (var rumor in data.rumors)
        {
            if (rumor.target == witness)
            {
                Files files = Files.Load();
                bool  added = files.GetCaseStatus().AddRumor(openedCase.GetRumorFromData(rumor));
                files.Save();
                DialogUI.StartDialog(rumor.findingDialog, added, DialogType.RUMOR);
                return;
            }
        }
        DialogUI.StartDialog(data.genericNegativeAnswers[Random.Range(0, data.genericNegativeAnswers.Count)]);
    }
 public void SetInfo(WitnessData data)
 {
     title.text = data.witnessName;
     obj        = data;
     type       = DataType.WITNESS;
 }
Exemple #8
0
 public Speak(string what, WitnessData who)
 {
     this.what = what;
     this.who  = who;
 }
 public void AskWitness(WitnessData witness)
 {
     collidingWitness[0].Ask(witness);
 }
Exemple #10
0
 public int GetWitnessIndexFromData(WitnessData data)
 {
     return(witnesses.IndexOf(data));
 }
        internal void CreateEntityData(EntityType type, int num = 0)
        {
            ("Creating entity: " + type).AddLog();
            switch (type)
            {
            case EntityType.Vic:
                $"Victim exists: {CsiCreator.Victim.Exists()}".AddLog();
                var boneIDs = new List <PedBoneId>
                {
                    PedBoneId.Head,
                    PedBoneId.LeftFoot,
                    PedBoneId.RightFoot,
                    PedBoneId.LeftForeArm,
                    PedBoneId.RightForearm,
                    PedBoneId.LeftHand,
                    PedBoneId.RightHand,
                    PedBoneId.LeftThigh,
                    PedBoneId.RightThigh,
                    PedBoneId.LeftUpperArm,
                    PedBoneId.RightUpperArm,
                    PedBoneId.Neck
                };

                Array  traces = Enum.GetValues(typeof(EvidenceData.Traces));
                Traces trace  = (Traces)traces.GetValue(Fiskey111Common.Rand.RandomNumber(traces.Length));

                _vicData = new PedData(CsiCreator.Victim.Ped, PedType.Victim, true, false, boneIDs[MathHelper.GetRandomInteger(1, boneIDs.Count - 1)].ToString(),
                                       boneIDs[MathHelper.GetRandomInteger(1, boneIDs.Count - 1)].ToString(),
                                       boneIDs[MathHelper.GetRandomInteger(1, boneIDs.Count - 1)].ToString(), trace, true);

                if (MathHelper.GetRandomInteger(6) == 1)
                {
                    _vicData.IsImportant = true;
                }

                _vicData.Model = CsiCreator.Victim.Ped.Model.Name;

                CsiCreator.Victim.KeyCollect  = Settings.Settings.CollectKey();
                CsiCreator.Victim.KeyInteract = Settings.Settings.InteractKey();
                CsiCreator.Victim.KeyLeave    = Settings.Settings.LeaveKey();
                break;

            case EntityType.Fo:
                $"FO exists: {CsiCreator.FirstOfficer.Exists}".AddLog();
                FoDialog = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Fo, CsiCreator.FirstOfficer.Ped, _wDataList.Count), CsiCreator.FirstOfficer.Ped.Position);
                FoDialog.AddPed(0, Game.LocalPlayer.Character);
                FoDialog.AddPed(1, CsiCreator.FirstOfficer.Ped);

                FoDialog.DistanceToStop = 3f;

                _foData = new ReportData(ReportData.Service.FO,
                                         Functions.GetPersonaForPed(CsiCreator.FirstOfficer.Ped).FullName, FoDialog.Dialogue)
                {
                    Transcript = FoDialog.Dialogue,
                    Exists     = true
                };
                _rDataList.Add(_foData);
                break;

            case EntityType.Wit1:
                if (MathHelper.GetRandomInteger(2) == 1)
                {
                    "Creating Witness 1".AddLog();
                    _wit1 = new Services.LtFlash.Common.EvidenceLibrary.Evidence.Witness(
                        "W1", "Witness 1", new Services.SpawnPoint(CsiCreator._W1SpawnPoint.Heading, CsiCreator._W1SpawnPoint.Position),
                        Model.PedModels.ToList()[MathHelper.GetRandomInteger(Model.PedModels.ToList().Count)],
                        null, CsiCreator.EmsLast.Position);

                    _wit1.Ped.IsInvincible = true;
                    _wit1.Ped.RandomizeVariation();
                    _wit1.Ped.MakeMissionPed();

                    _wit1.KeyCollect  = Settings.Settings.CollectKey();
                    _wit1.KeyInteract = Settings.Settings.InteractKey();
                    _wit1.KeyLeave    = Settings.Settings.LeaveKey();

                    _wit1Data = new PedData(_wit1.Ped, PedType.Witness1, MathHelper.GetRandomInteger(3) == 1);

                    if (_wit1Data.IsImportant)
                    {
                        var keys   = new List <int>(WitnessData.WhatSeen().Keys);
                        var random = Fiskey111Common.Rand.RandomNumber(0, 8);
                        _wit1Data.WhatSeenInt    = keys[random];
                        _wit1Data.WhatSeenString = WitnessData.WhatSeen()[_wit1Data.WhatSeenInt];
                    }

                    Wit1Dialog = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Witness, _wit1.Ped, 0, false, null, null, _wit1Data), _wit1.Ped.Position);
                    Wit1Dialog.AddPed(0, Game.LocalPlayer.Character);
                    Wit1Dialog.AddPed(1, _wit1.Ped);
                    Wit1Dialog.DisableFirstKeypress = false;

                    _wit1Data.Conversation = Wit1Dialog.Dialogue;
                    _caseData.WitnessIDs.Add(1);
                    _wDataList.Add(_wit1Data);
                    _witList.Add(_wit1, Wit1Dialog);
                    GameFiber.Sleep(0500);
                }
                break;

            case EntityType.Wit2:
                if (MathHelper.GetRandomInteger(2) == 1)
                {
                    "Creating Witness 2".AddLog();
                    _wit2 = new Services.LtFlash.Common.EvidenceLibrary.Evidence.Witness(
                        "W2", "Witness 2", new Services.SpawnPoint(CsiCreator._W2SpawnPoint.Heading, CsiCreator._W2SpawnPoint.Position),
                        Model.PedModels.ToList()[MathHelper.GetRandomInteger(Model.PedModels.ToList().Count)],
                        null, CsiCreator.EmsLast.Position);

                    _wit2.Ped.IsInvincible = true;
                    _wit2.Ped.RandomizeVariation();
                    _wit2.Ped.MakeMissionPed();

                    _wit2.KeyCollect  = Settings.Settings.CollectKey();
                    _wit2.KeyInteract = Settings.Settings.InteractKey();
                    _wit2.KeyLeave    = Settings.Settings.LeaveKey();

                    _wit2Data = new PedData(_wit2.Ped, PedType.Witness2, MathHelper.GetRandomInteger(3) == 1);

                    if (_wit2Data.IsImportant)
                    {
                        var keys   = new List <int>(WitnessData.WhatSeen().Keys);
                        var random = Fiskey111Common.Rand.RandomNumber(0, 8);
                        _wit2Data.WhatSeenInt    = keys[random];
                        _wit2Data.WhatSeenString = WitnessData.WhatSeen()[_wit2Data.WhatSeenInt];
                    }

                    Wit2Dialog = new Dialog(ConversationCreator.DialogLineCreator(ConversationCreator.ConversationType.Witness, _wit2.Ped, 0, false, null, null, _wit2Data), _wit2.Ped.Position);
                    Wit2Dialog.AddPed(0, Game.LocalPlayer.Character);
                    Wit2Dialog.AddPed(1, _wit2.Ped);
                    Wit2Dialog.DisableFirstKeypress = false;

                    _wit2.Dialog = Wit2Dialog;

                    _wit2Data.Conversation = Wit2Dialog.Dialogue;
                    _caseData.WitnessIDs.Add(2);
                    _wDataList.Add(_wit2Data);
                    _witList.Add(_wit2, Wit2Dialog);
                    GameFiber.Sleep(0500);
                }
                break;

            case EntityType.Sus:
            {
                "Suspect being created".AddLog();
                var s = new Ped(Model.PedModels.Where(m => m.IsPed).ToList()[MathHelper.GetRandomInteger(Model.PedModels.Where(m => m.IsPed).ToList().Count)], new Vector3(0, 0, 0), 0f);
                if (!s.IsHuman)
                {
                    s = new Ped(Model.PedModels.Where(m => m.IsPed).ToList()[MathHelper.GetRandomInteger(Model.PedModels.Where(m => m.IsPed).ToList().Count)], new Vector3(0, 0, 0), 0f);
                }
                GameFiber.Sleep(1000);
                _sDataList.Add(new PedData(s, PedType.Suspect, false, num == 1));
                GameFiber.Sleep(0500);
                if (s)
                {
                    s.Delete();
                }
            }
            break;

            case EntityType.VicFamily:
            {
                "Creating vicfamily member".AddLog();
                var s = new Ped(new Vector3(0, 0, 0));
                if (!s.IsHuman)
                {
                    s = new Ped(Model.PedModels.Where(m => m.IsPed).ToList()[MathHelper.GetRandomInteger(Model.PedModels.Where(m => m.IsPed).ToList().Count)], new Vector3(0, 0, 0), 0f);
                }
                GameFiber.Sleep(1000);
                var data = new PedData(s, PedType.VictimFamily);
                GameFiber.Sleep(0500);
                _pDataList.Add(data);
                GameFiber.Sleep(0500);
                if (s)
                {
                    s.Delete();
                }
            }
            break;
            }

            ("Entity " + type + " created successfully").AddLog();
        }
 public void SetInfo(string question, WitnessData data)
 {
     this.question.text = question;
     this.answer.text   = data.name;
 }