public static IKitchenArea GetKitchenArea(ItemType dishType)
        {
            if (dishType.Equals(ItemType.DESERT))
            {
                return(DesertArea.GetInstance());
            }
            else if (dishType.Equals(ItemType.DRINK))
            {
                return(DrinkArea.GetInstance());
            }
            else if (dishType.Equals(ItemType.FRIES))
            {
                return(FriesArea.GetInstance());
            }
            else if (dishType.Equals(ItemType.GRILL))
            {
                return(GrillArea.GetInstance());
            }
            else if (dishType.Equals(ItemType.SALAD))
            {
                return(SaladArea.GetInstance());
            }

            throw new NotImplementedException($"We do not have an area to prepare this kind of food.");
        }
Example #2
0
 public static QualityChecker GetChecker(ItemType itemType)
 {
     if (itemType.Equals(ItemType.Legendary))
     {
         return(new LegengaryItemQualityChecker());
     }
     if (itemType.Equals(ItemType.NonExpiry))
     {
         return(new NonExpiryItemQualityChecker());
     }
     return(new QualityChecker());
 }
Example #3
0
 public bool isEquip()
 {
     if (itemType.Equals(ItemType.Weapon0) || itemType.Equals(ItemType.Hat1) || itemType.Equals(ItemType.Shield2) || itemType.Equals(ItemType.Armor3))
     {
         return(true);
     }
     return(false);
 }
Example #4
0
        // public bool HasLogo{ get; set; }
        // public int ItemID { get; set; }
        // //public string ItemType { get; set; }
        //// public int NumColors { get; set; }
        // public int NumItems { get; set;  }
        // public decimal Price { get; set; }


        private void Calc()
        {
            decimal basePrice = ItemType.Equals("USB")  ? USB : ItemType.Equals("Mug") ? MUG : PEN;

            if (ItemType.Equals("USB"))
            {
                basePrice = USB;
            }
            else if (ItemType.Equals("Mug"))
            {
                basePrice = MUG;
            }
            else
            {
                basePrice = PEN;
            }
            //check whth the hasLogo to see if we add something with colors
            if (hasLogo == true)
            {
                basePrice += LOGO_PRICE;

                basePrice += PRICE_PER_COLOR * NumColors;
                if (!Text.Trim().Equals(""))
                {
                    basePrice += PRICE_FOR_TEXT;
                }
            }
            //add price for the text
            Price = basePrice * NumItems;
        }
Example #5
0
 public override bool Equals(ColumnType other)
 {
     if (other == this)
     {
         return(true);
     }
     if (!(other is VectorType tmp))
     {
         return(false);
     }
     if (!ItemType.Equals(tmp.ItemType))
     {
         return(false);
     }
     if (Size != tmp.Size)
     {
         return(false);
     }
     if (Dimensions.Length != tmp.Dimensions.Length)
     {
         return(false);
     }
     for (int i = 0; i < Dimensions.Length; i++)
     {
         if (Dimensions[i] != tmp.Dimensions[i])
         {
             return(false);
         }
     }
     return(true);
 }
    /// <summary>
    /// Each call spawns a new item. Called on Start().
    /// </summary>
    private void SpawnLoop()
    {
        // Randomize spawn size and location
        float posX  = Random.Range(_spawnBoundaryLeft.position.x + (_maxSpawnSize + 0.01f), _spawnBoundaryRight.position.x - (_maxSpawnSize + 0.01f));
        float scale = Random.Range(_minSpawnSize, _maxSpawnSize);

        // Spawn and scale item
        GameObject item = Instantiate(_spawnItemPrefab, new Vector3(posX, _spawnBoundaryLeft.position.y + 1, _spawnBoundaryLeft.position.z), Quaternion.identity);

        item.transform.localScale = new Vector3(scale, scale, scale);

        // Initialize item (determine punishment/reward class)
        // Determine item class
        ItemType type = SampleItemType();
        Material mat  = DetermineItemMaterial(type);

        item.GetComponent <ItemDrop>().Init(type, mat);
        item.name = type.ToString();
        item.tag  = type.ToString();
        // Set physics layer
        if (type.Equals(ItemType.Reward))
        {
            item.layer = 8;
        }
        else
        {
            item.layer = 9;
        }
    }
