Beispiel #1
0
 public PeopleViewForm()
 {
     InitializeComponent();
     this.bitmapButtonClose.ImageNormal = PicLoader.Read("ButtonBitmap", "CloseButton1.JPG");
     people        = new List <DbRivalState>();
     virtualRegion = new VirtualRegion(this);
     virtualRegion.AddRegion(new PictureRegion(1, 41, 40, 70, 70, PictureRegionCellType.People, 0));
     for (int i = 0; i < 20; i++)
     {
         int xoff = (i % 5) * cardWidth + 19;
         int yoff = (i / 5) * cardHeight + 159;
         SubVirtualRegion region = new PictureAnimRegion(i + 2, xoff, yoff, cardWidth, cardHeight, PictureRegionCellType.People, 0);
         region.AddDecorator(new RegionTextDecorator(0, 45, 9));
         virtualRegion.AddRegion(region);
     }
     types = GetPeopleAvailTypes();
     for (int i = 0; i < types.Count; i++)
     {
         int xoff = i * 26 + 19;
         int yoff = 125;
         virtualRegion.AddRegion(new ButtonRegion(i + 30, xoff, yoff, 24, 24, string.Format("MiniPeopleType{0}.JPG", types[i]), string.Format("MiniPeopleType{0}On.JPG", types[i])));
     }
     virtualRegion.RegionEntered += new VirtualRegion.VRegionEnteredEventHandler(virtualRegion_RegionEntered);
     virtualRegion.RegionLeft    += new VirtualRegion.VRegionLeftEventHandler(virtualRegion_RegionLeft);
     virtualRegion.RegionClicked += new VirtualRegion.VRegionClickEventHandler(virtualRegion_RegionClick);
 }
Beispiel #2
0
        public void Init(int lid, int rid, string map, int rlevel, PeopleFightParm reason)
        {
            isHuman    = lid == 0;
            rightId    = rid;
            leftId     = lid;
            rightLevel = rlevel;
            mapName    = map;
            timeViewer1.Init();
            cardsArray1.Init();
            cardList2.Init();
            miniItemView1.Init();
            miniItemView1.Enabled = false;
            cardsArray1.SetEnable(false);

            BattleManager.Instance.Init();
            BattleManager.Instance.RuleData.Parm = reason;
            BattleManager.Instance.PlayerManager.Init(leftId, rightId, rightLevel);
            int index = 0;//初始化英雄技能按钮

            foreach (var skillId in BattleManager.Instance.PlayerManager.LeftPlayer.HeroSkillList)
            {
                var region = new PictureAnimRegion(index + 1, 25, 538 + index * 45, 40, 40, PictureRegionCellType.HeroSkill, skillId);
                region.AddDecorator(new RegionBorderDecorator(Color.Lime));
                vRegion.AddRegion(region);
                index++;
            }
            if (leftId > 0)
            {
                lifeClock1.SetPlayer(BattleManager.Instance.PlayerManager.LeftPlayer, leftId);
                miniItemView1.Visible = false;
            }
            else
            {
                lifeClock1.SetPlayer(BattleManager.Instance.PlayerManager.LeftPlayer, UserProfile.ProfileName, UserProfile.InfoBasic.Face);
            }
            lifeClock2.SetPlayer(BattleManager.Instance.PlayerManager.RightPlayer, rightId);
            BattleManager.Instance.PlayerManager.LeftPlayer.CardsDesk = cardsArray1;
            BattleManager.Instance.PlayerManager.LeftPlayer.InitialCards();
            BattleManager.Instance.PlayerManager.RightPlayer.CardsDesk = cardList2;
            BattleManager.Instance.PlayerManager.RightPlayer.InitialCards();
            cardSelector1.Init(BattleManager.Instance.PlayerManager.LeftPlayer, new CardSelectMethodInit());
            BattleManager.Instance.PlayerManager.LeftPlayer.HeroSkillChanged         += LeftPlayerHeroSkillChanged;
            BattleManager.Instance.PlayerManager.LeftPlayer.OnShowCardSelector       += LeftPlayerShowCardSelector;
            BattleManager.Instance.PlayerManager.LeftPlayer.OnUseCard                += cardFlow1.OnPlayerUseCard;
            BattleManager.Instance.PlayerManager.RightPlayer.OnUseCard               += cardFlow1.OnPlayerUseCard;
            BattleManager.Instance.PlayerManager.LeftPlayer.TrapHolder.OnTrapRemove  += cardFlow1.OnPlayerTrapTriggered;
            BattleManager.Instance.PlayerManager.RightPlayer.TrapHolder.OnTrapRemove += cardFlow1.OnPlayerTrapTriggered;
            BattleManager.Instance.PlayerManager.LeftPlayer.OnKillEnemy              += cardFlow1.OnPlayerKillMonster;
            BattleManager.Instance.PlayerManager.RightPlayer.OnKillEnemy             += cardFlow1.OnPlayerKillMonster;
            BattleManager.Instance.MemMap = new MemRowColumnMap(mapName, 0);
            BattleManager.Instance.MemMap.InitUnit(BattleManager.Instance.PlayerManager.LeftPlayer);
            BattleManager.Instance.MemMap.InitUnit(BattleManager.Instance.PlayerManager.RightPlayer);
            showGround            = true;
            cardsArray1.Visible   = false;
            miniItemView1.Visible = false;
            vRegion.Visible       = false;
        }
        private void AddBookRegion(int id, int x, int y, int cardId, string text)
        {
            RegionTextDecorator textControl;
            var region = new PictureAnimRegion(id, x, y, 76, 100, PictureRegionCellType.Card, cardId);

            textControl = new RegionTextDecorator(3, 80, 10, Color.Lime, true);
            textControl.SetState(text);
            region.AddDecorator(textControl);
            virtualRegion.AddRegion(region);
        }