public void AddDamageCardToDatabase(DamageCard c) { c.gameObject.name = c.CardName; allDamageCards.Add(c.CardName, c); c.transform.SetParent(transform); }
public void Use_Should_Use_Mana(int manaCost, int damage) { var sut = new DamageCard(manaCost, damage); int initialMana = _playerOne.Mana; sut.Use(_playerOne, _playerTwo); int usedMana = initialMana - _playerOne.Mana; Assert.Equal(manaCost, usedMana); }
public void Use_Should_Damage_Opponent(int manaCost, int damage) { var sut = new DamageCard(manaCost, damage); int initialHealth = _playerTwo.Health; sut.Use(_playerOne, _playerTwo); int receivedDamage = initialHealth - _playerTwo.Health; Assert.Equal(damage, receivedDamage); }
public void ResolveClick() { List <DamageCard> cards = new List <DamageCard>(); if (this._cardsDropdown.value > 0) { string selectedCard = this._cardsDropdown.options[this._cardsDropdown.value].text; DamageCard y = (DamageCard)GameSystem.Instance.CurrentPlayer.Cards.First(x => x.Name == selectedCard); cards.Add(y); } this.ResolveFight(this._playerRoll, cards); }
public void AddDamageCardToDeck(DamageCard c) { //Debug.Log("AddCardToDeck: " + c.title); GameObject go = Instantiate(c.gameObject); go.GetComponent <DamageCard>().CopyActionsFrom(c); GameObject hand = GameObject.Find("Deck"); go.transform.SetParent(hand.transform); go.SetActive(false); }
public void AddDamageCardToDeck(string title) { if (allDamageCards.ContainsKey(title) == false) { Debug.LogError("No player card with title: " + title); return; } // Debug.Log(title); DamageCard c = allDamageCards[title]; AddDamageCardToDeck(c); }
public void CopyActionsFrom(DamageCard c) { this.CardDamage = c.CardDamage; this.CardName = c.CardName; this.CardCost = c.CardCost; this.CardDescription = c.CardDescription; this.Target = c.Target; this.Area = c.Area; this.Range = c.Range; this.Effect = c.Effect; this.CardDraw = c.CardDraw; this.DamageType = c.DamageType; }
void DamageType() { GameObject Player = GameObject.Find(map.selecterPlayer); PlayableCharacter player = Player.GetComponent <PlayableCharacter> (); DamageCard damageCard = d.GetComponentInParent <DamageCard>(); switch (damageType) { case DamageTypes.Magic: damage = player.PlayerClass.MagicAttackDMG * damageCard.CardDamage; break; case DamageTypes.Physical: damage = player.PlayerClass.PhysicalAttackDMG * damageCard.CardDamage; break; case DamageTypes.Ranged: damage = player.PlayerClass.RangedAttackDMG * damageCard.CardDamage; break; default: break; } }
public void OnDrop(PointerEventData eventData) { d = eventData.pointerDrag.GetComponent <Draggable> (); // GameObject GameController = GameObject.Find ("GameController"); // GameController gameController = GameController.GetComponent<GameController> (); // GameObject ButtonScripts = GameObject.Find ("ButtonsCanvas"); // ButtonScripts buttonScripts = ButtonScripts.GetComponent<ButtonScripts> (); buttonScripts.TurnEverythingFalse(); GameController.control.TurnFalsePlayerButtons(); // Debug.Log("OnDrop cone"); // if (d != null ) { // Debug.Log(d.attack); // attack = d.attack; // movementCost = d.movementCost; // effect = d.effect; d.parentToReturnTo = this.transform; // } mobility = false; // else{ // Debug.Log("OnDrop cone"); // Debug.Log(d.cardType); switch (d.cardType) { case CardTypes.Damage: // GameObject Unit = GameObject.Find(map.selecterPlayer); // Unit unit = Unit.GetComponent<Unit> (); DamageCard damageCard = d.GetComponentInParent <DamageCard>(); // DamageCard damageCard = eventData.pointerDrag.GetComponent<DamageCard>(); Debug.Log(damageCard.DamageType); mobility = damageCard.Mobility; range = damageCard.Range; target = damageCard.Target; areaRange = damageCard.Area; damageType = damageCard.DamageType; GameController.control.cardCost = damageCard.CardCost; DamageType(); effect = damageCard.Effect; RunTargets(); break; case CardTypes.Heal: HealCard healCard = d.GetComponentInParent <HealCard>(); GameObject Player = GameObject.Find(map.selecterPlayer); PlayableCharacter player = Player.GetComponent <PlayableCharacter> (); // DamageCard damageCard = eventData.pointerDrag.GetComponent<DamageCard>(); // mobility = damageCard.Mobility; // buttonScripts.healSelected = true; // playingPlayer = map.selecterPlayer; range = healCard.Range; target = healCard.Target; areaRange = healCard.Area; effect = healCard.Effect; healDot = player.PlayerClass.HealValue / 2; heal = (player.PlayerClass.HealValue * healCard.CardHeal) / 3; GameController.control.cardCost = healCard.CardCost; RunTargets(); break; case CardTypes.Utility: UtilityCard utilityCard = d.GetComponentInParent <UtilityCard>(); // DamageCard damageCard = eventData.pointerDrag.GetComponent<DamageCard>(); // mobility = damageCard.Mobility; range = utilityCard.Range; target = utilityCard.Target; areaRange = utilityCard.Area; effect = utilityCard.Effect; GameController.control.cardCost = utilityCard.CardCost; RunTargets(); break; default: break; } // } //TODO värjää väärin if (d != null) { GameObject HighlightTiles = GameObject.Find("_Scripts"); HighlightTiles highlightTiles = HighlightTiles.GetComponent <HighlightTiles> (); highlightTiles.HighlightTilesInRange(); } }