Inheritance: MonoBehaviour
Example #1
0
    public bool OnItemUse(ItemBase item)
    {
        bool isSuccess = false;

        if (placedItem)
        {
            if (GameManager.Get().playerRef.GetComponent <InventoryManager>().AddToInventory(placedItem))
            {
                placedItem = item;
                isSuccess  = true;
            }
        }
        else
        {
            placedItem = item;
            isSuccess  = true;
        }

        //Create the selected inventory prefab and delete the old one
        GameObject newItemPrefab = Instantiate(placedItem.itemModel, itemPosition);

        Destroy(itemPrefab);

        //Add InventoryPrefab component for spin effect
        newItemPrefab.AddComponent <InventoryPrefab>();
        newItemPrefab.GetComponent <Rigidbody>().isKinematic = true;

        itemPrefab = newItemPrefab;

        itemPrefab.GetComponent <Pickupable>().PickupEvent += Item_PickupEvent;

        UseItem?.Invoke();
        return(isSuccess);
    }
Example #2
0
 /// <summary>
 /// Depricated - Use ArrayHelper.DoForEach()
 /// </summary>
 /// <typeparam name="E"></typeparam>
 /// <param name="array"></param>
 /// <param name="function"></param>
 public static void ForAll <E>(E[] array, UseItem <E> function)
 {
     for (int x = 0; x < array.GetLength(0); x++)
     {
         function(array[x], x);
     }
 }
 void OnTreasureSellYes()
 {
     UseItem.SellItem(ItemManager.GetItemFromPlayer(selectedItemIndex), PlayerSession.GetProfile().itemsOwned[selectedItemIndex]);
     PlayerSession.GetProfile().RemoveItem(selectedItemIndex, PlayerSession.GetProfile().itemsOwned[selectedItemIndex]);
     UpdateFilteredList();
     UpdateList();
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     dialog = GameObject.Find("DialogManager").GetComponent <Dialog>();
     log    = GameObject.Find("LogManager").GetComponent <LogManager>();
     item   = GetComponent <UseItem> ();
     gitem  = girl.GetComponent <UseItem> ();
 }
Example #5
0
 public void SetItemData(ItemData itemData, int slotNum)         //アイテムスロットにアイテムデータをセット
 {
     pocketDatas[slotNum] = itemData;
     pocket_item_panel.GetChild(slotNum).GetChild(0).GetComponent <Image>().sprite = itemData.GetItemSprite();
     useItem = pocket_item_panel.GetChild(slotNum).GetComponent <UseItem>();
     useItem.SetItemSwitch(itemData);
 }
 void OnSkillBookUseYes()
 {
     UseItem.LearnActiveSkills(PlayerSession.GetProfile().characters[selectedCharacterIndex]
                               , ItemManager.GetItemFromPlayer(selectedItemIndex));
     OnItemUseYes();
     charList.gameObject.SetActive(false);
 }
Example #7
0
    // Update is called once per frame
    void Update()
    {
        if (fpsController.enabled)
        {
            EquipSystem equipSystem = GetComponent <EquipSystem>();
            if (CrossPlatformInputManager.GetButtonDown("Interact") && itemInView != null)
            {
                //Interacting with objects in the world
                itemInView.GetComponent <InteractableBase>().OnInteract();
            }
            else if (equipSystem && equipSystem.currentEquippedItem)
            {
                Pickupable pickupable = equipSystem.currentEquippedItem.GetComponent <Pickupable>();
                if (pickupable)
                {
                    //Using item that the player has equipped
                    if (CrossPlatformInputManager.GetButtonDown("Fire1"))
                    {
                        pickupable.OnUse();
                        UseItem?.Invoke(pickupable);
                    }
                    else if (CrossPlatformInputManager.GetButtonDown("DropItem"))
                    {
                        equipSystem.DropItem(pickupable.item);
                    }
                }
            }
        }

        if (CrossPlatformInputManager.GetButtonDown("Cancel"))
        {
            CancelAction?.Invoke();
        }
    }
