コード例 #1
0
            public static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                LotScenario s = scenario as LotScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new SellDuplicateResidentialBookScenario(s.Lot), ScenarioResult.Start);
            }
コード例 #2
0
            protected static void OnPerform(Scenario scenario, ScenarioFrame frame)
            {
                SimScenario s = scenario as SimScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new RerollCareerOnTopLevelScenario(s.Sim), ScenarioResult.Start);
            }
コード例 #3
0
            public static void OnPerform(Scenario scenario, ScenarioFrame frame)
            {
                SimScenario s = scenario as SimScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new MarriageGatheringScenario(s.Sim), ScenarioResult.Start);
            }
コード例 #4
0
            protected static void OnPerform(Scenario scenario, ScenarioFrame frame)
            {
                SimScenario s = scenario as SimScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new CelebrityPromotionScenario(s.Sim), ScenarioResult.Failure);
            }
コード例 #5
0
            public static void OnInstall(Scenario scenario, ScenarioFrame frame)
            {
                LotScenario s = scenario as LotScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new RepopulateLibraryScenario(s.Lot), ScenarioResult.Start);
            }
コード例 #6
0
            protected static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                SimScenario s = scenario as SimScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new PropagateMournScenario(s.Sim), ScenarioResult.Start);
            }
コード例 #7
0
ファイル: FuneralScenario.cs プロジェクト: yakoder/NRaas
            protected static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                SimScenario s = scenario as SimScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, FuneralScenario.Create(scenario.Situations, s.Sim), ScenarioResult.Start);
            }
コード例 #8
0
        public void Perform(Scenario scenario, ScenarioFrame frame, SimDescription actor, SimDescription target)
        {
            if (mScenario != null)
            {
                PropagateBuffScenario propagation = mScenario.Clone() as PropagateBuffScenario;

                propagation.SetActors(actor, target);

                scenario.IncStat("Propagate");

                scenario.Add(frame, propagation, ScenarioResult.Start);
            }
        }
コード例 #9
0
            public static void OnInstall(Scenario scenario, ScenarioFrame frame)
            {
                BirthScenario s = scenario as BirthScenario;

                if (s == null)
                {
                    return;
                }

                foreach (SimDescription baby in s.Babies)
                {
                    scenario.Add(frame, new MeetFamilyScenario(baby), ScenarioResult.Start);
                }
            }
コード例 #10
0
            public static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                ImmigrantMoveInScenario s = scenario as ImmigrantMoveInScenario;

                if (s == null)
                {
                    return;
                }

                foreach (SimDescription sim in s.Movers)
                {
                    scenario.Add(frame, new ChooseLifetimeWishScenario(sim), ScenarioResult.Start);
                }
            }
コード例 #11
0
            protected static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                BirthScenario s = scenario as BirthScenario;

                if (s == null)
                {
                    return;
                }

                SimDescription mom = null;
                SimDescription dad = null;

                Relationships.GetParents(s.Babies[0], out mom, out dad);

                if ((mom != null) && (mom.Household == s.Babies[0].Household))
                {
                    scenario.Add(frame, new MaternityLeaveScenario(mom, s.Babies.Count), ScenarioResult.Start);
                }

                if ((scenario.GetValue <PaternityLeaveOption, bool>()) && (dad != null) && (dad.Household == s.Babies[0].Household))
                {
                    scenario.Add(frame, new MaternityLeaveScenario(dad, s.Babies.Count), ScenarioResult.Start);
                }
            }
コード例 #12
0
            protected static void OnPerform(Scenario scenario, ScenarioFrame frame)
            {
                DualSimScenario s = scenario as DualSimScenario;

                ManagerRomance.AffairStory affairStory = ManagerRomance.AffairStory.All;

                OldFlirtScenario flirtScenario = scenario as OldFlirtScenario;

                if (flirtScenario != null)
                {
                    affairStory = flirtScenario.AffairStory;
                }

                scenario.Add(frame, new AffairScenario(s.Sim, s.Target, affairStory), ScenarioResult.Failure);
            }
コード例 #13
0
ファイル: XmlTests.cs プロジェクト: pandey623/ReUI
        public void Setup()
        {
            Pool = new UIPool();

            Scenario = new Scenario();
            Scenario.Add(Pool.CreateSystem(new InitializeDependencySingletons(
                                               new TestContentProvider(),
                                               new SimpleViewProvider(),
                                               new XLuaProvider())))
            // Read xml
            .Add(Pool.CreateSystem(new ReadEmbedSystem()))
            .Add(Pool.CreateSystem(new ReadXmlSystem()))
            .Add(Pool.CreateSystem(new ParseXmlSystem()));

            Scenario.Initialize();
        }
