完成四角塔,修复每回合城市财产
This commit is contained in:
parent
ae17256762
commit
33866959b3
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
@ -0,0 +1,114 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bb99c5430da749d409fddffc438edb3a
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -9,7 +9,7 @@ using UnityEditor;
|
||||
public enum TerrainType { None,Land, ShallowSea, DeepSea } // 海陆层
|
||||
public enum TerrainFeature { None, Mountain,Road } // 地形层
|
||||
public enum Vegetation { None, Trees } // 植被层
|
||||
public enum ResourceType { None, Fish, Starfish, Metal, Animal, Fruit, Crop, CityCenter, Treasure, Farm, Mine, LumberHut,Port,Sawmill,Forge,Windmill, Wonder,Bridge,Market,Temple,ForestTemple,MountainTemple,WaterTemple } // 资源层+建筑层
|
||||
public enum ResourceType { None, Fish, Starfish, Metal, Animal, Fruit, Crop, CityCenter, Treasure, Farm, Mine, LumberHut,Port,Sawmill,Forge,Windmill, Wonder,Bridge,Market,Temple,ForestTemple,MountainTemple,WaterTemple,Tower } // 资源层+建筑层
|
||||
public enum AttackAnimType {None,Melee,Arrow,Bomb}
|
||||
public enum MainObjectType { None,Grid,City,Unit,Player}
|
||||
|
||||
|
||||
@ -128,9 +128,18 @@ namespace Logic
|
||||
//获得一个city当前的回合钱
|
||||
public int GetCityStarsPerTurn(MapData mapData, CityData cityData)
|
||||
{
|
||||
//如果城市亏exp,要减少每回合的给钱数
|
||||
int mins = 0;
|
||||
if (cityData.LevelExp < 0)
|
||||
mins = cityData.LevelExp;
|
||||
int ret = 0;
|
||||
if (GetBuildingLevelByCity(mapData, cityData, ResourceType.Market, out var marketLevel))
|
||||
return marketLevel + cityData.ParkCount + cityData.Level + (cityData.IsCradle ? 1 : 0) + (cityData.Workshop ? 1 : 0);
|
||||
return cityData.Level + cityData.ParkCount + (cityData.IsCradle ? 1 : 0) + (cityData.Workshop ? 1 : 0);
|
||||
ret = marketLevel + cityData.ParkCount + cityData.Level - 1 + (cityData.IsCradle ? 1 : 0) + (cityData.Workshop ? 1 : 0) + mins;
|
||||
else
|
||||
ret = cityData.Level - 1 + cityData.ParkCount + (cityData.IsCradle ? 1 : 0) + (cityData.Workshop ? 1 : 0) + mins;
|
||||
if (ret < 0)
|
||||
ret = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
//获得一个city当前的某种building的level
|
||||
|
||||
@ -272,6 +272,15 @@ namespace Logic
|
||||
// 生成资源层
|
||||
var resource = GenerateResource(x, y, terrain, feature, vegetation);
|
||||
|
||||
//生成四个角的塔
|
||||
if (HasTower(x, y))
|
||||
{
|
||||
feature = TerrainFeature.None;
|
||||
resource = ResourceType.Tower;
|
||||
vegetation = Vegetation.None;
|
||||
}
|
||||
|
||||
|
||||
// 生成文明层
|
||||
var civId = GenerateCivilization(mapData,x, y);
|
||||
|
||||
@ -283,6 +292,16 @@ namespace Logic
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool HasTower(int x, int y)
|
||||
{
|
||||
if (x == 0 && y == 0) return true;
|
||||
if (x == 0 && y == _height - 1) return true;
|
||||
if (x == _width - 1 && y == 0) return true;
|
||||
if (x == _width - 1 && y == _height - 1) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//生成文明摇篮城市(每个玩家的原始首都)
|
||||
|
||||
@ -612,8 +612,12 @@ namespace Logic
|
||||
{
|
||||
foreach (var id in gidList)
|
||||
{
|
||||
playerData.Sight.SightGidSet.Add(id);
|
||||
mapData.GridMap.GetGridDataByGid(id,out var gridData);
|
||||
if (!playerData.Sight.SightGidSet.Add(id)) continue;
|
||||
if (!mapData.GridMap.GetGridDataByGid(id, out var gridData)) continue;
|
||||
if (!mapData.GetCapitalCityDataByPlayerId(playerData.Id, out var city)) continue;
|
||||
//处理发现tower的情况
|
||||
if (gridData.Resource == ResourceType.Tower)
|
||||
Main.CityLogic.CityUpdateExp(mapData,city,1);
|
||||
gridData.RenderMark = true;
|
||||
if (mapData.GetUnitDataByGid(id, out var unitData))
|
||||
unitData.RenderMark = true;
|
||||
|
||||
@ -371,6 +371,8 @@ namespace Logic
|
||||
ResourceType.Market => Resources.Load<Sprite>(
|
||||
$"ArtResources/TH1Buildings/TH1BuildingsCommon/TH1Building_Market"),
|
||||
ResourceType.Wonder => Table.Instance.GridAndResourceDataAssets.GetWonderSprite(_gridData.Wonder,_playerData),
|
||||
ResourceType.Tower => Resources.Load<Sprite>(
|
||||
$"ArtResources/TH1Buildings/TH1BuildingsCommon/TH1Building_Tower"),
|
||||
_ => null
|
||||
};
|
||||
if (_resource.GetComponent<SpriteRenderer>().sprite != res)
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user