Example #8
0
        internal static void Register()
        {
            FunctionHandling.ClearDelegates();
            uint CustomFuncTramps = 0x0047FA7D;

            CustomFuncs.About.Init(ref CustomFuncTramps);
            //CustomFuncs.SuperFly.Init(ref CustomFuncTramps);
            //CustomFuncs.AddToZ.Init(ref CustomFuncTramps);
            CustomFuncs.Commands.Init(ref CustomFuncTramps);
            //Wallclimb.Init(ref CustomFuncTramps);

            CustomFuncTramps = 0x0047FA99;

            //Console.ReadLine();
            NoClip1.Init(ref CustomFuncTramps);
            NoClip2.Init(ref CustomFuncTramps);
            NoClip3.Init(ref CustomFuncTramps);
            //NoClip4.Init(ref CustomFuncTramps);
            Loot.Init(ref CustomFuncTramps);
            UseItem.Init(ref CustomFuncTramps);
            UseSpell.Init(ref CustomFuncTramps);
            UseObject.Init(ref CustomFuncTramps);
            Interact.Init(ref CustomFuncTramps);
            Thanks.Init(ref CustomFuncTramps);
            AutoLoot.Init(ref CustomFuncTramps);
            SaveBars.Init(ref CustomFuncTramps);

            CustomFuncTramps = 0x0047FA61;

            LoadBars.Init(ref CustomFuncTramps);
            RemoveBars.Init(ref CustomFuncTramps);

            DirectX.FirstRun = 1;
        }
Example #9
0
 private void Start()
 {
     farmerMovement  = ClassManager.instance.farmerMovement;
     playerInventory = ClassManager.instance.playerInventory;
     foodManager     = ClassManager.instance.foodManager;
     useItem         = ClassManager.instance.useItem;
     shopManager     = ClassManager.instance.shopManager;
 }
Example #10
0
 public override void OnInteract()
 {
     if (placedItem && GameManager.Get().playerRef.GetComponent <InventoryManager>().AddToInventory(placedItem))
     {
         Item_PickupEvent();
         UseItem?.Invoke();
     }
 }
Example #11
0
        public void Load(string fileName)
        {
            var tdfFile = new TdfFile();

            tdfFile.Load(fileName);

            using (var reader = new BinaryReaderExt(new MemoryStream(tdfFile.ResTable)))
            {
                for (var row = 0; row < tdfFile.Header.Row; row++)
                {
                    //i_n_00026,i_n_00026,partsbox,열려있는 파츠 박스,n/a,n/a,n/a,하이퍼 파츠를 넣을 수 있게 열려있는 파츠 박스.,100,10,n/a,n/a,n/a,0,False,False,False,
                    var item = new UseItem();
                    item.Id       = reader.ReadUnicode();     //i_n_00019 <- ID
                    item.Category = reader.ReadUnicode();     //accelpointup <-- TYPE
                    item.Name     = reader.ReadUnicode();     //가속 향상제 <-- NAME
                    reader.ReadUnicode();                     // ig_n_B <-- GROUPID
                    reader.ReadUnicode();                     // n/a, i_n_00003 <-- NextID Name
                    reader.ReadUnicode();                     // n/a, 10 <-- Roundnum?
                    item.Description  = reader.ReadUnicode(); // 가속포인트를 50 초간 30 포인트 올려줌 <-- Description?
                    item.BuyValue     = reader.ReadUnicode(); // 100 <-- Cost?
                    item.SellValue    = reader.ReadUnicode(); // 10 <-- Sell?
                    item.MaxStack     = reader.ReadUnicode(); // 30
                    item.StatModifier = reader.ReadUnicode(); // 50
                    item.CooldownTime = reader.ReadUnicode(); // n/a, 0
                    item.Duration     = reader.ReadUnicode(); // 0, /na
                    item.PartsShop    = reader.ReadUnicode();
                    item.Sendable     = reader.ReadUnicode();
                    item.Auctionable  = reader.ReadUnicode();
                    UseItemList.Add(item);

                    /*
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * UseItemTypeStrToVar(&src, &v50.UseInfo.Type);
                     * XiTDFRead::GetString(&v53, v50.Name, 56);
                     * XiTDFRead::GetString(&v53, v50.GroupID, 56);
                     * XiTDFRead::GetString(&v53, v50.NextID.m_Name, 56);
                     * v50.RoundNum = 0;
                     * XiTDFRead::GetULong(&v53, &v50.RoundNum);
                     * if ( !v50.RoundNum )
                     * v50.RoundNum = 99;
                     * XiTDFRead::GetULong(&v53, &v50.Cost);
                     * XiTDFRead::GetULong(&v53, &v50.Sell);
                     * XiTDFRead::GetULong(&v53, &v50.UseInfo.Value);
                     * XiTDFRead::GetULong(&v53, &v50.UseInfo.Time);
                     * XiTDFRead::GetULong(&v53, &v50.Time);
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * if ( !wcscmp(&src, L"True") )
                     * v50.Shop = 1;
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * if ( !wcscmp(&src, L"True") )
                     * v50.Trade = 1;
                     * XiTDFRead::GetString(&v53, &src, 56);
                     * if ( !wcscmp(&src, L"True") )
                     * v50.Auction = 1;
                     */
                }
            }
        }
