Exemplo n.º 1
0
    public RepairDroidData(ItemQuality quality, float level, RepairDroidType type, int repairSpeed) : base(quality, level)
    {
        this.type        = type;
        this.repairSpeed = repairSpeed;

        name        = type.name();
        description = type.description();
        volume      = type.volume();
        itemType    = ItemType.REPAIR_DROID;
    }
Exemplo n.º 2
0
    public static RepairDroidData createRepairDroidData(RepairDroidType type)
    {
        ItemQuality quality = randQuality();
        float       level   = randLevel();

        int repairSpeed = Mathf.RoundToInt(type.repairSpeed() * level * qualityMultiplier(quality));

        RepairDroidData data = new RepairDroidData(quality, level, type, repairSpeed);

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

        return(data);
    }
Exemplo n.º 3
0
    public static string description(this RepairDroidType type)
    {
        switch (type)
        {
        case RepairDroidType.RAIL: return("Ремонтный дроид на\nоснове рельс");

        case RepairDroidType.CHANNEL: return("Ремонтный дроид на\nоснове каналов");

        case RepairDroidType.BIPHASIC: return("Ремонтный дроид на\nоснове бифаз");

        case RepairDroidType.THREAD: return("Ремонтный дроид на\nоснове потоков");

        default: return("Неизвестный тип дроида-ремонтника");
        }
    }
Exemplo n.º 4
0
    public static int energyNeeded(this RepairDroidType type)
    {
        switch (type)
        {
        case RepairDroidType.RAIL: return(10);

        case RepairDroidType.CHANNEL: return(20);

        case RepairDroidType.BIPHASIC: return(30);

        case RepairDroidType.THREAD: return(40);

        default: return(0);
        }
    }
Exemplo n.º 5
0
    public static int cost(this RepairDroidType type)
    {
        switch (type)
        {
        case RepairDroidType.RAIL: return(100);

        case RepairDroidType.CHANNEL: return(200);

        case RepairDroidType.BIPHASIC: return(300);

        case RepairDroidType.THREAD: return(400);

        default: return(0);
        }
    }
Exemplo n.º 6
0
    public static float volume(this RepairDroidType type)
    {
        switch (type)
        {
        case RepairDroidType.RAIL: return(1);

        case RepairDroidType.CHANNEL: return(1);

        case RepairDroidType.BIPHASIC: return(1);

        case RepairDroidType.THREAD: return(1);

        default: return(0);
        }
    }
Exemplo n.º 7
0
    public static int repairSpeed(this RepairDroidType type)
    {
        switch (type)
        {
        case RepairDroidType.RAIL: return(5);

        case RepairDroidType.CHANNEL: return(10);

        case RepairDroidType.BIPHASIC: return(17);

        case RepairDroidType.THREAD: return(30);

        default: return(0);
        }
    }
Exemplo n.º 8
0
    public static string name(this RepairDroidType type)
    {
        switch (type)
        {
        case RepairDroidType.RAIL: return("Рельсовый дроид");

        case RepairDroidType.CHANNEL: return("Канальный дроид");

        case RepairDroidType.BIPHASIC: return("Бифазный дроид");

        case RepairDroidType.THREAD: return("Поточный дроид");

        default: return("Неизвестный тип дроида-ремонтника");
        }
    }
Exemplo n.º 9
0
    public static Sprite getRepairDroidSprite(RepairDroidType type)
    {
        switch (type)
        {
        case RepairDroidType.RAIL: return(repairDroids[0]);

        case RepairDroidType.CHANNEL: return(repairDroids[1]);

        case RepairDroidType.BIPHASIC: return(repairDroids[2]);

        case RepairDroidType.THREAD: return(repairDroids[3]);

        default: Debug.Log("Unknown repair droid type: " + type); return(null);
        }
    }
Exemplo n.º 10
0
    public static RepairDroidData createRepairDroidData()
    {
        RepairDroidType type = RepairDroidType.RAIL;

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

        case 1: type = RepairDroidType.CHANNEL; break;

        case 2: type = RepairDroidType.BIPHASIC; break;

        case 3: type = RepairDroidType.THREAD; break;

        default: Debug.Log("Unmapped value for repair droid"); break;
        }
        return(createRepairDroidData(type));
    }