diff --git a/assets/Data/GameSettings.json b/assets/Data/GameSettings.json index 6b58a60..8bd98c6 100644 --- a/assets/Data/GameSettings.json +++ b/assets/Data/GameSettings.json @@ -173,7 +173,7 @@ "goldReward": 0, "healthPotionRewardChance": 0.01, "magnetRewardChance": 0.01, - "chestRewardChance": 0 + "chestRewardChance": 1 }, { "id": "StandardEnemy", @@ -471,9 +471,9 @@ "individualEnemySpawners": [ { "common": { - "enemyId": "SiegeEnemyRanged", + "enemyId": "BasicEnemy", "startDelay": 0, - "stopDelay": 2, + "stopDelay": 100, "cooldown": 1 } }, diff --git a/assets/Media/Prefabs/ModalWindows/Chest.meta b/assets/Media/Prefabs/ModalWindows/Chest.meta new file mode 100644 index 0000000..02b8e55 --- /dev/null +++ b/assets/Media/Prefabs/ModalWindows/Chest.meta @@ -0,0 +1,12 @@ +{ + "ver": "1.1.0", + "importer": "directory", + "imported": true, + "uuid": "5bf41cb5-9a22-495b-91ae-a8dcd4cd7e46", + "files": [], + "subMetas": {}, + "userData": { + "compressionType": {}, + "isRemoteBundle": {} + } +} diff --git a/assets/Media/Prefabs/ModalWindows/Chest/ChestModalWindow.prefab b/assets/Media/Prefabs/ModalWindows/Chest/ChestModalWindow.prefab new file mode 100644 index 0000000..3da32fc --- /dev/null +++ b/assets/Media/Prefabs/ModalWindows/Chest/ChestModalWindow.prefab @@ -0,0 +1,1626 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "ChestModalWindow", + "_objFlags": 0, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false, + "asyncLoadAssets": false + }, + { + "__type__": "cc.Node", + "_name": "ChestModalWindow", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_components": [ + { + "__id__": 70 + }, + { + "__id__": 72 + }, + { + "__id__": 74 + } + ], + "_prefab": { + "__id__": 76 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Animated", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 9 + }, + { + "__id__": 57 + } + ], + "_active": true, + "_components": [ + { + "__id__": 65 + }, + { + "__id__": 67 + } + ], + "_prefab": { + "__id__": 69 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 4 + }, + { + "__id__": 6 + } + ], + "_prefab": { + "__id__": 8 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 5 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 640, + "height": 960 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "c5lhLHKUVHb6b9KM4Q1B77" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "__prefab": { + "__id__": 7 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 147 + }, + "_spriteFrame": { + "__uuid__": "0a917d5c-2810-46e1-8332-63f00395d63a@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "0dDC5jMI5PKbDuUYgdvo4A" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "a4H4MOZL1Lx4AKbYuogwSa" + }, + { + "__type__": "cc.Node", + "_name": "Window", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 10 + } + ], + "_active": true, + "_components": [ + { + "__id__": 54 + } + ], + "_prefab": { + "__id__": 56 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "ChestLevelUpSkill", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 9 + }, + "_children": [ + { + "__id__": 11 + }, + { + "__id__": 29 + }, + { + "__id__": 35 + }, + { + "__id__": 41 + } + ], + "_active": true, + "_components": [ + { + "__id__": 47 + }, + { + "__id__": 49 + }, + { + "__id__": 51 + } + ], + "_prefab": { + "__id__": 53 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Bg", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [ + { + "__id__": 12 + } + ], + "_active": true, + "_components": [ + { + "__id__": 24 + }, + { + "__id__": 26 + } + ], + "_prefab": { + "__id__": 28 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -7.74, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 2, + "y": 2, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "Shadow", + "_objFlags": 0, + "_parent": { + "__id__": 11 + }, + "_children": [ + { + "__id__": 13 + } + ], + "_active": true, + "_components": [ + { + "__id__": 19 + }, + { + "__id__": 21 + } + ], + "_prefab": { + "__id__": 23 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 15, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "TitleBg", + "_objFlags": 0, + "_parent": { + "__id__": 12 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 14 + }, + { + "__id__": 16 + } + ], + "_prefab": { + "__id__": 18 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 13, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_enabled": true, + "__prefab": { + "__id__": 15 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 86, + "height": 28 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a3H99wMmVAhZUrcRKq0W0D" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_enabled": true, + "__prefab": { + "__id__": 17 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "ae4d7996-bef9-4db8-82d4-978dcbd6bf30@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "fabDlk5idHUK3IAzzoZ8wz" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "2bOl1R9txFMq0/tc0rV/q6" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 12 + }, + "_enabled": true, + "__prefab": { + "__id__": 20 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 78, + "height": 15 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "e6XNlqlnZPoqL05/UvfiGz" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 12 + }, + "_enabled": true, + "__prefab": { + "__id__": 22 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "b2204e0c-756a-46c5-861f-d9ff79130dff@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "9bf15FYMpI9YQ0EgMv9ahp" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "7cI9cguUxGEZb9l1aQPMsL" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 11 + }, + "_enabled": true, + "__prefab": { + "__id__": 25 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 78, + "height": 110 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "29NGQ5UmxKyZ71sICZuQd3" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 11 + }, + "_enabled": true, + "__prefab": { + "__id__": 27 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "229e635e-a24d-4248-999e-e920dceefd4c@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "17+ajSwk1G+LUJh+7GVmPi" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "56Fm/bqntHoIguRxPB3U7/" + }, + { + "__type__": "cc.Node", + "_name": "Title", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 30 + }, + { + "__id__": 32 + } + ], + "_prefab": { + "__id__": 34 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 51.138, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "__prefab": { + "__id__": 31 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 118.46, + "height": 37.2 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "393EtoiC1PyrnQfhdE+gMb" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "__prefab": { + "__id__": 33 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 25, + "g": 29, + "b": 43, + "a": 255 + }, + "_string": "Increase health", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 18, + "_fontSize": 18, + "_fontFamily": "Arial", + "_lineHeight": 18, + "_overflow": 1, + "_enableWrapText": true, + "_font": { + "__uuid__": "c96b42a9-d20d-4c59-8e99-8ed749a715c8", + "__expectedType__": "cc.BitmapFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 1, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "aaQheJVnBGoZ6YlrVZqYaF" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "0dSDXFj4RLnKETWF78+9qo" + }, + { + "__type__": "cc.Node", + "_name": "Sprite", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 36 + }, + { + "__id__": 38 + } + ], + "_prefab": { + "__id__": 40 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -24.948, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 2, + "y": 2, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 35 + }, + "_enabled": true, + "__prefab": { + "__id__": 37 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 32, + "height": 32 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "cb38vfzKhMIrVVwr3QXNja" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 35 + }, + "_enabled": true, + "__prefab": { + "__id__": 39 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "d9da770f-92eb-4ec5-8510-b207bc7b36af@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": { + "__uuid__": "c4872559-07b2-44e5-9613-5f22506b1989", + "__expectedType__": "cc.SpriteAtlas" + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "faHDZ4GoZEb6COf8yh0X4j" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "df0fbU8wZCDKs8ey4tm0D3" + }, + { + "__type__": "cc.Node", + "_name": "Description", + "_objFlags": 0, + "_parent": { + "__id__": 10 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 42 + }, + { + "__id__": 44 + } + ], + "_prefab": { + "__id__": 46 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": -81.138, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 41 + }, + "_enabled": true, + "__prefab": { + "__id__": 43 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 117.86, + "height": 36 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "6akjBB1LFFTqTTmWJlOyUK" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 41 + }, + "_enabled": true, + "__prefab": { + "__id__": 45 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 151, + "g": 169, + "b": 192, + "a": 255 + }, + "_string": "Increase healthwefwef", + "_horizontalAlign": 1, + "_verticalAlign": 1, + "_actualFontSize": 12, + "_fontSize": 12, + "_fontFamily": "Arial", + "_lineHeight": 12, + "_overflow": 1, + "_enableWrapText": true, + "_font": { + "__uuid__": "c96b42a9-d20d-4c59-8e99-8ed749a715c8", + "__expectedType__": "cc.BitmapFont" + }, + "_isSystemFontUsed": false, + "_spacingX": 0, + "_isItalic": false, + "_isBold": false, + "_isUnderline": false, + "_underlineHeight": 2, + "_cacheMode": 1, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "4c5hN/5ldJ4ZtvyMN8hHCs" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "c93GBLyS5MtKzqr4rp8Mcf" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": { + "__id__": 48 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 156, + "height": 200 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2dw/C9Z2JLmLfrfzXC3Vkq" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 10 + }, + "_enabled": false, + "__prefab": { + "__id__": 50 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "229e635e-a24d-4248-999e-e920dceefd4c@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 1, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d1xh0sxhVN/pdLt9v0uKNC" + }, + { + "__type__": "65e26iJvE9IfYYlYC+87Y6x", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 10 + }, + "_enabled": true, + "__prefab": { + "__id__": 52 + }, + "skillTitle": { + "__id__": 32 + }, + "skillDescription": { + "__id__": 44 + }, + "skillIcon": { + "__id__": 38 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "50gwwBkKpJ9ZZg3IcRwirJ" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "1fQlEDFZ9JTqwVneSztvbI" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 9 + }, + "_enabled": true, + "__prefab": { + "__id__": 55 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 640, + "height": 960 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "fa4m+6cDBEPbDPsQkcim8p" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "e1AOGk0qpH6ZeVYP9+MiEv" + }, + { + "__type__": "cc.Node", + "_name": "OkButton", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 58 + }, + { + "__id__": 60 + }, + { + "__id__": 62 + } + ], + "_prefab": { + "__id__": 64 + }, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 57 + }, + "_enabled": true, + "__prefab": { + "__id__": 59 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 640, + "height": 960 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "00IVmnTwNOhIPUbSd9EUJD" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 57 + }, + "_enabled": true, + "__prefab": { + "__id__": 61 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 0 + }, + "_spriteFrame": { + "__uuid__": "0a917d5c-2810-46e1-8332-63f00395d63a@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "81sYL+mVNNhIdedWXiXhP2" + }, + { + "__type__": "55e5f5nQ8dHiL5fPWjgdXbH", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 57 + }, + "_enabled": true, + "__prefab": { + "__id__": 63 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "db+NM824RH97nAB1oArHdd" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "0dde3ylBxH+4mjCN3bCby2" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 66 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 640, + "height": 960 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "e4B9UglJFDQYcryS0d+eE/" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "__prefab": { + "__id__": 68 + }, + "playOnLoad": true, + "_clips": [ + { + "__uuid__": "db746fc0-e505-4f7e-a532-88cdba7d3482", + "__expectedType__": "cc.AnimationClip" + }, + { + "__uuid__": "e5bb5e18-b3a9-4d4b-bec5-439ff214d76a", + "__expectedType__": "cc.AnimationClip" + } + ], + "_defaultClip": { + "__uuid__": "db746fc0-e505-4f7e-a532-88cdba7d3482", + "__expectedType__": "cc.AnimationClip" + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "d7RrH28tFPG4ZxprKl97K+" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "8dMwoGhd1GUbOjpeRqLjco" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 71 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 640, + "height": 960 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "2eO+M9deJI1KYyU2Otv4xD" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "__editorExtras__": {}, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 73 + }, + "_alignFlags": 45, + "_target": null, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_horizontalCenter": 0, + "_verticalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 100, + "_alignMode": 2, + "_lockFlags": 0, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "67Ws0zREFMYKNYvOHw9C0b" + }, + { + "__type__": "422c899zDhMapxhQgwpGmEL", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 75 + }, + "animation": { + "__id__": 67 + }, + "backgroundCloseButton": null, + "levelUpSkill": { + "__id__": 51 + }, + "okButton": { + "__id__": 62 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "652hkBXutHsKyuPyNlg1pm" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "32U/bJCUBDlaQxxGFNXZTu", + "targetOverrides": [] + } +] \ No newline at end of file diff --git a/assets/Media/Prefabs/ModalWindows/Chest/ChestModalWindow.prefab.meta b/assets/Media/Prefabs/ModalWindows/Chest/ChestModalWindow.prefab.meta new file mode 100644 index 0000000..f67efa5 --- /dev/null +++ b/assets/Media/Prefabs/ModalWindows/Chest/ChestModalWindow.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.40", + "importer": "prefab", + "imported": true, + "uuid": "d07d3ad3-88c1-4b8e-af61-05f53a405d59", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "ChestModalWindow" + } +} diff --git a/assets/Scenes/Game.scene b/assets/Scenes/Game.scene index ee33a3e..21b9a0c 100644 --- a/assets/Scenes/Game.scene +++ b/assets/Scenes/Game.scene @@ -269,7 +269,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": 319.99999999999994, - "y": 479.99999999999994, + "y": 480.00000000000006, "z": 0 }, "_lrot": { @@ -1639,7 +1639,7 @@ "_lpos": { "__type__": "cc.Vec3", "x": -320, - "y": 480, + "y": 480.0000000000001, "z": -1000 }, "_lrot": { @@ -2954,6 +2954,10 @@ { "__uuid__": "cc259578-1eb4-4dd3-87b0-fd42c11668b1", "__expectedType__": "cc.Prefab" + }, + { + "__uuid__": "d07d3ad3-88c1-4b8e-af61-05f53a405d59", + "__expectedType__": "cc.Prefab" } ], "_id": "1afHrrV8tIPrYb4xymz6bQ" @@ -3391,7 +3395,7 @@ "_priority": 1073741824, "_fov": 45, "_fovAxis": 0, - "_orthoHeight": 480, + "_orthoHeight": 480.00000000000006, "_near": 0, "_far": 2000, "_color": { @@ -3622,8 +3626,8 @@ "_target": null, "_left": -5.684341886080802e-14, "_right": 0, - "_top": 0, - "_bottom": -5.684341886080802e-14, + "_top": 1.1368683772161603e-13, + "_bottom": 5.684341886080802e-14, "_horizontalCenter": 0, "_verticalCenter": 0, "_isAbsLeft": true, diff --git a/assets/Scripts/Game/Game.ts b/assets/Scripts/Game/Game.ts index 05dc65a..efe41db 100644 --- a/assets/Scripts/Game/Game.ts +++ b/assets/Scripts/Game/Game.ts @@ -97,7 +97,6 @@ export class Game extends Component { this.player.init(multiInput, this.createPlayerData(settings.player, metaUpgrades)); this.enemyManager.init(this.player.node, settings.enemyManager); - this.itemManager.init(this.enemyManager, this.player, this.gameResult, settings.items); this.playerCollisionSystem = new PlayerCollisionSystem(this.player, settings.player.collisionDelay, this.itemManager); new WeaponCollisionSystem(this.player.Weapon); @@ -157,6 +156,7 @@ export class Game extends Component { ); const modalLauncher = new GameModalLauncher(this.modalWindowManager, this.player, this.gamePauser, upgrader, translationData); + this.itemManager.init(this.enemyManager, this.player, this.gameResult, modalLauncher, settings.items); this.gameUI.init(this.player, modalLauncher); this.background.init(this.player.node); diff --git a/assets/Scripts/Game/Items/ItemManager.ts b/assets/Scripts/Game/Items/ItemManager.ts index 98cb51b..e197e92 100644 --- a/assets/Scripts/Game/Items/ItemManager.ts +++ b/assets/Scripts/Game/Items/ItemManager.ts @@ -3,6 +3,7 @@ import { ISignal } from "../../Services/EventSystem/ISignal"; import { Signal } from "../../Services/EventSystem/Signal"; import { ItemSettings } from "../Data/GameSettings"; import { GameResult } from "../Game"; +import { GameModalLauncher } from "../ModalWIndows/GameModalLauncher"; import { Enemy } from "../Unit/Enemy/Enemy"; import { EnemyManager } from "../Unit/Enemy/EnemyManager"; import { Player } from "../Unit/Player/Player"; @@ -24,15 +25,17 @@ export class ItemManager extends Component { private player: Player; private gameResult: GameResult; + private modalLauncher: GameModalLauncher; private healthPerPotion: number; private pickupEvent = new Signal(); private itemTypeToAction = new Map void>(); - public init(enemyManager: EnemyManager, player: Player, gameResult: GameResult, settings: ItemSettings): void { + public init(enemyManager: EnemyManager, player: Player, gameResult: GameResult, modalLauncher: GameModalLauncher, settings: ItemSettings): void { this.player = player; this.gameResult = gameResult; + this.modalLauncher = modalLauncher; this.healthPerPotion = settings.healthPerPotion; enemyManager.EnemyAddedEvent.on(this.addEnemyListeners, this); @@ -50,7 +53,7 @@ export class ItemManager extends Component { this.itemTypeToAction.set(ItemType.Gold, this.addGold.bind(this)); this.itemTypeToAction.set(ItemType.HealthPotion, this.useHealthPotion.bind(this)); this.itemTypeToAction.set(ItemType.Magnet, this.activateMagnet.bind(this)); - this.itemTypeToAction.set(ItemType.Chest, this.giveRandomSkill.bind(this)); + this.itemTypeToAction.set(ItemType.Chest, this.openChest.bind(this)); } public get PickupEvent(): ISignal { @@ -84,7 +87,9 @@ export class ItemManager extends Component { this.player.Magnet.activate(); } - private giveRandomSkill(): void {} + private openChest(): void { + this.modalLauncher.showChestModal(); + } private addEnemyListeners(enemy: Enemy): void { enemy.DeathEvent.on(this.trySpawnItems, this); diff --git a/assets/Scripts/Game/ModalWIndows/ChestModalWindow.ts b/assets/Scripts/Game/ModalWIndows/ChestModalWindow.ts new file mode 100644 index 0000000..669a04d --- /dev/null +++ b/assets/Scripts/Game/ModalWIndows/ChestModalWindow.ts @@ -0,0 +1,21 @@ +import { randomRangeInt, _decorator } from "cc"; +import { ModalWindow } from "../../Services/ModalWindowSystem/ModalWindow"; +import { UIButton } from "../../Services/UI/Button/UIButton"; +import { LevelUpModalWindowParams } from "../UI/LevelUpWindow/LevelUpModalWindow"; +import { LevelUpSkill } from "../UI/LevelUpWindow/LevelUpSkill"; +import { UpgradeType } from "../Upgrades/UpgradeType"; +const { ccclass, property } = _decorator; + +@ccclass("ChestModalWindow") +export class ChestModalWindow extends ModalWindow { + @property(LevelUpSkill) private levelUpSkill: LevelUpSkill; + @property(UIButton) private okButton: UIButton; + + protected setup(params: LevelUpModalWindowParams): void { + const randomIndex = randomRangeInt(0, params.availableUpgrades.length - 1); + const skillToUpgrade = params.availableUpgrades[randomIndex]; + this.levelUpSkill.init(skillToUpgrade, params.translationData); + + this.okButton.InteractedEvent.on(() => this.dismiss(skillToUpgrade), this); + } +} diff --git a/assets/Scripts/Game/ModalWIndows/ChestModalWindow.ts.meta b/assets/Scripts/Game/ModalWIndows/ChestModalWindow.ts.meta new file mode 100644 index 0000000..87263e6 --- /dev/null +++ b/assets/Scripts/Game/ModalWIndows/ChestModalWindow.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "422c8f7d-cc38-4c6a-9c61-420c291a610b", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/Scripts/Game/ModalWIndows/GameModalLauncher.ts b/assets/Scripts/Game/ModalWIndows/GameModalLauncher.ts index 9516e4c..4b5dea4 100644 --- a/assets/Scripts/Game/ModalWIndows/GameModalLauncher.ts +++ b/assets/Scripts/Game/ModalWIndows/GameModalLauncher.ts @@ -27,8 +27,18 @@ export class GameModalLauncher { GameModalWindowTypes.LevelUp, { availableUpgrades: Array.from(this.upgrader.getAvailableUpgrades()), translationData: this.translationData } ); - this.gamePauser.resume(); this.upgrader.upgradeSkill(skillToUpgrade); + this.gamePauser.resume(); + } + + public async showChestModal(): Promise { + this.gamePauser.pause(); + const skillToUpgrade: UpgradeType = await this.modalWindowManager.showModal( + GameModalWindowTypes.Chest, + { availableUpgrades: Array.from(this.upgrader.getAvailableUpgrades()), translationData: this.translationData } + ); + this.upgrader.upgradeSkill(skillToUpgrade); + this.gamePauser.resume(); } public async showPauseModal(): Promise { diff --git a/assets/Scripts/Game/ModalWIndows/GameModalWindowTypes.ts b/assets/Scripts/Game/ModalWIndows/GameModalWindowTypes.ts index 790584d..fc896af 100644 --- a/assets/Scripts/Game/ModalWIndows/GameModalWindowTypes.ts +++ b/assets/Scripts/Game/ModalWIndows/GameModalWindowTypes.ts @@ -1,4 +1,5 @@ export enum GameModalWindowTypes { LevelUp = "LevelUpModalWindow", + Chest = "ChestModalWindow", Pause = "PauseModalWindow" } diff --git a/assets/Scripts/Services/ModalWindowSystem/ModalWindowManager.ts b/assets/Scripts/Services/ModalWindowSystem/ModalWindowManager.ts index f272468..c8ab22a 100644 --- a/assets/Scripts/Services/ModalWindowSystem/ModalWindowManager.ts +++ b/assets/Scripts/Services/ModalWindowSystem/ModalWindowManager.ts @@ -12,7 +12,6 @@ export class ModalWindowManager extends Component { windowNode.setParent(this.node); const modalWindow: ModalWindow = >windowNode.getComponent(name); - const result: TResult = await modalWindow.runAsync(params); windowNode.destroy();