Example #12
0
 public ItemAction(BattleActor user, BattleActor[] targs, UseItem item) : base(user, targs)
 {
     myItem = item;
     item.quantity--;
     if (item.quantity == 0)
     {
         GameDatabase.Instance.Inventory[GameDatabase.Instance.Inventory.IndexOf(item)] = GameDatabase.Instance.ItemDatabase[0];
     }
 }
Example #13
0
 void Start()
 {
     inv     = GameObject.Find("Inventory").GetComponent <Inventory>();
     useItem = GameObject.Find("Inventory").GetComponent <UseItem>();
     tooltip = inv.GetComponent <Tooltip>();
     this.transform.SetParent(inv.slots[slot].transform);
     this.transform.position = inv.slots[slot].transform.position;
     iditem = item.ID;
 }
Example #14
0
    // Update is called once per frame
    void Update()
    {
        // クリックされたら
        if (Input.GetMouseButtonDown(0))
        {
            // 画像の上にマウスカーソルがあれば
            if (parentColliders.OverlapPoint(Input.mousePosition))
            {
                // つかんでいるフラグをオンにする
                catchFlag = true;
                // 移動している画像をスキルスロットに教える
                SetSkillIcon.moveImage = this.gameObject;

                // そのアイコンがアイテムだった時の処理
                UseItem useItem = gameObject.GetComponent <UseItem>();
                if (useItem)
                {
                    // アイテムを使うスクリプトをオフにする
                    useItem.enabled = false;
                    // アイテムのフラグをオフにする
                    SetSkillIcon.skillorItemFlag[useItem.skillPaletteNumber] = SetSkillIcon.PALETTE_CODE.NONE;
                    // クールタイムのオブジェクトを非アクティブにする
                    SetSkillIcon.itemCoolTimeObjects[useItem.skillPaletteNumber].SetActive(false);
                }
            }
        }
        // 画像をつかんでいるフラグが立っていたら
        if (catchFlag)
        {
            // 画像の座標をマウスに合わせる
            this.transform.position = Input.mousePosition;

            // ボタンが離されたら
            if (Input.GetMouseButtonUp(0))
            {
                // スキルスロットのコライダーと重なっていたら
                foreach (var collider in SetSkillIcon.col)
                {
                    // コライダーと重なっていたら
                    if (collider.OverlapPoint(Input.mousePosition))
                    {
                        // つかんでいるフラグをオフにする
                        catchFlag = false;
                        // 座標をコライダーの真ん中に合わせる
                        this.transform.position = parentColliders.bounds.center;
                    }
                }
                // コライダーと重なっていなければ
                if (catchFlag)
                {
                    // 削除する
                    GameObject.Destroy(this.gameObject);
                }
            }
        }
    }
Example #15
0
 /// <summary>
 /// Depricated - Use ArrayHelper.DoForEach()
 /// </summary>
 /// <typeparam name="E"></typeparam>
 /// <param name="array"></param>
 /// <param name="function"></param>
 public static void ForAll <E>(E[,] array, UseItem <E> function)
 {
     for (int x = 0; x < array.GetLength(0); x++)
     {
         for (int y = 0; y < array.GetLength(1); y++)
         {
             function(array[x, y], x, y);
         }
     }
 }
