Ejemplo n.º 1
0
        public static MiningModuleIntegrityBar CreateMiningModuleIntegrityBar(SceneMgr mgr, MiningModule module, Player owner)
        {
            MiningModuleIntegrityBar arc = new MiningModuleIntegrityBar(mgr, IdMgr.GetNewId(mgr.GetCurrentPlayer().GetId()));

            arc.Color  = owner.Data.SpecialColor;
            arc.Radius = module.Radius + 5;

            CenterCloneControl pControl = new CenterCloneControl(module);

            arc.AddControl(pControl);

            HpBarControl hControl = new HpBarControl(arc);

            module.AddControl(hControl);

            arc.SetGeometry(SceneGeometryFactory.CreateArcSegments(arc));

            return(arc);
        }
Ejemplo n.º 2
0
        public static MiningModule CreateMiningModule(SceneMgr mgr, Vector position, Player owner)
        {
            MiningModule module = new MiningModule(mgr, IdMgr.GetNewId(mgr.GetCurrentPlayer().GetId()), owner);

            module.Position = position;
            module.Radius   = 10;
            module.Color    = Colors.Crimson;


            ModuleDamageControl mc = new ModuleDamageControl();

            mc.MaxHp = SharedDef.SPECTATOR_MAX_HP;
            module.AddControl(mc);

            SphereCollisionShape cs = new SphereCollisionShape();

            cs.Center             = module.Center;
            cs.Radius             = module.Radius;
            module.CollisionShape = cs;

            ControlableDeviceControl dc = new ControlableMiningModuleControl();

            module.AddControl(dc);

            LinearRotationControl rc = new LinearRotationControl();

            rc.RotationSpeed = SharedDef.SPECTATOR_MODULE_ROTATION_SPEED;
            module.AddControl(rc);

            HpRegenControl hc = new HpRegenControl();

            hc.MaxRegenTime = SharedDef.SPECTATOR_HP_REGEN_CD;
            hc.RegenTimer   = SharedDef.SPECTATOR_HP_REGEN_CD;
            hc.RegenSpeed   = SharedDef.SPECTATOR_REGEN_SPEED;
            module.AddControl(hc);

            module.AddControl(new RespawningObjectControl());
            module.AddControl(new StickySphereCollisionShapeControl());

            module.SetGeometry(SceneGeometryFactory.CrateMiningModule(module));

            return(module);
        }