Exemplo n.º 1
0
 public void Update(Scr_Player player)
 {
     foreach (Lootbag lb in player.connecter.lootHandler.lootList)
     {
         if (Vector3.Distance(player.transform.position, lb.transform.position) < 3)
         {
             player.connecter.lootHandler.collectLoot(lb.id);
         }
     }
 }
Exemplo n.º 2
0
 public void Update(Scr_Player player)
 {
     if (player.currentHealth < Trigger)
     {
         if (SkillsAndAbilities.instance.getAbilitySlot(Slot).cooldownCurrent <= 0)
         {
             player.useAbility(Slot);
         }
     }
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Awake()
 {
     vTransition = true;
     vScale      = 0f;
     vOpen       = true;
     vHole.transform.localScale      = new Vector3(vScale, vScale, 1f);
     vBlackN.transform.localPosition = new Vector3(0f, vScale * 5f + 500f, 0f);
     vBlackS.transform.localPosition = new Vector3(0f, -vScale * 5f - 500f, 0f);
     vBlackE.transform.localPosition = new Vector3(vScale * 5f + 500f, 0f, 0f);
     vBlackW.transform.localPosition = new Vector3(-vScale * 5f - 500f, 0f, 0f);
     vPlayerComp = vPlayer.GetComponent <Scr_Player> ();
 }
Exemplo n.º 4
0
    private void OnEndTurn()
    {
        if (ActivePlayer == PrefabPlayer1)
        {
            ActivePlayer = PrefabPlayer2;
        }
        else
        {
            ActivePlayer = PrefabPlayer1;
        }

        ActivePlayer.StartTurn();
    }
Exemplo n.º 5
0
        public static void Update(Scr_Player player)
        {
            if (Input.GetKeyDown(KeyCode.U))
            {
                active = !active;
            }

            if (active)
            {
                foreach (IUpdatable iup in updatables)
                {
                    iup.Update(player);
                }
            }
        }
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        PrefabPlayer1.EndTurnListener += OnEndTurn;
        PrefabPlayer2.EndTurnListener += OnEndTurn;

        if (Random.Range(0, 100) > 50)
        {
            ActivePlayer = PrefabPlayer1;
        }
        else
        {
            ActivePlayer = PrefabPlayer2;
        }

        ActivePlayer.StartTurn();
    }
Exemplo n.º 7
0
    void MakeThemAct(bool TF)
    {
        GameObject[] Those;
        Those = GameObject.FindGameObjectsWithTag("Player");
        foreach (GameObject That in Those)
        {
            vPlayerComp         = That.GetComponent <Scr_Player> ();
            vPlayerComp.vActing = TF;
        }

        /*Those = GameObject.FindGameObjectsWithTag ("Player");
         * foreach (GameObject That in Those) {
         *      vPlayerComp = That.GetComponent<Scr_Player> ();
         *      vPlayerComp.vActing = TF;
         * }*/
    }
Exemplo n.º 8
0
    // Use this for initialization
    void Start()
    {
        playerScr = playerRef.GetComponent <Scr_Player>();
        mapScr    = mapRef.GetComponent <Scr_MapData>();

        mapScr.Initialise();
        Vector2Int startpos = new Vector2Int(1, 1);

        startpos = mapScr.FindTilePosition((int)Scr_MapData.TileType.START);
        if (startpos.x == -1 || startpos.y == -1)
        {
            Debug.Log("No start position on map!");
            startpos = new Vector2Int(1, 1);
        }
        playerScr.Initialise(startpos, mapScr);
    }
Exemplo n.º 9
0
 public void Update(Scr_Player player)
 {
     if (Input.GetKeyDown(KeyCode.U) && Input.GetKeyDown(KeyCode.LeftControl))
     {
         player.connecter.harvestableHandler.harvestablesList.ForEach(h =>
         {
             h.gameObject.AddComponent <TextMesh>();
             h.GetComponent <TextMesh>().text = h.harvestableName;
             h.gameObject.AddComponent <MeshRenderer>();
         });
         player.connecter.npcHandler.npcList.ForEach(n =>
         {
             n.gameObject.AddComponent <TextMesh>();
             n.GetComponent <TextMesh>().text = n.npcName;
         });
     }
 }
