Example #1
0
 private void HandleGuest(GuestVO guest)
 {
     if (guest != null)
     {
         Activate();
     }
 }
Example #2
0
 override protected void HandleGuest(GuestVO guest)
 {
     if (guest != null && guest == _guest)
     {
         bool activate = guest.Action != null;
         gameObject.SetActive(activate);
         if (activate)
         {
             GuestActionIcon icon;
             GuestActionVO   action = guest.Action;
             foreach (ActionMap map in Actions)
             {
                 activate = map.ActionType == action.Type;
                 map.View.SetActive(activate);
                 if (activate)
                 {
                     icon = map.View.GetComponent <GuestActionIcon>();
                     if (icon != null)
                     {
                         icon.SetAction(action);
                     }
                 }
             }
         }
     }
 }
Example #3
0
 override protected void HandleGuest(GuestVO guest)
 {
     if (guest != null && guest == _guest)
     {
         if (guest.State != GuestState.Offended)
         {
             float amount = (_guest.Opinion >= 100) ? 1f : ((float)_guest.Opinion) * .01f;
             if (gameObject.activeInHierarchy)
             {
                 StopAllCoroutines();
                 StartCoroutine(FillMeter(amount));
             }
             else
             {
                 OpinionIndicator.fillAmount = amount;
             }
             InterestIcon.sprite       = InterestSprites.GetSprite(_guest.Like);
             InterestIconBorder.sprite = BorderSprites.GetSprite(_guest.State.ToString());
         }
         else
         {
             gameObject.SetActive(false);
         }
     }
 }
Example #4
0
 private void HandleSelect(GuestVO guest)
 {
     if (_remark != null && guest != null && guest == _guest)
     {
         if (_remark.Interest == _guest.Like)
         {
             if (_animator != null)
             {
                 _animator.SetTrigger("Positive Remark");
             }
             if (PositiveEffect != null)
             {
                 PositiveEffect.Play();
             }
         }
         else if (_remark.Interest == _guest.Dislike)
         {
             if (_animator != null)
             {
                 _animator.SetTrigger("Negative Remark");
             }
             if (NegativeEffect != null)
             {
                 NegativeEffect.Play();
             }
         }
         else
         {
             if (_animator != null)
             {
                 _animator.SetTrigger("Neutral Remark");
             }
         }
     }
 }
Example #5
0
 public GuestVO(GuestVO guest)
 {
     FirstName = guest.FirstName;
     LastName  = guest.LastName;
     Title     = guest.Title;
     Like      = guest.Like;
     Dislike   = guest.Dislike;
     Gender    = guest.Gender;
     Opinion   = guest.Opinion;
     State     = guest.State;
 }
Example #6
0
 private void HandleGuestTargeted(GuestVO guest)
 {
     if (guest == null)
     {
         On = false;
     }
     else if (guest == _guest)
     {
         On = !_intoxicated;
     }
 }
Example #7
0
        public override void OnEnterState()
        {
            ConversationModel model = AmbitionApp.GetModel <ConversationModel>();

            GuestVO[] guests = Array.FindAll(model.Guests, g => !g.IsLockedIn && g.State != GuestState.Bored);
            if (guests.Length > 0)
            {
                GuestVO g = Util.RNG.TakeRandom(guests);
                g.State = GuestState.Bored;
                AmbitionApp.SendMessage(PartyMessages.GUEST_REACTION_BORED, g);
            }
        }
