Exemple #1
0
    public object ConfigProcess(string[] row)

    {
        if (row.Length < 17)

        {
            return(null);
        }



        RowHelper rh = new RowHelper(row);

        DisassemblygirlMonsterConfig rec = new DisassemblygirlMonsterConfig();



        rec.id = CSVUtility.ToInt(rh.Read());              //id

        rec.level = CSVUtility.ToInt(rh.Read());           //级别

        rec.name = rh.Read();                              //名字

        rec.resourceID = rh.Read();                        //资源ID

        rec.explosionID = rh.Read();                       //爆炸资源ID

        rec.missileResourceID = rh.Read();                 //投射物资源ID

        rec.type = CSVUtility.ToInt(rh.Read());            //类型

        rec.DEF = CSVUtility.ToFloat(rh.Read());           //防御力

        rec.ANTI = CSVUtility.ToFloat(rh.Read());          //抵抗力

        rec.SPD = CSVUtility.ToFloat(rh.Read());           //速度

        rec.HP = CSVUtility.ToInt(rh.Read());              //生命值

        rec.components = rh.Read();                        //部件吊掉落配置

        rec.groundDamping = CSVUtility.ToFloat(rh.Read()); //地面阻力

        rec.airDamping = CSVUtility.ToFloat(rh.Read());    //空中阻力

        rec.immunityEffectors = rh.Read();                 //效果器免疫

        rec.RP = CSVUtility.ToInt(rh.Read());              //RP

        rec.GP = CSVUtility.ToInt(rh.Read());              //GP

        return(rec);
    }
Exemple #2
0
        public static MonsterData FromConfig(DisassemblygirlMonsterConfig config)
        {
            MonsterData monster = new MonsterData();

            monster.id             = config.id;
            monster.name           = config.name;
            monster.level          = config.level;
            monster.resourceID     = config.resourceID;
            monster.explosionID    = config.explosionID;
            monster.type           = config.type;
            monster.groundDamping  = config.groundDamping;
            monster.airDamping     = config.airDamping;
            monster.componentDatas = new List <EntityComponentData>();

            monster.missileData            = new MissileData();
            monster.missileData.resourceID = config.missileResourceID;

            if (!string.IsNullOrEmpty(config.components) && config.components != "0")
            {
                string[] components = config.components.Split('|');

                foreach (string component in components)
                {
                    EntityComponentData data = EntityComponentData.Parse(component);

                    monster.componentDatas.Add(data);
                }
            }

            monster.attributeBox = AttributeBox.CreateDefault();
            monster.attributeBox.SetAttribute(AttributeKeys.SPD, AttributeSetTypes.BaseValue, config.SPD);
            monster.attributeBox.SetAttribute(AttributeKeys.ANTI, AttributeSetTypes.BaseValue, config.ANTI);
            monster.attributeBox.SetAttribute(AttributeKeys.HP, AttributeSetTypes.BaseValue, config.HP);
            monster.attributeBox.SetAttribute(AttributeKeys.MaxHP, AttributeSetTypes.BaseValue, config.HP);
            monster.attributeBox.SetAttribute(AttributeKeys.DEF, AttributeSetTypes.BaseValue, config.DEF);
            monster.attributeBox.SetAttribute(AttributeKeys.RP, AttributeSetTypes.BaseValue, config.RP);
            monster.attributeBox.SetAttribute(AttributeKeys.GP, AttributeSetTypes.BaseValue, config.GP);

            monster.immunityEffectors = new List <int>();
            foreach (string effectorID in config.immunityEffectors.Split('|'))
            {
                if (effectorID != "0")
                {
                    monster.immunityEffectors.Add(int.Parse(effectorID));
                }
            }

            return(monster);
        }
Exemple #3
0
    public void Load()

    {
        CSVReader reader = new CSVReader();

        reader.LoadText("Config/Disassemblygirl_Monster.txt", 3);

        int rows = reader.GetRowCount();

        for (int r = 0; r < rows; ++r)

        {
            string[] row = reader.GetRow(r);

            DisassemblygirlMonsterConfig ac = ConfigProcess(row) as DisassemblygirlMonsterConfig;

            configs.Add(ac.id, ac);
        }
    }