コード例 #1
0
 public void Submit()
 {
     AmbitionApp.SendMessage(PartyMessages.SHOW_ROOM, _incident?.ID);
     Close();
 }
コード例 #2
0
 public override void OnEnterState()
 {
     AmbitionApp.SendMessage(_messageID);
 }
コード例 #3
0
 override public void OnEnterState()
 {
     AmbitionApp.Subscribe(GameMessages.FADE_OUT_COMPLETE, HandleFadeOutComplete);
     AmbitionApp.SendMessage(GameMessages.FADE_OUT);
 }
コード例 #4
0
ファイル: LocationReward.cs プロジェクト: rasmus-z/DeWinter
 public void Execute(CommodityVO reward)
 {
     AmbitionApp.SendMessage(ParisMessages.ADD_LOCATION, reward.ID);
 }
コード例 #5
0
 public void Decline()
 {
     AmbitionApp.SendMessage(PartyMessages.DECLINE_INVITATION, _rendezvous);
     SetText(RSVP.Declined, _rendezvous.IsCaller);
 }
コード例 #6
0
 public override void OnEnter()
 {
     AmbitionApp.SendMessage(PartyMessages.TURN, ++AmbitionApp.GetModel <PartyModel>().Turn);
 }
コード例 #7
0
        public override void OnEnter()
        {
            PartyModel model = AmbitionApp.GetModel <PartyModel>();

            IncidentVO[]  incidents = new IncidentVO[model.NumRooms];
            IncidentModel story     = AmbitionApp.Story;

            if (model.Incidents != null)
            {
                incidents = new IncidentVO[model.NumRooms];
                for (int i = model.NumRooms - 1; i >= 0; --i)
                {
                    incidents[i] = story.GetIncident(model.Incidents[i]);
                }
            }
            else
            {
                HashSet <string> characters = new HashSet <string>();
                if (model.RequiredIncident != null)
                {
                    int index = RNG.Generate(model.NumRooms);
                    incidents[index] = story.GetIncident(model.RequiredIncident);
                }
                else
                {
                    List <IncidentVO> result = new List <IncidentVO>();
                    IncidentVO        incident;
                    if (model.Party.SupplementalIncidents != null)
                    {
                        string[] shuffle = RNG.Shuffle(model.Party.SupplementalIncidents);
                        foreach (string incidentID in shuffle)
                        {
                            incident = story.GetIncident(incidentID);
                            if (result.Count < model.NumRooms)
                            {
                                if (FindCharacters(incident, characters))
                                {
                                    result.Add(incident);
                                }
                            }
                        }
                    }

                    if (result.Count < model.NumRooms)
                    {
                        incidents = story.GetIncidents(IncidentType.Party);
                        incidents = RNG.Shuffle(incidents);
                        foreach (IncidentVO rand in incidents)
                        {
                            if (AmbitionApp.CheckIncidentEligible(rand) &&
                                (rand.Factions?.Length == 0 || Array.IndexOf(rand.Factions, model.Party.Faction) >= 0) &&
                                FindCharacters(rand, characters))
                            {
                                result.Add(rand);
                            }
                            if (result.Count >= model.NumRooms)
                            {
                                break;
                            }
                        }
                    }
                    while (result.Count < model.NumRooms)
                    {
                        result.Add(null);
                    }
                    incidents = RNG.Shuffle(result);
                }
                model.Incidents = new string[model.NumRooms];
                for (int i = model.NumRooms - 1; i >= 0; --i)
                {
                    model.Incidents[i] = incidents[i]?.ID;
                }
            }

            AmbitionApp.SendMessage(PartyMessages.SELECT_INCIDENTS, incidents);
            string title = AmbitionApp.Localize(PartyConstants.PARTY_NAME + model.Party.ID);

            if (string.IsNullOrEmpty(title))
            {
                title = PartyConstants.PARTY_REASON + model.Party.Faction.ToString().ToLower() + "." + model.Party.phrases[0];
            }
            AmbitionApp.SendMessage(GameMessages.SHOW_HEADER, title);
        }
コード例 #8
0
 private void HandleButton()
 {
     AmbitionApp.SendMessage(TutorialMessages.TUTORIAL_NEXT_STEP);
 }
コード例 #9
0
 public void Execute()
 {
     AmbitionApp.GetModel <GameModel>().Exhaustion = 0;
     AmbitionApp.SendMessage(CalendarMessages.NEXT_DAY);
 }
コード例 #10
0
 public void MouseClick()
 {
     MouseHover();
     AmbitionApp.SendMessage(InventoryMessages.SORT_INVENTORY, _labelString);
 }
コード例 #11
0
 // Use this for initialization
 void Start()
 {
     AmbitionApp.SendMessage(GameMessages.FADE_IN);
     Destroy(this);
 }
コード例 #12
0
 // Use this for initialization
 void Awake()
 {
     AmbitionApp.SendMessage(AudioMessages.PLAY_AMBIENT, AmbientSFX);
 }
