示例#1
0
    /// <summary>
    /// 激活部件效果
    /// </summary>
    private void AtcivePartEffect()
    {
        foreach (var part in this.Ship.PartsList)
        {
            proto.PartReference partRef = part.Reference;
            int effectValue             = partRef.effect_val * (1 + partRef.effect_val_growthrate * (part.Level - 1));
            switch (partRef.passive_effect_type)
            {
            case Def.PassiveEffectType.None: break;

            case Def.PassiveEffectType.DurablilityChg:
                this.ShipProperty_.Durability.Change(effectValue);
                break;

            case Def.PassiveEffectType.ArmorChg:
                this.ShipProperty_.ArmouredShield.Change(effectValue);
                break;

            case Def.PassiveEffectType.ShieldConversionvalChg:
                this.ShipProperty_.EnergyShield.Change(effectValue);
                break;

            case Def.PassiveEffectType.ShuttleTeamAdd:
                this.ShipProperty_.ShuttleTeam.Change(effectValue);
                break;

            case Def.PassiveEffectType.Eccm:
                this.ShipProperty_.Eccm.Change(effectValue);
                break;

            case Def.PassiveEffectType.SpeedChg:
                this.ShipProperty_.Speed.Change(effectValue);
                break;

            case Def.PassiveEffectType.SwspeedChg:
                this.ShipProperty_.Swspeed.Change(effectValue);
                break;

            case Def.PassiveEffectType.ForceShield:
                this.ShipProperty_.ForceShield.Change(effectValue);
                break;
            }
        }
    }
示例#2
0
文件: GlobalConfig.cs 项目: LynnPi/OF
 public static proto.PartReference GetPartReference(int id)
 {
     proto.PartReference parts = null;
     PartReferenceList.TryGetValue(id, out parts);
     return(parts);
 }
示例#3
0
文件: GlobalConfig.cs 项目: LynnPi/OF
    public static void AnalyzeBin(byte[] bytes)
    {
        var tempManager = new proto.ReferenceManager();

        tempManager.Parse(bytes, 0, bytes.Length);

        for (int i = 0; i < tempManager.units_res_size(); i++)
        {
            proto.UnitReference unit = tempManager.units_res(i);
            UnitReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.defensive_units_res_size(); i++)
        {
            proto.DefensiveUnitsReference unit = tempManager.defensive_units_res(i);
            DefensiveUnitsReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.buff_res_size(); i++)
        {
            proto.BuffReference unit = tempManager.buff_res(i);
            BuffReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.parts_replace_team_res_size(); i++)
        {
            proto.PartsReplaceTeamReference unit = tempManager.parts_replace_team_res(i);
            PartsReplaceTeamReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.shuttle_res_size(); i++)
        {
            proto.ShuttleReference unit = tempManager.shuttle_res(i);
            ShuttleReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.shuttle_team_res_size(); i++)
        {
            proto.ShuttleTeamReference unit = tempManager.shuttle_team_res(i);
            ShuttleTeamReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.skill_res_size(); i++)
        {
            proto.SkillReference unit = tempManager.skill_res(i);
            SkillReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.parts_res_size(); i++)
        {
            proto.PartReference unit = tempManager.parts_res(i);
            PartReferenceList.Add(unit.id, unit);
        }

        for (int i = 0; i < tempManager.battlefield_res_size(); i++)
        {
            proto.BattlefieldReference battle = tempManager.battlefield_res(i);
            BattlefieldReferenceList.Add(battle.id, battle);
        }

        List <proto.LevelDeployUnitReference> levelDelpoyUnitList = null;

        for (int i = 0; i < tempManager.leveldeployunit_res_size(); i++)
        {
            proto.LevelDeployUnitReference levelDeployUnit = tempManager.leveldeployunit_res(i);

            if (LevelDeployReferenceDic.ContainsKey(levelDeployUnit.battlefield_id))
            {
                levelDelpoyUnitList = LevelDeployReferenceDic[levelDeployUnit.battlefield_id];
            }
            else
            {
                levelDelpoyUnitList = new List <proto.LevelDeployUnitReference>();
                LevelDeployReferenceDic.Add(levelDeployUnit.battlefield_id, levelDelpoyUnitList);
            }

            levelDelpoyUnitList.Add(levelDeployUnit);
        }
    }