예제 #1
0
 public Monster(string n, Scene s)
     : base(n, s)
 {
 }
예제 #2
0
 public NetPlayer(string n, Scene s)
     : base(n, s)
 {
 }
예제 #3
0
        static public Character CreateCharacter(string path, Scene scene, string name = "")
#endif		
        {
            EntityDefinition.EntityDefinition ed = GameConst.Content.Load<EntityDefinition.EntityDefinition>(@"template/" + path);

            if (ed != null)
            {
                Type type = Type.GetType("demo." + ed.type);
                if (type != null)
                {
                    Character c = type.Assembly.CreateInstance("demo." + ed.type) as Character;
                    if (c != null)
                    {
                        c.scene = scene;
                        c.templateid = ed.tmpid;
                        c.hp = ed.hp;
                        c.maxhp = ed.maxhp;
                        c.atk = ed.atk;
                        c.def = ed.def;
                        if (name != "")
                            c.name = name;
                        else
                            c.name = ed.name;
                        c.speed = ed.speed;
                        CharacterDefinition.PicDef pd = GameConst.Content.Load<CharacterDefinition.PicDef>(@"chardef/" + ed.pics[0]);
                        CharacterPic cpic = new CharacterPic(pd, 0);
                        if (ed.pics.Count > 0)
                        {
                            for (int i = 1; i < ed.pics.Count; ++i)
                            {
                                CharacterDefinition.PicDef pd1 = GameConst.Content.Load<CharacterDefinition.PicDef>(@"chardef/" + ed.pics[i]);
                                cpic.AddCharacterDefinition(pd1);
                            }
                        }
                        cpic.State = RenderChunk.RenderChunkState.FadeIn;
                        c.Picture = cpic;
                        if (c.NeedTitle)
                        {
                            CharacterTitle title = new CharacterTitle(GameConst.CurrentFont);
                            title.NameString = ed.name;
                            title.Character = c;
                            c.Title = title;
                        }
                        c.pic.Size = new Vector2(ed.size, ed.size);
                        c.State = CharacterState.Idle;
                        return c;
                    }
                }
            }
            return null;
        }
예제 #4
0
        /// <summary>
        /// create character use reflection
        /// </summary>
        /// <param name="path">path of character template file</param>
        /// <param name="scene">scene of character to add</param>
        /// <param name="name">character's name</param>
        /// <returns></returns>
#if WINDOWS_PHONE
        static public Character CreateCharacter(string path, Scene scene, string name)
예제 #5
0
 public Character(string n, Scene s)
 {
     name = n;
     scene = s;
 }
예제 #6
0
 public Npc(string n, Scene s)
     : base(n, s)
 {
 }
예제 #7
0
 public Player(string n, Scene s) :
     base(n, s)
 {
     TrailParticle = null;
 }