Example #16
0
    public void ItemUse(int ItemID)
    {
        UseItem Item = ItemManager.returnUseItem(ItemID);

        if (InventoryManager.ReturnPieces(ItemID) > 0)
        {
            Item.ItemUse(Name.Value);
            InventoryManager.ItemReduce(ItemID);
        }
    }
Example #17
0
    public static void SavePlayer(UseItem u, FoundRecipes cm)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/player.inv";
        FileStream      stream    = new FileStream(path, FileMode.Create);
        PlayerData      pd        = new PlayerData(u, cm);

        formatter.Serialize(stream, pd);
        stream.Close();
    }
Example #18
0
        //public bool TestUseItem()
        //{
        //    var p = new LuaGameObject(9);
        //    state["player"] = p;
        //    var go = new LuaGameObject(_scriptVars["EVENTRANGE0"]);
        //    state["Target"] = go;
        //    var func = state.DoString($"return {Dict}:IsEventItemUsable(player, Target, {_scriptVars["ITEM1"]})");

        //    return func != null && (bool)func[0];
        //}


        public List <UseItem> GetItemUseable(int seq)
        {
            if (!ItemUseable)
            {
                return(null);
            }
            var p = new LuaGameObject(seq);

            state["player"] = p;

            var items = _scriptVars.Where(i => i.Key.StartsWith("ITEM")).ToList();
            var ret   = new List <UseItem>();

            foreach (var k in _scriptVars)
            {
                if (k.Key.StartsWith("EVENTRANGE") ||
                    k.Key.StartsWith("EOBJECT") ||
                    k.Key.StartsWith("ENEMY")
                    )
                {
                    var go = new LuaGameObject(k.Value);
                    state["gameObject"] = go;
                    foreach (var item in items)
                    {
                        var func = state.DoString($"return {Dict}:IsEventItemUsable(player, gameObject, {item.Value})");
                        if (func == null)
                        {
                            //log.Warn("Failed to do IsEventItemUsable");
                        }
                        if (func[0] is bool && ((bool)func[0]))
                        {
                            var toadd = new UseItem
                            {
                                ObjectId = k.Value,
                                ItemId   = item.Value,
                            };
                            if (go.LastField != null)
                            {
                                toadd.GameObjectState = (byte)go.LastField.Item1;
                            }
                            if (p.LastField != null)
                            {
                                toadd.Field    = (byte)p.LastField.Item1;
                                toadd.FieldPos = (byte)p.LastField.Item2;

                                p.LastField = null;
                            }
                            ret.Add(toadd);
                        }
                    }
                }
            }
            return(ret);
        }
Example #19
0
        //**//

        //**ИНТЕРАКТИВНЫЕ ЭЛЕМЕНТЫ ФОРМЫ**//

        public static void UseBtn() // Кнопка "Использовать"
        {
            List <Parameter> parameters = user.actor.chosenItem.GetParamsList();

            if (user.actor.chosenItem.GetType().Equals("Food"))
            {
                UseItem.UseFood(parameters);

                InitializeForm();
            }
        }
Example #20
0
        //使用物品
        public void SEND_CG_REQ_USE_ITEM(uint id, uint nCount = 1)
        {
            UseItem ip = new UseItem();

            ip.Id  = id;
            ip.Num = nCount;
            MemoryStream ms = GetStream();

            UseItem.Serialize(ms, ip);
            Send(MsgId.ID_UseItem, ms);
            //Debug.Log("id:"+id+",nCount:"+nCount);
        }
Example #21
0
        public void Receive(UseItem useItemAction)
        {
            UseItemEventArgs useItemEventArgs = new UseItemEventArgs(this, useItemAction);

            OnUseItem?.Invoke(this, useItemEventArgs);

            // TODO

            ItemUsedEventArgs itemUsedEventArgs = new ItemUsedEventArgs(this, useItemAction);

            OnItemUsed?.Invoke(this, itemUsedEventArgs);
        }
Example #22
0
        public override void OnResponseReceived(dynamic data)
        {
            KCDatabase db = KCDatabase.Instance;

            db.UseItems.Clear();
            foreach (var elem in data)
            {
                var item = new UseItem();
                item.LoadFromResponse(APIName, elem);
                db.UseItems.Add(item);
            }

            base.OnResponseReceived((object)data);
        }
