//Cancels the effect of the Red and Green Bond skill private void CancelRedGreenBond() { //remove the skill display RemoveFromSkillChangeTracker("Cain's Red and Green Bond skill providing +30 attack for this battle."); //restore Cain's attack attackModifier -= 30; //removes the callback AfterBattleEvent.RemoveListener(CancelRedGreenBond); }
//This method cancels the Green-Red Twin Strike private void CancelTwinStrike() { //lower Abel's attack attackModifier -= 40; //remove effect display. RemoveFromSkillChangeTracker("Abel's Green-Red Twin Strike skill providing +40 attack."); //remove callback. AfterBattleEvent.RemoveListener(CancelTwinStrike); }
//This method cancels the Formation Skill private void CancelFormationSkill() { //lower Barst's attack attackModifier -= 50; //remove effect display. RemoveFromSkillChangeTracker("Barst's Formation Skill providing +50 attack and the ability to destroy 2 orbs."); //remove callback. AfterBattleEvent.RemoveListener(CancelFormationSkill); }
//Red and Green Bond [ALWAYS] If this unit is being supported by "Abel", this unit gains +30 attack. //called by the BattleSupportEvent, this method checks if there is a supporting card and if it is named "Abel", and if so activates the ability. private void RedGreenBond() { if (Owner.SupportCard != null && Owner.SupportCard.CompareNames("Abel")) { //Display the ability CardReader.instance.UpdateGameLog("Cain's Red and Green Bond skill raises his attack by +30 when supported by Abel!"); AddToSkillChangeTracker("Cain's Red and Green Bond skill providing +30 attack for this battle."); //raise Cain's attack attackModifier += 30; //set up the removal callback AfterBattleEvent.AddListener(CancelRedGreenBond); } }
//Falchion [ALWAYS] If this unit is attacking a <Dragon>, this unit gains +20 attack. //Checks to see if the current attack target is a dragon and if so, then adds an attack buff. //NOTE: As an [ALWAYS] skill, may need to add more complex tracking if an opponent gains (or loses) Dragon affinity //during the battle process. Example Gunter4 (B06-096R) //Should add a check to an event on the Defending Card which tracks when that card's affinities and stats are changed. public void Falchion(bool attacking) { //Only apply if this card is attacking. if (attacking) { if (GameManager.instance.CurrentDefender.UnitTypeArray[(int)CipherData.TypesEnum.Dragon]) { attackModifier += 20; CardReader.instance.UpdateGameLog("Marth's Falchion skill provides +20 attack against " + GameManager.instance.CurrentDefender.CharName + "!"); AddToSkillChangeTracker("Marth's Falchion skill providing +20 attack."); AfterBattleEvent.AddListener(EndFalchionBoost); } } }
//Green-Red Twin Strike [TRIGGER] [Tap an allied "Cain"] When this unit attacks, you may pay the cost and if you do: Until the end of this combat, this unit gains +40 attack. //This method actually activates the above skill. private void GreenRedTwinStrike(BasicCard cainCard) { //Tap Cain to pay the cost. cainCard.Tap(); //raise Abel's attack attackModifier += 40; //display the skill's activation and effect. CardReader.instance.UpdateGameLog(Owner.playerName + " activates Abel's Green-Red Twin Strike skill to tap Cain and give Abel " + "+40 attack during this battle!"); AddToSkillChangeTracker("Abel's Green-Red Twin Strike skill providing +40 attack."); //add a call to cancel this skill. AfterBattleEvent.AddListener(CancelTwinStrike); }
//[Formation Skill] Bord, Cord, and Barst [TRIGGER] [Tap allied "Bord" and "Cord"] //When this unit attacks, you may pay the cost, and if you do: //Until the end of this combat, this unit gains +50 attack and the number of Orbs that this unit's attack will destroy becomes 2. //This method actually activates the above skill. private void FormationSkill(BasicCard bordCard, BasicCard cordCard) { //Tap Bord and Cord to pay the cost. bordCard.Tap(); cordCard.Tap(); //raise Barst's attack attackModifier += 50; //increase the number of orbs to be destroyed to 2. GameManager.instance.numOrbsToBreak = 2; //display the skill's activation and effect. CardReader.instance.UpdateGameLog(Owner.playerName + " activates Barst's Formation Skill: Bord, Cord, and Barst! Tapping Bord" + " and Cord gives Barst +50 attack and the ability to destroy 2 orbs during this battle!"); AddToSkillChangeTracker("Barst's Formation Skill providing +50 attack and the ability to destroy 2 orbs."); //add a call to cancel this skill. AfterBattleEvent.AddListener(CancelFormationSkill); }
//This method removes the skill modifier information from the card after the battle. public void EndFalchionBoost() { attackModifier -= 20; RemoveFromSkillChangeTracker("Marth's Falchion skill providing +20 attack."); AfterBattleEvent.RemoveListener(EndFalchionBoost); }