Example #8
0
        public override void OnEnterState()
        {
            UController controller = _machine._uflow.GetController(_machine);

            if (controller != null)
            {
                MapModel map    = AmbitionApp.GetModel <MapModel>();
                GuestVO  guest  = map.Room.Guests[controller.transform.GetSiblingIndex()];
                string   reward = Util.RNG.TakeRandom(guest.Action.Tags);
                guest.Action.Tags   = new string[] { reward };
                guest.Action.Rounds = guest.Action.Values[reward];
            }
        }
        override public bool Validate()
        {
            MapModel    map        = AmbitionApp.GetModel <MapModel>();
            UController controller = _machine._uflow.GetController(_machine);
            int         index      = controller.transform.GetSiblingIndex();

            if (index >= map.Room.Guests.Length)
            {
                return(false);
            }
            GuestVO guest = map.Room.Guests[index];

            return(guest.Action != null && guest.Action.Type == _actionType);
        }
        public override bool Validate()
        {
            UController controller = _machine._uflow.GetController(_machine);

            if (controller == null)
            {
                return(false);
            }

            MapModel map   = AmbitionApp.GetModel <MapModel>();
            GuestVO  guest = map.Room.Guests[controller.transform.GetSiblingIndex()];

            return(guest.Action != null && guest.Action.Rounds > 0);
        }
Example #11
0
        private void HandleGuest(GuestVO guest)
        {
            UController controller = _machine._uflow.GetController(_machine);

            if (guest != null && controller != null)
            {
                ConversationModel model = AmbitionApp.GetModel <ConversationModel>();
                int index = controller.transform.GetSiblingIndex();
                if (model.Remark != null &&
                    model.Remark.Interest != guest.Dislike &&
                    guest == model.Guests[index])
                {
                    Activate();
                }
            }
        }
Example #12
0
        // Returns a Sprite corresponding to the guest's approval
        // TODO: This may eventually be completely handled by Mecanim
        public Sprite GetSprite(GuestVO guest)
        {
            int len = GuestSprites.Length;

            if (guest.State == GuestState.Bored)
            {
                return(BoredSprite);
            }
            if (guest.Opinion <= 1)
            {
                return(GuestSprites[0]);
            }
            if (guest.Opinion >= 100)
            {
                return(GuestSprites[GuestSprites.Length - 1]);
            }
            return(GuestSprites[1 + (int)((GuestSprites.Length - 2) * (float)(guest.Opinion) * 0.01f)]);
        }
Example #13
0
 private void HandleSelected(GuestVO guest)
 {
     if (_remark != null && guest != null && Guest == guest)
     {
         if (_remark.Interest == Guest.Like)
         {
             Animator.SetTrigger("Positive Remark");
         }
         else if (_remark.Interest == Guest.Dislike)
         {
             Animator.SetTrigger("Negative Remark");
         }
         else
         {
             Animator.SetTrigger("Neutral Remark");
         }
     }
 }
        override public void OnEnterState()
        {
            UController controller = _machine._uflow.GetController(_machine);

            if (controller != null)
            {
                MapModel map   = AmbitionApp.GetModel <MapModel>();
                GuestVO  guest = map.Room.Guests[controller.transform.GetSiblingIndex()];
                if (guest.Action != null && guest.Action.Tags != null && guest.Action.Tags.Length > 0)
                {
                    switch (guest.Action.Tags[0])
                    {
                    case "Map":
                        RoomVO[] rooms = Array.FindAll(map.Map.Rooms, r => !r.Revealed);
                        RoomVO   room  = rooms[Util.RNG.Generate(rooms.Length)];
                        room.Revealed = true;
                        AmbitionApp.SendMessage(room);
                        break;

                    case "Wine":
                        AmbitionApp.SendMessage(PartyMessages.REFILL_DRINK);
                        break;

                    case "Remarks":
                        AmbitionApp.SendMessage(PartyMessages.FREE_REMARK);
                        AmbitionApp.SendMessage(PartyMessages.FREE_REMARK);
                        AmbitionApp.SendMessage(PartyMessages.FREE_REMARK);
                        break;

                    case "Accolade":
                        foreach (GuestVO g in map.Room.Guests)
                        {
                            g.Opinion += (g == guest ? 30 : 10);
                            if (g.Opinion >= 100)
                            {
                                g.Opinion   = 100;
                                guest.State = GuestState.Charmed;
                            }
                        }
                        break;
                    }
                }
            }
        }
