예제 #1
0
 public NpcType(string name, NpcRace race, NpcAi ai)
 {
     Name = name;
     Race = race;
     DefaultAi = ai;
     Shop = null;
     Drops = new List<DropChance>();
     Dialog = new NpcDialog();
     Dialog.Add("Intro text", NpcInteraction.NpcInteractionState.Intro);
     BaseStats = new Stats();
 }
예제 #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);
        }