コード例 #14
0
ファイル: GeneticBlendScenario.cs プロジェクト: yakoder/NRaas
            protected static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                BirthScenario s = scenario as BirthScenario;

                if (s == null)
                {
                    return;
                }

                SimDescription priorBaby = null;

                foreach (SimDescription baby in s.Babies)
                {
                    scenario.Add(frame, new GeneticBlendScenario(baby, priorBaby), ScenarioResult.Start);
                    priorBaby = baby;
                }
            }
コード例 #15
0
ファイル: RetireAtMaxScenario.cs プロジェクト: yakoder/NRaas
            public static void OnPerform(Scenario scenario, ScenarioFrame frame)
            {
                RetirementScenario retirement = scenario as RetirementScenario;

                if (retirement != null)
                {
                    retirement.RetiredAtMax = scenario.GetValue <Option, bool>();
                }

                SimScenario s = scenario as SimScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new RetireAtMaxScenario(s.Sim), ScenarioResult.Start);
            }
コード例 #16
0
            protected static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                IInvestigationScenario s = scenario as IInvestigationScenario;

                if (s == null)
                {
                    return;
                }

                if (!s.AllowGoToJail)
                {
                    return;
                }

                if (string.IsNullOrEmpty(s.InvestigateStoryName))
                {
                    return;
                }

                scenario.Add(frame, new InvestigateScenario(s.Target, s.Sim, s.InvestigateStoryName, s.InvestigateMinimum, s.InvestigateMaximum), ScenarioResult.Failure);
            }
コード例 #17
0
            public static void OnPerform(Scenario scenario, ScenarioFrame frame)
            {
                PromotedScenario promoted = scenario as PromotedScenario;

                if (promoted != null)
                {
                    if (promoted.IsSuppressed())
                    {
                        return;
                    }
                }

                SimScenario s = scenario as SimScenario;

                if (s == null)
                {
                    return;
                }

                scenario.Add(frame, new CareerBranchScenario(s.Sim), ScenarioResult.Start);
            }