Example #7
0
 protected void ProjectDropDownList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ItemType.Equals(ProjectItemType.Task))
     {
         fillModuleDropDownList();
     }
 }
        /// <summary>
        /// Returns true if ChannelDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of ChannelDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ChannelDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Uid == input.Uid ||
                     (Uid != null &&
                      Uid.Equals(input.Uid))
                     ) &&
                 (
                     Id == input.Id ||
                     (Id != null &&
                      Id.Equals(input.Id))
                 ) &&
                 (
                     ChannelTypeUID == input.ChannelTypeUID ||
                     (ChannelTypeUID != null &&
                      ChannelTypeUID.Equals(input.ChannelTypeUID))
                 ) &&
                 (
                     ItemType == input.ItemType ||
                     (ItemType != null &&
                      ItemType.Equals(input.ItemType))
                 ) &&
                 (
                     Kind == input.Kind ||
                     (Kind != null &&
                      Kind.Equals(input.Kind))
                 ) &&
                 (
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                 ) &&
                 (
                     Description == input.Description ||
                     (Description != null &&
                      Description.Equals(input.Description))
                 ) &&
                 (
                     DefaultTags == input.DefaultTags ||
                     DefaultTags != null &&
                     DefaultTags.SequenceEqual(input.DefaultTags)
                 ) &&
                 (
                     Properties == input.Properties ||
                     Properties != null &&
                     Properties.SequenceEqual(input.Properties)
                 ) &&
                 (
                     Configuration == input.Configuration ||
                     Configuration != null &&
                     Configuration.SequenceEqual(input.Configuration)
                 ));
        }
Example #9
0
 public override bool Equals(object obj)
 {
     if (!(obj is Item))
     {
         return(false);
     }
     return(itemType.Equals((obj as Item).itemType));
 }
Example #10
0
    public void SetVisibility()
    {
        Debug.Log("Looking for tile: " + myTile.Position);
        foreach (Generator g in Level.Instance.Generators)
        {
            foreach (Tile t in g.AffectedTiles)
            {
                if (t.Equals(myTile))
                {
                    Debug.Log("TILE FOUNDED");
                    if (g.IsOn)
                    {
                        if (ItemType.Equals(TimelineObject.Present))
                        {
                            SetInvisibleLayer();
                            Debug.Log("PRESENT: INVISIBLE LAYER COS ISON");
                        }
                        else
                        {
                            SetVisibleLayer();
                            Debug.Log("PAST: VISIBLE LAYER COS ISON");
                        }


                        return;
                    }
                    else
                    {
                        if (ItemType.Equals(TimelineObject.Present))
                        {
                            SetVisibleLayer();
                            Debug.Log("PRESENT: VISIBLE LAYER COS NOT ON");
                        }
                        else
                        {
                            SetInvisibleLayer();
                            Debug.Log("PAST: INVISIBLE LAYER COS NOT ON");
                        }
                        return;
                    }
                }
            }
        }

        if (ItemType.Equals(TimelineObject.Present))
        {
            SetVisibleLayer();
            Debug.Log("PRESENT: VISIBLE LAYER COS NO GEN");
        }
        else
        {
            SetInvisibleLayer();
            Debug.Log("PAST: INVISIBLE LAYER COS NO GEN");
        }
    }
