示例#1
0
 public ActiveNpc(NpcType npc, Vector2 location )
 {
     Type = npc;
     Ai = npc.DefaultAi;
     Name = Type.Name;
     Health = npc.BaseStats.Str * 10;
     Movement = new Movement(location, npc.Race.Animation.CurrentLocation.Width, npc.Race.Animation.CurrentLocation.Height);
     Invunerable = 0;
     CurrentPath = null;
 }
示例#2
0
        public void Initialize(ContentManager content, Package package, Texture2D uiTexture)
        {
            UiTexture = uiTexture;

            // Ai
            Ai[0] = new NpcAiDummy();
            Ai[1] = new NpcAiChase();

            // Races
            Races[0] = new NpcRace("Lynch", content.Load<Texture2D>("Npcs/Sprites/lynch"), package.LocalString("c:/blueprint/lynch.xml", false));

            // Npcs
            Types[0] = new NpcType("The Lynch", Races[0], Ai[1]);
            Types[0].Dialog.Add("Hello {playername}", NpcInteraction.NpcInteractionState.Intro);
            Types[0].Dialog.Add("Here is some interesting information {playername}", NpcInteraction.NpcInteractionState.Gossip);

            // Active Npcs
            ActiveNpc npc = new ActiveNpc(Types[0], new Vector2(200, -50));
            ActiveNpcs.Add(npc);
        }