コード例 #1
0
    public static damageTypes GetDamageType(damageTypes damage1, damageTypes damage2)
    {
        switch (damage1)
        {
        case damageTypes.light:
            switch (damage2)
            {
            case damageTypes.medium:
                return(damageTypes.special1);

            case damageTypes.heavy:
                return(damageTypes.special2);

            default:
                return(damage1);
            }
            break;

        case damageTypes.medium:
            switch (damage2)
            {
            case damageTypes.medium:
                return(damage2);

            case damageTypes.heavy:
                return(damageTypes.special3);

            default:
                return(GetDamageType(damage2, damage1));
            }
            break;

        case damageTypes.heavy:
            switch (damage2)
            {
            case damageTypes.heavy:
                return(damage2);

            default:
                return(GetDamageType(damage2, damage1));
            }
            break;

        default:
            return(damage2);

            break;
        }
    }
コード例 #2
0
 public void Break(damageTypes damageType)
 {
     for (int i = 0; i < brokenBy.Length; i++)
     {
         if (damageType == brokenBy[i])
         {
             if (soundEffectOnBreak)
             {
                 FindObjectOfType <AudioManager>().PlayClip(soundEffectOnBreak, transform.position);
             }
             GetComponent <Collider>().enabled = false;
             Instantiate(replaceOnBreak, transform.position + Vector3.up * moveBrokenYUp, transform.rotation);
             Destroy(gameObject);
             break;
         }
     }
 }
コード例 #3
0
ファイル: Weapon.cs プロジェクト: sidav/StealthRoguelike
 public Weapon(string WeaponName)
 {
     Name = WeaponName;
     switch (Name)
     {
         case "dagger":
             type = weaponTypes.melee;
             TypeOfDamage = damageTypes.stab;
             mindamage = 1;
             maxdamage = 2;
             break;
         case "baton":
             type = weaponTypes.melee;
             TypeOfDamage = damageTypes.smash;
             mindamage = 1;
             maxdamage = 1;
             break;
         case "katar":
             type = weaponTypes.melee;
             TypeOfDamage = damageTypes.stab;
             mindamage = 2;
             maxdamage = 3;
             break;
         //just for lulz
         case "concept-art drawing":
             type = weaponTypes.melee;
             TypeOfDamage = damageTypes.smash;
             mindamage = 1;
             maxdamage = 1;
             break;
         //If you see this ingame, then there is probaby a bug somewhere
         default:
             Name = "Default_Weapon";
             type = weaponTypes.melee;
             TypeOfDamage = damageTypes.smash;
             mindamage = 1;
             maxdamage = 1;
             break;
     }
     if (type == weaponTypes.melee)
     {
         Appearance = ')';
         Color = ConsoleColor.White;
     }
 }
コード例 #4
0
 public void Break(damageTypes damageType)
 {
     timeTracker.timeLeft = -1;
     GetComponent <Breakable>().Break(damageType);
 }
コード例 #5
0
 public void SetBaseBullet(UpgradeStats stats, Transform target, damageTypes bulletDamageType)
 {
     this.stats   = stats;
     this.target  = target;
     myDamageType = bulletDamageType;
 }
コード例 #6
0
 public void SetBullet(UpgradeStats stats, float rotaionspeed, Transform target, damageTypes myDamageType)
 {
     this.rotationspeed = rotaionspeed;
     SetBaseBullet(stats, target, myDamageType);
 }