Example #11
0
    //void OnCollisionEnter2D(Collision2D collision)
    //{
    //    if (collision.gameObject.tag.Equals("Player"))
    //    {
    //        if (item.Equals(ItemType.HEAL))
    //        {
    //            if (collision.gameObject.GetComponent<Player>().getMyData().currentHealth == collision.gameObject.GetComponent<Player>().maxHP)
    //            {
    //                Physics2D.IgnoreCollision(GetComponent<Collider2D>(), collision.collider);
    //                return;
    //            }
    //            collision.gameObject.GetComponent<Player>().healPlayer(ammountToHeal);
    //            Destroy(gameObject);
    //        }
    //        if (item.Equals(ItemType.ATT_UP))
    //        {
    //            if (collision.gameObject.GetComponent<PlayerStats>().getAttStat() > collision.gameObject.GetComponent<PlayerStats>().baseAtt)
    //            {
    //                Physics2D.IgnoreCollision(GetComponent<Collider2D>(), collision.collider);
    //                return;
    //            }
    //            collision.gameObject.GetComponent<PlayerStats>().setAttStat(attUp);
    //            Destroy(gameObject);
    //        }
    //        if (item.Equals(ItemType.DEF_UP))
    //        {
    //            if (collision.gameObject.GetComponent<PlayerStats>().getDefStat() > collision.gameObject.GetComponent<PlayerStats>().baseDef)
    //            {
    //                Physics2D.IgnoreCollision(GetComponent<Collider2D>(), collision.collider);
    //                return;
    //            }
    //            collision.gameObject.GetComponent<PlayerStats>().setDefStat(defUp);
    //            Destroy(gameObject);
    //        }
    //        if (item.Equals(ItemType.MYSTERY))
    //        {

    //            enimiesToDestroy = GameObject.FindGameObjectsWithTag("Enemy");
    //            foreach (GameObject i in enimiesToDestroy)
    //            {
    //                Destroy(i);
    //            }
    //            Destroy(gameObject);
    //        }

    //    }
    //    else if (collision.gameObject.tag.Equals("Enemy"))
    //    {
    //        Physics2D.IgnoreCollision(GetComponent<Collider2D>(), collision.collider);
    //        return;
    //    }
    //}

    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.transform.root.tag.Equals("Player"))
        {
            if (item.Equals(ItemType.HEAL))
            {
                if (collision.gameObject.transform.root.GetComponent <Player>().getMyData().currentHealth == collision.gameObject.transform.root.GetComponent <Player>().maxHP)
                {
                    return;
                }
                collision.gameObject.transform.root.GetComponent <Player>().healPlayer(ammountToHeal);
                Destroy(gameObject);
            }
            if (item.Equals(ItemType.ATT_UP))
            {
                if (collision.gameObject.transform.root.GetComponent <PlayerStats>().getAttStat() > collision.gameObject.transform.root.GetComponent <PlayerStats>().baseAtt)
                {
                    return;
                }
                collision.gameObject.transform.root.GetComponent <PlayerStats>().setAttStat(attUp);
                Destroy(gameObject);
            }
            if (item.Equals(ItemType.DEF_UP))
            {
                if (collision.gameObject.transform.root.GetComponent <PlayerStats>().getDefStat() > collision.gameObject.transform.root.GetComponent <PlayerStats>().baseDef)
                {
                    return;
                }
                collision.gameObject.transform.root.GetComponent <PlayerStats>().setDefStat(defUp);
                Destroy(gameObject);
            }
            if (item.Equals(ItemType.MYSTERY))
            {
                enimiesToDestroy = GameObject.FindGameObjectsWithTag("Enemy");
                foreach (GameObject i in enimiesToDestroy)
                {
                    Destroy(i);
                }
                Destroy(gameObject);
            }
        }
    }
    public void CreateLaserChain()
    {
        Debug.Log("Creating laser chain");
        GameObject laserObj;

        //natocim
        if (laserDirection == LaserGeneratorDirection.Down || laserDirection == LaserGeneratorDirection.Up)
        {
            laserObj = Instantiate(laserPrefabUpDown);
            //laserObj.transform.Rotate(new Vector3(0, -90, -90));
        }
        else
        {
            laserObj = Instantiate(laserPrefab);
        }

        Laser l = laserObj.GetComponent <Laser>();

        Debug.Log("Laser generator position: " + transform.position + " vector: " + DirVector);
        Tile[] t = Level.GetTile(transform.position + DirVector);
        Tile   tile;

        if (l.render == null)
        {
            l.render = l.GetComponent <MeshRenderer>();
        }

        if (ItemType.Equals(TimelineObject.Present))
        {
            tile              = t[0];
            l.ItemType        = TimelineObject.Present;
            l.render.material = l.material;
        }
        else
        {
            tile              = t[1];
            l.ItemType        = TimelineObject.Past;
            l.render.material = l.pastMaterial;
            l.ChangeState();
        }
        Debug.Log("Tile: " + tile.Position.x + " " + tile.Position.y);

        //nastavim  pozici
        laserObj.transform.parent   = this.transform;
        laserObj.transform.position = new Vector3(tile.Position.x, tile.Height, tile.Position.y);

        firstLaserReference = l;
        l.source            = this;
        tile.LaserOnTile    = l;
        l.myTile            = tile;
        l.SetVisibility();
        l.CreateLaser(tile);
    }
Example #13
0
    /// <summary>
    /// Funktion, wird von Unity jeden Frame nach dem Auufruf aller Update Methoden aufgerufen.
    /// </summary>
    private void LateUpdate()
    {
        EventManager.UpdateTimerDisplay();
        if (_timer != null)
        {
            if (GlobalDataHandler.GetGameModus())
            {
                if (!_timer.ElapsedCountdownTimer() || _activeItemName.Equals(ItemType.None))
                {
                    return;
                }
                if (_timer.ElapsedCountdownTimer())
                {
                    _timer = null;
                }
            }
            else
            {
                _timer = null;
            }
        }
        else
        {
            _previousTimerVal = TimerInitVal;
        }

        // Wird ausgeführt wenn der Timer des aktuellen Items ausgelaufen ist
        // Dabei werden alle Änderungen die durch die Items ausgelöst wurden zurückgeführt
        if ((_activeItemName.Equals(ItemType.Faster) || _activeItemName.Equals(ItemType.Slower)) && GlobalDataHandler.GetRunMode() != RunMode.Idle)
        {
            GlobalDataHandler.SetRunMode(RunMode.Normal);
        }
        else if (GlobalDataHandler.IsMultiplierActive())
        {
            GlobalDataHandler.SetMultiplierActive(!GlobalDataHandler.IsMultiplierActive());
        }

        _activeItemName = ItemType.None;
    }
