Exemplo n.º 1
0
        public static void AnnoyWitnessesVictimless(Agent perp)
        {
            foreach (Agent bystander in GC.agentList)
            {
                if (Vector2.Distance(bystander.tr.position, perp.tr.position) < bystander.LOSRange / perp.hardToSeeFromDistance &&
                    bystander != perp && !bystander.zombified && !bystander.ghost && !bystander.oma.hidden &&
                    (!perp.aboveTheLaw || !bystander.enforcer) &&
                    perp.prisoner == bystander.prisoner && !perp.invisible)
                {
                    string perpRel = bystander.relationships.GetRel(perp);

                    if (perpRel == nameof(relStatus.Neutral) || perpRel == nameof(relStatus.Friendly))
                    {
                        if (bystander.relationships.GetRelationship(perp).hasLOS)
                        {
                            relStatus perpRel2 = bystander.relationships.GetRelCode(perp);

                            // TODO something isn't right here, condition always evaluates to true
                            if (perpRel2 != relStatus.Aligned || perpRel2 != relStatus.Loyal)
                            {
                                bystander.relationships.SetStrikes(perp, 2);
                            }
                        }
                    }
                    else if (perpRel == nameof(relStatus.Annoyed) && bystander.relationships.GetRelationship(perp).hasLOS)
                    {
                        bystander.relationships.SetRelHate(perp, 5);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public static void flash(int agentid)
        {
            Agent         playerAgent = Utils.getPlayer(agentid);
            List <string> list        = new List <string>();

            for (int i = 0; i < GameController.gameController.agentList.Count; i++)
            {
                Agent agent = GameController.gameController.agentList[i];
                if (Vector2.Distance(agent.tr.position, playerAgent.tr.position) < agent.LOSRange / playerAgent.hardToSeeFromDistance && agent != playerAgent)
                {
                    Relationship relationship = agent.relationships.GetRelationship(playerAgent);
                    if (relationship != null && agent.movement.HasLOSAgent360(playerAgent) && agent.movement.HasLOSAgent360(playerAgent))
                    {
                        relStatus    relTypeCode   = relationship.relTypeCode;
                        Relationship relationship2 = playerAgent.relationships.GetRelationship(agent);
                        relStatus    relTypeCode2  = relationship2.relTypeCode;
                        //if (relTypeCode == relStatus.Annoyed || agent.relationships.GetRel(playerAgent) == "Hateful")
                        {
                            list.Add(Utils.getId(agent).ToString());
                        }
                    }
                }
            }
            if (list != null && list.Count > 0)
            {
                NetworkPackage package = new NetworkPackage(2);
                package.write(Utils.getId(GameController.gameController.playerAgent).ToString());
                package.write_string_list(list);
                RedNetwork.SendPackage(package);
            }



            //agent.relationships.SetRel(interactingAgent, "Neutral");
        }
Exemplo n.º 3
0
        public override void OnPressed()
        {
            if (CurrentTarget is null)
            {
                gc.audioHandler.Play(Owner, VanillaAudio.CantDo);
            }
            else
            {
                Agent target = (Agent)CurrentTarget;
                int   rnd    = new System.Random().Next(3) + 1;

                relStatus code = target.relationships.GetRelCode(Owner);
                if (code == relStatus.Friendly || code == relStatus.Submissive)
                {
                    target.SayDialogue("HugPositive" + rnd);
                    target.relationships.SetRel(Owner, "Loyal");
                }
                else if (code == relStatus.Loyal)
                {
                    target.SayDialogue("HugPositive" + rnd);
                    target.relationships.SetRel(Owner, "Aligned");
                }
                else if (code == relStatus.Aligned)
                {
                    target.SayDialogue("HugPositive" + rnd);
                }
                else if (code == relStatus.Neutral)
                {
                    target.SayDialogue("HugNegative" + rnd);
                    target.relationships.SetRel(Owner, "Annoyed");
                    target.relationships.SetStrikes(Owner, 2);
                    target.statusEffects.annoyeders.Add(Owner);
                    gc.audioHandler.Play(target, VanillaAudio.AgentAnnoyed);
                    return;
                }
                else if (code == relStatus.Annoyed)
                {
                    target.SayDialogue("HugForgive" + rnd);
                    target.relationships.SetRel(Owner, "Neutral");
                }
                else if (code == relStatus.Hostile)
                {
                    return;
                }
                target.relationships.SetStrikes(Owner, 0);
                gc.audioHandler.Play(target, VanillaAudio.AgentOK);
                huggedList.Add(target);
            }
        }
Exemplo n.º 4
0
        // TODO I'd like to move this entire region somewhere else, but haven't made my mind up yet where it should go
        // TODO unused.
        public static void AnnoyWitnesses(Agent perp, Agent victim)
        {
            foreach (Agent bystander in GC.agentList)
            {
                if (Vector2.Distance(bystander.tr.position, perp.tr.position) < bystander.LOSRange / perp.hardToSeeFromDistance &&
                    bystander != perp && bystander != victim && !bystander.zombified && !bystander.ghost && !bystander.oma.hidden &&
                    (!perp.aboveTheLaw || !bystander.enforcer || victim.enforcer) &&
                    perp.prisoner == bystander.prisoner && !perp.invisible && !victim.noEnforcerAlert)
                {
                    string perpRel   = bystander.relationships.GetRel(perp);
                    string victimRel = bystander.relationships.GetRel(victim);

                    if (victimRel != nameof(relStatus.Hostile) && victimRel != nameof(relStatus.Annoyed))
                    {
                        if (perpRel == nameof(relStatus.Neutral) || perpRel == nameof(relStatus.Friendly))
                        {
                            if (bystander.relationships.GetRelationship(perp).hasLOS)
                            {
                                relStatus victimRel2 = bystander.relationships.GetRelCode(victim);
                                relStatus perpRel2   = bystander.relationships.GetRelCode(perp);

                                if ((victimRel2 == relStatus.Aligned && perpRel2 != relStatus.Aligned) ||
                                    (victimRel2 == relStatus.Loyal && perpRel2 != relStatus.Aligned && perpRel2 != relStatus.Loyal))
                                {
                                    bystander.sawBiteList.Add(victim);
                                    bystander.relationships.SetRelHate(perp, 5);
                                }
                                else
                                {
                                    bystander.sawBiteList.Add(victim);
                                    bystander.relationships.SetStrikes(perp, 2);
                                }
                            }
                        }
                        else if (perpRel == nameof(relStatus.Annoyed) && bystander.relationships.GetRelationship(perp).hasLOS)
                        {
                            bystander.sawBiteList.Add(victim);
                            bystander.relationships.SetRelHate(perp, 5);
                        }
                    }
                }
            }
        }