Example #15
0
        override public void OnEnterState()
        {
            UController controller = _machine._uflow.GetController(_machine);

            if (controller != null)
            {
                ConversationModel model = AmbitionApp.GetModel <ConversationModel>();
                GuestVO           guest = model.Guests[controller.transform.GetSiblingIndex()];
                if (guest.Action != null && guest.Action.Values != null)
                {
                    int reward;
                    int others;
                    guest.Action.Values.TryGetValue("guest", out reward);
                    guest.Action.Values.TryGetValue("others", out others);
                    guest.Opinion += reward - others;
                    Array.ForEach(model.Guests, g => g.Opinion += others);
                }
            }
        }
        override public void OnEnterState()
        {
            MapModel      map        = AmbitionApp.GetModel <MapModel>();
            UController   controller = _machine._uflow.GetController(_machine);
            GuestVO       guest      = map.Room.Guests[controller.transform.GetSiblingIndex()];
            PartyModel    model      = AmbitionApp.GetModel <PartyModel>();
            GuestActionVO action     = AmbitionApp.Create <string, GuestActionVO>("Interest");

            action.Tags = new string[] { guest.Like, "" };
            int index = Util.RNG.Generate(1, model.Interests.Length);

            if (guest.Like == model.Interests[index])
            {
                index = 0;
            }
            guest.Like     = model.Interests[index];
            guest.Dislike  = model.Interests[(index + 1) % model.Interests.Length];
            action.Tags[1] = guest.Like;
            guest.Action   = action;
            AmbitionApp.SendMessage(guest);
        }
Example #17
0
 private void HandleTargeted(GuestVO guest)
 {
     if (guest == null)
     {
         _avatar.Pose = _pose;
     }
     else if (!_isIntoxicated && _remark != null && Guest == guest)
     {
         if (_remark.Interest == Guest.Like)
         {
             _avatar.Pose = "charmed";
         }
         else if (_remark.Interest == Guest.Dislike)
         {
             _avatar.Pose = "putout";
         }
         else
         {
             _avatar.Pose = "approval";
         }
     }
 }
Example #18
0
 protected abstract void HandleGuest(GuestVO guest);
Example #19
0
 protected override void HandleGuest(GuestVO guest)
 {
 }
Example #20
0
 private void HandleGuests(GuestVO[] guests)
 {
     _guest = (_index < guests.Length) ? guests[_index] : null;
     gameObject.SetActive(_guest != null);
     HandleGuest(_guest);
 }
Example #21
0
        public void GuestPutOffReaction(GuestVO guest)
        {
            FMODEvent selectedBark = GuestBarkCollection.GetFMODEvent(guest.Gender, "negative"); //Still waiting on a Put Off Sound Effect

            AmbitionApp.SendMessage(AudioMessages.PLAY_ONESHOTSFX, selectedBark);
        }
