Exemplo n.º 1
0
        public Character(
            GameWorld world,
            ModCharacterDfnXML chaData,
            ModCharacterSkinDfnXML chaSkin,
            Mogre.Vector3 initPosition,
            bool isBot) : base(-1, world)
        {
            this.world      = world;
            this.isBot      = isBot;
            this.chaData    = chaData;
            skin            = chaSkin;
            Id              = id;
            brain           = new DecisionSystem(this);
            weaponSystem    = new WeaponSystem(this, null);
            equipmentSystem = new EquipmentSystem(this);

            currentActivity = new Idle();
            moveInfo        = new MoveInfo(CharacterController.RUN_SPEED);
            health          = new HealthInfo(this);
            messageQueue    = new List <CharacterMessage>();

            initEquipments();

            mesh       = new CharacterController(world, chaData, chaSkin, initPosition, isBot);
            controller = (CharacterController)mesh;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="world">Environment</param>
        /// <param name="cam">Camera</param>
        /// <param name="id">Unique Id</param>
        /// <param name="teamId">Team Id</param>
        /// <param name="name">Name</param>
        /// <param name="meshName">Mesh Name</param>
        /// <param name="initPosition">Init Position</param>
        /// <param name="isBot">Is Bot or not</param>
        public Character(
            GameWorld world,
            int id,
            string teamId,
            string displayName,
            string meshName,
            Mogre.Vector3 initPosition,
            ModCharacterSkinDfnXML skin,
            bool isBot) : base(id, world)
        {
            this.world       = world;
            this.displayName = displayName;
            this.meshName    = meshName;
            this.skin        = skin;
            this.isBot       = isBot;
            Id              = id;
            position        = initPosition;
            brain           = new DecisionSystem(this);
            weaponSystem    = new WeaponSystem(this, new Fist(world, -1, id));
            equipmentSystem = new EquipmentSystem(this);

            currentActivity = new Idle();
            moveInfo        = new MoveInfo(CharacterController.RUN_SPEED);
            health          = new HealthInfo(this);
            messageQueue    = new List <CharacterMessage>();

            create();
        }
Exemplo n.º 3
0
        public Character(
            GameWorld world,
            ModCharacterDfnXML xmlData,
            ModCharacterSkinDfnXML skinXmlData,
            Mogre.Vector3 initPosition,
            bool isBot) : base(-1, world)
        {
            this.world       = world;
            this.xmlData     = xmlData;
            this.skinXmlData = skinXmlData;
            position         = initPosition;
            Id              = id;
            brain           = new DecisionSystem(this);
            weaponSystem    = new WeaponSystem(this, null);
            equipmentSystem = new EquipmentSystem(this);

            currentActivity = new Idle();
            moveInfo        = new MoveInfo(CharacterController.RUN_SPEED);
            health          = new HealthInfo(this);
            messageQueue    = new List <CharacterMessage>();

            initEquipments();

            renderable = new CharacterController(world, this, isBot);
            controller = (CharacterController)renderable;
        }
Exemplo n.º 4
0
        List <Entity> itemAttached;       //Item that attached to character

        public CharacterController(
            GameWorld world,
            ModCharacterDfnXML chaData,
            ModCharacterSkinDfnXML chaSkin,
            Mogre.Vector3 initPosition,
            bool isBot = true) : base(world.Camera)
        {
            this.world       = world;
            controlled       = !isBot;
            itemAttached     = new List <Entity>();
            charaMeshName    = chaSkin.Mesh;
            physicsScene     = world.PhysicsScene;
            physics          = physicsScene.Physics;
            cotrollerManager = physics.ControllerManager;
            this.chaData     = chaData;
            this.chaSkin     = chaSkin;

            setupBody(initPosition);
            if (controlled)
            {
                setupCamera(camera);
            }
            //setupAnimations();
            setupPhysics();
        }
Exemplo n.º 5
0
        List <Entity> itemAttached;//Item that attached to character

        public CharacterController(
            Camera cam,
            NavmeshQuery query,
            Scene physicsScene,
            string meshName,
            ModCharacterSkinDfnXML skin,
            bool isBot,
            Mogre.Vector3 initPosition)
        {
            camera            = cam;
            this.controlled   = !isBot;
            itemAttached      = new List <Entity>();
            this.sceneMgr     = cam.SceneManager;
            charaMeshName     = meshName;
            this.physicsScene = physicsScene;
            physics           = physicsScene.Physics;
            cotrollerManager  = physics.ControllerManager;
            this.query        = query;
            setupBody(initPosition);
            if (controlled)
            {
                setupCamera(cam);
            }

            this.skin = skin;

            setupAnimations();
            setupPhysics();
        }
Exemplo n.º 6
0
        List <Entity> itemAttached;       //Item that attached to character

        public CharacterController(
            GameWorld world,
            Character character,
            bool isBot = true) : base(world.Camera)
        {
            this.world       = world;
            controlled       = !isBot;
            itemAttached     = new List <Entity>();
            charaMeshName    = chaSkin.Mesh;
            physicsScene     = world.PhysicsScene;
            physics          = physicsScene.Physics;
            cotrollerManager = physics.ControllerManager;
            this.chaData     = character.XmlData;
            this.chaSkin     = character.SkinXmlData;

            setupBody(character.Position);
            if (controlled)
            {
                setupCamera(camera);
            }
            else
            {
                movementController = new EntityMovementController(entity, world.CurrentMap.Navmesh);
            }
            //setupAnimations();
            setupPhysics();
        }