コード例 #1
0
 public void Realize(iLogicMapContainer owner, Team team, bool isTest = false)
 {
     checkNode = true;
     if (type == LogicEffectType.SINGLE)
     {
         if (!isTest)
         {
             //effect.owner = owner;
             effect.Realize(owner, team);
             //if (owner is TriggerZone)
             //{
             //    TriggerZone triggerZone = owner as TriggerZone;
             //    triggerZone.Reactivate();
             //}
         }
         else
         {
             Debug.Log(string.Format("Realize effect {0}", effect.type));
         }
     }
     else if (type == LogicEffectType.ARRAY)
     {
         foreach (Effect e in effects)
         {
             if (!isTest)
             {
                 e.Realize(owner, team);
             }
             else
             {
                 Debug.Log(string.Format("Realize effect {0}", e.type));
             }
         }
     }
 }
コード例 #2
0
        public void CreateWaitAction(iLogicMapContainer owner, UnityAction trueAction, UnityAction falseAction)
        {
            Timeline   timeline = Timeline.GetInstantiate();
            GameObject goAction = new GameObject(string.Format("TimelineAction_WaitChallenge"));

            goAction.transform.parent = timeline.transform;
            TimelineAction waitAction = goAction.AddComponent <TimelineAction>();

            waitAction.actionType = TimelineActionType.WAIT;
            waitAction.action     = delegate
            {
                bool result = Realize(owner);
                if (result)
                {
                    trueAction();
                }
                else
                {
                    falseAction();
                }
            };
            if (waitType == WaitType.ABSOLUTE)
            {
                waitAction.timer = GameTime.ConvertToFloat(waitTime);
            }
            else if (waitType == WaitType.RELATION)
            {
                waitAction.timer = timeline.GetTime() + GameTime.ConvertToFloat(waitTime);
            }
            else if (waitType == WaitType.ABSOLUTE_HOURS)
            {
                GameTime curTime = GameTime.Convert(timeline.GetTime());
                if (curTime.GetDayHour() <= waitTime)
                {
                    GameTime resultTime = new GameTime()
                    {
                        minutes = waitTime.minutes,
                        hours   = waitTime.hours,
                        days    = curTime.days,
                        weeks   = curTime.weeks,
                        months  = curTime.months
                    };
                    waitAction.timer = GameTime.ConvertToFloat(resultTime);
                }
                else if (curTime.GetDayHour() > waitTime)
                {
                    GameTime resultTime = new GameTime()
                    {
                        minutes = waitTime.minutes,
                        hours   = waitTime.hours,
                        days    = curTime.days + 1,
                        weeks   = curTime.weeks,
                        months  = curTime.months
                    };
                    waitAction.timer = GameTime.ConvertToFloat(resultTime);
                }
            }
            timeline.RegistrateAction(waitAction);
            Debug.Log(string.Format("ждать челендж {0}", waitTime.ToString()), this);
        }
コード例 #3
0
ファイル: LogicMap.cs プロジェクト: eakuznec/BadDetective_old
 public void RealizeLogicMap(iLogicMapContainer owner, Team team, bool isTest = false)
 {
     Debug.Log(string.Format("Realize logic map"), this);
     curOwner  = owner;
     this.team = team;
     ClearCheck();
     startRealize = true;
     RealizeFunction(startFunction, isTest);
 }
コード例 #4
0
        public Temper Realize(iLogicMapContainer owner)
        {
            Team team = null;

            if (owner is QuestTask)
            {
                team = ((QuestTask)owner).GetTeam();
            }
            return(team.GetPriorityTemper(rudeOutput != null, prudentOutput != null, mercifulOutput != null, cruelOutput != null, mercantileOutput != null, principledOutput != null));
        }
コード例 #5
0
        public Method Realize(iLogicMapContainer owner)
        {
            Team team = null;

            if (owner is QuestTask)
            {
                team = ((QuestTask)owner).GetTeam();
            }
            return(team.GetPriorityMethod(brutalOutput != null, carefulOutput != null, diplomatOutput != null, scienceOutput != null));
        }
コード例 #6
0
        private bool Realize(iLogicMapContainer owner)
        {
            Team team = null;

            if (owner is QuestTask)
            {
                team = ((QuestTask)owner).GetTeam();
            }
            return(challenge.Challage(team));
        }
コード例 #7
0
        public void LoyaltyInfluence(Temper temper, iLogicMapContainer owner)
        {
            Team team = null;

            if (owner is QuestTask)
            {
                team = ((QuestTask)owner).GetTeam();
            }
            Agency agency = Agency.GetInstantiate();
            float  mod    = 1f;

            foreach (Detective detective in agency.GetDetectives())
            {
                if (team.detectives.Contains(detective))
                {
                    mod = 1f;
                }
                else
                {
                    mod = 0.25f;
                }
                if (temper == Temper.RUDE)
                {
                    if (detective.temper == Temper.RUDE)
                    {
                        detective.ChangeCurLoyalty(mod * loyaltyInfluence);
                    }
                    else if (detective.temper == Temper.PRUDENT)
                    {
                        detective.ChangeCurLoyalty(-mod * loyaltyInfluence);
                    }
                }
                else if (temper == Temper.PRUDENT)
                {
                    if (detective.temper == Temper.PRUDENT)
                    {
                        detective.ChangeCurLoyalty(mod * loyaltyInfluence);
                    }
                    else if (detective.temper == Temper.RUDE)
                    {
                        detective.ChangeCurLoyalty(-mod * loyaltyInfluence);
                    }
                }
                else if (temper == Temper.MERCIFUL)
                {
                    if (detective.temper == Temper.MERCIFUL)
                    {
                        detective.ChangeCurLoyalty(mod * loyaltyInfluence);
                    }
                    else if (detective.temper == Temper.CRUEL)
                    {
                        detective.ChangeCurLoyalty(-mod * loyaltyInfluence);
                    }
                }
                else if (temper == Temper.CRUEL)
                {
                    if (detective.temper == Temper.CRUEL)
                    {
                        detective.ChangeCurLoyalty(mod * loyaltyInfluence);
                    }
                    else if (detective.temper == Temper.MERCIFUL)
                    {
                        detective.ChangeCurLoyalty(-mod * loyaltyInfluence);
                    }
                }
                else if (temper == Temper.MERCANTILE)
                {
                    if (detective.temper == Temper.MERCANTILE)
                    {
                        detective.ChangeCurLoyalty(mod * loyaltyInfluence);
                    }
                    else if (detective.temper == Temper.PRINCIPLED)
                    {
                        detective.ChangeCurLoyalty(-mod * loyaltyInfluence);
                    }
                }
                else if (temper == Temper.PRINCIPLED)
                {
                    if (detective.temper == Temper.PRINCIPLED)
                    {
                        detective.ChangeCurLoyalty(mod * loyaltyInfluence);
                    }
                    else if (detective.temper == Temper.MERCANTILE)
                    {
                        detective.ChangeCurLoyalty(-mod * loyaltyInfluence);
                    }
                }
            }
        }