public PassiveEffect hasPassiveEffectForTime(EWhenToApply aTimeToApply,float aTargetHPVal,float aMyHP,ElementalType aAttackerType,ElementalType aDefendentType,BetterList<BattleMonster> aAllies,BetterList<BattleMonster> aOpponents,ERangedStatus aRange,BattleMonster aAttacker,ElementalType aAttackingMoveElement,EStatusEffects aStatusEffectInduced = EStatusEffects.None) { for(int i = 0;i<_effects.size;i++) { if(_effects[i].applyAt==aTimeToApply) { if((_effects[i].applyAt==EWhenToApply.AtEndOfMoveQueue)|| (_effects[i].applyAt==EWhenToApply.BattleStart)|| (_effects[i].applyAt==EWhenToApply.WhenHit) ) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenAttackingWithMoveType)&&(aAttackingMoveElement==_effects[i].whenMoveElementType)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenTheirHPHigherThan)&&(aTargetHPVal>_effects[i].HPPercentage)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenTheirHPLowerThan)&&(aTargetHPVal<_effects[i].HPPercentage)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenMyHPHigherThan)&&(aMyHP>(1/_effects[i].HPPercentage))) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenMyHPLowerThan)&&(aMyHP<(1/_effects[i].HPPercentage))) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenAttackerIsType)&&(aAttackerType==_effects[i].whenMoveElementType)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenDefendentIsType)&&(aDefendentType==_effects[i].whenMoveElementType)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenAlliesAreType)&&(listContainsElement(_effects[i].whenMoveElementType,aAllies).size>0)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenDefendentIsType)&&(listContainsElement(_effects[i].whenMoveElementType,aOpponents).size>0)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenOneOpponentisSameAsEffectOwner)&&(listContainsElement(aAttackerType,aOpponents).size>0)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenHitByMoveType)&&(aAttackerType==_effects[i].whenMoveElementType)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenHitByRangeType)&&(aRange==_effects[i].whenRangeType)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenOpponentHasStatusEffect)&&(listContainsStatusEffect(_effects[i].whenStatusEffects,aOpponents).size>0)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenStatusEffectsSuffered)&&((_effects[i].whenStatusEffects&aAttacker.statusEffects)!=EStatusEffects.None)) { return _effects[i]; } if((_effects[i].applyAt==EWhenToApply.WhenHitByMoveTypeAtEndOfMoveQueue)&&(_effects[i].whenMoveElementType==aAttackingMoveElement)) { return _effects[i]; } } } return null; }
public void init(BattleMonster aMonster,int aXPToAdd,double aDelayToAdd,float aBestMeleeAtck,float aBestMeleeDef,float aBestRangeAtck,float aBestRangeDef,float aBestSpeed,float aBestAccuracy,float aBestAgility) { aMonster.healthBarEnabled = false; _xpToAdd = (int) Convert.ToInt32((float) aXPToAdd * XP_MULTIPLIER); _monsterRef = aMonster; levelUpLabel.gameObject.SetActive(false); xpGained.text = ""; xpBar.value = _monsterRef.monster.XPAsPercentage; this.monsterName.text = aMonster.name; StartCoroutine(delayedStartToAddXP(aDelayToAdd)); xpBarLabel.text = _monsterRef.monster.XpToNext().ToString()+" XP To Next"; hpBarLabel.text = _monsterRef.monster.hp.ToString()+" / "+_monsterRef.monster.MaxHP.ToString(); health.value = _monsterRef.monster.HpAsPercentage; _lastLevel = _monsterRef.monster.level; this.transform.FindChild("MovesBtn").FindChild("Glow").gameObject.tag = "ParticlesUnderPlayer"; Transform t = this.transform.FindChild("MovesBtn").FindChild("Glow"); ParticleSystem[] p = t.GetComponentsInChildren<ParticleSystem>(); for(int i =0;i<p.Length;i++) { p[i].gameObject.tag = "ParticlesUnderPlayer"; p[i].gameObject.layer = 14; } GameObject[] allParticles = GameObject.FindGameObjectsWithTag("ParticlesUnderPlayer"); for(int i = 0;i<allParticles.Length;i++) { allParticles[i].GetComponent<ParticleSystem>().GetComponent<Renderer>().sortingLayerName = "ParticlesUnderPlayer"; ParticleSystem[] children = allParticles[i].GetComponentsInChildren<ParticleSystem>(); for(int j = 0;j<children.Length;j++) { children[j].GetComponent<Renderer>().sortingLayerName = "ParticlesUnderPlayer"; } } checkAvailableMovePoints(); if(aMonster.ownersName!=PlayerMain.REF.name) { Destroy (this.gameObject); return; } // Do the ev's where appropriat if(this._monsterRef.monster.accuracy<aBestAccuracy) { this._monsterRef.monster.canBoostAccuracyEV((aBestAccuracy-this._monsterRef.monster.accuracy)/EV_ADDER_DIVIDER,true); } if(this._monsterRef.monster.agility<aBestAgility) { this._monsterRef.monster.canBoostAgilityEV((aBestAgility-this._monsterRef.monster.agility)/EV_ADDER_DIVIDER,true); } if(this._monsterRef.monster.meleeAttack<aBestMeleeAtck) { this._monsterRef.monster.canBoostMeleeAtckEV((aBestMeleeAtck-this._monsterRef.monster.meleeAttack)/EV_ADDER_DIVIDER,true); } if(this._monsterRef.monster.rangeAttack<aBestRangeAtck) { this._monsterRef.monster.canBoostRangeAtckEV((aBestRangeAtck-this._monsterRef.monster.rangeAttack)/EV_ADDER_DIVIDER,true); } if(this._monsterRef.monster.meleeDefense<aBestMeleeDef) { this._monsterRef.monster.canBoostMeleeDefEV((aBestMeleeDef-this._monsterRef.monster.meleeDefense)/EV_ADDER_DIVIDER,true); } if(this._monsterRef.monster.rangeDefense<aBestRangeDef) { this._monsterRef.monster.canBoostMeleeDefEV((aBestRangeDef-this._monsterRef.monster.rangeDefense)/EV_ADDER_DIVIDER,true); } if(this._monsterRef.monster.speed<aBestSpeed) { this._monsterRef.monster.canBoostMeleeDefEV((aBestSpeed-this._monsterRef.monster.speed)/EV_ADDER_DIVIDER,true); } }
public CommentaryMessageSettings (string aMessage,ECommentaryMessageType aType,ECommentaryMessagePosition aMessagePosition,PassiveEffect aEffect,BattleMonster aMonster) { message = aMessage; type = aType; position = aMessagePosition; passiveEffect = aEffect; monster = aMonster; }
public void initMonster(MonsterDataMain aMonster,BattleMonster aBattleMonster) { for(int i = 0;i<buttons.Length;i++) { if(aMonster.selectedMoves[i]!=null) { if(aMonster.selectedMoves[i].hasMoveData) { labels[i].text = aMonster.selectedMoves[i].moveData.Name; buttons[i].gameObject.SetActive(true); ElementalType e = aMonster.selectedMoves[i].moveData.elementType; ElementalLibrary.REF.recolourButtonForElement(buttons[i].GetComponent<UIButton>(),e); } else { buttons[i].gameObject.SetActive(false); } } } _battleMonster = aBattleMonster; if(aMonster.movePointsAvailable>0) { if(hasMovePointsAvailable!=null) { hasMovePointsAvailable.gameObject.SetActive(true); } } else { if(hasMovePointsAvailable!=null) { hasMovePointsAvailable.gameObject.SetActive(false); } } }
private void onEasyTargetClicked (BattleMonster aMonster, BattleTeam aTeam) { aTeam.onMonsterClicked(aMonster); easyTarget.gameObject.SetActive(false); }
private void onMoveHasBeenSet(BattleTeam aTeam,BattleMonster aMonster,MoveQueueItem aMoveQueue,bool aAutomatic) { // Debug.Log ("onMoveHasbeenSet"); if(aTeam.isLocalTeam) { easyTarget.gameObject.SetActive(false); this._positionOfMoveQueueEntry++; BattleBase.MultiplayerDebugText("onMoveHasBeenSet (LocalTeam)!!!!!!!!!!!!!!!!!!!!!!!!"); if(aMoveQueue.moveData!=null) { BattleBase.MultiplayerDebugText("Move was not null"); if(aMoveQueue.moveData.isBoost) { BattleBase.MultiplayerDebugText("Is boost for team, find target in team"); aMoveQueue.targetTeam = positionFromTeam(aTeam); findTargetInTeam(aTeam,aTeam,aMonster,aMoveQueue,aAutomatic); } else { BattleBase.MultiplayerDebugText("Is not boost for team, find target in opponent"); findTargetInTeam(aTeam,otherTeam(aTeam),aMonster,aMoveQueue,aAutomatic); } } else { if(aMoveQueue.usedItem!=null) { aMoveQueue.targetTeam = positionFromTeam(aTeam); findTargetInTeam(aTeam,aTeam,aMonster,aMoveQueue,true); } if(aTeam.allMonstersHaveMoves) { aTeam.declareReadyForNextTurn(); } } } else { if(aTeam.allMonstersHaveMoves) { aTeam.declareReadyForNextTurn(); } } }
public BetterList<BattleMonster> monstersApartFrom(BattleMonster aMonster) { BetterList<BattleMonster> r = new BetterList<BattleMonster>(); BetterList<BattleMonster> ms = this.monstersAsBattleMonster; for(int i = 0;i<ms.size;i++) { if(ms[i]!=aMonster) { r.Add(ms[i]); } } return r; }
public BetterList<BattleMonster> getBoostTargetsForMove(EMonsterPos aPrimaryTarget,MoveLibItem aMove,BattleMonster aActioningMonster) { BetterList<BattleMonster> ms = this.monstersAsBattleMonster; BetterList<BattleMonster> r = new BetterList<BattleMonster>(); if(aMove==null) { Debug.LogError ("Move for "+aActioningMonster.name+" was "+aMove+". Monsters passive effect was: "+aActioningMonster.monster.passiveEffect.name); return r; } ESplashRange splashRange = aMove.splashRange; int boostInfo = (int) aMove.splashRange; if((splashRange&ESplashRange.AllBoosts)==0) { return new BetterList<BattleMonster>(); } if(aMove.splashRange==ESplashRange.Boost2) { for(int i = 0;i<ms.size;i++) { if(ms[i]!=aActioningMonster) { r.Add(ms[i]); } } r = cleanReturnTargets(r); return r; } switch(aPrimaryTarget) { case(EMonsterPos.Front): { r.Add(ms[BattleConstants.FRONT_INDEX]); if(aMove.splashRange==ESplashRange.BoostAll/*||aMove.splashRange==ESplashRange.Boost1*/) { // Middle monster has no splash range 1, only lessened damage to splashers r.Add(ms[BattleConstants.TOP_INDEX]); r.Add(ms[BattleConstants.BOTTOM_INDEX]); } } break; case(EMonsterPos.Top): { r.Add(ms[BattleConstants.TOP_INDEX]); if(aMove.splashRange==ESplashRange.BoostAll/*||aMove.splashRange==ESplashRange.Boost1*/) { r.Add(ms[BattleConstants.FRONT_INDEX]); if(aMove.splashRange==ESplashRange.BoostAll) r.Add (ms[BattleConstants.BOTTOM_INDEX]); } } break; case(EMonsterPos.Bottom): { r.Add(ms[BattleConstants.BOTTOM_INDEX]); if(aMove.splashRange==ESplashRange.BoostAll/*||aMove.splashRange==ESplashRange.Boost1*/) { // Middle monster has no splash range 1, only lessened damage to splashers r.Add(ms[BattleConstants.FRONT_INDEX]); if(aMove.splashRange==ESplashRange.BoostAll) r.Add (ms[BattleConstants.TOP_INDEX]); } } break; } r = cleanReturnTargets(r); if(r.size==0&&!this.teamIsDead) { // Aim downwards if we can switch(aPrimaryTarget) { case(EMonsterPos.Top): return getBoostTargetsForMove(EMonsterPos.Front,aMove,aActioningMonster); case(EMonsterPos.Front): return getBoostTargetsForMove(EMonsterPos.Bottom,aMove,aActioningMonster); case(EMonsterPos.Bottom): return getBoostTargetsForMove(EMonsterPos.Top,aMove,aActioningMonster); } } return r; }
private PassiveEffect getAttackHPHitPassiveEffect(BattleMonster aAttacker,BattleMonster aDefender,MoveLibItem aMove) { PassiveEffect p = aAttacker.monster.hasPassiveEffectForTime(EWhenToApply.WhenAttackingWithMoveType, aDefender.monster.HpAsPercentage, aAttacker.monster.HpAsPercentage, aAttacker.monster.elementType, aDefender.monster.elementType, this.monstersAsBattleMonster, null, aMove.rangeStatus, aAttacker, aMove.elementType); if(p!=null) { return p; } p = aAttacker.monster.hasPassiveEffectForTime(EWhenToApply.WhenMyHPHigherThan, aDefender.monster.HpAsPercentage, aAttacker.monster.HpAsPercentage, aAttacker.monster.elementType, aDefender.monster.elementType, this.monstersAsBattleMonster, null, aMove.rangeStatus, aAttacker, aMove.elementType); if(p!=null) { return p; } p = aAttacker.monster.hasPassiveEffectForTime(EWhenToApply.WhenMyHPLowerThan, aDefender.monster.HpAsPercentage, aAttacker.monster.HpAsPercentage, aAttacker.monster.elementType, aDefender.monster.elementType, this.monstersAsBattleMonster, null, aMove.rangeStatus, aAttacker, aMove.elementType); if(p!=null) { return p; } p = aAttacker.monster.hasPassiveEffectForTime(EWhenToApply.WhenOpponentHasStatusEffect, aDefender.monster.HpAsPercentage, aAttacker.monster.HpAsPercentage, aAttacker.monster.elementType, aDefender.monster.elementType, this.monstersAsBattleMonster, null, aMove.rangeStatus, aAttacker, aMove.elementType); if(p!=null) { return p; } p = aAttacker.monster.hasPassiveEffectForTime(EWhenToApply.WhenStatusEffectsSuffered, aDefender.monster.HpAsPercentage, aAttacker.monster.HpAsPercentage, aAttacker.monster.elementType, aDefender.monster.elementType, this.monstersAsBattleMonster, null, aMove.rangeStatus, aAttacker, aMove.elementType); if(p!=null) { return p; } return null; }
// TODO Apply HP Boosts to team? public bool applyHPBoostsToTeam(PassiveEffect aEffect,BattleMonster aActioningMonster,MoveQueueItem aMoveQueueItem,ETeamPosition aTeamPosition) { if(containsMonster(aActioningMonster)) { ESplashRange splash = aEffect.moveRef.splashRange; float splashPercent = aEffect.moveRef.splashPercent; if(aEffect.applyAt==EWhenToApply.WhenHitByMoveTypeAtEndOfMoveQueue&&((aMoveQueueItem.moveData.elementType==aEffect.whenMoveElementType)||(aEffect.whenMoveElementType==null))) { EMonsterPos target = positionForMonster(aActioningMonster); BetterList<BattleMonster> targets = getBoostTargetsForMove(target,aEffect.moveRef,aActioningMonster); if(targets.size>0) { for(int i =0;i<targets.size;i++) { if(i==0) targets[i].applyHPBoostForMove(aEffect.moveRef,1.0f,aTeamPosition,positionForMonster(targets[i])); else { targets[i].applyHPBoostForMove(aEffect.moveRef,splashPercent,aTeamPosition,positionForMonster(targets[i])); } } } else { } } } else { } return false; }
protected byte indexForMonster(BattleMonster aMonster) { BetterList<BattleMonster> ms = this.monstersAsBattleMonster; for(byte i = 0;i<ms.size;i++) { if(ms[i]==aMonster) { return i; } } return 255; }
public EMonsterPos positionForMonster(BattleMonster aMonster) { BetterList<BattleMonster> ms = this.monstersAsBattleMonster; if(ms.size>BattleConstants.FRONT_INDEX&&ms[BattleConstants.FRONT_INDEX]==aMonster) { return EMonsterPos.Front; } if(ms.size>BattleConstants.BOTTOM_INDEX&&ms[BattleConstants.BOTTOM_INDEX]==aMonster) { return EMonsterPos.Bottom; } if(ms.size>BattleConstants.TOP_INDEX&&ms[BattleConstants.TOP_INDEX]==aMonster) { return EMonsterPos.Top; } return EMonsterPos.Unset; }
private void onFaintComplete(BattleMonster aMonster) { Debug.Log("Monster Has finished Fainting"); if(this.onMonsterFainted!=null) { this.onMonsterFainted(this as BattleTeam,aMonster); } }
protected void onMonsterCommentary(BattleMonster aMonster,string aMessage,ECommentaryMessageType aMessageType) { if(onCommentaryMessage!=null) { EMonsterPos monsterPosition = positionForMonster(aMonster); if(aMessageType==ECommentaryMessageType.StandardMessage) { this.onCommentaryMessage(aMonster.monster.ownersName+"'s "+aMessage,aMessageType,monsterPosition,this._position); } else { this.onCommentaryMessage(aMessage,aMessageType,monsterPosition,this._position); } } }
protected virtual void onMonsterMoveSet(BattleMonster aMonster,MoveLibItem aMove,bool aAutomatic) { /* */ if(this.onMoveHasBeenSet!=null) { this.onMoveHasBeenSet(this as BattleTeam,aMonster,aMonster.futureMove,aAutomatic); } else { } }
public bool containsMonster(BattleMonster aMonster) { BetterList<BattleMonster> ms = this.monstersAsBattleMonster; for(byte i=0;i<ms.size;i++) { if(ms[i]==aMonster) { return true; } } return false; }
protected void onMonsterMoveSet(BattleMonster aMonster,MoveLibItem aMove,bool aAutomatic) { base.onMonsterMoveSet(aMonster,aMove,aAutomatic); }
protected BattleTeam teamFromMonster(BattleMonster aMonster) { if(_teams[0].containsMonster(aMonster)) { return _teams[0]; } else { return _teams[1]; } }
private float applyStatEffectsToMonster(BattleMonster aMonster,MoveLibItem aMoveData,MoveQueueItem aMoveQueueItem) { return aMonster.applyStatEffectsFromMove(aMoveData,aMoveQueueItem); }
public void init(string aName,byte aLevel,BattleMonster aMonster) { monsterName.text = aName+" Lvl: "+aLevel; _monsterRef = aMonster; }
// From passive effect public void applyHPEffectToTeam(PassiveEffect aEffect,BattleMonster aMonster,EMonsterPos aPositions) { if(containsMonster(aMonster)) { Debug.Log("NO HP Effect to apply"); } else { ESplashRange splash = aEffect.moveRef.splashRange; float splashPrecent = aEffect.moveRef.splashPercent; EMonsterPos target = EMonsterPos.Unset; BetterList<BattleMonster> targets = getTargetsForMove(target,aEffect.moveRef); for(byte c = 0;c<targets.size;c++) { if(c == 0) { applyHPEffectToMonster(aMonster,aEffect.moveRef,1.0f,targets[c],null,aPositions); } else { applyHPEffectToMonster(aMonster,aEffect.moveRef,splashPrecent,targets[c],null,aPositions); } } } }
public void addTargettedMonster(BattleMonster aMonster) { for(int i =0;i<this.targettedMonster.size;i++) { if(targettedMonster[i]==aMonster) { return; } } targettedMonster.Add(aMonster); }
protected EMonsterPos monsterPositionByMonster(BattleMonster aMonster) { BetterList<BattleMonster> ms = this.monstersAsBattleMonster; for(byte c = 0 ; c < ms.size ; c++ ) { if(aMonster==ms[c]) { switch(c) { case(0):return EMonsterPos.Top;break; case(1):return EMonsterPos.Front;break; case(2):return EMonsterPos.Bottom;break; } } } return EMonsterPos.Unset; }
protected void showMovesForMonster(BattleMonster aMonster) { startConversation(); barController.gameObject.SetActive(true); barController.show = true; barController.setMonsterMoves(aMonster); if (aMonster != null) { this.setCamera(aMonster.gameObject,EMonsterCamPosition.FrontCamera,true,true,false,aMonster.transform); } this.FadeBlackScreen(0.8f,0.1f); topLabel.text = "";//aMonster.name+" L"+aMonster.monster.level; topLabel.gameObject.SetActive(true); }
public void addHitMonster(BattleMonster aMonster) { for(int i =0;i<this.hitMonsters.size;i++) { if(hitMonsters[i]==aMonster) { return; } } hitMonsters.Add(aMonster); }
public float applyPassiveEffectToMonsters(EWhenToApply aWhen,PassiveEffect aEffect,BattleMonster aPassiveEffectOwner,EMonsterPos aEffectOwnerPosition,MoveQueueItem aMoveQueueItem) { float delayAmount = 0f; if(aEffect.applyAt==aWhen) { if(this.containsMonster(aPassiveEffectOwner)) { // Check Splash on this passive effect BetterList<BattleMonster> monsters = new BetterList<BattleMonster>(); if(aMoveQueueItem!=null) monsters = this.getBoostTargetsForMove(positionForMonster(aPassiveEffectOwner),aEffect.moveRef,(BattleMonster) aMoveQueueItem.actioningMonster); else monsters = this.getBoostTargetsForMove(positionForMonster(aPassiveEffectOwner),aEffect.moveRef,aPassiveEffectOwner); if(aEffect.moveRef==null) { Debug.LogError("Passive effect for: "+aPassiveEffectOwner.name+" is "+aEffect.moveRef+" passive effect is: "+aPassiveEffectOwner.monster.passiveEffect.name); return 0f; } if(aEffect.moveRef.elementType!=ElementalLibrary.REF.getElement("Normal")) { // This passive effect can only be applied to monsters of type: aEffect.moveRef.elementType for(int i = 0;i<monsters.size;i++) { if(monsters[i].monster.elementType!=aEffect.moveRef.elementType) { monsters.RemoveAt(i); i--; } } for(int i = 0;i<monsters.size;i++) { monsters[i].applyStatEffectsFromMove(aEffect.moveRef,null,aEffect); delayAmount += monsters[i].applyStatusEffectsForMove(aEffect.moveRef,1,aEffect); this.applyHPBoostsToTeam(aEffect,aPassiveEffectOwner,aMoveQueueItem,this._position); if(aEffect.moveRef.decisiveBlowsImmunity>0f) { monsters[i].criticalHitImmune = true; } if(aEffect.moveRef.oneHitKillInvulnerable>0f) { monsters[i].oneHitKOImmune = true; } } } } else { BetterList<BattleMonster> monsters = this.getTargetsForMove(EMonsterPos.Unset,aEffect.moveRef); for(int i = 0;i<monsters.size;i++) { monsters[i].applyStatEffectsFromMove(aEffect.moveRef,null,aEffect); delayAmount += monsters[i].applyStatusEffectsForMove(aEffect.moveRef,1,aEffect); applyHPEffectToTeam(aEffect,aPassiveEffectOwner,aEffectOwnerPosition); } } } return delayAmount; }
protected void moveMonsterToLayer(BattleMonster aMonster,string aLayer) { aMonster.sortingLayer = aLayer; }
private void onMonsterFainted(BattleTeamBase aTeam,BattleMonster aMonster) { //if(aTeam.isLocalTeam) { this._commentaryManager.addCommentaryMessage(aMonster.ownersName+"'s "+aMonster.name+" has Fainted!",ECommentaryMessageType.StandardMessage,ECommentaryMessagePosition.CenterMessage); //} if(aTeam.teamIsDead) { handleBattleOver(aTeam as BattleTeam); } }
private void findTargetInTeam(BattleTeam aAttacking,BattleTeam aDefending,BattleMonster aMonster,MoveQueueItem aMoveQueue,bool aAutomatic) { if((aDefending.monsterCount==1)||(aAutomatic)) { if(aAttacking.nextUnsetMonster!=null) { StartCoroutine(delayToShowNextMonster(aAttacking)); } else { aAttacking.declareReadyForNextTurn(); } } else { if(aMoveQueue.moveData.splashRange==ESplashRange.RandomOpponent) { // Doesn't matter what target we put here, it will be randomized later aMoveQueue.targetMonster = aDefending.positionForMonster(aDefending.monstersAsBattleMonster[0]); if(aAttacking.nextUnsetMonster!=null) { StartCoroutine(delayToShowNextMonster(aAttacking)); } else { aAttacking.declareReadyForNextTurn(); } return; } topLabel.text = "Select a Target"; aAttacking.healthBars = false; aDefending.healthBars = false; FadeBlackScreen(0.8f,0.1f); aAttacking.bringMonsterToFront(aMonster); aMonster.healthBarEnabled = true; BetterList<BattleMonster> otherMonsters = aDefending.monstersAsBattleMonster; easyTarget.gameObject.SetActive(true); easyTarget.initTargets(otherMonsters,aDefending); for(byte c = 0;c<otherMonsters.size;c++) { aDefending.bringMonsterToFront(otherMonsters[c]); otherMonsters[c].healthBarEnabled = true; } aDefending.onTargetFound += onFoundTargetForMove; aDefending.findTargetForMove(aMoveQueue); } }
private void onDoSpawnRangeAttack(BattleMonster aActionMonster) { aActionMonster.onSpawnAttack -= onDoSpawnRangeAttack; this._currentItem.onMoveQueueItemChange += onMoveQueueItemChanged; this._currentItem.advanceMoveQueueFromState(EMoveQueueItemStatus.Start); this.setCamera(aActionMonster.gameObject,EMonsterCamPosition.TVCamera,true,true,false,aActionMonster.transform); //this.setCamera (closestOpponent.gameObject, EMonsterCamPosition.FrontSide, true, false, true, closestOpponent.transform); aActionMonster.returnPosition = BattleConstants.getMyPosition(this.positionFromTeam(this.teamFromMonster(aActionMonster)),this.teamFromMonster(aActionMonster).positionForMonster(aActionMonster.gameObject),this.transform.parent.gameObject.transform.position); }