コード例 #13
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     AmbitionApp.SendMessage <CharacterVO>(PartyMessages.TARGET_GUEST, Guest);
 }
コード例 #14
0
 public void Execute()
 {
     AmbitionApp.SendMessage(AmbitionApp.Inventory.Inventory);
 }
コード例 #15
0
ファイル: CurrentMonthBtn.cs プロジェクト: rasmus-z/DeWinter
        public void HandleClick()
        {
            DateTime today = AmbitionApp.GetModel <CalendarModel>().Today;

            AmbitionApp.SendMessage <DateTime>(CalendarMessages.VIEW_MONTH, today);
        }
コード例 #16
0
        public void Execute(GuestVO 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];
            int          opinionDelta = (int)(((float)RNG.Generate(result.OpinionMin, result.OpinionMax)) * ReparteBonus * levelBonus);

            guest.Opinion += opinionDelta;
            if (guest.Opinion >= 100)
            {
                AmbitionApp.SendMessage(PartyMessages.GUEST_CHARMED, guest);
            }
            else if (guest.Opinion <= 0)
            {
                AmbitionApp.SendMessage(PartyMessages.GUEST_OFFENDED, guest);
            }
            else
            {
                switch (key)
                {
                case PartyConstants.LIKE:
                    guest.State = GuestState.Interested;
                    AmbitionApp.SendMessage(PartyMessages.GUEST_REACTION_POSITIVE, guest);
                    AmbitionApp.SendMessage(PartyMessages.FREE_REMARK);
                    break;

                case PartyConstants.DISLIKE:
                    AmbitionApp.SendMessage(PartyMessages.GUEST_REACTION_NEGATIVE, guest);
                    guest.State = GuestState.Bored;
                    break;

                default:
                    guest.State = GuestState.Interested;
                    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
            AmbitionApp.SendMessage(result.Remarks < 0 ? PartyMessages.BURN_REMARKS : PartyMessages.RESHUFFLE_REMARKS, Math.Abs(result.Remarks));
        }
コード例 #17
0
 public override void OnClose()
 {
     AmbitionApp.SendMessage <string>(GameMessages.DIALOG_CLOSED, ID);
 }
コード例 #18
0
 public override void OnEnter() => AmbitionApp.SendMessage(GameMessages.FADE_OUT);
コード例 #19
0
 public void ResetGame()
 {
     AmbitionApp.OpenDialog("exit", () => AmbitionApp.SendMessage(GameMessages.EXIT_GAME));
 }
コード例 #20
0
 private void OnActivate()
 {
     AmbitionApp.SendMessage(GameMessages.FADE_IN);
     Activate();
 }
コード例 #21
0
        public void Execute()
        {
            CommodityVO penalty = new CommodityVO(CommodityType.Credibility, AmbitionApp.Game.ExhaustionPenalty);

            AmbitionApp.SendMessage(penalty);
        }
コード例 #22
0
ファイル: GuestView.cs プロジェクト: rasmus-z/DeWinter
 public void OnPointerExit(PointerEventData eventData)
 {
     AmbitionApp.SendMessage <GuestVO>(PartyMessages.TARGET_GUEST, null);
 }
コード例 #23
0
 public void Accept()
 {
     AmbitionApp.SendMessage(PartyMessages.ACCEPT_INVITATION, _rendezvous);
     SetText(RSVP.Accepted, _rendezvous.IsCaller);
 }
コード例 #24
0
ファイル: GuestView.cs プロジェクト: rasmus-z/DeWinter
 public void OnPointerClick(PointerEventData eventData)
 {
     AmbitionApp.SendMessage(PartyMessages.SELECT_GUEST, Guest);
 }
コード例 #25
0
 protected void OnClick()
 {
     AmbitionApp.SendMessage(MapMessage.GO_TO_ROOM, _room);
 }
コード例 #26
0
 private void OnClick() => AmbitionApp.SendMessage(PartyMessages.START_PARTY);
コード例 #27
0
 public void Execute(ItemVO item)
 {
     AmbitionApp.Inventory.Inventory.Remove(item);
     AmbitionApp.SendMessage(InventoryMessages.ITEM_DELETED, item);
     AmbitionApp.Inventory.Broadcast();
 }
コード例 #28
0
 public void OnPointerClick(PointerEventData eventData)
 {
     AmbitionApp.SendMessage(IncidentMessages.TRANSITION, _transition);
 }
コード例 #29
0
 private void HandleFadeOutComplete()
 {
     AmbitionApp.Unsubscribe(GameMessages.FADE_OUT_COMPLETE, HandleFadeOutComplete);
     AmbitionApp.SendMessage <string>(GameMessages.LOAD_SCENE, _sceneID);
     AmbitionApp.SendMessage(GameMessages.FADE_IN);
 }
コード例 #30
0
 private void OnApplicationQuit()
 {
     AmbitionApp.SendMessage(GameMessages.AUTOSAVE);
 }