示例#1
0
	/// <summary>
	/// Called when the grid block creates the unit.
	/// </summary>
	/// <param name="startLocation">Start location.</param>
	public virtual void spawnUnit(CreatePlayGrid gm, GridBlock startLocation, Team t){
		grid = gm;
		blockList = new LinkedList<GridBlock>();
		//set base unit stats so they can be adjusted at runtime
		maxProgramLength = unitInfo.maxLength;
		maximumMovment = unitInfo.maxMove;
		movmentActionsRemaning = maximumMovment;
		currentMaxPosibleAttackActions = unitInfo.maxAttackActions;
		currentAttacksRemaning = currentMaxPosibleAttackActions;
		currentAttackPower = unitInfo.attackPow;
		team = t;
		team.addAlly(this);
		team.addSpawn();

		blockList.AddLast(startLocation);
		float spawnTime = spawnAnimation();
		Invoke("checkAllDisplay", spawnTime);
		timerStartup();
		Invoke("startTimerTick", spawnTime);
	}