Example #1
0
    public override bool canExecute()
    {
        HoverJet  jet  = controller.GetComponentInChildren <HoverJet> ();
        RobotArms arms = controller.GetComponentInChildren <RobotArms>();

        return(arms != null && !arms.hasTarget() && !target.hasTag(TagEnum.Grabbed) && controller.knowsTarget(target.labelHandle) && jet != null && jet.canReach(target));
    }
Example #2
0
        // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
        public static void AttachToBlock(HoverJet gameObject)
        {
            var thing = gameObject.gameObject.AddComponent <HoverJetAim>();

            if (thing != null)
            {
                thing.hover = gameObject;
            }
        }
Example #3
0
    protected override float getCost()
    {
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            return(jet.calculatePathCost(routePoints[currentDestination].label));
        }
        return(0);
    }
Example #4
0
    protected override float getCost()
    {
        HoverJet jet = controller.GetComponentInChildren <HoverJet>();

        if (jet != null)
        {
            return(jet.calculatePathCost(powerStation));
        }
        return(0f);
    }
Example #5
0
    protected override float getCost()
    {
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            return(jet.calculatePathCost(dropPoint.label));
        }
        return(0);
    }
Example #6
0
    public override void stopExecution()
    {
        base.stopExecution();
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            jet.setAvailability(true);
            jet.setTarget(null);
        }
    }
Example #7
0
    public override void execute()
    {
        base.execute();
        HoverJet jet = controller.GetComponentInChildren <HoverJet>();

        if (jet != null)
        {
            jet.setTarget(powerStation.labelHandle);
            jet.setAvailability(false);
        }
    }
Example #8
0
    public override void execute()
    {
        base.execute();
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            jet.setTarget(dropPoint, true);
            jet.setAvailability(false);
        }
    }
Example #9
0
    public override void execute()
    {
        base.execute();
        HoverJet jet = controller.GetComponentInChildren <HoverJet> ();

        if (jet != null)
        {
            currentDestination = getNearest(controller.transform.position);
            jet.setTarget(routePoints[currentDestination]);
            jet.setAvailability(false);
        }
    }
    protected override float getCost()
    {
        HoverJet jet = controller.GetComponentInChildren <HoverJet>();

        if (jet != null)
        {
            System.Nullable <Vector3> pos = controller.getLastKnownPosition(parent);
            if (pos.HasValue)
            {
                float cost = jet.calculatePathCost(pos.Value);
                //Debug.Log("investigate path cost: " + cost);
                return(cost);
            }
        }
        return(0);
    }
Example #11
0
 public override void onMessage(RobotMessage message)
 {
     if (message.Message.Equals("target reached"))
     {
         HoverJet jet = controller.GetComponentInChildren <HoverJet> ();
         if (jet != null && routePoints[currentDestination] == message.Target)
         {
             ++currentDestination;
             if (currentDestination == routePoints.Count)
             {
                 currentDestination = 0;
             }
             if (routePoints[currentDestination] == null)
             {
                 Debug.LogWarning("Robot '" + controller.name + "' has detected a missing patrol route point. ");
                 Debug.LogWarning("Robot '" + controller.name + "' halted. ");
             }
             else
             {
                 jet.setTarget(routePoints[currentDestination]);
             }
         }
     }
 }
Example #12
0
 private static void Postfix(ref HoverJet __instance)
 {
     EnableJetEffects.Invoke(__instance, new object[] { displayHoverEffectsBool });
 }
Example #13
0
    void Start()
    {
        jet = GetComponentInChildren<HoverJet>();
        arms = GetComponentInChildren<RobotArms>();
        agent = GetComponentInChildren<NavMeshAgent>();

        MeshRenderer gameObjectRenderer = GetComponent<MeshRenderer>();
        original = gameObjectRenderer.material;
        foreach (RobotInterest location in locations) {
            sightingFound(location);
            trackedTargets.Add(location);
        }
    }
Example #14
0
 private static void Postfix(HoverJet __instance)
 {
     HoverJetAim.AttachToBlock(__instance);
 }