Exemplo n.º 10
0
        public static void Start(Scr_Player player)
        {
            Player = player;
            Targets.TargetHarvest OakHarvest = new Targets.TargetHarvest("Oak", player);
            Targets.TargetHandler targets    = new Targets.TargetHandler(OakHarvest);
            UpdateHook.updatables.Add(targets);
            UpdateHook.updatables.Add(new QOL.Scanner());

            Commands.Add("@target", SetTargetName);
            Commands.Add("@maxdelay", SetMaxDelay);
            Commands.Add("@loot", ToggleLoot);
            Commands.Add("@trigger", AddTrigger);
            Commands.Add("@xp", AddGhostXP);
            Commands.Add("@addwp", AddWP);
            Commands.Add("@clearwp", ClearWP);
            Commands.Add("@startwp", StartWP);
            Commands.Add("@setmc", SetMc);
            Commands.Add("@scr", SetChaserRadius);
        }
Exemplo n.º 11
0
 public void Update(Scr_Player player)
 {
     if (target.DistanceTo() < (target is TargetWayPointChaserHarvest ? InteractChaserRadius : 4.3f))
     {
         player.autoMoving = false;
         if (InteractTickDelay < 1)
         {
             target.Interact();
             InteractTickDelay = InteractTickDelayMax;
         }
         if (InteractTickDelay > 0)
         {
             InteractTickDelay--;
         }
     }
     else
     {
         target.GoTo();
     }
 }
Exemplo n.º 12
0
        public static Scr_Npc NearestNpcTo(Scr_Player from, string to)
        {
            Scr_Npc nearest = null;

            foreach (Scr_Npc npc in from.connecter.npcHandler.npcList)
            {
                if (npc != null && npc.currentHealth > 0 && npc.npcName.Equals(to))
                {
                    if (nearest == null)
                    {
                        nearest = npc;
                    }
                    if (Vector3.Distance(from.transform.position, npc.transform.position) < Vector3.Distance(from.transform.position, nearest.transform.position))
                    {
                        nearest = npc;
                    }
                }
            }
            return(nearest);
        }
Exemplo n.º 13
0
        public static Scr_Harvestable NearestHarvestTo(Scr_Player from, string to)
        {
            Scr_Harvestable nearest = null;

            foreach (Scr_Harvestable harvest in from.connecter.harvestableHandler.harvestablesList)
            {
                if (harvest != null && harvest.currentHealth > 0 && (harvest.harvestableName.Equals(to) || to.Equals("all")))
                {
                    if (nearest == null)
                    {
                        nearest = harvest;
                    }
                    if (Vector3.Distance(from.transform.position, harvest.transform.position) < Vector3.Distance(from.transform.position, nearest.transform.position))
                    {
                        nearest = harvest;
                    }
                }
            }
            return(nearest);
        }
Exemplo n.º 14
0
 // Start is called before the first frame update
 void Start()
 {
     player = GetComponentInParent <Scr_Player>();
 }
Exemplo n.º 15
0
 public TargetWayPointChaserHarvest(string harvestname, Scr_Player player, Stack <Waypoint> stack) : base(harvestname, player)
 {
     Forward = new Stack <Waypoint>(stack.Reverse());
     current = Forward.Pop();
 }
Exemplo n.º 16
0
 void Start()
 {
     playerScr = player.GetComponent <Scr_Player>();
     newHeight = transform.position.y + altura;
 }
Exemplo n.º 17
0
 public TargetHarvest(string harvestName, Scr_Player player)
 {
     HarvestName = harvestName;
     Player      = player;
 }
Exemplo n.º 18
0
 public TargetEnemy(string enemyName, Scr_Player player)
 {
     EnemyName = enemyName;
     Player    = player;
 }