Example #14
0
 public void SetupData(string id, string type, string name, int price)
 {
     this.id = id;
     if (type.Equals("Terrain", StringComparison.OrdinalIgnoreCase))
     {
         this.type = ItemType.Terrain;
     }
     if (type.Equals("Atmosphere", StringComparison.OrdinalIgnoreCase))
     {
         this.type = ItemType.Machine;
     }
     if (type.Equals("Liquid", StringComparison.OrdinalIgnoreCase))
     {
         this.type = ItemType.Machine;
     }
     if (type.Equals("Food", StringComparison.OrdinalIgnoreCase))
     {
         this.type = ItemType.Food;
     }
     this.itemName = name;
     this.price    = price;
 }
Example #15
0
        public bool Equals(Item item)
        {
            if (item is null)
            {
                return(false);
            }

            if (ReferenceEquals(this, item))
            {
                return(true);
            }

            return(ItemType.Equals(item.ItemType) && Level.Equals(item.Level) && Tag.Equals(item.Tag) && Age.Equals(item.Age));
        }
    /// <summary>
    /// Update is used to draw the rays.
    /// </summary>
    //private void Update()
    //{
    //    foreach(var ray in _visionRays)
    //    {
    //        Debug.DrawLine(ray.origin, ray.origin + transform.up * _visionRayLength, Color.red);
    //    }
    //}
    #endregion

    #region Public Functions
    /// <summary>
    /// Rewards the agent
    /// </summary>
    /// <param name="rewardSignal">Reward to signal</param>
    public void EvaluateReward(ItemType itemType)
    {
        if (itemType.Equals(ItemType.Reward))
        {
            reward       += 1;
            _rewardScore += 1;
        }
        else
        {
            reward           -= 1;
            _punishmentScore -= 1;
        }
        _scoreText.text = "<color=blue>R +" + _rewardScore + "</color>: <color=red>P " + _punishmentScore + "</color>: S: " + (_rewardScore + _punishmentScore);
    }
Example #17
0
    protected override void EnterPattern(GameObject gameObject, AnimalData animalData)
    {
        Vector3Int destination;

        if (Destination.Equals(ItemType.Terrain))
        {
            destination = base.TileDataController.FindClosestLiquidSource(animalData.animal.PopulationInfo, gameObject);
        }
        else
        {
            int locationIndex = animalData.animal.PopulationInfo.random.Next(0, animalData.animal.PopulationInfo.AccessibleLocations.Count);
            destination = animalData.animal.PopulationInfo.AccessibleLocations[locationIndex];
        }
        AnimalPathfinding.PathRequestManager.RequestPath(base.TileDataController.WorldToCell(gameObject.transform.position), destination, animalData.animal.MovementController.AssignPath, animalData.animal.PopulationInfo.Grid);
    }
Example #18
0
    private void Start()
    {
        if (itemType.Equals(ItemType.Stock))
        {
            thisSR        = GetComponent <SpriteRenderer>();
            thisSR.sprite = sprite;
        }


        interactable = GetComponent <Interactable>();

        if (canInteract == true)
        {
            interactable.enabled = true;
        }
        else
        {
            interactable.enabled = false;
        }
    }
Example #19
0
    // Use this for initialization
    void Start()
    {
        if (type.Equals(ItemType.Random))
        {
            switch ((int)Random.Range(0, 3))
            {
            case 0:
                type = ItemType.Sword;
                break;

            case 1:
                type = ItemType.BowAndArrow;
                break;

            case 2:
                type = ItemType.Wand;
                break;
            }
        }
    }
Example #20
0
 protected override void CheckOnStart(Tile[] t)
 {
     if (ItemType.Equals(TimelineObject.Present))
     {
         t[0].ObjectOnTile = this;
         t[0].IsOccupied   = true;
         //t[0].IsAccessable = false;
         SetVisibleLayer();
         //Debug.Log("PTSObject to tile " + t[0].Position + " " + transform.position.y);
         t[0].Height = transform.position.y + 1;
     }
     else if (ItemType.Equals(TimelineObject.Past))
     {
         t[1].ObjectOnTile = this;
         t[1].IsOccupied   = true;
         //t[1].IsAccessable = false;
         SetInvisibleLayer();
         Debug.Log("PTSObject to tile " + t[1].Position + " " + transform.position.y);
         t[1].Height = transform.position.y + 1;
     }
 }
