コード例 #1
0
ファイル: Player.cs プロジェクト: dritory/Janus
        public Player()
            : base(0, 40, 25, '@', TCODColor.white)
        {
            this.engine = Program.engine;
            this.components.Add(new DestructiblePlayer(this, 100, 4, "your cadaver", 0.1F));
            this.components.Add(new Components.Attacker(this, 5));
            this.components.Add(new Components.PlayerAI(this));
            this.components.Add(new Components.Container(this, 100));

            mainToolSlot = new Components.Slot(this, "Tool");
            this.components.Add(mainToolSlot);
            this.components.Add(new Components.Slot(this, "Mail"));
            this.components.Add(new Components.Slot(this, "Gauntlet"));
            this.components.Add(new Components.Slot(this, "Legging"));
            this.components.Add(new Components.Slot(this, "Boot"));


            fov = new Components.DynamicFov(this, fovRadius, 50);
            this.components.Add(fov);

            containerGui = new GUI.ContainerGui(this, "Inventory", engine.screenWidth - 44, 4, 40, 50);

            name          = "you";
            this.playerAi = (Components.PlayerAI)getComponent(typeof(Components.PlayerAI));
        }
コード例 #2
0
ファイル: Player.cs プロジェクト: dritory/Janus
 public override void load(ActorHandler actorhandler)
 {
     base.load(actorhandler);
     this.engine       = Program.engine;
     containerGui      = new GUI.ContainerGui(this, "Inventory", engine.screenWidth - 44, 4, 40, 50);
     this.playerAi     = (Components.PlayerAI)getComponent(typeof(Components.PlayerAI));
     this.fov          = (Components.DynamicFov)getComponent(typeof(Components.DynamicFov));
     this.mainToolSlot = (Components.Slot)getComponent(typeof(Components.Slot));
 }