public Monster(string n, Scene s) : base(n, s) { }
public NetPlayer(string n, Scene s) : base(n, s) { }
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; }
/// <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)
public Character(string n, Scene s) { name = n; scene = s; }
public Npc(string n, Scene s) : base(n, s) { }
public Player(string n, Scene s) : base(n, s) { TrailParticle = null; }