Example #1
0
        protected void CheckPathConnections(PathMarker nearbyPathMarker)
        {                                       //TODO possibly remove this as Paths now handles this task
                                                //check the nearby path markers
                                                //if one of them is not a neigbor
                                                //then we know we're supposed to try and link it
            if (nearbyPathMarker == null || nearbyPathMarker.IsFinished)
            {
                return;
            }
            else if (!Paths.IsNeighbor(nearbyPathMarker, this))
            {
                MarkerAlterAction alterAction = MarkerAlterAction.None;
                if (Paths.CanAttachPathMarker(nearbyPathMarker, this, out alterAction))
                {
                    //this calls for a skill
                    Skill     learnedSkill = null;
                    PathSkill skillToUse   = null;
                    switch (alterAction)
                    {
                    case MarkerAlterAction.AppendToPath:
                    case MarkerAlterAction.CreateBranch:
                        if (Skills.Get.HasLearnedSkill("AlterPath", out learnedSkill))
                        {
                            skillToUse = learnedSkill as PathSkill;
                        }
                        break;

                    case MarkerAlterAction.CreatePath:
                    case MarkerAlterAction.CreatePathAndBranch:
                        if (Skills.Get.HasLearnedSkill("CreatePath", out learnedSkill))
                        {
                            skillToUse = learnedSkill as PathSkill;
                        }
                        break;

                    case MarkerAlterAction.None:
                    default:
                        break;
                    }

                    if (skillToUse != null)
                    {
                        Paths.CreateTemporaryConnection(nearbyPathMarker, this, alterAction, skillToUse);
                    }
                }
            }
        }
Example #2
0
        public void OnItemOfInterestLeave()
        {
            if (!mInitialized)
            {
                return;
            }

            if (!HasPathMarkerProps)
            {
                return;
            }

            Visitable  visitable = worlditem.Get <Visitable>();
            PathMarker pm        = null;

            if (visitable.LastItemOfInterestToLeave != null && visitable.LastItemOfInterestToLeave.Is <PathMarker>(out pm))
            {
                //not sure what to do here
            }
        }
Example #3
0
        public void OnItemOfInterestVisit()
        {
            if (!mInitialized)
            {
                return;
            }

            if (!HasPathMarkerProps)
            {
                return;
            }

            Visitable  visitable = worlditem.Get <Visitable>();
            PathMarker pm        = null;

            if (visitable.LastItemOfInterestToVisit != null && visitable.LastItemOfInterestToVisit.Is <PathMarker>(out pm))
            {
                CheckPathConnections(pm);
            }
        }