コード例 #18
0
ファイル: FightScenarioHelper.cs プロジェクト: yakoder/NRaas
        public bool Perform(Scenario scenario, ScenarioFrame frame, SimDescription sim, SimDescription target, SuccessUpdateDelegate successUpdate, out bool fail)
        {
            fail = false;

            if (!mSuccess.TestBeforehand(scenario.Manager, sim, target))
            {
                scenario.IncStat("Success TestBeforehand Fail");
                return(false);
            }

            if (!mFailure.TestBeforehand(scenario.Manager, sim, target))
            {
                scenario.IncStat("Failure TestBeforehand Fail");
                return(false);
            }

            if (!mExtremeFailure.TestBeforehand(scenario.Manager, sim, target))
            {
                scenario.IncStat("ExtremeFailure TestBeforehand Fail");
                return(false);
            }

            int score = 0;

            if (!string.IsNullOrEmpty(mFightScoring))
            {
                score  = scenario.AddScoring("Fight Sim", ScoringLookup.GetScore(mFightScoring, sim));
                score -= scenario.AddScoring("Fight Target", ScoringLookup.GetScore(mFightScoring, target));
            }

            if (score < 0)
            {
                if ((target.CreatedSim != null) && (target.OccultManager.HasOccultType(OccultTypes.Werewolf)))
                {
                    target.CreatedSim.BuffManager.AddElement(BuffNames.TopDog, Origin.FromWinningFight);
                }

                fail = true;

                if ((sim == scenario.Personalities.GetClanLeader(scenario.Manager)) && (RandomUtil.RandomChance(-score)))
                {
                    mExtremeFailure.Perform(scenario, frame, "ExtremeFailure", sim, target);
                }

                if (mAllowGoToJail)
                {
                    int bail = mBail;
                    if (bail == 0)
                    {
                        bail = scenario.Manager.GetValue <GotArrestedScenario.BailOption, int>() * 2;
                    }

                    scenario.Manager.AddAlarm(new GoToJailScenario(sim, bail));
                }
                else if (mActorAllowInjury)
                {
                    scenario.Manager.AddAlarm(new GoToHospitalScenario(sim, target, "InjuredFight", SimDescription.DeathType.OldAge));
                }

                mFailure.Perform(scenario, frame, "Failure", sim, target);
                return(true);
            }
            else if ((successUpdate == null) || (successUpdate(frame)))
            {
                if ((sim.CreatedSim != null) && (sim.OccultManager.HasOccultType(OccultTypes.Werewolf)))
                {
                    sim.CreatedSim.BuffManager.AddElement(BuffNames.TopDog, Origin.FromWinningFight);
                }

                if (mTargetAllowInjury)
                {
                    scenario.Manager.AddAlarm(new GoToHospitalScenario(target, sim, "InjuredFight", mDeathType, mChanceOfDeath.Value));
                }

                scenario.Add(frame, new PropagateWonFightScenario(sim, target), ScenarioResult.Start);
                scenario.Add(frame, new PropagateClanDelightScenario(sim, scenario.Manager, Origin.FromTheft), ScenarioResult.Start);

                mSuccess.Perform(scenario, frame, "Success", sim, target);
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #19
0
ファイル: WeightScenarioHelper.cs プロジェクト: yakoder/NRaas
        public void Perform(Scenario scenario, ScenarioFrame frame, string name, SimDescription sim, SimDescription target)
        {
            scenario.IncStat(name);

            foreach (KeyValuePair <BuffNames, Origin> value in mActorBuffs)
            {
                HandleBuff(sim.CreatedSim, value.Key, value.Value);
            }

            foreach (KeyValuePair <BuffNames, Origin> value in mTargetBuffs)
            {
                HandleBuff(target.CreatedSim, value.Key, value.Value);
            }

            mRecruit.Perform(scenario, sim, target);

            mPropagate.Perform(scenario, frame, sim, target);

            int minCelebrity = scenario.GetValue <ManagerPersonality.MinCelebrityOption, int>();

            if (minCelebrity > 0)
            {
                SimPersonality personality = scenario.Manager as SimPersonality;

                int actorCelebrity = mActorCelebrity;
                if (actorCelebrity < minCelebrity)
                {
                    actorCelebrity = minCelebrity;
                }

                if (actorCelebrity > 0)
                {
                    scenario.Friends.AccumulateCelebrity(sim, actorCelebrity);
                }

                if ((personality != null) && (personality.Me != sim))
                {
                    scenario.Friends.AccumulateCelebrity(personality.Me, actorCelebrity);
                }

                int targetCelebrity = mTargetCelebrity;
                if (targetCelebrity < minCelebrity)
                {
                    targetCelebrity = minCelebrity;
                }

                if (targetCelebrity > 0)
                {
                    scenario.Friends.AccumulateCelebrity(target, targetCelebrity);
                }
            }

            if (mAccumulatorOptions != null)
            {
                foreach (SimPersonality.IAccumulatorValue value in mAccumulatorOptions)
                {
                    value.ApplyAccumulator();
                }
            }

            Scenario newScenario = GetNewScenario(scenario.Manager, sim, target);

            if (newScenario != null)
            {
                scenario.IncStat(newScenario.UnlocalizedName);

                scenario.Add(frame, newScenario, ScenarioResult.Start);
            }

            SimPersonality clan = scenario.Manager as SimPersonality;

            if ((sim != clan.Me) && (clan != null) && (clan.IsFriendlyLeadership))
            {
                int delta = mDelta.Score(new DualSimScoringParameters(sim, clan.Me));

                if (delta < 0)
                {
                    scenario.IncStat("ExistingEnemy");

                    scenario.Add(frame, new ExistingEnemyManualScenario(sim, clan.Me, delta, 0), ScenarioResult.Start);
                }
                else if (delta > 0)
                {
                    scenario.IncStat("ExistingFriend");

                    scenario.Add(frame, new ExistingFriendManualScenario(sim, clan.Me, delta, 0), ScenarioResult.Start);
                }
            }

            scenario.Add(frame, new SuccessScenario(), ScenarioResult.Start);
        }
コード例 #20
0
 public static void OnInstall(Scenario scenario, ScenarioFrame frame)
 {
     scenario.Add(frame, new ImmigrantManageBossScenario(), ScenarioResult.Start);
 }
コード例 #21
0
        public void Perform(Scenario scenario, ScenarioFrame frame, string name, SimDescription sim, SimDescription target)
        {
            scenario.IncStat(name);

            foreach (KeyValuePair<BuffNames, Origin> value in mActorBuffs)
            {
                HandleBuff(sim.CreatedSim, value.Key, value.Value);
            }

            foreach (KeyValuePair<BuffNames, Origin> value in mTargetBuffs)
            {
                HandleBuff(target.CreatedSim, value.Key, value.Value);
            }

            mRecruit.Perform(scenario, sim, target);

            mPropagate.Perform(scenario, frame, sim, target);

            int minCelebrity = scenario.GetValue<ManagerPersonality.MinCelebrityOption, int>();

            if (minCelebrity > 0)
            {
                SimPersonality personality = scenario.Manager as SimPersonality;

                int actorCelebrity = mActorCelebrity;
                if (actorCelebrity < minCelebrity)
                {
                    actorCelebrity = minCelebrity;
                }

                if (actorCelebrity > 0)
                {
                    scenario.Friends.AccumulateCelebrity(sim, actorCelebrity);
                }

                if ((personality != null) && (personality.Me != sim))
                {
                    scenario.Friends.AccumulateCelebrity(personality.Me, actorCelebrity);
                }

                int targetCelebrity = mTargetCelebrity;
                if (targetCelebrity < minCelebrity)
                {
                    targetCelebrity = minCelebrity;
                }

                if (targetCelebrity > 0)
                {
                    scenario.Friends.AccumulateCelebrity(target, targetCelebrity);
                }
            }

            if (mAccumulatorOptions != null)
            {
                foreach (SimPersonality.IAccumulatorValue value in mAccumulatorOptions)
                {
                    value.ApplyAccumulator();
                }
            }

            Scenario newScenario = GetNewScenario(scenario.Manager, sim, target);
            if (newScenario != null)
            {
                scenario.IncStat(newScenario.UnlocalizedName);

                scenario.Add(frame, newScenario, ScenarioResult.Start);
            }

            SimPersonality clan = scenario.Manager as SimPersonality;
            if ((sim != clan.Me) && (clan != null) && (clan.IsFriendlyLeadership))
            {
                int delta = mDelta.Score(new DualSimScoringParameters(sim, clan.Me));

                if (delta < 0)
                {
                    scenario.IncStat("ExistingEnemy");

                    scenario.Add(frame, new ExistingEnemyManualScenario(sim, clan.Me, delta, 0), ScenarioResult.Start);
                }
                else if (delta > 0)
                {
                    scenario.IncStat("ExistingFriend");

                    scenario.Add(frame, new ExistingFriendManualScenario(sim, clan.Me, delta, 0), ScenarioResult.Start);
                }
            }

            scenario.Add(frame, new SuccessScenario(), ScenarioResult.Start);
        }
コード例 #22
0
    void MakeTestScenario()
    {
        ////////////// actor null exception

        //*
        Task introduction = new Task("Intro", "");

        introduction.instruction = new Instruction(introduction.name);
        introduction.instruction.SetContentWithContext("Tutorial", Information.Context.Title);
        introduction.instruction.SetContentWithContext("Hi. Your training is just started. Please follow the instruction.", Information.Context.Narration);
        introduction.instruction.SetContentWithContext("Hi. Your training is just started. Please follow the instruction.", Information.Context.Description);
        introduction.exit = new Condition(new TimeState(0, 0, 5), Condition.RelationalOperator.LargerOrEqual);
        //introduction.exit = new Condition(new InputUpState(actor, (int)KeyCode.C), Condition.Operator.Equal);
        scenario.Add(introduction);


        //안녕하세요. 지금부터 장비 훈련을 시작하겠습니다. 노란 머리의 엔지니어의 시범을 본 후에 따라해주세요.
        //첫 번째 단계로 조이스틱을 조종하여 X 좌표를 43으로 Y 좌표를 -29로 맞춰주세요.
        //두 번째 단계로 휠을 시계 방향으로 한 바퀴 돌려 크레인 훅을 내려보세요.
        //세 번째 단계로 그랩 버튼을 눌러 크레인 훅이 물체를 잡도록 하세요.
        //네 번째 단계로 레버를 몸 쪽으로 잡아 당겨 크레인의 기어를 1로 바꿔 주세요.
        //다섯 번째 단계로 휠을 반시계방향으로 한 바퀴 돌려 크레인 훅을 올라가도록 하세요.
        //훈련이 종료되었습니다. 수고하셨습니다.

        Joystick joystick      = FindObjectsOfType <Joystick>()[0];
        Wheel    wheel         = FindObjectsOfType <Wheel>()[0];
        Button   correctButton = GameObject.Find("Grab button red").GetComponent <Button>();
        Lever    lever         = FindObjectsOfType <Lever>()[0];

        Task task1 = new Task("Task1", "");

        //task1.instruction = new Instruction("첫 번째 단계로 조이스틱을 조종하여 X 좌표를 43으로 Y 좌표를 -29로 맞춰주세요.");
        task1.instruction = new Instruction(task1.name);
        task1.instruction.SetContentWithContext("Stage 1", Information.Context.Title);
        task1.instruction.SetContentWithContext("As a first step, control the joystick.", Information.Context.Narration);
        task1.instruction.SetContentWithContext("As a first step, control the joystick to set the X coordinate to 43 and the Y coordinate to -29.", Information.Context.Description);
        task1.exit = new Condition(new VariableDistanceState(new VectorVariableState(joystick, "leverCoord", new Vector3(43, -29, 0)), 10.0f), Condition.RelationalOperator.SmallerOrEqual);
        scenario.Add(task1);

        Task task2 = new Task("Task2", "");

        task2.instruction = new Instruction(task2.name);
        task2.instruction.SetContentWithContext("Stage 2", Information.Context.Title);
        task2.instruction.SetContentWithContext("As a second step, turn the wheel clockwise one turn.", Information.Context.Narration);
        task2.instruction.SetContentWithContext("As a second step, turn the wheel clockwise one turn.", Information.Context.Description);
        task2.exit = new Condition(new BoolVariableState(wheel, "didCW", true), Condition.RelationalOperator.Equal);
        scenario.Add(task2);

        Task task3 = new Task("Task3", "");

        task3.instruction = new Instruction(task3.name);
        task3.instruction.SetContentWithContext("Stage 3", Information.Context.Title);
        task3.instruction.SetContentWithContext("As a third step, press the grab button to hold the crane hook.", Information.Context.Narration);
        task3.instruction.SetContentWithContext("As a third step, press the grab button to hold the crane hook.", Information.Context.Description);
        task3.exit = new Condition(new BoolVariableState(correctButton, "isPushed", true), Condition.RelationalOperator.Equal);
        scenario.Add(task3);

        Task task4 = new Task("Task4", "");

        task4.instruction = new Instruction(task4.name);
        task4.instruction.SetContentWithContext("Stage 4", Information.Context.Title);
        task4.instruction.SetContentWithContext("As a fourth step, pull the lever toward you and change the gear of the crane to 1.", Information.Context.Narration);
        task4.instruction.SetContentWithContext("As a fourth step, pull the lever toward you and change the gear of the crane to 1.", Information.Context.Description);
        task4.exit = new Condition(new IntVariableState(lever, "gearValue", 1), Condition.RelationalOperator.Equal);
        scenario.Add(task4);

        Task task5 = new Task("Task5", "");

        task5.instruction = new Instruction(task5.name);
        task5.instruction.SetContentWithContext("Stage 5", Information.Context.Title);
        task5.instruction.SetContentWithContext("As a fifth step, turn the wheel counterclockwise one turn.", Information.Context.Narration);
        task5.instruction.SetContentWithContext("As a fifth step, turn the wheel counterclockwise one turn.", Information.Context.Description);
        task5.exit = new Condition(new BoolVariableState(wheel, "didCCW", true), Condition.RelationalOperator.Equal);
        scenario.Add(task5);

        Task ending = new Task("Finish", "");

        ending.instruction = new Instruction(ending.name);
        ending.instruction.SetContentWithContext("Finish", Information.Context.Title);
        ending.instruction.SetContentWithContext("Well done! Your training is successfully terminated.", Information.Context.Narration);
        ending.instruction.SetContentWithContext("Well done! Your training is successfully terminated.", Information.Context.Description);
        ending.exit = new Condition(new InputUpState(actor, (int)KeyCode.C), Condition.RelationalOperator.Equal);
        scenario.Add(ending);

        scenario.MakeProcedure();

        scenario.Activate();
    }
コード例 #23
0
            public static void OnInstall(Scenario scenario, ScenarioFrame frame)
            {
                SimScenario s = scenario as SimScenario;

                scenario.Add(frame, new ManageCareerScenario(s.Sim), ScenarioResult.Start);
            }
コード例 #24
0
            protected static void OnRun(Scenario scenario, ScenarioFrame frame)
            {
                ScheduledMarriageScenario marriageScenario = scenario as ScheduledMarriageScenario;

                scenario.Add(frame, new ScoredBreakupScenario(marriageScenario.Sim, marriageScenario.Target), ScenarioResult.Start);
            }