Example #21
0
        public void WriteTo(IPacketWriter packet)
        {
            packet.Append(ItemType);

            if (!ItemType.Equals("b"))
            {
                packet.Append(SpriteId);
                packet.Append(Name);
                packet.Append(Amount);
                packet.Append(IsLimited);

                if (IsLimited)
                {
                    packet.Append(LimitedEditionStack);
                    packet.Append(LimitedEditionSells);
                }
            }
            else
            {
                packet.Append(Name);
            }
        }
Example #22
0
    protected override void CheckOnStart(Tile[] t)
    {
        if (ItemType.Equals(TimelineObject.Present))
        {
            t[0].ActivatorOnTile = this;
            t[0].IsOccupied      = OccupyTile;
            SetVisibleLayer();
        }
        else if (ItemType.Equals(TimelineObject.Past))
        {
            t[1].ActivatorOnTile = this;
            t[1].IsOccupied      = OccupyTile;
            SetInvisibleLayer();
        }

        if (material != null)
        {
            render.material = material;
        }

        StartCoroutine(AssignToDoors());
    }
Example #23
0
 public bool Equals(Item obj)
 {
     if (obj == null)
     {
         return(false);
     }
     if (ReferenceEquals(this, obj))
     {
         return(true);
     }
     if (this.GetType() != obj.GetType())
     {
         return(false);
     }
     if (!base.Equals(obj))
     {
         return(false);
     }
     return((Description.Equals(obj.Description) &&
             (Name.Equals(obj.Name))) &&
            (Type.Equals(obj.Type)) &&
            (sprite == obj.sprite));
 }
Example #24
0
        /// <summary>
        /// Equivalent to calling Equals(ColumnType) for non-vector types. For vector type,
        /// returns true if current and other vector types have the same size and item type.
        /// </summary>
        public bool SameSizeAndItemType(ColumnType other)
        {
            if (other == null)
            {
                return(false);
            }

            if (Equals(other))
            {
                return(true);
            }

            // For vector types, we don't care about the factoring of the dimensions.
            if (!IsVector || !other.IsVector)
            {
                return(false);
            }
            if (!ItemType.Equals(other.ItemType))
            {
                return(false);
            }
            return(VectorSize == other.VectorSize);
        }
    /// <summary>
    /// Metoda pro item na zaklade jeho casoveho zarazeni, nastavi ulozeni reference do
    /// odpovidajiciho tilu a nastavi collidery a viditelnost.
    /// </summary>
    /// <param name="t"></param>
    protected override void CheckOnStart(Tile[] t)
    {
        if (material != null)
        {
            render.material = material;
        }

        if (ItemType.Equals(TimelineObject.Present))
        {
            t[0].ObjectOnTile = this;
            t[0].IsOccupied   = true;
            SetVisibleLayer();

            ChangeMaterial(PTSShaderEnum.Present);
        }
        else if (ItemType.Equals(TimelineObject.Past))
        {
            t[1].ObjectOnTile = this;
            t[1].IsOccupied   = true;
            SetInvisibleLayer();
            ChangeMaterial(PTSShaderEnum.Past);
        }
    }
Example #26
0
        public bool Equals(BpmnFlowNode other)
        {
            // Check for null
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            // Check for same reference
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            // Not Check Key, because generated Guid

            // Check for same value
            return(((Id == null && other.Id == null) || (Id != null && other.Id != null && Id.Equals(other.Id))) &&
                   ((Name == null && other.Name == null) || (Name != null && other.Name != null && Name.Equals(other.Name))) &&
                   (IsForCompensation.Equals(other.IsForCompensation)) &&
                   (ItemType.Equals(other.ItemType)) &&
                   (StartQuantity.Equals(other.StartQuantity)) &&
                   (CompletionQuantity.Equals(other.CompletionQuantity)));
        }
        /// <summary>
        /// Returns true if ChannelTypeDTO instances are equal
        /// </summary>
        /// <param name="input">Instance of ChannelTypeDTO to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ChannelTypeDTO input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Parameters == input.Parameters ||
                     Parameters != null &&
                     Parameters.SequenceEqual(input.Parameters)
                     ) &&
                 (
                     ParameterGroups == input.ParameterGroups ||
                     ParameterGroups != null &&
                     ParameterGroups.SequenceEqual(input.ParameterGroups)
                 ) &&
                 (
                     Description == input.Description ||
                     (Description != null &&
                      Description.Equals(input.Description))
                 ) &&
                 (
                     Label == input.Label ||
                     (Label != null &&
                      Label.Equals(input.Label))
                 ) &&
                 (
                     Category == input.Category ||
                     (Category != null &&
                      Category.Equals(input.Category))
                 ) &&
                 (
                     ItemType == input.ItemType ||
                     (ItemType != null &&
                      ItemType.Equals(input.ItemType))
                 ) &&
                 (
                     Kind == input.Kind ||
                     (Kind != null &&
                      Kind.Equals(input.Kind))
                 ) &&
                 (
                     StateDescription == input.StateDescription ||
                     (StateDescription != null &&
                      StateDescription.Equals(input.StateDescription))
                 ) &&
                 (
                     Tags == input.Tags ||
                     Tags != null &&
                     Tags.SequenceEqual(input.Tags)
                 ) &&
                 (
                     UID == input.UID ||
                     (UID != null &&
                      UID.Equals(input.UID))
                 ) &&
                 (
                     Advanced == input.Advanced ||
                     (Advanced != null &&
                      Advanced.Equals(input.Advanced))
                 ) &&
                 (
                     CommandDescription == input.CommandDescription ||
                     (CommandDescription != null &&
                      CommandDescription.Equals(input.CommandDescription))
                 ));
        }
