Esempio n. 1
0
        private void SetAddionalParameter(ref ShipModule module, ModuleSettingsRes res, ModuleSlotSettingData slotSetting, AdditionalParameter prm, ColorInfo color)
        {
            int pointsMax = 10;


            switch (prm)
            {
            case AdditionalParameter.resist:
                //module.SetResist(BalanceFormulas.ComputeRESISTANCE(Rand.Int(1, pointsMax), pointsMax, dropParams.level, dropParams.resource.Leveling.CapLevel(), slotSetting.resist_max, color.factor));
                module.SetCommonResist(BalanceFormulas.Resistance(res, slotSetting.resist, dropParams.level, Rand.Int(1, res.addPointMax), color));
                break;

            case AdditionalParameter.damage_bonus:
                //module.SetDamageBonus(BalanceFormulas.ComputeDAMAGEBONUS(Rand.Int(1, pointsMax), slotSetting.damage_bonus_points_value, slotSetting.damage_bonus_points_factor, dropParams.level));
                module.SetDamageBonus(BalanceFormulas.DamageBonus(res, slotSetting.damageBonus, dropParams.level, Rand.Int(1, res.addPointMax), color));
                break;

            case AdditionalParameter.energy_bonus:
                //module.SetEnergyBonus(BalanceFormulas.ComputeENERGYBONUS(Rand.Int(1, pointsMax), slotSetting.energy_bonus_points_value, slotSetting.energy_bonus_points_factor, dropParams.level));
                module.SetEnergyBonus(BalanceFormulas.EnergyBonus(res, slotSetting.energyBonus, dropParams.level, Rand.Int(1, res.addPointMax), color));
                break;

            case AdditionalParameter.crit_chance:
                //module.SetCritChance(BalanceFormulas.ComputeCRITCHANCE(Rand.Int(1, pointsMax), slotSetting.critical_chance_points_value, slotSetting.critical_chance_points_factor, dropParams.level));
                module.SetCritChance(BalanceFormulas.CritChance(res, slotSetting.critChanceBonus, dropParams.level, Rand.Int(1, res.addPointMax), color));
                break;

            case AdditionalParameter.crit_damage:
                //module.SetCritDamage(BalanceFormulas.ComputeCRITDAMAGEBONUS(Rand.Int(1, pointsMax), slotSetting.critical_damage_points_value, slotSetting.critical_damage_points_factor, dropParams.level));
                module.SetCritDamage(BalanceFormulas.CritDamageBonus(res, slotSetting.critDamageBonus, dropParams.level, Rand.Int(1, res.addPointMax), color));
                break;

            case AdditionalParameter.speed_bonus:
                //module.SetSpeedBonus(BalanceFormulas.ComputeSPEEDBONUS(Rand.Int(1, pointsMax), slotSetting.speed_bonus_points_value, slotSetting.speed_bonus_points_factor, dropParams.level));
                module.SetSpeedBonus(BalanceFormulas.SpeedBonus(res, slotSetting.speedBonus, dropParams.level, Rand.Int(1, res.addPointMax), color));
                break;

            case AdditionalParameter.hold_bonus:
                //module.SetHoldBonus(BalanceFormulas.ComputeCARGOBONUS(Rand.Int(1, pointsMax), slotSetting.cargo_bonus_points_value, slotSetting.cargo_bonus_points_factor, dropParams.level));
                module.SetHoldBonus(BalanceFormulas.CargoBonus(res, slotSetting.cargoBonus, dropParams.level, Rand.Int(1, res.addPointMax), color));
                break;
            }
        }
Esempio n. 2
0
        public ShipModule SourceObject()
        {
            if (this.CraftMaterials == null)
            {
                this.CraftMaterials = new Dictionary <string, int>();
            }

            ShipModule result = new ShipModule(
                (ShipModelSlotType)this.SlotType,
                this.ModuleId,
                this.Level,
                this.Name,
                (Workshop)this.Workshop,
                this.TemplateId,
                this.CraftMaterials,
                Difficulty.none
                );

            result.SetPrefab(this.Prefab);
            result.SetHP(this.HP);
            result.SetHold(this.Hold);
            result.SetCommonResist(this.Resist);
            result.SetAcidResist(this.acidResist);
            result.SetLaserResist(this.laserResist);
            result.SetRocketResist(this.rocketResist);
            result.SetSpeed(this.Speed);
            result.SetDamageBonus(this.DamageBonus);
            result.SetColor((ObjectColor)this.Color);
            result.SetSkill(this.Skill);
            result.SetSet(this.SetID);
            result.SetCritChance(this.CritChance);
            result.SetCritDamage(this.CritDamage);
            result.SetEnergyBonus(this.energyBonus);
            result.SetSpeedBonus(this.speedBonus);
            result.SetHoldBonus(this.holdBonus);

            return(result);
        }