コード例 #1
0
ファイル: Bullet.cs プロジェクト: Nahast/Grand-Theft-Epic
 //METHODS
 public int Damage(Bullet_Type type)
 {
     Random rand = new Random();
     int jet = rand.Next(0, 100);
     int damage = 0;
     if (type == Bullet_Type.sniper_bullet)
     {
         damage = 70;
         int critical_bonus_rate = 50;
         int critical_rate = 33;
         if (jet >= critical_rate)
         {
             damage = damage + damage * critical_bonus_rate / 100;
         }
         return damage;
     }
     else
         if (type == Bullet_Type.rifle_bullet)
         {
             damage = 10;
             int critical_bonus_rate = 20;
             int critical_rate = 20;
             if (jet >= critical_rate)
             {
                 damage = damage + damage * critical_bonus_rate / 100;
             }
             return damage;
         }
         else
             if (type == Bullet_Type.gun_bullet)
             {
                 damage = 5;
                 int critical_bonus_rate = 10;
                 int critical_rate = 30;
                 if (jet >= critical_rate)
                 {
                     damage = damage + damage * critical_bonus_rate / 100;
                 }
                 return damage;
             }
             else
                 if (type == Bullet_Type.bazooka_bullet)
                 {
                     damage = 100;
                     int critical_bonus_rate = 1;
                     int critical_rate = 5;
                     if (jet >= critical_rate)
                     {
                         damage = damage + damage * critical_bonus_rate / 100;
                     }
                     return damage;
                 }
                 else
                     return damage;
 }
コード例 #2
0
ファイル: Bullet.cs プロジェクト: Nahast/Grand-Theft-Epic
 //CONSTRUCTORS
 public Bullet(Bullet_Type type, int speed, int bullet_damage)
 {
     this.speed = speed;
     this.bullet_damage = bullet_damage;
     this.type = type;
 }
コード例 #3
0
 //Constructor
 public void Weapon(Weapon_Type weapon, Bullet_Type bullet)
 {
     this.weapon_type = weapon;
     this.bullet = bullet;
 }