void CheckTurn() { DiceBehaviour firstDice = (DiceBehaviour)dices.GetValue(0); DiceBehaviour secondDice = (DiceBehaviour)dices.GetValue(1); foreach (var dice in dices) { if (dice.name == "First Dice") { firstDice = dice; } else { secondDice = dice; } } if (firstDice.GetLanded() && firstDice.GetThrown() && firstDice.diceValue > 0 && secondDice.GetLanded() && secondDice.GetThrown() && secondDice.diceValue > 0 && !canBeReset) { allDicesLaned = true; } else { allDicesLaned = false; } if (allDicesLaned) { totalDiceValue = 0; foreach (var dice in dices) { totalDiceValue += dice.diceValue; if (dice.diceValue == 0) { allDicesLaned = false; Debug.Log(totalDiceValue + " dices Failed"); dice.Reset(); break; } } Debug.Log(totalDiceValue + " dices has been Rolled!"); allDicesLaned = false; canBeReset = true; //if (playerControls[i].GetIsMoving() && playerControls[i].steps <= 1) //ShowCard(playerControls[i].GetRoutePos()); if (!playerControls[i].GetIsMoving()) { playerControls[i].steps = totalDiceValue; } //if (!playerControls[i].GetIsMoving() && playerControls[i].steps == 0) //cardPrefab } }
public void GiveSlashDamage(BattleUnitModel enemy, BattleDiceBehavior dice) { DiceBehaviour xml = dice.behaviourInCard.Copy(); xml.Detail = BehaviourDetail.Slash; BattleVoidBehaviour Newdice = new BattleVoidBehaviour(dice); Newdice.behaviourInCard = xml; Newdice._damageReductionByGuard = DamageReductionByGuard; Newdice.RollDice(); Newdice.UpdateDiceFinalValue(); Newdice.GiveDamage(enemy); }
public BattleVoidBehaviour(BattleDiceBehavior OriginalDice) { this.OriginalDice = OriginalDice; this.owner = OriginalDice.owner; this.behaviourInCard = OriginalDice.behaviourInCard; this.abilityList = OriginalDice.abilityList; this.card = OriginalDice.card; if (OriginalDice.TargetDice != null && OriginalDice.TargetDice.Detail == BehaviourDetail.Guard) { _damageReductionByGuard = OriginalDice.TargetDice.DiceResultValue; } else { _damageReductionByGuard = 0; } _statBonus = typeof(BattleDiceBehavior).GetField("_statBonus", AccessTools.all).GetValue(this.OriginalDice) as DiceStatBonus; OriginalStatBonus = _statBonus.Copy(); }
public override void OnRoundStart() { if (this.phase != ApocalypsePhase.Small || this._owner.allyCardDetail.GetAllDeck().Count <= 0) { return; } foreach (BattleDiceCardModel card in this._owner.allyCardDetail.GetAllDeck()) { card.CopySelf(); DiceCardXmlInfo xmlInfo = card.XmlData.Copy(true); DiceCardSpec Spec = xmlInfo.Spec.Copy(); Spec.Ranged = CardRange.FarArea; Spec.affection = CardAffection.Team; xmlInfo.Spec = Spec; DiceBehaviour dice = new DiceBehaviour() { Min = 0, Dice = 0, Type = BehaviourType.Atk, Detail = RandomUtil.SelectOne <BehaviourDetail>(new List <BehaviourDetail>() { BehaviourDetail.Slash, BehaviourDetail.Hit, BehaviourDetail.Penetrate }), MotionDetail = MotionDetail.J, EffectRes = "", Script = "", ActionScript = "Final_ApcBird_PutDownArea", Desc = "" }; foreach (DiceBehaviour behaviour in xmlInfo.DiceBehaviourList) { dice.Min += behaviour.Min; dice.Dice += behaviour.Dice; } xmlInfo.DiceBehaviourList = new List <DiceBehaviour>() { dice }; typeof(BattleDiceCardModel).GetField("_xmlData", AccessTools.all).SetValue(card, xmlInfo); EmotionCardAbility_bossbird4.Summation.Add(card); } }