Example #23
0
        public override void OnResponseReceived(dynamic data)
        {
            KCDatabase db = KCDatabase.Instance;

            // Admiral - 各所でバグるので封印
            //db.Admiral.LoadFromResponse( APIName, data.api_basic );


            // Equipments
            db.Equipments.Clear();
            foreach (var elem in data.api_slot_item)
            {
                var eq = new EquipmentData();
                eq.LoadFromResponse(APIName, elem);
                db.Equipments.Add(eq);
            }


            // Arsenal
            foreach (var ars in data.api_kdock)
            {
                int id = (int)ars.api_id;

                if (!db.Arsenals.ContainsKey(id))
                {
                    var a = new ArsenalData();
                    a.LoadFromResponse(APIName, ars);
                    db.Arsenals.Add(a);
                }
                else
                {
                    db.Arsenals[id].LoadFromResponse(APIName, ars);
                }
            }


            // UseItem
            db.UseItems.Clear();
            if (data.api_useitem())
            {
                foreach (var elem in data.api_useitem)
                {
                    var item = new UseItem();
                    item.LoadFromResponse(APIName, elem);
                    db.UseItems.Add(item);
                }
            }

            base.OnResponseReceived((object)data);
        }
Example #24
0
        public void ConsumeAndItem()
        {
            var caster = new Mock<ISceneActor>();
            var target = new Mock<ISceneActor>();

            HealthPotion hpPotion = new HealthPotion() { Value = 50.0f};
            UseItem useItem = new UseItem() { Item = hpPotion };
            useItem.Target = target.Object;
            useItem.Caster= caster.Object;

            target.Setup(x => x.GetDerivativeStatNamed("Health")).Returns(new DerivativeStat(new Stat("Strenght", 10), 15));
            useItem.Resolve();
            var targetHP = target.Object.GetDerivativeStatNamed("Health");
            Assert.AreEqual(targetHP.CurrentValue, 200.0f);
        }
Example #25
0
 private void setClasses()
 {
     inputManager           = gameObject.GetComponent <InputManager>();
     ageManager             = gameObject.GetComponent <AgeManager>();
     farmerMovement         = farmerObject.GetComponent <FarmerMovement>();
     playerInventory        = farmerObject.GetComponent <PlayerInventory>();
     spriteManager          = gameObject.GetComponent <SpriteManager>();
     prefabManager          = gameObject.GetComponent <PrefabManager>();
     dropItem               = farmerObject.GetComponent <DropItem>();
     selectedTileController = farmerObject.GetComponent <SelectedTileController>();
     useItem           = farmerObject.GetComponent <UseItem>();
     groundTileManager = gameObject.GetComponent <GroundTileManager>();
     plantManager      = gameObject.GetComponent <PlantManager>();
     foodManager       = gameObject.GetComponent <FoodManager>();
     shopManager       = gameObject.GetComponent <ShopManager>();
     farmerAnimator    = farmerObject.GetComponent <Animator>();
     sfxPlayer         = soundObject.GetComponent <SfxPlayer>();
 }
    public void onClickOk()
    {
        if (dialogContext == DialogContext.STORE_LOAD_FAILURE)
        {
            HideDialogScreen();
        }

        if (dialogContext == DialogContext.STORE_LOADING)
        {
            HideDialogScreen();
        }

        if (dialogContext == DialogContext.PURCHASE_SUCCESS)
        {
            UseItem.Use(StoreActions.INSTANCE.product);
            HideDialogScreen();
            StoreActions.INSTANCE.resetCheckoutScreen();
            MenuNavigation.INSTANCE.selectStoreIcon();
        }
    }
