1
Fork 0
This commit is contained in:
Francesca Peres 2019-04-29 22:50:44 +02:00
commit 5f7107d0ab
18 changed files with 386 additions and 27 deletions

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f6a2c0a52737a5a4794c1c554ae74f92
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,99 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2367471035175245579
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6396226493625798564}
- component: {fileID: 2626420468597207246}
- component: {fileID: 7494384068586061072}
m_Layer: 0
m_Name: ShopCore
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6396226493625798564
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2367471035175245579}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 1.674, y: 1.288, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &2626420468597207246
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2367471035175245579}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -1632844979
m_SortingLayer: 1
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 6f7fb14bc8def66489cd073508b3f7f1, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 3, y: 2}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &7494384068586061072
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2367471035175245579}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aec5e971190b4b544a78be24566f9e6c, type: 3}
m_Name:
m_EditorClassIdentifier:
hpTrueMax: 10000
overlappable: 0
hpMax: 0
hp: 0
monsterName: Shop

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c3ac02f145d6cad40ae01edcbdcd9e5c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2996832894549006294
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5877171006370156409}
- component: {fileID: 7011391471819570637}
m_Layer: 0
m_Name: ShopEdge
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5877171006370156409
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2996832894549006294}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &7011391471819570637
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2996832894549006294}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aec5e971190b4b544a78be24566f9e6c, type: 3}
m_Name:
m_EditorClassIdentifier:
hpTrueMax: 10000
overlappable: 0
hpMax: 0
hp: 0
monsterName: Shop

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e2be382851e835b47b54bd2312bc7e2c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -12,7 +12,7 @@ GameObject:
- component: {fileID: -812928086201289980}
- component: {fileID: 7711614280348628083}
m_Layer: 0
m_Name: SHOP Rapier
m_Name: ShopRapier
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -67,7 +67,7 @@ SpriteRenderer:
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -522733599
m_SortingLayer: 1
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 0b83d7efeff86e3458c4860e3760ab38, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
@ -96,8 +96,8 @@ MonoBehaviour:
overlappable: 1
hpMax: 1
hp: 1
hpChange: -2
maxHpChange: -2
hpChange: -4
maxHpChange: -4
damage: 3
attackAnimation: {fileID: 5896060810164205279, guid: 602b69921902efc44ab8a008655b6574,
type: 3}

View file

@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 4697102406538043977}
- component: {fileID: -7754318986722149322}
m_Layer: 0
m_Name: SHOP Sword
m_Name: ShopSword
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -67,7 +67,7 @@ SpriteRenderer:
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -522733599
m_SortingLayer: 1
m_SortingLayer: 2
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 29a95eeaa590c2b468ff8382fa4459f1, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
@ -96,8 +96,8 @@ MonoBehaviour:
overlappable: 1
hpMax: 1
hp: 0
hpChange: -6
maxHpChange: -6
hpChange: -10
maxHpChange: -10
damage: 5
attackAnimation: {fileID: 5896060810164205279, guid: 602b69921902efc44ab8a008655b6574,
type: 3}

View file

@ -92,7 +92,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 08019d8cb8af79544a488e243ab1fec4, type: 3}
m_Name:
m_EditorClassIdentifier:
hpTrueMax: 10
hpTrueMax: 6
overlappable: 0
hpMax: 10
hp: 10

View file

@ -12,7 +12,7 @@ GameObject:
- component: {fileID: 1965585829385846694}
- component: {fileID: -144353291634153714}
m_Layer: 0
m_Name: SkeletonArrow
m_Name: SkeletonArcher
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -92,7 +92,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 8c5306e803d8d9344b3a7b100fa00deb, type: 3}
m_Name:
m_EditorClassIdentifier:
hpTrueMax: 10
hpTrueMax: 4
overlappable: 0
hpMax: 0
hp: 0

View file

@ -66,7 +66,7 @@ SpriteRenderer:
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -522733599
m_SortingLayerID: -1632844979
m_SortingLayer: 1
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 831bed7066c807a478c9a7069bde5f13, type: 3}

View file

@ -92,7 +92,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: d03e35d46ecc79e45a2b1a4735094763, type: 3}
m_Name:
m_EditorClassIdentifier:
hpTrueMax: 15
hpTrueMax: 14
overlappable: 0
hpMax: 15
hp: 15

View file

@ -272,6 +272,14 @@ MonoBehaviour:
curiositiesToSpawn: 35
stairsPrefab: {fileID: 6102638172941227538, guid: 772ce20bae1b4ee41a0f142397309d32,
type: 3}
shopCorePrefab: {fileID: 2367471035175245579, guid: c3ac02f145d6cad40ae01edcbdcd9e5c,
type: 3}
shopEdgePrefab: {fileID: 2996832894549006294, guid: e2be382851e835b47b54bd2312bc7e2c,
type: 3}
shopItems:
- {fileID: 1306643954942640807, guid: 95108a3fad23a64459e636e30a6af002, type: 3}
- {fileID: 92662261887728601, guid: 7c2fb7e54af6dea468b8dac35e5b6e8c, type: 3}
- {fileID: 9176106732687901849, guid: f706c9b9b5b3ec1459e524a5defeb1c8, type: 3}
--- !u!1 &6763073704789207264
GameObject:
m_ObjectHideFlags: 0
@ -424,7 +432,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:

View file

@ -187,10 +187,5 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2174908496911848014, guid: 4c25f33cb89f6624db48fc49d353a7f2,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -9.999878
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 4c25f33cb89f6624db48fc49d353a7f2, type: 3}

View file

