コード例 #1
0
    public HandWeaponData(ItemQuality quality, float level, HandWeaponType type, int minDamage, int maxDamage) : base(quality, level)
    {
        this.type      = type;
        this.minDamage = minDamage;
        this.maxDamage = maxDamage;

        name        = type.name();
        description = type.description();
        volume      = type.volume();
        itemType    = ItemType.HAND_WEAPON;
    }
コード例 #2
0
    public static HandWeaponData createHandWeaponData(HandWeaponType type)
    {
        ItemQuality quality = randQuality();
        float       level   = randLevel();

        int damage    = Mathf.RoundToInt(type.damage() * level * qualityMultiplier(quality));
        int minDamage = damage - Mathf.RoundToInt((float)damage * .25f);
        int maxDamage = damage + Mathf.RoundToInt((float)damage * .25f);

        HandWeaponData data = new HandWeaponData(quality, level, type, minDamage, maxDamage);

        data.initCommons(calculateCost(data), 0);

        return(data);
    }
コード例 #3
0
ファイル: HandWeaponType.cs プロジェクト: aintech/Brooks_Star
    public static string name(this HandWeaponType type)
    {
        switch (type)
        {
        case HandWeaponType.GAUSSE: return("Ружьё Гаусса");

        case HandWeaponType.GUN: return("Пистолет");

        case HandWeaponType.MINIGUN: return("Миниган");

        case HandWeaponType.RAILGUN: return("Рельсовое ружьё");

        case HandWeaponType.REVOLVER: return("Револьвер");

        default: Debug.Log("Unknown hand weapon type: " + type); return("");
        }
    }
コード例 #4
0
ファイル: HandWeaponType.cs プロジェクト: aintech/Brooks_Star
    public static int cost(this HandWeaponType type)
    {
        switch (type)
        {
        case HandWeaponType.GUN: return(100);

        case HandWeaponType.REVOLVER: return(150);

        case HandWeaponType.MINIGUN: return(200);

        case HandWeaponType.GAUSSE: return(300);

        case HandWeaponType.RAILGUN: return(500);

        default: Debug.Log("Unknown hand weapon type: " + type); return(0);
        }
    }
コード例 #5
0
ファイル: ImagesProvider.cs プロジェクト: aintech/Brooks_Star
    public static Sprite getHandWeaponSprite(HandWeaponType type)
    {
        switch (type)
        {
        case HandWeaponType.GUN: return(handWeapons[0]);

        case HandWeaponType.REVOLVER: return(handWeapons[1]);

        case HandWeaponType.MINIGUN: return(handWeapons[2]);

        case HandWeaponType.GAUSSE: return(handWeapons[3]);

        case HandWeaponType.RAILGUN: return(handWeapons[4]);

        default: Debug.Log("Unknown hand weapon type: " + type); return(null);
        }
    }
コード例 #6
0
    public static HandWeaponData createHandWeaponData()
    {
        HandWeaponType type = HandWeaponType.GUN;

        switch (UnityEngine.Random.Range(0, Enum.GetNames(typeof(HandWeaponType)).Length))
        {
        case 0: type = HandWeaponType.GUN; break;

        case 1: type = HandWeaponType.REVOLVER; break;

        case 2: type = HandWeaponType.MINIGUN; break;

        case 3: type = HandWeaponType.GAUSSE; break;

        case 4: type = HandWeaponType.RAILGUN; break;

        default: Debug.Log("Unmapped value for hand weapon"); break;
        }
        return(createHandWeaponData(type));
    }
コード例 #7
0
ファイル: HandWeaponType.cs プロジェクト: aintech/Brooks_Star
 public static float volume(this HandWeaponType type)
 {
     return(0);
 }