示例#1
0
 static public Asf GetCharacterAsf(string fileName)
 {
     return(GetAsf(ResFile.GetAsfFilePathBase(fileName, ResType.Npc),
                   fileName));
 }
示例#2
0
文件: Obj.cs 项目: mapic91/JxqyHD
 public void SetObjFile(string fileName)
 {
     _objFileName = fileName;
     _objFile     = ResFile.ReadFile(@"ini\objres\" + fileName, ResType.Obj);
 }
示例#3
0
        private void AssignToValue(string[] nameValue, bool noAttackFile)
        {
            try
            {
                var info = this.GetType().GetProperty(nameValue[0]);
                switch (nameValue[0])
                {
                case "Name":
                case "Intro":
                case "ActionFile":
                case "NpcFile":
                case "Type":
                case "FlyIni":
                case "FlyIni2":
                case "MagicToUseWhenBeAttacked":
                case "MagicWhenNewPos":
                    info.SetValue(this, nameValue[1], null);
                    break;

                case "Image":
                case "Icon":
                    info.SetValue(this, Utils.GetAsf(@"asf\magic\", nameValue[1]), null);
                    break;

                case "NpcIni":
                    NpcIni = ResFile.ReadFile(@"ini\npcres\" + nameValue[1], ResType.Npc);
                    break;

                case "FlyingImage":
                case "VanishImage":
                case "SuperModeImage":
                case "LeapImage":
                    info.SetValue(this, Utils.GetAsf(@"asf\effect\", nameValue[1]), null);
                    break;

                case "AttackFile":
                    if (File.Exists(@"ini\magic\" + nameValue[1]) && !noAttackFile)
                    {
                        info.SetValue(this, new Magic(@"ini\magic\" + nameValue[1], true, true), null);
                    }
                    break;

                case "FlyingSound":
                case "VanishSound":
                    info.SetValue(this, Utils.GetSoundEffect(nameValue[1]), null);
                    break;

                case "ExplodeMagicFile":
                case "FlyMagic":
                case "ParasiticMagic":
                case "SecondMagicFile":
                case "RandMagicFile":
                    info.SetValue(this, Utils.GetMagic(nameValue[1], false), null);
                    break;

                case "RegionFile":
                    if (!string.IsNullOrEmpty(nameValue[1]))
                    {
                        info.SetValue(this, MagicRegionFileReader.Load(@"ini\magic\" + nameValue[1]), null);
                    }
                    break;

                case "UseActionFile":
                    if (!string.IsNullOrEmpty(nameValue[1]))
                    {
                        info.SetValue(this, Utils.GetAsf(@"asf\character\", nameValue[1]), null);
                    }
                    break;

                case "GoodsName":
                    GoodsName = Utils.GetGood(nameValue[1]);
                    break;

                default:
                    var integerValue = int.Parse(nameValue[1]);
                    info.SetValue(this, integerValue, null);
                    break;
                }
            }
            catch (Exception)
            {
                //Do nothing
                return;
            }
        }