Exemplo n.º 1
0
        public void Perform(Scenario scenario, SimDescription actor, SimDescription target)
        {
            ICollection <SimDescription> recruits = mTargetRecruit.Filter(new SimScenarioFilter.Parameters(scenario, mActorRecruit.Enabled), "TargetRecruit", target);

            recruits = mActorRecruit.Filter(new SimScenarioFilter.Parameters(scenario, false), "ActorRecruit", actor, recruits);
            if (recruits == null)
            {
                return;
            }

            SimPersonality clan = scenario.Manager as SimPersonality;

            foreach (SimDescription recruit in recruits)
            {
                clan.AddToClan(scenario, recruit, mAllowSteal);
            }
        }
Exemplo n.º 2
0
        protected override bool PrivateUpdate(ScenarioFrame frame)
        {
            if (!mSuccess.TestBeforehand(Manager, Sim, Target))
            {
                IncStat("Success TestBeforehand Fail");
                return(false);
            }

            if (!mFailure.TestBeforehand(Manager, Sim, Target))
            {
                IncStat("Failure TestBeforehand Fail");
                return(false);
            }

            if (!base.PrivateUpdate(frame))
            {
                return(false);
            }

            SimPersonality clan = Manager as SimPersonality;

            if (clan == null)
            {
                IncStat("No Clan");
                return(false);
            }

            mFail = !clan.AddToClan(this, Target, mAllowSteal);

            if (mFail)
            {
                mFailure.Perform(this, frame, "Failure", Sim, Target);
                return(false);
            }
            else
            {
                mSuccess.Perform(this, frame, "Success", Sim, Target);
                return(true);
            }
        }