Example #28
0
    public void WeaponSetting(ItemType WeaponType, ItemPrivateNum playerweapon)
    {
        if (WeaponType.Equals(ItemType.MELEE_WEAPON))
        {
            switch (playerweapon)
            {
            case ItemPrivateNum.TOOTH_PICK:
                MeleeWeaponSetting("현재무기 : 이쑤시개", WEAPONRATING.NORMAL, 4, 0.3f, 0, 0.04f);
                break;

            case ItemPrivateNum.CLUB:
                MeleeWeaponSetting("현재무기 : 클럽", WEAPONRATING.NORMAL, 6, 0.5f, 1, 0.04f);
                break;

            case ItemPrivateNum.STONE_SPEAR:
                MeleeWeaponSetting("현재무기 : 돌창", WEAPONRATING.NORMAL, 7, 0.5f, 2, 0.04f);
                break;

            case ItemPrivateNum.WOOD_SHIELD:
                MeleeWeaponSetting("현재무기 : 나무방패", WEAPONRATING.NORMAL, 4, 0.6f, 3, 0.06f);
                break;

            case ItemPrivateNum.SPIRAL_SWORD:
                MeleeWeaponSetting("현재무기 : 나선검", WEAPONRATING.RARE, 9, 0.5f, 4, 0.03f);
                break;

            case ItemPrivateNum.RSHIELD_LSWORD:
                MeleeWeaponSetting("현재무기 : 오른쪽엔 검 왼쪽엔 방패", WEAPONRATING.RARE, 9, 0.5f, 5, 0.04f);
                break;

            case ItemPrivateNum.KOLA:
                MeleeWeaponSetting("현재무기 : 콜라", WEAPONRATING.RARE, 11, 0.4f, 6, 0.03f);
                break;

            case ItemPrivateNum.LAPPER:
                MeleeWeaponSetting("현재무기 : 레이피어", WEAPONRATING.RARE, 8, 0.2f, 7, 0.03f);
                break;

            case ItemPrivateNum.FORK:
                MeleeWeaponSetting("현재무기 : 포크", WEAPONRATING.UNIQUE, 14, 0.4f, 8, 0.06f);
                break;

            case ItemPrivateNum.SEALED_KEY:
                MeleeWeaponSetting("현재무기 : 봉인된 열쇠", WEAPONRATING.UNIQUE, 17, 0.3f, 9, 0.03f);
                break;

            case ItemPrivateNum.MASTER_KEY:
                MeleeWeaponSetting("현재무기 : 마스터키", WEAPONRATING.LEGEND, 35, 0.3f, 10, 0.07f);
                break;

            case ItemPrivateNum.GAUNTLET:
                MeleeWeaponSetting("현재무기 : ??? 건틀릿", WEAPONRATING.UNKNOWN, 6, 0.4f, 11, 0.05f);
                break;

            case ItemPrivateNum.SMALL_KEY:
                MeleeWeaponSetting("현재무기 : ??? 작은 열쇠", WEAPONRATING.UNKNOWN, 6, 0.5f, 12, 0.03f);
                break;
            }
        }
        else if (WeaponType.Equals(ItemType.RANGED_WEAPON))
        {
            switch (playerweapon)
            {
            case ItemPrivateNum.WOOD_SLINGSHOT:
                RangedWeaponSetting("현재무기 : 나무새총", WEAPONRATING.NORMAL, 15, 90, 1.0f, 3, 0.4f, 13, 0.1f, 2.5f);
                break;

            case ItemPrivateNum.WOOD_BOW:
                RangedWeaponSetting("현재무기 : 나무활", WEAPONRATING.NORMAL, 10, 100, 1.3f, 4, 0.6f, 14, 0.06f, 1.04f);
                break;

            case ItemPrivateNum.POISON_NEEDLE:
                RangedWeaponSetting("현재무기 : 독침", WEAPONRATING.NORMAL, 15, 100, 0.8f, 3, 0.4f, 15, 0.04f, 1.0f);
                break;

            case ItemPrivateNum.FIRE_BIRD:
                RangedWeaponSetting("현재무기 : 불새", WEAPONRATING.RARE, 10, 100, 1.2f, 6, 0.6f, 16, 0.06f, 1.04f);
                break;

            case ItemPrivateNum.HWASEUNGGUN:
                RangedWeaponSetting("현재무기 : 화승총", WEAPONRATING.RARE, 5, 60, 1.7f, 9, 1.0f, 17, 0.06f, 0.6f);
                break;

            case ItemPrivateNum.CHAKRAM:
                RangedWeaponSetting("현재무기 : 차크람", WEAPONRATING.RARE, 10, 80, 0.8f, 8, 0.6f, 18, 0.0f, 0.0f);
                break;

            case ItemPrivateNum.NAILGUN:
                RangedWeaponSetting("현재무기 : 네일건", WEAPONRATING.RARE, 25, 120, 1.0f, 7, 0.4f, 19, 0.05f, 0.6f);
                break;

            case ItemPrivateNum.SHIELD_PISTOL:
                RangedWeaponSetting("현재무기 : 쉴드피스톨", WEAPONRATING.UNIQUE, 20, 120, 1.0f, 10, 0.5f, 20, 0.05f, 0.5f);
                break;

            case ItemPrivateNum.GENTLEBRELLA:
                RangedWeaponSetting("현재무기 : 신사 우산", WEAPONRATING.UNIQUE, 20, 100, 0.7f, 8, 0.4f, 21, 0.03f, 0.8f);
                break;

            case ItemPrivateNum.TFFGUN:
                RangedWeaponSetting("현재무기 : 369", WEAPONRATING.UNIQUE, 6, 93, 1.3f, 6, 0.5f, 22, 0.05f, 0.55f);
                break;

            case ItemPrivateNum.FLAXGUN:
                RangedWeaponSetting("현재무기 : Flax Gun", WEAPONRATING.UNIQUE, 15, 150, 1.2f, 9, 0.3f, 23, 0.03f, 0.9f);
                break;

            case ItemPrivateNum.ENDOFCENTURYGAUNTLET:
                RangedWeaponSetting("현재무기 : 세기말 건틀릿", WEAPONRATING.LEGEND, 5, 60, 2.0f, 22, 2.0f, 24, 0.03f, 1.0f);
                break;
            }
        }
    }
