private void Button_Click_4(object sender, RoutedEventArgs e) { if (Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Effect_States.Count >= Make.MODEL.GeneralControl.MaxStates) { MessageBox.Show("状态数量已满"); States_Select.Visibility = Visibility.Hidden; return; } State state = new State { Name = (sender as Button).Content.ToString(), Duration_Immediate = 10, Duration_Round = 1 }; Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Effect_States.Add(state); SkillCard skillCard = new SkillCard { Is_Cure = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Cure, Is_Eternal = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Eternal, Is_Physics = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Physics, Is_Magic = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Magic, Is_Attack = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Attack }; Custom_Card.DataContext = skillCard; Custom_Card.DataContext = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1]; Origin_Custom_Card.DataContext = skillCard; Origin_Custom_Card.DataContext = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1]; States_Select.Visibility = Visibility.Hidden; }
public void DropOut() { this.cardAnimations.Fall(); SkillCard c = skillCardManager.RandomANewCard(this.indexInList); //c.indexInList = this.indexInList; //c.DropIn(c.indexInList); }
public void ReplaceSkillCard(SkillCard newType) { var index = CardComponentsLookup.SkillCard; var component = CreateComponent <SkillCardComponent>(index); component.Type = newType; ReplaceComponent(index, component); }
private void CreateSkillObject(SkillCard skill) { var obj = Instantiate(SkillObjectPrefabs, SkillObjectParent, false); obj.SetSkillData(_setting.GetData(skill)); _skills.Add(obj); obj.Button.onClick.AddListener(() => ShowSkillDetail(obj)); }
void OnRaycastHit(RaycastHit hit) { SkillCard card = hit.collider.GetComponent <SkillCard>(); if (card != null) { Player.instance.gameState = PlayerState.SELECT; } currentSelect = card; }
public SkillCardViewModel(SkillCard card) { Id = card.Id; Name = card.Name; Location = card.Location; FatigueCost = card.FatigueCost; SkillpointsNeeded = card.SkillpointsNeeded; Classtype = card.Classtype.ToString(); IsExhausted = card.IsExhausted; }
private void Button_Click(object sender, RoutedEventArgs e) { Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Effect_States.Remove((State)(((Button)sender).DataContext)); SkillCard skillCard = new SkillCard { Is_Cure = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Cure, Is_Eternal = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Eternal, Is_Physics = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Physics, Is_Magic = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Magic, Is_Attack = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1].Is_Attack }; Custom_Card.DataContext = skillCard; Custom_Card.DataContext = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1]; Origin_Custom_Card.DataContext = skillCard; Origin_Custom_Card.DataContext = Custom_Card.SkillCardsModel.SkillCards[Custom_Card.Rate.Value - 1]; }
private void Button_Click_1(object sender, RoutedEventArgs e) { SkillCard[] skillCards = new SkillCard[5] { new SkillCard(), new SkillCard(), new SkillCard(), new SkillCard(), new SkillCard() }; int cnt = 0; string temp; foreach (SkillCard item in skillCards) { item.Name = "新技能" + (++cnt).ToString(); } SkillCardsModel skillCardsModel = new SkillCardsModel(skillCards); skillCardsModel.Add_To_General(); skillCardsModel.Save(); Add_Card(skillCardsModel); }
/// <summary> /// 随机生成一张新卡牌 /// </summary> /// <returns></returns> public SkillCard RandomANewCard(int index) { Transform anchor = cards_anchors[index]; int i = Random.Range(0, cards.Count); Debug.Log(i); GameObject card = Instantiate(cards[i], this.transform.position, Quaternion.identity) as GameObject; card.transform.parent = anchor; card.transform.localPosition = Vector3.zero; card.transform.rotation = anchor.transform.rotation; SkillCard c = card.GetComponent <SkillCard>(); c.indexInList = index; c.ResetRigidState(); return(card.GetComponent <SkillCard>()); }
private void Button_Click_1(object sender, RoutedEventArgs e) { SkillCard[] skillCards = new SkillCard[5] { new SkillCard(), new SkillCard(), new SkillCard(), new SkillCard(), new SkillCard() }; int cnt = 0; SkillCardsModel skillCardsModel = new SkillCardsModel(); foreach (SkillCard item in skillCards) { ++cnt; item.Level = cnt; item.Name = "新技能" + cnt.ToString(); item.Father_ID = skillCardsModel.ID; } skillCardsModel.SkillCards = skillCards; skillCardsModel.UserName = GeneralControl.Menu_Person_Information_Class.Instance.User.UserName; skillCardsModel.Add_To_General(); skillCardsModel.Save(); Add_Card(skillCardsModel); }
public void Update(string id, SkillCard cardIn) { skillCards.ReplaceOne(card => card.Id == id, cardIn); }
public void Remove(SkillCard cardIn) { skillCards.DeleteOne(card => card.Id == cardIn.Id); }
public SkillCard Create(SkillCard card) { skillCards.InsertOne(card); return(card); }
public BaseCard DrawCard(BaseCard card, Player player = null) { // todo each discard creates new gamestate? that would let us implement undos // discards the passed card into its appropriate deck BaseCard ret = new SkillCard(); switch (card.CardType) { case CardType.Crisis: ret = CurrentGameState.CrisisDeck.Draw(); break; case CardType.Quorum: ret = CurrentGameState.QuorumDeck.Draw(); break; case CardType.Skill: var skillCard = (SkillCard)card; switch (skillCard.CardColor) { case SkillCardColor.Politics: ret = CurrentGameState.PoliticsDeck.Draw(); break; case SkillCardColor.Leadership: ret = CurrentGameState.LeadershipDeck.Draw(); break; case SkillCardColor.Tactics: ret = CurrentGameState.TacticsDeck.Draw(); break; case SkillCardColor.Engineering: ret = CurrentGameState.EngineeringDeck.Draw(); break; case SkillCardColor.Piloting: ret = CurrentGameState.PilotingDeck.Draw(); break; case SkillCardColor.Treachery: ret = CurrentGameState.TreacheryDeck.Draw(); break; } break; case CardType.SuperCrisis: ret = CurrentGameState.SuperCrisisDeck.Draw(); break; case CardType.Loyalty: ret = CurrentGameState.LoyaltyDeck.Draw(); break; } if (player != null) { player.TakeCard(ret); } return(ret); }
void NavigateHeroCards() { //navigating hero cards if (Input.GetButtonDown(horizontalAxis)) { currentHeroCard.LeaveMe(); float dir = Input.GetAxisRaw(horizontalAxis); if (dir > 0) { currentHeroCard.right.SelectMe(this); } else { currentHeroCard.left.SelectMe(this); } if (SoundManager.Instance) { SoundManager.Instance.PlaySoundUI(0); } } else if (Input.GetButtonDown(verticalAxis)) { currentHeroCard.LeaveMe(); float dir = Input.GetAxisRaw(verticalAxis); if (dir > 0) { currentHeroCard.up.SelectMe(this); } else { currentHeroCard.down.SelectMe(this); } if (SoundManager.Instance) { SoundManager.Instance.PlaySoundUI(0); } } //go to hero detail if (Input.GetButtonDown(confirmSelectionAxis)) { if (currentHeroCard == null) { return; } isNavigatingSkillUI = true; //switch navigation mode herosPanel.alpha = 0f; //hide this player's hero panel infoUI.Show(); //show selected hero detail info panel currentSkillCard = infoUI.skillCards[0] as SkillCard; currentSkillCard.SelectMe(this); //by default the first skill is selected if (SoundManager.Instance) { SoundManager.Instance.PlaySoundUI(1); } } }
void OnRaycastHit(RaycastHit hit) { SkillCard card = hit.collider.GetComponent <SkillCard>(); currentSelect = card; }
public BaseCard DrawCard(BaseCard card, Player player = null) { // todo each discard creates new gamestate? that would let us implement undos // discards the passed card into its appropriate deck BaseCard ret = new SkillCard(); switch (card.CardType) { case CardType.Crisis: ret = CurrentGameState.CrisisDeck.Draw(); break; case CardType.Quorum: ret = CurrentGameState.QuorumDeck.Draw(); break; case CardType.Skill: var skillCard = (SkillCard)card; switch (skillCard.CardColor) { case SkillCardColor.Politics: ret = CurrentGameState.PoliticsDeck.Draw(); break; case SkillCardColor.Leadership: ret = CurrentGameState.LeadershipDeck.Draw(); break; case SkillCardColor.Tactics: ret = CurrentGameState.TacticsDeck.Draw(); break; case SkillCardColor.Engineering: ret = CurrentGameState.EngineeringDeck.Draw(); break; case SkillCardColor.Piloting: ret = CurrentGameState.PilotingDeck.Draw(); break; case SkillCardColor.Treachery: ret = CurrentGameState.TreacheryDeck.Draw(); break; } break; case CardType.SuperCrisis: ret = CurrentGameState.SuperCrisisDeck.Draw(); break; case CardType.Loyalty: ret = CurrentGameState.LoyaltyDeck.Draw(); break; } if (player != null) player.TakeCard(ret); return ret; }