Added interaction for trees and stones, added items wood, stone, book and slimeball, v1.4.0
This commit is contained in:
parent
8dbc177dcb
commit
d898a1c5fd
BIN
Assets/IMG/Aseprite/Inv_Book.aseprite
Normal file
BIN
Assets/IMG/Aseprite/Inv_Book.aseprite
Normal file
Binary file not shown.
7
Assets/IMG/Aseprite/Inv_Book.aseprite.meta
Normal file
7
Assets/IMG/Aseprite/Inv_Book.aseprite.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 61286a9c10c7f4c4eb77a6e7d33aac88
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/IMG/Aseprite/Inv_Slimeball.aseprite
Normal file
BIN
Assets/IMG/Aseprite/Inv_Slimeball.aseprite
Normal file
Binary file not shown.
7
Assets/IMG/Aseprite/Inv_Slimeball.aseprite.meta
Normal file
7
Assets/IMG/Aseprite/Inv_Slimeball.aseprite.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0644771adf7299244bb2b0c146ab8339
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/IMG/Aseprite/Inv_Stone.aseprite
Normal file
BIN
Assets/IMG/Aseprite/Inv_Stone.aseprite
Normal file
Binary file not shown.
7
Assets/IMG/Aseprite/Inv_Stone.aseprite.meta
Normal file
7
Assets/IMG/Aseprite/Inv_Stone.aseprite.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 540b33e18230d974e956b490744889ba
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/IMG/Aseprite/Inv_Wood.aseprite
Normal file
BIN
Assets/IMG/Aseprite/Inv_Wood.aseprite
Normal file
Binary file not shown.
7
Assets/IMG/Aseprite/Inv_Wood.aseprite.meta
Normal file
7
Assets/IMG/Aseprite/Inv_Wood.aseprite.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2e19fac0aad09b4487de5e151aa6888
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Resources/Items.meta
Normal file
8
Assets/Resources/Items.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 60b6a8d6b9127954281509010f10a374
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Items/Inv_Book.png
Normal file
BIN
Assets/Resources/Items/Inv_Book.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
120
Assets/Resources/Items/Inv_Book.png.meta
Normal file
120
Assets/Resources/Items/Inv_Book.png.meta
Normal file
@ -0,0 +1,120 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d5033562923ed0428ddde91034a6ab5
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
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
|
||||
vTOnly: 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: 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
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 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
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Items/Inv_Slimeball.png
Normal file
BIN
Assets/Resources/Items/Inv_Slimeball.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
120
Assets/Resources/Items/Inv_Slimeball.png.meta
Normal file
120
Assets/Resources/Items/Inv_Slimeball.png.meta
Normal file
@ -0,0 +1,120 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fddfe91ec79b5d942b0caad085ec5e09
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
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
|
||||
vTOnly: 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: 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
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 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
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Items/Inv_Stone.png
Normal file
BIN
Assets/Resources/Items/Inv_Stone.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 964 B |
120
Assets/Resources/Items/Inv_Stone.png.meta
Normal file
120
Assets/Resources/Items/Inv_Stone.png.meta
Normal file
@ -0,0 +1,120 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b09bda01d68d297459a9bc6063feaad8
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
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
|
||||
vTOnly: 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: 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
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 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
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Resources/Items/Inv_Wood.png
Normal file
BIN
Assets/Resources/Items/Inv_Wood.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
120
Assets/Resources/Items/Inv_Wood.png.meta
Normal file
120
Assets/Resources/Items/Inv_Wood.png.meta
Normal file
@ -0,0 +1,120 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 274b6fd388925774e9b6459c142397f0
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 11
|
||||
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: 1
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 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: 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
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 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
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -53,6 +53,18 @@ public class Controls : MonoBehaviour
|
||||
case "Enemy":
|
||||
fight.GetComponent<Fight>().startFight(worldGen.GetComponent<WorldGenerator>().getCurrentTile(), target, player);
|
||||
break;
|
||||
case "Tree":
|
||||
GameObject.Find("Inventory").GetComponent<Inventory>().addItem(new Item("Wood"));
|
||||
Destroy(target);
|
||||
break;
|
||||
case "Stone":
|
||||
GameObject.Find("Inventory").GetComponent<Inventory>().addItem(new Item("Stone"));
|
||||
Destroy(target);
|
||||
break;
|
||||
case "NPC":
|
||||
break;
|
||||
case "House":
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,13 +9,21 @@ namespace Assets.Scripts
|
||||
{
|
||||
public Book(int luck) : base(luck)
|
||||
{
|
||||
|
||||
itemName = "The kings diary #1";
|
||||
loadImage();
|
||||
rarityColor = Color.white;
|
||||
}
|
||||
|
||||
public Book(JToken json) : base(json)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
override
|
||||
protected void loadImage()
|
||||
{
|
||||
image = Resources.Load<Texture>("Items/Inv_Book");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -357,19 +357,32 @@ namespace Assets.Scripts
|
||||
Item endItem = endDrag.getItem(endDrag.getCurrentBag());
|
||||
if (endItem != null)
|
||||
{
|
||||
if (((Equipment)endItem).getPlace() != startDrag.place)
|
||||
if (endItem is Equipment)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (startDrag.place == ItemPlace.BAG)
|
||||
{
|
||||
startDrag.setItem(endItem, endDrag.getCurrentBag());
|
||||
if (((Equipment)endItem).getPlace() != startDrag.place)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
startDrag.setEquip((Equipment)endItem);
|
||||
inventory.calculateStatBoost(attributes, false);
|
||||
inventory.calculateStatBoost(((Equipment)endItem).getAttributes(), true);
|
||||
if (startDrag.place == ItemPlace.BAG)
|
||||
{
|
||||
startDrag.setItem(endItem, endDrag.getCurrentBag());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (endItem is Equipment)
|
||||
{
|
||||
startDrag.setEquip((Equipment)endItem);
|
||||
inventory.calculateStatBoost(attributes, false);
|
||||
inventory.calculateStatBoost(((Equipment)endItem).getAttributes(), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
isSwap = true;
|
||||
}
|
||||
|
||||
@ -18,10 +18,19 @@ namespace Assets.Scripts
|
||||
{
|
||||
luck = luck + GameObject.Find("Inventory").GetComponent<Inventory>().getEquipmentBonus()["LCK"];
|
||||
calculateRarity(luck);
|
||||
chooseItem();
|
||||
setColor();
|
||||
loadImage();
|
||||
}
|
||||
|
||||
public Item(string name)
|
||||
{
|
||||
rarity = ItemRarity.COMMON;
|
||||
itemName = name;
|
||||
rarityColor = Color.white;
|
||||
loadImage();
|
||||
}
|
||||
|
||||
public Item(JToken json)
|
||||
{
|
||||
rarity = (ItemRarity)Enum.Parse(typeof(ItemRarity), json["rarity"].ToString());
|
||||
@ -72,7 +81,18 @@ namespace Assets.Scripts
|
||||
|
||||
protected virtual void loadImage()
|
||||
{
|
||||
|
||||
switch (itemName)
|
||||
{
|
||||
case "Slimeball":
|
||||
image = Resources.Load<Texture>("Items/Inv_Slimeball");
|
||||
break;
|
||||
case "Wood":
|
||||
image = Resources.Load<Texture>("Items/Inv_Wood");
|
||||
break;
|
||||
case "Stone":
|
||||
image = Resources.Load<Texture>("Items/Inv_Stone");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string saveGame()
|
||||
@ -100,7 +120,20 @@ namespace Assets.Scripts
|
||||
|
||||
public virtual string getInformation()
|
||||
{
|
||||
return "";
|
||||
string result = "";
|
||||
switch (itemName)
|
||||
{
|
||||
case "Slimeball":
|
||||
result = "Soft and sticky... Does it have a use?";
|
||||
break;
|
||||
case "Wood":
|
||||
result = "Quite a nice piece of wood";
|
||||
break;
|
||||
case "Stone":
|
||||
result = "A small stone to craft with";
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual void move(InventorySlot startDrag, Inventory inventory, InventorySlot endDrag)
|
||||
@ -114,9 +147,39 @@ namespace Assets.Scripts
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
endDrag.setItem(this, startDrag.getCurrentBag());
|
||||
startDrag.setItem(item, endDrag.getCurrentBag());
|
||||
}
|
||||
else
|
||||
{
|
||||
startDrag.removeItem();
|
||||
}
|
||||
|
||||
endDrag.setItem(this, startDrag.getCurrentBag());
|
||||
}
|
||||
|
||||
private void chooseItem()
|
||||
{
|
||||
/* Common: Slimeball
|
||||
* Rare:
|
||||
* Epic:
|
||||
* Legendary:
|
||||
*/
|
||||
int index = rand.Next(10);
|
||||
switch (rarity)
|
||||
{
|
||||
case ItemRarity.COMMON:
|
||||
itemName = "Slimeball";
|
||||
break;
|
||||
case ItemRarity.RARE:
|
||||
itemName = "Slimeball";
|
||||
break;
|
||||
case ItemRarity.EPIC:
|
||||
itemName = "Slimeball";
|
||||
break;
|
||||
case ItemRarity.LEGENDARY:
|
||||
itemName = "Slimeball";
|
||||
break;
|
||||
}
|
||||
startDrag.setItem(item, endDrag.getCurrentBag());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -100,9 +100,23 @@ namespace Assets.Scripts.Slimes
|
||||
|
||||
public Item getItem()
|
||||
{
|
||||
if (new System.Random().Next(100) + 1 < 10 + luck)
|
||||
int rand = new System.Random().Next(100) + 1;
|
||||
if (rand < 10000)//10 + luck)
|
||||
{
|
||||
item = new Equipment(luck);
|
||||
int type = new System.Random().Next(3);
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
item = new Equipment(luck);
|
||||
break;
|
||||
case 1:
|
||||
item = new Book(luck);
|
||||
break;
|
||||
case 2:
|
||||
item = new Item(luck);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
Music:0
|
||||
Effects:0
|
||||
Effects:0.5068976
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user