Example #29
0
    // Update is called once per frame
    void FixedUpdate()
    {
        //CONTROLS

        //MOVEMENT
        if (Input.GetKey(KeyCode.DownArrow) && canIGo(new Vector2(0, -GetComponent <BoxCollider2D>().bounds.extents.y)))
        {
            currentDirection   = new Vector3(0, -speed, 0);
            currentOrientation = Orientation.DOWN;
        }
        else if (Input.GetKey(KeyCode.UpArrow) && canIGo(new Vector2(0, GetComponent <BoxCollider2D>().bounds.extents.y)))
        {
            currentDirection   = new Vector3(0, speed, 0);
            currentOrientation = Orientation.UP;
        }
        else if (Input.GetKey(KeyCode.LeftArrow) && canIGo(new Vector2(-GetComponent <BoxCollider2D>().bounds.extents.x, 0)))
        {
            currentDirection   = new Vector3(-speed, 0, 0);
            currentOrientation = Orientation.LEFT;
        }
        else if (Input.GetKey(KeyCode.RightArrow) && canIGo(new Vector2(GetComponent <BoxCollider2D>().bounds.extents.x, 0)))
        {
            currentDirection   = new Vector3(speed, 0, 0);
            currentOrientation = Orientation.RIGHT;
        }

        //USE ITEMS

        //USE SWORD
        if (Input.GetKeyDown(KeyCode.Q))
        {
            //IF NOT USING SWORD AND I HAVE A SWORD, EQUIP IT
            if (!usingItem.Equals(ItemType.Sword) && GameManager.inventory.Contains(ItemHelper.ItemType.Sword))
            {
                usingItem = ItemType.Sword;
                goSword.SetActive(true);
            }
            //IF AM USING A SWORD, UNEQUIP IT
            else if (usingItem.Equals(ItemType.Sword))
            {
                usingItem = ItemType.Nothing;
                goSword.SetActive(false);
            }
        }

        //USE BOW
        if (Input.GetKeyDown(KeyCode.W))
        {
            //IF NOT USING BOW AND I HAVE A BOW, EQUIP IT
            if (!usingItem.Equals(ItemType.BowAndArrow) && GameManager.inventory.Contains(ItemHelper.ItemType.BowAndArrow))
            {
                usingItem = ItemType.BowAndArrow;
                goBow.SetActive(true);
            }
            //IF AM USING A BOW, UNEQUIP IT
            else if (usingItem.Equals(ItemType.BowAndArrow))
            {
                usingItem = ItemType.Nothing;
                goBow.SetActive(false);
            }
        }

        //USE WAND
        if (Input.GetKeyDown(KeyCode.E))
        {
            //IF NOT USING BOW AND I HAVE A BOW, EQUIP IT
            if (!usingItem.Equals(ItemType.Wand) && GameManager.inventory.Contains(ItemHelper.ItemType.Wand))
            {
                //usingItem = ItemType.Wand;
                GameManager.inventory.Remove(ItemType.Wand);
                arcaneExplosion();
            }
        }

        move(currentDirection.x, currentDirection.y, currentDirection.z);


        float targetAngle = 0f;

        if (currentOrientation.Equals(Orientation.UP))
        {
            targetAngle = 90f;
        }
        if (currentOrientation.Equals(Orientation.LEFT))
        {
            targetAngle = 180f;
        }
        if (currentOrientation.Equals(Orientation.RIGHT))
        {
            targetAngle = 0f;
        }
        if (currentOrientation.Equals(Orientation.DOWN))
        {
            targetAngle = 270f;
        }
        float zAngle = targetAngle;        //Mathf.LerpAngle (transform.rotation.eulerAngles.z, targetAngle, rotatingSpeed);

        transform.eulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, zAngle);

        if (usingItem.Equals(ItemType.Sword))
        {
            Debug.Log("Swoosh!");
        }
    }
