diff --git a/Exe.zip b/Exe.zip new file mode 100644 index 0000000..fce2b11 Binary files /dev/null and b/Exe.zip differ diff --git a/SlimeGame/Slimes/Assets/Resources/Slimes/Faces/ultimateSlime.png b/SlimeGame/Slimes/Assets/Resources/Slimes/Faces/ultimateSlime.png new file mode 100644 index 0000000..50b7f8b Binary files /dev/null and b/SlimeGame/Slimes/Assets/Resources/Slimes/Faces/ultimateSlime.png differ diff --git a/SlimeGame/Slimes/Assets/Resources/Slimes/Faces/ultimateSlime.png.meta b/SlimeGame/Slimes/Assets/Resources/Slimes/Faces/ultimateSlime.png.meta new file mode 100644 index 0000000..b5a3864 --- /dev/null +++ b/SlimeGame/Slimes/Assets/Resources/Slimes/Faces/ultimateSlime.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 3b1f3942e8019de4c83a6c8212f3a40e +timeCreated: 1513725784 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + externalObjects: {} + serializedVersion: 4 + 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 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + 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} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 100 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/SlimeGame/Slimes/Assets/Resources/stats.txt b/SlimeGame/Slimes/Assets/Resources/stats.txt index 47d3d1d..baf380e 100644 --- a/SlimeGame/Slimes/Assets/Resources/stats.txt +++ b/SlimeGame/Slimes/Assets/Resources/stats.txt @@ -1,29 +1,56 @@ { + "Ultimate":{ + "name":"Ultimate", + "picDirection":"Slimes/Faces/ultimateSlime", + "minBaseAttack":100, + "maxBaseAttack":100, + "minAttackDrain":0.00, + "maxAttackDrain":0.00, + "minAttackMultiplier":10.0, + "maxAttackMultiplier":10.0, + "splitDrain":0.0, + "maxSlimes":12, + "plainMassGain":50, + "scalingMassGain":0.5, + "conquerMassDrain":0.0, + "slimeCountActionGain":4, + "minCalcMass":110, + "maxCalcMass":110, + "minDamageReduction":0.75, + "maxDamageReduction":0.80, + "maxMass":150, + "movement":10, + "range":10, + "baseActions":2, + "baseMass":100 + + + }, "Lust":{ "name":"Lust", "picDirection":"Slimes/Faces/lust", "minBaseAttack":2, - "maxBaseAttack":10, + "maxBaseAttack":6, "minAttackDrain":0.02, - "maxAttackDrain":0.15, - "minAttackMultiplier":2.0, - "maxAttackMultiplier":5.0, + "maxAttackDrain":0.12, + "minAttackMultiplier":3.0, + "maxAttackMultiplier":6.0, "splitDrain":0.5, - "maxSlimes":8, - "plainMassGain":10, - "scalingMassGain":0.05, + "maxSlimes":10, + "plainMassGain":5, + "scalingMassGain":0.08, "conquerMassDrain":0.0, - "slimeCountActionGain":4, - "minCalcMass":15, - "maxCalcMass":110, - "minDamageReduction":0.05, - "maxDamageReduction":0.10, - "maxMass":150, - "movement":3, - "range":4, - "baseActions":2, + "slimeCountActionGain":5, + "minCalcMass":10, + "maxCalcMass":140, + "minDamageReduction":0.10, + "maxDamageReduction":0.20, + "maxMass":160, + "movement":4, + "range":3, + "baseActions":3, "baseMass":50 @@ -33,27 +60,27 @@ "name":"Greed", "picDirection":"Slimes/Faces/greed", - "minBaseAttack":2, - "maxBaseAttack":10, - "minAttackDrain":0.02, + "minBaseAttack":5, + "maxBaseAttack":12, + "minAttackDrain":0.08, "maxAttackDrain":0.15, - "minAttackMultiplier":2.0, - "maxAttackMultiplier":5.0, + "minAttackMultiplier":1.5, + "maxAttackMultiplier":4.5, "splitDrain":0.5, "maxSlimes":8, "plainMassGain":10, - "scalingMassGain":0.05, + "scalingMassGain":0.06, "conquerMassDrain":0.0, "slimeCountActionGain":4, - "minCalcMass":15, - "maxCalcMass":110, - "minDamageReduction":0.05, - "maxDamageReduction":0.10, - "maxMass":150, - "movement":3, - "range":4, + "minCalcMass":20, + "maxCalcMass":150, + "minDamageReduction":0.10, + "maxDamageReduction":0.25, + "maxMass":170, + "movement":5, + "range":2, "baseActions":2, - "baseMass":50 + "baseMass":80 }, @@ -62,27 +89,27 @@ "name":"Pride", "picDirection":"Slimes/Faces/pride", - "minBaseAttack":2, + "minBaseAttack":5, "maxBaseAttack":10, - "minAttackDrain":0.02, - "maxAttackDrain":0.15, - "minAttackMultiplier":2.0, - "maxAttackMultiplier":5.0, + "minAttackDrain":0.05, + "maxAttackDrain":0.10, + "minAttackMultiplier":1.5, + "maxAttackMultiplier":6.5, "splitDrain":0.5, "maxSlimes":8, - "plainMassGain":10, + "plainMassGain":18, "scalingMassGain":0.05, "conquerMassDrain":0.0, "slimeCountActionGain":4, - "minCalcMass":15, - "maxCalcMass":110, + "minCalcMass":20, + "maxCalcMass":140, "minDamageReduction":0.05, - "maxDamageReduction":0.10, - "maxMass":150, + "maxDamageReduction":0.15, + "maxMass":160, "movement":3, - "range":4, + "range":3, "baseActions":2, - "baseMass":50 + "baseMass":55 }, @@ -91,26 +118,26 @@ "name":"Envy", "picDirection":"Slimes/Faces/envy", - "minBaseAttack":2, - "maxBaseAttack":10, + "minBaseAttack":5, + "maxBaseAttack":20, "minAttackDrain":0.02, - "maxAttackDrain":0.15, - "minAttackMultiplier":2.0, - "maxAttackMultiplier":5.0, + "maxAttackDrain":0.08, + "minAttackMultiplier":1.0, + "maxAttackMultiplier":6.0, "splitDrain":0.5, - "maxSlimes":8, - "plainMassGain":10, + "maxSlimes":10, + "plainMassGain":12, "scalingMassGain":0.05, "conquerMassDrain":0.0, - "slimeCountActionGain":4, - "minCalcMass":15, - "maxCalcMass":110, + "slimeCountActionGain":5, + "minCalcMass":10, + "maxCalcMass":150, "minDamageReduction":0.05, - "maxDamageReduction":0.10, - "maxMass":150, + "maxDamageReduction":0.15, + "maxMass":170, "movement":3, "range":4, - "baseActions":2, + "baseActions":3, "baseMass":50 @@ -122,24 +149,24 @@ "minBaseAttack":2, "maxBaseAttack":10, - "minAttackDrain":0.02, - "maxAttackDrain":0.15, + "minAttackDrain":0.05, + "maxAttackDrain":0.20, "minAttackMultiplier":2.0, - "maxAttackMultiplier":5.0, + "maxAttackMultiplier":3.0, "splitDrain":0.5, - "maxSlimes":8, - "plainMassGain":10, - "scalingMassGain":0.05, + "maxSlimes":14, + "plainMassGain":5, + "scalingMassGain":0.04, "conquerMassDrain":0.0, - "slimeCountActionGain":4, - "minCalcMass":15, - "maxCalcMass":110, - "minDamageReduction":0.05, - "maxDamageReduction":0.10, - "maxMass":150, - "movement":3, + "slimeCountActionGain":2, + "minCalcMass":20, + "maxCalcMass":130, + "minDamageReduction":0.10, + "maxDamageReduction":0.15, + "maxMass":100, + "movement":4, "range":4, - "baseActions":2, + "baseActions":3, "baseMass":50 }, @@ -154,7 +181,7 @@ "minAttackMultiplier":2.0, "maxAttackMultiplier":5.0, "splitDrain":0.5, - "maxSlimes":8, + "maxSlimes":10, "plainMassGain":10, "scalingMassGain":0.05, "conquerMassDrain":0.0, @@ -184,15 +211,15 @@ "maxAttackMultiplier":5.5, "splitDrain":0.5, "maxSlimes":10, - "plainMassGain":15, + "plainMassGain":12, "scalingMassGain":0.1, "conquerMassDrain":0.0, "slimeCountActionGain":3, "minCalcMass":30, "maxCalcMass":120, "minDamageReduction":0.15, - "maxDamageReduction":0.30, - "maxMass":180, + "maxDamageReduction":0.45, + "maxMass":220, "movement":2, "range":1, "baseActions":2, @@ -211,15 +238,15 @@ "maxAttackMultiplier":5.5, "splitDrain":0.5, "maxSlimes":12, - "plainMassGain":20, - "scalingMassGain":0.2, + "plainMassGain":25, + "scalingMassGain":0.25, "conquerMassDrain":0.0, "slimeCountActionGain":4, "minCalcMass":10, - "maxCalcMass":210, + "maxCalcMass":250, "minDamageReduction":0.2, - "maxDamageReduction":0.4, - "maxMass":230, + "maxDamageReduction":0.25, + "maxMass":300, "movement":2, "range":3, "baseActions":2, @@ -408,7 +435,7 @@ "maxCalcMass":0, "minDamageReduction":0.00, "maxDamageReduction":0.00, - "maxMass":0, + "maxMass":40, "movement":1, "range":1, "baseActions":0, @@ -435,7 +462,7 @@ "maxCalcMass":0, "minDamageReduction":-0.05, "maxDamageReduction":-0.08, - "maxMass":0, + "maxMass":60, "movement":-1, "range":2, "baseActions":0, @@ -462,7 +489,7 @@ "maxCalcMass":0, "minDamageReduction":0.1, "maxDamageReduction":0.15, - "maxMass":0, + "maxMass":100, "movement":2, "range":-1, "baseActions":0, diff --git a/SlimeGame/Slimes/Assets/Scenes/Main.unity b/SlimeGame/Slimes/Assets/Scenes/Main.unity index a3105f6..eee3aad 100644 --- a/SlimeGame/Slimes/Assets/Scenes/Main.unity +++ b/SlimeGame/Slimes/Assets/Scenes/Main.unity @@ -895,6 +895,17 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 608162607} + m_MethodName: NotifyPaused + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null --- !u!114 &601972842 @@ -3681,6 +3692,17 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 + - m_Target: {fileID: 608162607} + m_MethodName: NotifyResumed + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null --- !u!114 &1563218355 diff --git a/SlimeGame/Slimes/Assets/Scenes/Settings.unity b/SlimeGame/Slimes/Assets/Scenes/Settings.unity index 71ab1b7..f698abb 100644 --- a/SlimeGame/Slimes/Assets/Scenes/Settings.unity +++ b/SlimeGame/Slimes/Assets/Scenes/Settings.unity @@ -455,7 +455,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 338548163} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 281.5, y: 477.05, z: 0} + m_LocalPosition: {x: -187.5, y: 477.05, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 974888467} @@ -546,9 +546,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c97b72fcf6948004b9754b46f7ab25ed, type: 3} m_Name: m_EditorClassIdentifier: - maxTime: 10 - startPos: {x: 1200, y: 0, z: 0} - endPos: {x: -1200, y: 0, z: 0} + maxTime: 0 + startPos: {x: 0, y: 0, z: 0} + endPos: {x: 0, y: 0, z: 0} --- !u!114 &365443885 MonoBehaviour: m_ObjectHideFlags: 0 @@ -969,7 +969,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 658150990} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -720.5, y: 342.1, z: 0} + m_LocalPosition: {x: -251.5, y: 13.100006, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1569879322} @@ -1196,6 +1196,7 @@ MonoBehaviour: m_EditorClassIdentifier: effects: 0 music: 0 + ultimateSlime: 0 --- !u!114 &692874360 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1325,7 +1326,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 806503240} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 548.5, y: 477.05, z: 0} + m_LocalPosition: {x: 79.5, y: 477.05, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 974888467} @@ -1558,9 +1559,9 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c97b72fcf6948004b9754b46f7ab25ed, type: 3} m_Name: m_EditorClassIdentifier: - maxTime: 6 - startPos: {x: -1200, y: 200, z: 0} - endPos: {x: 1200, y: 200, z: 0} + maxTime: 0 + startPos: {x: 0, y: 0, z: 0} + endPos: {x: 0, y: 0, z: 0} --- !u!114 &866399872 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2015,7 +2016,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1048918049} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 25, y: -533.5, z: 0} + m_LocalPosition: {x: 25, y: -204.5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1946946470} @@ -2443,7 +2444,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1390335283} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 960, y: 540, z: 0} + m_LocalPosition: {x: 491, y: 211, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 1946946470} @@ -2552,7 +2553,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1585572731} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -4.5, y: 477.05, z: 0} + m_LocalPosition: {x: -473.5, y: 477.05, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 974888467} @@ -2654,7 +2655,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1647439494} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: -413.59998, z: 0} + m_LocalPosition: {x: 0, y: -84.59999, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 552514373} @@ -3122,7 +3123,7 @@ RectTransform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1929299885} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: -25, y: -498, z: 0} + m_LocalPosition: {x: -25, y: -169, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 1946946470} @@ -3324,6 +3325,7 @@ GameObject: - component: {fileID: 2021736882} - component: {fileID: 2021736884} - component: {fileID: 2021736883} + - component: {fileID: 2021736885} m_Layer: 5 m_Name: Background FireHand m_TagString: Untagged @@ -3382,6 +3384,58 @@ CanvasRenderer: m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2021736881} +--- !u!114 &2021736885 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2021736881} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 2021736883} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 692874359} + m_MethodName: toggleUltimate + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null --- !u!1 &2039133532 GameObject: m_ObjectHideFlags: 0 diff --git a/SlimeGame/Slimes/Assets/Scripts/Controllers/BackGroundController.cs b/SlimeGame/Slimes/Assets/Scripts/Controllers/BackGroundController.cs index cf62430..762f328 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Controllers/BackGroundController.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Controllers/BackGroundController.cs @@ -41,8 +41,12 @@ void Start () { s1.GetComponent ().material = seaMaterial; s2.GetComponent ().material = seaMaterial; - s1.GetComponent ().material.SetFloat("RandomOffset",Random.Range(0.1f,5.0f)); - s2.GetComponent ().material.SetFloat("RandomOffset",Random.Range(0.1f,5.0f)); + s1.GetComponent ().material.SetFloat("_RandomOffset",Random.Range(0.1f,5.0f)); + s2.GetComponent ().material.SetFloat("_RandomOffset",Random.Range(0.1f,5.0f)); + + s1.GetComponent ().material.SetInt("_Background",1); + s2.GetComponent ().material.SetInt("_Background",1); + s1.GetComponent ().sortingOrder = 1000 - (int)(s1.transform.position.y*10); s2.GetComponent ().sortingOrder = 1000 - (int)(s2.transform.position.y*10); diff --git a/SlimeGame/Slimes/Assets/Scripts/Controllers/GameController.cs b/SlimeGame/Slimes/Assets/Scripts/Controllers/GameController.cs index 96ae6a3..0ed2888 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Controllers/GameController.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Controllers/GameController.cs @@ -514,7 +514,9 @@ private void ConquerTile(Tile tile){ //c.a = 0.5f; tile.tileConquerLayer.color = c; tile.SetOwner (currentPlayer); - playerActions++; + if (!(currentPlayer.statsCoreInfo.name == "Greed")) { + playerActions++; + } selectedSlime.ChangeElement (tile.elementType); tile.RemoveElement (); status = GameControllerStatus.CHECKINGLOGIC; @@ -682,8 +684,17 @@ public AIGameState GetGameState(){ public void ApplyDamage(Slime attacker,Slime defender){ int damage = attacker.getDamage; - attacker.ChangeMass (attacker.selfDamage); - defender.ChangeMass ((int)(-damage*(1-defender.damageReduction))); + if (currentPlayer.statsCoreInfo.name == "Lust") { + attacker.ChangeMass (attacker.selfDamage/3f); + } else if (currentPlayer.statsCoreInfo.name == "Pride") { + } else { + attacker.ChangeMass (attacker.selfDamage); + } + if (currentPlayer.statsCoreInfo.name == "Envy") { + defender.ChangeMass ((int)(-damage)); + } else { + defender.ChangeMass ((int)(-damage*(1-defender.damageReduction))); + } //FloatingTextController.CreateFloatingText (((int)-damage).ToString(),defender.transform); } diff --git a/SlimeGame/Slimes/Assets/Scripts/Controllers/InputController.cs b/SlimeGame/Slimes/Assets/Scripts/Controllers/InputController.cs index f32a407..fa52f3a 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Controllers/InputController.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Controllers/InputController.cs @@ -22,6 +22,8 @@ public class InputController : MonoBehaviour protected bool JoinEnabled; protected bool InputEnabled; + protected bool gamePaused; + private Vector3 prevMousePosition; void Start() @@ -33,6 +35,7 @@ void Start() SplitEnabled = true; JoinEnabled = true; InputEnabled = true; + gamePaused = false; gameController = Camera.main.GetComponent(); uiController = Camera.main.GetComponent(); @@ -74,7 +77,7 @@ private void ManageInput(bool inputStarted, bool inputMaintained, bool inputEnde bool selectedSlime = gameController.GetSelectedSlime()!=null; if (InputEnabled && gameController.getStatus () == GameControllerStatus.WAITINGFORACTION && - (inputStarted || inputMaintained || inputEnded)) { + (inputStarted || inputMaintained || inputEnded) && !gamePaused) { Collider2D[] colliders = Physics2D.OverlapPointAll (position); Slime s=null; Tile t=null; @@ -343,4 +346,11 @@ public void ClearMarkedTiles(){ joinTiles = new List (); } + public void NotifyPaused(){ + gamePaused = true; + } + + public void NotifyResumed(){ + gamePaused = false; + } } diff --git a/SlimeGame/Slimes/Assets/Scripts/Controllers/SelectorController.cs b/SlimeGame/Slimes/Assets/Scripts/Controllers/SelectorController.cs index 4fbf665..9ac2905 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Controllers/SelectorController.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Controllers/SelectorController.cs @@ -31,6 +31,8 @@ public class SelectorController : MonoBehaviour { private Image core3; private Image core4; + private bool ultimateSlime; + // Use this for initialization void Start () { maxPlayers = 2; @@ -50,7 +52,10 @@ void Start () { corePaths.Add ("Slimes/Faces/lust"); corePaths.Add ("Slimes/Faces/pride"); corePaths.Add ("Slimes/Faces/innocence"); - + loadSet (); + if (ultimateSlime) { + corePaths.Add ("Slimes/Faces/ultimateSlime"); + } sprite = "Sprites/slime_sprite"; currentSprite = GameObject.Find ("CurrentSprite").GetComponent(); sprite1 = GameObject.Find ("Sprite1").GetComponent(); @@ -183,6 +188,8 @@ private void changeInfo(){ stats = StatsFactory.GetStat (SlimeCoreTypes.PRIDE); } else if (coreSelector [currentPlayer] == 7) { stats = StatsFactory.GetStat (SlimeCoreTypes.INNOCENCE); + } else if (coreSelector [currentPlayer] == 8) { + stats = StatsFactory.GetStat (SlimeCoreTypes.ULTIMATE); // Por ahora peta } else { stats = StatsFactory.GetStat (SlimeCoreTypes.GLUTTONY); } @@ -230,6 +237,8 @@ public void changeCore(int cursor){ GameSelection.playerCores [currentPlayer - 1] = SlimeCoreTypes.PRIDE; } else if (coreSelector [currentPlayer] == 7) { GameSelection.playerCores [currentPlayer - 1] = SlimeCoreTypes.INNOCENCE; + } else if (coreSelector [currentPlayer] == 8) { + GameSelection.playerCores [currentPlayer - 1] = SlimeCoreTypes.ULTIMATE; } /*else if (currentPlayer == 2) GameSelection.player2Core = coreSelector[currentPlayer]; @@ -324,6 +333,11 @@ public void ModeSelection(int value){ } GameObject.Find ("Pin").GetComponent ().anchoredPosition = new Vector3 (140, yPos, 0); } + + private void loadSet(){ + int data = PlayerPrefs.GetInt ("ultimate"); + ultimateSlime = data == 1; + } } /* enum MapTypeSelectionTypes{ Random, diff --git a/SlimeGame/Slimes/Assets/Scripts/Controllers/SettingsController.cs b/SlimeGame/Slimes/Assets/Scripts/Controllers/SettingsController.cs index 8da7078..476c7be 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Controllers/SettingsController.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Controllers/SettingsController.cs @@ -9,7 +9,9 @@ public class SettingsController : MonoBehaviour { private bool firstTime; private int previousScene; private string jsonData; + private string jsonData2; private bool modifyingBar; + public bool ultimateSlime; // Use this for initialization void Start () { @@ -41,6 +43,10 @@ public void onValueChange(bool modifyBar){ } } } + public void toggleUltimate(){ + ultimateSlime = !ultimateSlime; + saveSet (); + } private void resizeImages(){ GameObject.Find ("Background Not 1").GetComponent ().localScale = new Vector3 (music, music, 0); @@ -54,19 +60,30 @@ private void resizeImages(){ private void loadSet(){ if (jsonData != null && !jsonData.Equals ("")) { Vector2 data = JsonUtility.FromJson (jsonData); + int intData = PlayerPrefs.GetInt ("ultimate"); music = data.x; effects = data.y; + ultimateSlime = intData==1; } else { music = 1.0f; effects = 1.0f; + ultimateSlime = false; saveSet (); } } - + private void saveSet(){ + int intData; + if (ultimateSlime) { + intData = 1; + } else { + intData = 0; + } Vector2 data = new Vector2 (music, effects); jsonData = JsonUtility.ToJson (data); + PlayerPrefs.SetString ("SettingsVolume", jsonData); + PlayerPrefs.SetInt ("ultimate", intData); PlayerPrefs.Save (); } diff --git a/SlimeGame/Slimes/Assets/Scripts/Controllers/UIController.cs b/SlimeGame/Slimes/Assets/Scripts/Controllers/UIController.cs index f899d47..665802d 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Controllers/UIController.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Controllers/UIController.cs @@ -310,7 +310,7 @@ public void UpdateInfo(Slime slime, Tile terrain){ rangeT.GetComponent().text = terrain.GetAttackRange ().ToString(); movementT.GetComponent().text = terrain.GetMovementRange ().ToString(); attackT.GetComponent().text = terrain.GetDamage().ToString(); - defenseT.GetComponent().text = terrain.GetDamage().ToString(); + defenseT.GetComponent().text = terrain.GetDamageReduction().ToString (); } else { healthT.GetComponent().text = ""; rangeT.GetComponent().text = ""; diff --git a/SlimeGame/Slimes/Assets/Scripts/DataStructures/StatsContainer.cs b/SlimeGame/Slimes/Assets/Scripts/DataStructures/StatsContainer.cs index 370a619..4fb07df 100644 --- a/SlimeGame/Slimes/Assets/Scripts/DataStructures/StatsContainer.cs +++ b/SlimeGame/Slimes/Assets/Scripts/DataStructures/StatsContainer.cs @@ -6,6 +6,7 @@ public class StatsContainer public string picDirection; public int picCount; + public string name; public int minBaseAttack; public int maxBaseAttack; public float minAttackDrain; @@ -30,7 +31,7 @@ public class StatsContainer public StatsContainer (SimpleJSON.JSONNode data) { - + name = data["name"]; picDirection = data ["picDirection"]; picCount = data ["picCount"]; diff --git a/SlimeGame/Slimes/Assets/Scripts/Enums/SlimeCoreTypes.cs b/SlimeGame/Slimes/Assets/Scripts/Enums/SlimeCoreTypes.cs index e234351..08123af 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Enums/SlimeCoreTypes.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Enums/SlimeCoreTypes.cs @@ -6,5 +6,6 @@ public enum SlimeCoreTypes{ GREED, PRIDE, ENVY, - INNOCENCE + INNOCENCE, + ULTIMATE } \ No newline at end of file diff --git a/SlimeGame/Slimes/Assets/Scripts/Factories/StatsFactory.cs b/SlimeGame/Slimes/Assets/Scripts/Factories/StatsFactory.cs index efd99cc..42fff73 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Factories/StatsFactory.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Factories/StatsFactory.cs @@ -54,6 +54,8 @@ public static StatsContainer GetStat(SlimeCoreTypes type){ return (StatsContainer) statsContainer["Lust"]; case SlimeCoreTypes.PRIDE: return (StatsContainer) statsContainer["Pride"]; + case SlimeCoreTypes.ULTIMATE: + return (StatsContainer) statsContainer["Ultimate"]; default: return null; } diff --git a/SlimeGame/Slimes/Assets/Scripts/ProjectileTrajectory.cs b/SlimeGame/Slimes/Assets/Scripts/ProjectileTrajectory.cs index da530a5..429c0a6 100644 --- a/SlimeGame/Slimes/Assets/Scripts/ProjectileTrajectory.cs +++ b/SlimeGame/Slimes/Assets/Scripts/ProjectileTrajectory.cs @@ -49,12 +49,17 @@ void OnDestroy(){ GameController gameController = GameObject.Find ("Main Camera").GetComponent (); gameController.ApplyDamage(source,target); if (!target.isAlive ()) { + if ((gameController.GetCurrentPlayer ().statsCoreInfo.name == "Pride")) { + source.ChangeMass (2f * source.plainGrowth); + } target.GetTileData ().SetSlimeOnTop ((Slime)null); target.GetPlayer ().GetSlimes ().Remove (target); - Destroy(target.gameObject); - gameController.RemoveSlime(target); + Destroy (target.gameObject); + gameController.RemoveSlime (target); - } + } else { + source.ChangeMass (source.selfDamage); + } gameController.OnProjectileAnimationEnded(); } diff --git a/SlimeGame/Slimes/Assets/Scripts/Tile.cs b/SlimeGame/Slimes/Assets/Scripts/Tile.cs index fc55b8a..6fce38d 100644 --- a/SlimeGame/Slimes/Assets/Scripts/Tile.cs +++ b/SlimeGame/Slimes/Assets/Scripts/Tile.cs @@ -240,4 +240,12 @@ public int GetDamage(){ } } + public int GetDamageReduction(){ + if (elementType != null) { + return (int)(StatsFactory.GetStat (elementType).maxDamageReduction*100f); + } else { + return 0; + } + } + } diff --git a/SlimeGame/Slimes/Assets/SeaShader.shader b/SlimeGame/Slimes/Assets/SeaShader.shader index dedd453..ce7f42a 100644 --- a/SlimeGame/Slimes/Assets/SeaShader.shader +++ b/SlimeGame/Slimes/Assets/SeaShader.shader @@ -10,7 +10,7 @@ Shader "Unlit/SeaShader" _MainTex ("Texture", 2D) = "white" {} _Color ("Main Color", Color) = (1,1,1,1) _RandomOffset ("RandomOffset", float) = 1.0 - + _Background("Background", int) = 0 } SubShader { @@ -31,6 +31,7 @@ Shader "Unlit/SeaShader" float4 _MainTex_ST; uniform float4 _TexCoords; fixed _RandomOffset; + fixed _Background; fixed4 _Color; float top; float bottom; @@ -59,10 +60,13 @@ Shader "Unlit/SeaShader" float2 screenPos = i.screenPos.xy / i.screenPos.w; float _half = (top + bottom)*0.5; float _diff = (bottom - top)*0.5; - //float maxY = (-abs(sin(i.uv.x*60+_Time.w/12.0+screenPos.y)))*0.8; - float maxY = (-abs(sin(i.uv.x*60+sin(_Time.w/8.0+_RandomOffset)+screenPos.y)))*0.8; + float maxY = (-abs(sin(i.uv.x*60+_Time.w/4.0+screenPos.y)))*0.8; + if(_Background==1){ + maxY = (-abs(sin(i.uv.x*60+sin(_Time.w/8.0+_RandomOffset)+screenPos.y)))*0.8; + } fixed4 sum = fixed4(0.0h,0.0h,0.0h,0.0h); //sum = tex2D(_MainTex,float2(i.uv.x+(1-i.uv.y)*sin((_Time.w+i.uv.y)*2.3),i.uv.y))*screenPos.y;//*_SinTime.w + if(_Background==1){ sum = tex2D(_MainTex,float2(i.uv.x,(1-maxY)*i.uv.y));//*_SinTime.w if(sum.w<0.99){ sum = fixed4(0.0h,0.0h,0.0h,0.0h); @@ -70,6 +74,12 @@ Shader "Unlit/SeaShader" sum/=2.0; sum.w=1.0; } + }else{ + sum = tex2D(_MainTex,float2(i.uv.x,(1-maxY)*i.uv.y));//*_SinTime.w + if(sum.w<0.99){ + sum = fixed4(0.0h,0.0h,0.0h,0.0h); + } + } //sum = tex2D(_MainTex,float2(i.uv.x,i.uv.y))*screenPos.y; return sum; diff --git a/SlimeGame/Slimes/ProjectSettings/GraphicsSettings.asset b/SlimeGame/Slimes/ProjectSettings/GraphicsSettings.asset index 40ff158..d74737e 100644 --- a/SlimeGame/Slimes/ProjectSettings/GraphicsSettings.asset +++ b/SlimeGame/Slimes/ProjectSettings/GraphicsSettings.asset @@ -36,7 +36,6 @@ GraphicsSettings: - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} - - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}