function attackTile(address _msgSender, uint16 _tileId, uint _attackAmount, bool _useBattleValue, bool _autoFortify) public isValidCaller {
            require(_attackAmount >= 1 finney);         
            require(_attackAmount % 1 finney == 0);
    
            address claimer;
            uint blockValue;
            (claimer, blockValue) = bwData.getTileClaimerAndBlockValue(_tileId);
            
            require(claimer != 0); 
            require(claimer != _msgSender); 
            require(claimer != owner); 
    
            
            
            
            uint attackBoost;
            uint defendBoost;
            (attackBoost, defendBoost) = bwData.calculateBattleBoost(_tileId, _msgSender, claimer);
            uint totalAttackAmount = _attackAmount + attackBoost;
            uint totalDefendAmount = blockValue + defendBoost;
            require(totalAttackAmount >= _attackAmount); 
            require(totalDefendAmount >= blockValue); 
            require(totalAttackAmount + totalDefendAmount > totalAttackAmount && totalAttackAmount + totalDefendAmount > totalDefendAmount); 
    
            
            require(totalAttackAmount / 10 <= blockValue); 
            require(totalAttackAmount >= blockValue / 10); 
    
            
            uint attackRoll = random(totalAttackAmount + totalDefendAmount); 
            if (attackRoll > totalDefendAmount) {
                
                emit TileAttackedSuccessfully(_tileId, _msgSender, _attackAmount, totalAttackAmount, claimer, blockValue, totalDefendAmount, attackRoll, block.timestamp);
    
                
                bwData.setClaimerForTile(_tileId, _msgSender);
    
                
                if (_useBattleValue) {
                    if (_autoFortify) {
                        
                        fortifyClaim(_msgSender, _tileId, _attackAmount);
                        subUserBattleValue(_msgSender, _attackAmount, false);
                    } else {
                        
                    }
                } else {
                    if (_autoFortify) {
                        
                        fortifyClaim(_msgSender, _tileId, _attackAmount);
                    } else {
                        addUserBattleValue(_msgSender, _attackAmount); 
                    }
                }
            } else {
                
                if (_useBattleValue) {
                    subUserBattleValue(_msgSender, _attackAmount, false); 
                }
                addUserBattleValue(claimer, _attackAmount); 
    
                
                emit TileDefendedSuccessfully(_tileId, _msgSender, _attackAmount, totalAttackAmount, claimer, blockValue, totalDefendAmount, attackRoll, block.timestamp);
    
                
                bwData.updateTileTimeStamp(_tileId);
            }
        }