Example #30
0
    public void CreateLaser(Tile t)
    {
        if (render == null)
        {
            render = GetComponent <MeshRenderer>();
        }

        if (c == null)
        {
            c = GetComponent <Collider>();
        }

        render.enabled = true;

        LaserReceiver lr = t.ActivatorOnTile as LaserReceiver;

        if (lr != null)
        {
            receiver = lr;
            receiver.OnActivate();
            return;
        }

        if (t.ObjectOnTile != null)
        {
            LaserGenerator lg = t.ObjectOnTile as LaserGenerator;

            if (lr != null)
            {
                receiver = lr;
                receiver.OnActivate();
            }
            else if (lg != null && lg.isMirror)
            {
                receiver = lg;
                receiver.OnActivate();
            }
            else
            {
                render.enabled = false;
            }
        }

        Vector3 vec = transform.position + source.DirVector;

        Debug.Log("TRANS: " + transform.position + " " + source.DirVector);
        Debug.Log(vec.x);
        Tile[] tiles = Level.GetTile(vec);

        if (tiles == null)
        {
            return;
        }

        Tile tile;

        Debug.Log("Tile " + tiles[0].Position);

        GameObject laserObj;

        if (orientation.Equals(LaserDirection.upDown))
        {
            laserObj = Instantiate(source.laserPrefabUpDown);
        }
        else
        {
            laserObj = Instantiate(source.laserPrefab);
        }

        Laser l = laserObj.GetComponent <Laser>();

        if (l.render == null)
        {
            l.render = l.GetComponent <MeshRenderer>();
        }

        if (ItemType.Equals(TimelineObject.Present))
        {
            tile              = tiles[0];
            l.ItemType        = TimelineObject.Present;
            l.render.material = l.material;
        }
        else
        {
            tile              = tiles[1];
            l.ItemType        = TimelineObject.Past;
            l.render.material = l.pastMaterial;
        }

        if (!tile.IsAccessable)
        {
            Debug.Log("There is no such tile!");
            Destroy(laserObj);
            return;
        }

        laserObj.transform.parent = source.transform;
        l.source         = source;
        l.previousLaser  = this;
        nextLaser        = l;
        tile.LaserOnTile = l;
        l.myTile         = tile;

        Debug.Log("TILE SET: " + myTile.Position);
        laserObj.transform.rotation = this.transform.rotation;
        laserObj.transform.position = new Vector3(tile.Position.x, tile.Height, tile.Position.y);

        Debug.Log("Visibility check");
        l.SetVisibility();
        l.CreateLaser(tile);
    }