예제 #1
0
        private void HandleRemark(RemarkVO remark)
        {
            On = false;
            if (_guest != null && remark != null)
            {
                Color c;
                if (remark.Interest == _guest.Like)
                {
                    c = Colors.GetColor("Like");
                }
                else if (remark.Interest == _guest.Dislike)
                {
                    c = Colors.GetColor("Dislike");
                }
                else
                {
                    c = Colors.GetColor("Neutral");
                }

                foreach (Image image in SpotImages)
                {
                    c.a         = image.color.a;
                    image.color = c;
                }
            }
        }
예제 #2
0
        override public void OnEnterState()
        {
            base.OnEnterState();
            Dispose();
            GameObject canvas = Array.Find(SceneManager.GetActiveScene().GetRootGameObjects(), o => o.GetComponent <Canvas>() != null);

            if (canvas != null)
            {
                ConversationModel model = AmbitionApp.GetModel <ConversationModel>();
                RemarkVO          rem   = model.Remark;
                if (rem != null)
                {
                    GuestVO[]       guests     = model.Guests;
                    SpotlightView[] spotlights = canvas.GetComponentsInChildren <SpotlightView>(true);
                    int             index      = Array.FindIndex(guests, g => g.Like == rem.Interest);
                    if (index < 0)
                    {
                        index = Array.FindIndex(guests, g => g.Dislike != rem.Interest);
                    }
                    if (index < 0)
                    {
                        index = 0;
                    }
                    _flash = spotlights[index].gameObject.AddComponent <TutorialFlashSpot>();
                }
            }
        }
예제 #3
0
        private void HandleHand(RemarkVO[] hand)
        {
            int altIndex = ((_remark == null || _hand == null) ? -1 : Array.IndexOf(_hand, _remark));

            if (_hand == null)
            {
                _hand = new RemarkVO[hand.Length];
            }
            hand.CopyTo(_hand, 0);
            _remark = _index < hand.Length ? hand[_index] : null;
            StopAllCoroutines();
            transform.localPosition = _savedPosition;
            if (_remark != null)
            {
                _image.sprite = RemarksConfig.GetSprite(_remark.Interest);
                Arrow.sprite  = RemarksConfig.GetSprite(_remark.Interest + "_" + _remark.NumTargets.ToString());
                //if (altIndex < 0)
                //{
                //    _animator.SetTrigger(DRAW);
                //}
                //else if (altIndex != _index)
                if (altIndex >= 0 && altIndex != _index)
                {
                    StartCoroutine(Slide(RemarkViews[altIndex].localPosition));
                    //_animator.SetTrigger(FILL_IN);
                }
            }
            gameObject.SetActive(_remark != null);
        }
예제 #4
0
        public void Execute()
        {
            ConversationModel model = AmbitionApp.GetModel <ConversationModel>();

            RemarkVO[] hand  = model.Remarks;
            int        index = Array.FindIndex(hand, r => r == null);

            if (index >= 0)
            {
                string[] interests = AmbitionApp.GetModel <PartyModel>().Interests;
                string   interest;

                // Create a topic that is exclusive of the previous topic used.
                if (model.Remark != null)
                {
                    interest = Util.RNG.TakeRandomExcept(interests, model.Remark.Interest);
                }
                else
                {
                    interest = Util.RNG.TakeRandom(interests);
                }
                hand[index] = new RemarkVO()
                {
                    NumTargets = Util.RNG.Generate(1, 3),
                    Interest   = interest,
                    Free       = true
                }; // Assuming 1:2 odds of one target vs two
                model.Remarks = hand;
            }
        }
예제 #5
0
 protected void Validate(RemarkVO value)
 {
     if (value != null)
     {
         Activate();
     }
 }
예제 #6
0
        public void Execute(RoomVO room)
        {
            PartyModel        party = AmbitionApp.GetModel <PartyModel>();
            ConversationModel model = AmbitionApp.GetModel <ConversationModel>();

            RemarkVO[] hand = model.Remarks;
            string     interest;
            int        numGuests = model.Guests.Length;
            int        i;

            for (i = hand.Length - 1; i >= party.AmbushHandSize - 1; i--)
            {
                hand[i] = new RemarkVO();
            }
            while (hand[i] == null)
            {
                interest = Util.RNG.TakeRandom(party.Interests);
                hand[i]  = new RemarkVO(Util.RNG.Generate(1, 3), interest);
                i--;
            }

            model.Remarks = hand;

            AmbitionApp.OpenDialog <RoomVO>(DialogConsts.ROOM, room);
            Dictionary <string, string> subs = new Dictionary <string, string>()
            {
                { "$ROOMNAME", room.Name }
            };

            AmbitionApp.OpenMessageDialog("ambush_dialog", subs);
        }