@ -114,6 +114,15 @@ public class Map : MonoBehaviour
[BeforeStartAttribute]
public GameObject stairsPrefab;
[BeforeStartAttribute]
public GameObject shopCorePrefab;
[BeforeStartAttribute]
public GameObject shopEdgePrefab;
[BeforeStartAttribute]
public GameObject[] shopItems; //3
private GameObject[,] tiles;
private List<MapRoom> rooms;
private TurnHandler turnHandler;
@ -258,9 +267,13 @@ public class Map : MonoBehaviour
private void PlaceEnemies() {
for(int i = 0; i < enemiesToSpawn; i++) {
MapRoom room = rooms[Random.Range(0, rooms.Count)];
Vector2Int point = room.RandomPoint();
if(turnHandler.GetEntitiesAtPosition(point).Count > 0) {
continue;
Vector2Int point;
while(true) {
point = room.RandomPoint();
if(turnHandler.GetEntitiesAtPosition(point).Count > 0) {
continue;
}
break;
}
GameObject enemyPrefab = enemyPrefabs[Random.Range(0, enemyPrefabs.Count)];
GameObject enemyObject = Instantiate(enemyPrefab, turnHandler.transform);
@ -272,9 +285,13 @@ public class Map : MonoBehaviour
private void PlaceCuriosities() {
for(int i = 0; i < curiositiesToSpawn; i++) {
MapRoom room = rooms[Random.Range(0, rooms.Count)];
Vector2Int point = room.RandomPoint();
if(turnHandler.GetEntitiesAtPosition(point).Count > 0) {
continue;
Vector2Int point;
while(true) {
point = room.RandomPoint();
if(turnHandler.GetEntitiesAtPosition(point).Count > 0) {
continue;
}
break;
}
GameObject curiosityPrefab = curiositiesPrefabs[Random.Range(0, curiositiesPrefabs.Count)];
GameObject curiosityObject = Instantiate(curiosityPrefab, turnHandler.transform);
@ -285,7 +302,14 @@ public class Map : MonoBehaviour
private void PlaceStairs() {
MapRoom room = rooms[Random.Range(0, rooms.Count)];
Vector2Int point = room.RandomPoint();
Vector2Int point;
while(true) {
point = room.RandomPoint();
if(turnHandler.GetEntitiesAtPosition(point).Count > 0) {
continue;
}
break;
}
GameObject curiosityObject = Instantiate(stairsPrefab, turnHandler.transform);
curiosityObject.name = "Stairs";
curiosityObject.transform.position = new Vector3(point.x, point.y, 0);
@ -307,6 +331,54 @@ public class Map : MonoBehaviour
}
}
private void PlaceShop() {
MapRoom room = rooms[Random.Range(0, rooms.Count)];
Vector2Int point;
while(true) {
bool done = true;
point = room.RandomPoint();
for(int x = -2; x <= 2; x++) {
for(int y = -2; y <= 2; y++) {
if(turnHandler.GetEntitiesAtPosition(new Vector2Int(x, y)).Count > 0) {
done = false;
}
if(!done) break;
}
if(!done) break;
}
if(done) break;
}
GameObject shopCore = Instantiate(shopCorePrefab, turnHandler.transform);
shopCore.name = "Shop (Core)";
shopCore.transform.position = new Vector3(point.x, point.y, 0);
GameObject shopEdge = Instantiate(shopEdgePrefab, turnHandler.transform);
shopEdge.name = "Shop (Edge)";
shopEdge.transform.position = new Vector3(point.x+1, point.y, 0);
shopEdge = Instantiate(shopEdgePrefab, turnHandler.transform);
shopEdge.name = "Shop (Edge)";
shopEdge.transform.position = new Vector3(point.x-1, point.y, 0);
shopEdge = Instantiate(shopEdgePrefab, turnHandler.transform);
shopEdge.name = "Shop (Edge)";
shopEdge.transform.position = new Vector3(point.x+1, point.y+1, 0);
shopEdge = Instantiate(shopEdgePrefab, turnHandler.transform);
shopEdge.name = "Shop (Edge)";
shopEdge.transform.position = new Vector3(point.x-1, point.y+1, 0);
shopEdge = Instantiate(shopEdgePrefab, turnHandler.transform);
shopEdge.name = "Shop (Edge)";
shopEdge.transform.position = new Vector3(point.x, point.y+1, 0);
shopEdge = Instantiate(shopEdgePrefab, turnHandler.transform);
shopEdge.name = "Shop (Edge)";
GameObject shopItem1 = Instantiate(shopItems[0], turnHandler.transform);
shopItem1.transform.position = new Vector3(point.x, point.y-1, 0);
shopEdge.name = "Shop Item 1";
GameObject shopItem2 = Instantiate(shopItems[1], turnHandler.transform);
shopItem2.transform.position = new Vector3(point.x+1, point.y-1, 0);
shopEdge.name = "Shop Item 2";
GameObject shopItem3 = Instantiate(shopItems[2], turnHandler.transform);
shopItem3.transform.position = new Vector3(point.x-1, point.y-1, 0);
shopEdge.name = "Shop Item 3";
}
public void NewLevel() {
//Cleanup everything.
transform.parent.BroadcastMessage("OnNewLevel");
@ -316,7 +388,8 @@ public class Map : MonoBehaviour
turnHandler = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren<TurnHandler>();
GenerateMap();
GenerateTileSprites();
GenerateTileSprites();
PlaceShop();
PlacePlayer();
PlaceEnemies();
PlaceCuriosities();

View file

@ -0,0 +1,112 @@
fileFormatVersion: 2
guid: 6f7fb14bc8def66489cd073508b3f7f1
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
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: 40
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: dcd53d4a666bacf428105dadf22be705
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant: