Exemplo n.º 1
0
		public MoveQueueItem(float aSpeed,SelectedMoveData aMoveData,ETeamPosition aTargetTeam,EMonsterPos aTargetMonster,BattleMonsterWithMoves aActionMonster,EMonsterPos aActionMonsterPosition) {
			_speed = aSpeed;
			_move = aMoveData;
			_actionMonster = aActionMonster;
			targetTeam = aTargetTeam;
			targetMonster = aTargetMonster;
			actionPosition = aActionMonsterPosition;
			// Multi hit moves
			timesToHit = 1;
			firstHit = true;

		}
Exemplo n.º 2
0
		public void initMonster(MonsterDataMain aMonsterRef,EMonsterPos aMyPosition) {
			base.initMonster(aMonsterRef,aMyPosition);
			this.ownersName = aMonsterRef.ownersName;
			moveDataRef = new SelectedMoveData[aMonsterRef.selectedMoves.size];
			for(int i = 0;i<aMonsterRef.selectedMoves.size;i++) {
				moveDataRef[i] = aMonsterRef.selectedMoves[i];

				for(int j = 0;j<3;j++) {
					if(moveDataRef[i].moveData!=null) {
						GameObject g = moveDataRef[i].moveData.attackAnimationPrefab;
						if(g!=null) {
							g.SetActive(false);
							MoveAnimationLibItem.putBackParticles(g);
						}
						g = moveDataRef[i].moveData.attackAnimationHitPrefab;
						if(g!=null) {
							g.SetActive(false); 
							MoveAnimationLibItem.putBackParticles(g);
						}
					}
				}
			}
		}
Exemplo n.º 3
0
		public void initFromMove(SelectedMoveData aMoveData,MonsterDataMain aMonster) {
			if(!aMoveData.validMove) {
				this.gameObject.SetActive(false);
				isLit = false;
				return;
			} else {
				float energy = (float) aMoveData.moveData.energy;
				float maxEnergy = (float) MovesLib.REF.maxMoveEnergy;
				gameObject.SetActive(true);
				
				this.progressBar.value = energy / maxEnergy;;
				if(aMoveData.moveData.energy<=aMonster.energy) {
					if(aMoveData.moveData.Name==null) {
						Debug.LogError("Move Data: "+aMoveData.moveData+" is null");
						return;
					}
					title.text = aMoveData.moveData.Name.ToUpper();
					isLit = true;
				} else {
			//		title.text = "Not Enough Energy!".ToUpper();
					title.text = MovesLib.REF.struggleMove.Name;
					isLit = true;
				
				}
			}
		
			for(int i = 0;i<inactiveStars.Length;i++) {
				if(aMoveData.move.currentUnlockLevel>i) {
					activeStars[i].gameObject.SetActive(true);
					inactiveStars[i].gameObject.SetActive(false);
				} else {
					activeStars[i].gameObject.SetActive(false);
					inactiveStars[i].gameObject.SetActive(true);
				}
			}
			
		}
Exemplo n.º 4
0
		public void setFutureMove(byte aMoveIndex,ETeamPosition aTargetTeam,EMonsterPos aTargetMonster,bool aAutomatic) {
			
			SelectedMoveData moveData = null;
			if(aMoveIndex<moves.size) 
				moveData = moves[aMoveIndex]; else {
					moveData = new SelectedMoveData();
				}
			if(_futureMoveInfo!=null) {
				_futureMoveInfo.cleanUp();
				_futureMoveInfo =null;
			}
			_futureMoveInfo = new MoveQueueItem(this.speed,moveData,aTargetTeam,aTargetMonster,this,this.myPosition);
			if(onMoveSet!=null) {
				onMoveSet(this as BattleMonster,this._futureMoveInfo.moveData,aAutomatic);
			}
			
		}
Exemplo n.º 5
0
		public void setFutureMove(ITMItem aItem) {
			
			SelectedMoveData moveData = new SelectedMoveData(aItem);
			
			if(_futureMoveInfo!=null) {
				_futureMoveInfo.cleanUp();
				_futureMoveInfo =null;
			}
			_futureMoveInfo = new MoveQueueItem(aItem,this);
			if(onMoveSet!=null) {
				Debug.Log("Setting Future Move From Item: "+aItem.Name());
				onMoveSet(this as BattleMonster,this._futureMoveInfo.moveData,false);
			}
			
		}
Exemplo n.º 6
0
		public void cleanUp() {
			_move = null;
			_speed = 0;
		}
Exemplo n.º 7
0
		public MoveQueueItem() {
			// This is only called when the user skips a turn, do they ever want to do this?
			_speed = float.MaxValue;
			_move = null;
			firstHit = true;
		}
Exemplo n.º 8
0
		private void initMoveButton(MoveButtonScript aMoveButton,SelectedMoveData aMove) {
			aMoveButton.initFromMove(aMove,(MonsterDataMain) this._monsterRef.monster);
		} 
Exemplo n.º 9
0
	public SelectedMoveData unlockTreeItemOverride(string aMove) {
		for(int i = 0 ; i < _items.size ; i++ ) {
			if(_items[i].itemRef.moveData.plainName == aMove) {
					_items[i].currentUnlockLevel++;
					SelectedMoveData md = new SelectedMoveData();
					md.setMove(EMoveUnlockType.Manual,_items[i]);
					return md;
				}
			} 
		return null;
	}