Example #22
0
        public override void OnEnterState()
        {
            PartyModel        partyModel = AmbitionApp.GetModel <PartyModel>();
            ConversationModel model      = AmbitionApp.GetModel <ConversationModel>();
            RoomVO            room       = model.Room;
            GuestVO           guest;

            GuestVO[] guests = model.Guests;
            _phrases = AmbitionApp.GetModel <LocalizationModel>();

            // This ensures that previous guest formations stay consistent
            if (guests == null || guests.Length == 0)
            {
                // TODO: Determine how to vary this number
                guests = new GuestVO[4];
            }
            for (int i = guests.Length - 1; i >= 0; i--)
            {
                if (guests[i] == null)
                {
                    guest = new GuestVO();
                    if (RNG.Generate(2) == 0)
                    {
                        guest.Gender    = Gender.Female;
                        guest.Title     = GetRandomDescriptor("female_title");
                        guest.FirstName = GetRandomDescriptor("female_name");
                    }
                    else
                    {
                        guest.Gender    = Gender.Male;
                        guest.Title     = GetRandomDescriptor("male_title");
                        guest.FirstName = GetRandomDescriptor("male_name");
                    }
                    guest.LastName = GetRandomDescriptor("last_name");
                    guest.LastName = "aeiouAEIOU".Contains(guest.LastName.Substring(0, 1))
                        ? (" d'" + guest.LastName)
                        : (" de " + guest.LastName);
                    guests[i] = guest;
                }
            }

            if (!room.Cleared)
            {
                int likeIndex;
                GuestDifficultyVO stats     = partyModel.GuestDifficultyStats[room.Difficulty - 1];
                string[]          interests = partyModel.Interests;

                if (room.Actions != null)
                {
                    AmbitionApp.SendMessage(room.Actions);
                }

                foreach (GuestVO g in guests)
                {
                    g.Opinion = RNG.Generate(stats.Opinion[0], stats.Opinion[1]);
                    likeIndex = RNG.Generate(interests.Length);
                    g.Like    = interests[likeIndex];
                    g.Dislike = interests[(likeIndex + 1) % interests.Length];
                }
                // All Variety of Likes final check
                if (Array.TrueForAll(guests, g => g.Like == guests[0].Like))
                {
                    guest         = RNG.TakeRandom(guests);
                    likeIndex     = RNG.Generate(interests.Length);
                    guest.Like    = interests[likeIndex];
                    guest.Dislike = interests[(likeIndex + 1) % interests.Length];
                }
            }
            model.Guests            = guests;
            model.Round             = 0;
            model.Remark            = null;
            model.FreeRemarkCounter = partyModel.FreeRemarkCounter;
            model.Repartee          = false;
            model.RemarksBought     = 0;
        }
Example #23
0
        public void GuestBoredReaction(GuestVO guest)
        {
            FMODEvent selectedBark = GuestBarkCollection.GetFMODEvent(guest.Gender, "bored");

            AmbitionApp.SendMessage(AudioMessages.PLAY_ONESHOTSFX, selectedBark);
        }
Example #24
0
 private void HandleGuest(GuestVO guest)
 {
     Activate();
 }
Example #25
0
 public EnemyVO(GuestVO guest) : base(guest)
 {
 }
Example #26
0
 private void HandleGuest(GuestVO guest)
 {
     _paused = guest != null && _script.Guest == guest;
 }
Example #27
0
        protected override void HandleGuest(GuestVO guest)
        {
            if (guest != null && guest == Guest)
            {
                // Only do this work if the state is changing.
                if (_avatar.ID == null || _avatar.ID != Guest.Avatar)
                {
                    if (Guest.Avatar != null)
                    {
                        _avatar.ID = Guest.Avatar;
                    }
                    else
                    {
                        AvatarVO[] avatars = _avatar.Collection.Find(Guest.Gender, "party");
                        _avatar.ID = Guest.Avatar = Util.RNG.TakeRandom(avatars).ID;
                    }
                    Guest.Gender = _avatar.Avatar.Gender;
                }

                if (guest.State != GuestState.Offended)
                {
                    if (_isIntoxicated)
                    {
                        _pose = "neutral";
                    }
                    else
                    {
                        switch (guest.State)
                        {
                        case GuestState.Bored:
                            _pose = "bored";
                            break;

                        case GuestState.Charmed:
                            _pose = "charmed";
                            break;

                        case GuestState.Interested:
                            _pose = "approval";
                            break;

                        default:
                            _pose = "neutral";
                            break;
                        }
                    }
                    if (_pose != _avatar.Pose)
                    {
                        _avatar.Pose = _pose;
                    }
                    if (_avatar.Sprite == null)
                    {
                        _avatar.Pose = _pose = "neutral";
                    }
                }
                else
                {
                    gameObject.SetActive(false);
                }
            }
        }