Example #27
0
        public static void Battle(Pokemon wildPokemon, Trainer trainer)
        {
            Console.WriteLine("1. Fight\n2. Go to Bag");
            Console.WriteLine("->");
            choice = Convert.ToInt32(Console.ReadLine());

            switch (choice)
            {
            case 1:
                Fight.Battle(wildPokemon, trainer);
                break;

            case 2:
                UseItem.GoToBag(wildPokemon, trainer);
                break;

            default:
                Battle(wildPokemon, trainer);
                break;
            }
        }
        internal static void Unregister(string parFuncName)
        {
            if (parFuncName != "GetPastDrawResult")
            {
                return;
            }
            uint CustomFuncTramps = 0x0047FA7D;

            CustomFuncs.About.Remove(ref CustomFuncTramps);
            //CustomFuncs.SuperFly.Remove(ref CustomFuncTramps);
            //CustomFuncs.AddToZ.Remove(ref CustomFuncTramps);
            CustomFuncs.Commands.Remove(ref CustomFuncTramps);
            //Wallclimb.Remove(ref CustomFuncTramps);

            CustomFuncTramps = 0x0047FA99;

            NoClip1.Remove(ref CustomFuncTramps);
            NoClip2.Remove(ref CustomFuncTramps);
            NoClip3.Remove(ref CustomFuncTramps);
            //NoClip4.Remove(ref CustomFuncTramps);
            Loot.Remove(ref CustomFuncTramps);
            UseItem.Remove(ref CustomFuncTramps);
            UseSpell.Remove(ref CustomFuncTramps);
            UseObject.Remove(ref CustomFuncTramps);
            Interact.Remove(ref CustomFuncTramps);
            Thanks.Remove(ref CustomFuncTramps);
            AutoLoot.Remove(ref CustomFuncTramps);
            SaveBars.Remove(ref CustomFuncTramps);

            CustomFuncTramps = 0x0047FA61;

            LoadBars.Remove(ref CustomFuncTramps);
            RemoveBars.Remove(ref CustomFuncTramps);


            //Memory.GetHack("Superfly").Remove();
            //Memory.GetHack("Antijump").Remove();
            //SuperFly.enabled = false;
        }
Example #29
0
        protected override bool ProcessKeyPressed(AsciiKey key)
        {
            switch (key.Key)
            {
            case Keys.U:
                UseItem?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.E:
                EquipItem?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.Z:
                EquipHoldableItemLeft?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.X:
                EquipHoldableItemRight?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.T:
                TakeOffItem?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.D:
                DropItem?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.A:
                DropStack?.Invoke(this, EventArgs.Empty);
                return(true);

            case Keys.C:
                CheckScroll?.Invoke(this, EventArgs.Empty);
                return(true);
            }
            return(base.ProcessKeyPressed(key));
        }
Example #30
0
    public PlayerData(UseItem u, FoundRecipes cm)
    {
        // int currentSpot = 0;

        for (int i = 0; i < 50; i++)
        {
            inventoryItems[i] = -1;
        }
        for (int i = 0; i < 100; i++)
        {
            unlockedRecipes[i] = -1;
        }
        foreach (KeyValuePair <int, Item> pair in u.inventoryItems)
        {
            inventoryItems[pair.Key]      = pair.Value.id;
            inventoryItemCounts[pair.Key] = pair.Value.stats["Current Count"];
        }
        // currentSpot = 0;
        foreach (KeyValuePair <int, Recipe> pair in cm.GetRecipes())
        {
            unlockedRecipes[pair.Key] = pair.Value.id;
        }
    }
Example #31
0
        public void ConsumeAndItem()
        {
            var caster = new Mock <ISceneActor>();
            var target = new Mock <ISceneActor>();

            HealthPotion hpPotion = new HealthPotion()
            {
                Value = 50.0f
            };
            UseItem useItem = new UseItem()
            {
                Item = hpPotion
            };

            useItem.Target = target.Object;
            useItem.Caster = caster.Object;

            target.Setup(x => x.GetDerivativeStatNamed("Health")).Returns(new DerivativeStat(new Stat("Strenght", 10), 15));
            useItem.Resolve();
            var targetHP = target.Object.GetDerivativeStatNamed("Health");

            Assert.AreEqual(targetHP.CurrentValue, 200.0f);
        }
Example #32
0
    void Start()
    {
        myanimator = GetComponent<Animator> ();	//アニメーションの情報を取得する
        controller = GetComponent<CharacterController>();
        useItem = GetComponent<UseItem>();
        if(target == null){
            target = GameObject.Find("target").transform;
        }

        AttackTime = 0.0f;
    }