예제 #7
0
        private void HandleRemark(RemarkVO remark)
        {
            if (_remark != null)
            {
                bool isRemark = remark == _remark;
                //_animator.SetBool(SELECTED, isRemark);

                Arrow.color   = Color.white;
                _image.sprite = RemarksConfig.GetSprite(isRemark ? (_remark.Interest + "_Select") : _remark.Interest);
            }
        }
예제 #8
0
        private void HandleRemark(RemarkVO remark)
        {
/*
 *          On = false;
 *          if (_guest != null && remark != null)
 *          {
 *              Color c;
 *              if (remark.Interest == _guest.Like) c = Colors.GetColor("Like");
 *              else if (remark.Interest == _guest.Dislike) c = Colors.GetColor("Dislike");
 *              else c = Colors.GetColor("Neutral");
 *
 *              foreach (Image image in SpotImages)
 *              {
 *                  c.a = image.color.a;
 *                  image.color = c;
 *              }
 *          }
 */
        }
예제 #9
0
        public void Execute(GuestVO guest)
        {
            ConversationModel model  = AmbitionApp.GetModel <ConversationModel>();
            RemarkVO          remark = model.Remark;

            if (remark != null)
            {
                GuestVO[] guests = model.Guests;
                int       index  = Array.IndexOf(guests, guest);
                if (index >= 0)
                {
                    int        num  = model.Remarks.Length - 1;
                    RemarkVO[] hand = model.Remarks;
                    for (int i = Array.IndexOf(model.Remarks, remark);
                         i < num;
                         i++)
                    {
                        hand[i] = hand[i + 1];
                    }
                    hand[num]     = null;
                    model.Remarks = hand;

                    num = guests.Length;
                    for (int i = remark.NumTargets - 1; i >= 0; i--)
                    {
                        guest = guests[(i + index) % num];
                        // Broadcast change to guest
                        AmbitionApp.SendMessage(PartyMessages.GUEST_SELECTED, guest);
                    }

                    // Erode the interest of guests not iteracted with
                    for (int i = num - model.Remark.NumTargets; i > 0; i--)
                    {
                        guest = guests[(index - i + num) % num];
                        AmbitionApp.SendMessage(PartyMessages.GUEST_IGNORED, guest);
                    }
                    model.Remark = null;
                }
            }
        }
예제 #10
0
        public void Execute(EnemyVO guest)
        {
            if (guest.IsLockedIn)
            {
                return;                   // Don't bother if the guest is already locked in
            }
            PartyModel        partyModel = AmbitionApp.GetModel <PartyModel>();
            ConversationModel model      = AmbitionApp.GetModel <ConversationModel>();
            RemarkVO          remark     = model.Remark;
            float             levelBonus = (AmbitionApp.GetModel <GameModel>().Level >= 4)
                ? 1.25f
                : 1.0f;
            float ReparteBonus = 1.0f + (model.Repartee ? AmbitionApp.GetModel <PartyModel>().ReparteeBonus : 0f);
            // Determine reaction to remark
            string key = remark.Interest == guest.Like
                        ? PartyConstants.LIKE
                        : remark.Interest == guest.Dislike
                        ? PartyConstants.DISLIKE
                        : PartyConstants.NEUTRAL;

            if (key == PartyConstants.DISLIKE && model.ItemEffect)
            {
                model.ItemEffect = false;
                return;
            }

            // Adjust guest according to configued reaction
            RemarkResult result = partyModel.RemarkResults[key];

            guest.Opinion += (int)(((float)RNG.Generate(result.OpinionMin, result.OpinionMax)) * ReparteBonus * levelBonus);
            if (guest.Opinion >= 100)
            {
                guest.Opinion = 100;
                guest.State   = GuestState.Charmed;
                AmbitionApp.SendMessage(PartyMessages.FREE_REMARK);
                AmbitionApp.SendMessage(PartyMessages.FREE_REMARK);
                AmbitionApp.SendMessage(PartyMessages.GUEST_CHARMED, guest);
            }
            else if (guest.Opinion <= 0)
            {
                guest.Opinion = 0;
                guest.State   = GuestState.PutOff;
                AmbitionApp.SendMessage(PartyMessages.GUEST_OFFENDED, guest);
            }
            else
            {
                switch (key)
                {
                case PartyConstants.LIKE:
                    AmbitionApp.SendMessage(PartyMessages.GUEST_REACTION_POSITIVE, guest);
                    break;

                case PartyConstants.DISLIKE:
                    AmbitionApp.SendMessage(PartyMessages.GUEST_REACTION_NEGATIVE, guest);
                    AmbitionApp.SendMessage(PartyMessages.FREE_REMARK);
                    break;

                default:
                    AmbitionApp.SendMessage(PartyMessages.GUEST_REACTION_NEUTRAL, guest);
                    break;
                }
            }
            // So, there's a potential that the clock won't reset? Deal with that when it's a thing
        }
예제 #11
0
 private void HandleRemark(RemarkVO remark)
 {
     _remark = remark;
 }