diff --git a/Assets/Prefabs/Enemies/Jenderal.prefab b/Assets/Prefabs/Enemies/Jenderal.prefab index f839474f4a73396eafe20124f66307700d02959e..c98e1c75da9c494ce08590fb66e2b3f42056c89d 100644 --- a/Assets/Prefabs/Enemies/Jenderal.prefab +++ b/Assets/Prefabs/Enemies/Jenderal.prefab @@ -324,7 +324,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: timeBetweenAttacks: 0.5 - attackDamage: 15 + attackDamage: 10 --- !u!114 &11489230 MonoBehaviour: m_ObjectHideFlags: 0 @@ -338,9 +338,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: type: 2 - startingHealth: 100 + startingHealth: 150 sinkSpeed: 2.5 - scoreValue: 12 + scoreValue: 50 deathClip: {fileID: 8300000, guid: 1d3bfb9269f136947bf8ac164cace1ff, type: 3} increaseDamageOrbPrefab: {fileID: 5928907673800009345, guid: eb4274969abbb7944acd2b2888294bba, type: 3} restoreHealthOrbPrefab: {fileID: 108012326883433976, guid: cbc7c018424f013499d4f4feb5ff52db, type: 3} diff --git a/Assets/Prefabs/Enemies/Kepala Keroco.prefab b/Assets/Prefabs/Enemies/Kepala Keroco.prefab index 5b8bc9bf5573d6b7e19794e59c5cdffb61af61be..4bb890f23e849aa4be8115f33e8c0102fb67439b 100644 --- a/Assets/Prefabs/Enemies/Kepala Keroco.prefab +++ b/Assets/Prefabs/Enemies/Kepala Keroco.prefab @@ -152,7 +152,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: timeBetweenAttacks: 2 - attackDamage: 8 + attackDamage: 6 --- !u!114 &11400002 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Enemies/Keroco.prefab b/Assets/Prefabs/Enemies/Keroco.prefab index e9dfc1f6bcea07898023a34286ae33ed31575c44..bbcdca1cdab9537f3eda9403c68e6e337b6cf352 100644 --- a/Assets/Prefabs/Enemies/Keroco.prefab +++ b/Assets/Prefabs/Enemies/Keroco.prefab @@ -259,7 +259,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: timeBetweenAttacks: 0.5 - attackDamage: 5 + attackDamage: 3 --- !u!114 &11400002 MonoBehaviour: m_ObjectHideFlags: 0 @@ -272,6 +272,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: aa10cc87aff30c04dbe0aa648f5b6adc, type: 3} m_Name: m_EditorClassIdentifier: + type: 0 startingHealth: 50 sinkSpeed: 2.5 scoreValue: 7 diff --git a/Assets/Prefabs/Enemies/Raja.prefab b/Assets/Prefabs/Enemies/Raja.prefab index 0d81cddae9010f60c0e628d9f1ea783be1fea440..702d8ca1f34fcf54e904b394d69eeddaa101dd09 100644 --- a/Assets/Prefabs/Enemies/Raja.prefab +++ b/Assets/Prefabs/Enemies/Raja.prefab @@ -10231,9 +10231,9 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: type: 3 - startingHealth: 2000 + startingHealth: 1500 sinkSpeed: 2.5 - scoreValue: 77 + scoreValue: 500 deathClip: {fileID: 8300000, guid: 8c615fd0429f34edf85539d70279360d, type: 3} increaseDamageOrbPrefab: {fileID: 5928907673800009345, guid: eb4274969abbb7944acd2b2888294bba, type: 3} restoreHealthOrbPrefab: {fileID: 108012326883433976, guid: cbc7c018424f013499d4f4feb5ff52db, type: 3} diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index 164f39510842c71ae3ebaf77aef9d15e2016f9a9..15bee376b7f0991a55913f721887e9f909e6aaa4 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -163,7 +163,8 @@ MonoBehaviour: m_EditorClassIdentifier: grenade: {fileID: 1105787354104060, guid: 41a4c48eef428174cb5039adb608d30c, type: 3} grenadeSpeed: 400 - grenadeFireDelay: 0.75 + grenadeFireDelay: 3 + damagePercent: 1 weaponsList: - {fileID: 6517554577502634727, guid: 654eb4aab37345147a96aba1eaf65063, type: 3} - {fileID: 7075423823514085712, guid: 541fd80819fc7354bb855fe83c2eab55, type: 3} @@ -250,7 +251,7 @@ MonoBehaviour: deathClip: {fileID: 8300000, guid: d36a393bca4582043982db9089e1694f, type: 3} flashSpeed: 5 flashColour: {r: 1, g: 0, b: 0, a: 0.09803922} - godMode: 0 + isCheatNoDamage: 0 --- !u!54 &5400000 Rigidbody: m_ObjectHideFlags: 0 @@ -291,6 +292,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: speed: 6 + originalSpeed: 6 + prevSpeed: 0 --- !u!136 &13600000 CapsuleCollider: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/Weapons/Shotgun.prefab b/Assets/Prefabs/Weapons/Shotgun.prefab index 1d2eba3b8ea0a6effab49db27c14c0360f99784b..6a02d7ddc79b370507cc83cc982c669e76c993ef 100644 --- a/Assets/Prefabs/Weapons/Shotgun.prefab +++ b/Assets/Prefabs/Weapons/Shotgun.prefab @@ -243,10 +243,11 @@ MonoBehaviour: m_EditorClassIdentifier: weaponModel: {fileID: 7278376730888836428} damagePerShot: 50 - timeBetweenBullets: 2 + timeBetweenBullets: 1.5 range: 3 effectsDisplayTime: 0.5 shootableMask: 0 + isEnemyWeapon: 0 triggerAudio: {fileID: 0} --- !u!199 &1667718078436812581 ParticleSystemRenderer: diff --git a/Assets/Scripts/Enemy/EnemyAttack.cs b/Assets/Scripts/Enemy/EnemyAttack.cs index 4c3d0d5d9c2ec7d961932936327db10cd065c0fc..d3355ba58434c013e11cd0a6cc5d00d5ce8c7255 100644 --- a/Assets/Scripts/Enemy/EnemyAttack.cs +++ b/Assets/Scripts/Enemy/EnemyAttack.cs @@ -25,6 +25,16 @@ namespace Nightmare anim = GetComponent <Animator> (); heldWeapon = GetComponentInChildren<Weapons>(); + int difficultyLvl = PlayerPrefs.GetInt("Difficulty", 0); + if (difficultyLvl == 1) + { + attackDamage = Mathf.RoundToInt(attackDamage * 1.5f); + } + else if (difficultyLvl == 2) + { + attackDamage = Mathf.RoundToInt(attackDamage * 2f); + } + StartPausible(); } diff --git a/Assets/Scripts/Enemy/EnemyHealth.cs b/Assets/Scripts/Enemy/EnemyHealth.cs index 7cb679d749953493647fe8f92502911ad3580fcb..166cbdad1baea99f3567ecdbf6ad25a04a9c8a26 100644 --- a/Assets/Scripts/Enemy/EnemyHealth.cs +++ b/Assets/Scripts/Enemy/EnemyHealth.cs @@ -31,6 +31,17 @@ namespace Nightmare hitParticles = GetComponentInChildren <ParticleSystem> (); capsuleCollider = GetComponent <CapsuleCollider> (); enemyMovement = this.GetComponent<EnemyMovement>(); + + int difficultyLvl = PlayerPrefs.GetInt("Difficulty", 0); + if (difficultyLvl == 1) + { + startingHealth = Mathf.RoundToInt(startingHealth * 1.5f); + scoreValue *= 2; + } else if (difficultyLvl == 2) + { + startingHealth = Mathf.RoundToInt(startingHealth * 2f); + scoreValue *= 3; + } } void OnEnable() diff --git a/Assets/Scripts/Managers/EnemyManager.cs b/Assets/Scripts/Managers/EnemyManager.cs index 3cd0f067267a0a9eec2d684314e901b071b910d0..3b12f2459507c7276ae005b3a81e6e20f06d3c48 100644 --- a/Assets/Scripts/Managers/EnemyManager.cs +++ b/Assets/Scripts/Managers/EnemyManager.cs @@ -14,6 +14,15 @@ namespace Nightmare void Start () { + int difficultyLvl = PlayerPrefs.GetInt("Difficulty", 0); + if (difficultyLvl == 1) + { + spawnTime /= 1.5f; + } + else if (difficultyLvl == 2) + { + spawnTime /= 2f; + } timer = spawnTime; } diff --git a/Assets/Scripts/Player/PlayerShooting.cs b/Assets/Scripts/Player/PlayerShooting.cs index ca3905840db3f4031990b9aec392372dcc1b089b..c1e05cc110dc1103bdaa54a4028b87fa0c8222bb 100644 --- a/Assets/Scripts/Player/PlayerShooting.cs +++ b/Assets/Scripts/Player/PlayerShooting.cs @@ -15,7 +15,7 @@ namespace Nightmare public float damagePercent = 1; int grenadeStock = 99; - float timer; + float timer, grenadeTimer; public List<GameObject> weaponsList; private Weapons currWeapon; private int currWeaponIdx; @@ -27,6 +27,7 @@ namespace Nightmare void Awake () { timer = 0; + grenadeTimer = 0; ChangeWeapon(0); AdjustGrenadeStock(0); @@ -50,6 +51,7 @@ namespace Nightmare // Add the time since Update was last called to the timer. timer += Time.deltaTime; + grenadeTimer += Time.deltaTime; currWeapon.damagePerShot = Mathf.RoundToInt(realWeaponDamage * damagePercent); @@ -71,7 +73,7 @@ namespace Nightmare } #if !MOBILE_INPUT - if (timer >= currWeapon.timeBetweenBullets && Time.timeScale != 0) + if (grenadeTimer >= grenadeFireDelay && Time.timeScale != 0) { // If the Fire1 button is being press and it's time to fire... if (Input.GetButton("Fire2") && grenadeStock > 0) @@ -79,9 +81,12 @@ namespace Nightmare // ... shoot a grenade. ShootGrenade(); } + } + if (timer >= currWeapon.timeBetweenBullets && Time.timeScale != 0) + { // If the Fire1 button is being press and it's time to fire... - else if (Input.GetButton("Fire1")) + if (Input.GetButton("Fire1")) { // ... shoot the gun. Shoot(); @@ -167,7 +172,7 @@ namespace Nightmare void ShootGrenade() { AdjustGrenadeStock(-1); - timer = currWeapon.timeBetweenBullets - grenadeFireDelay; + grenadeTimer = 0; GameObject clone = PoolManager.Pull("Grenade", transform.position, Quaternion.identity); EventManager.TriggerEvent("ShootGrenade", grenadeSpeed * transform.forward); //GameObject clone = Instantiate(grenade, transform.position, Quaternion.identity); @@ -182,7 +187,7 @@ namespace Nightmare public void ActivateCheatOneHitKill() { - damagePercent = 900; + damagePercent = 100000; } } } \ No newline at end of file diff --git a/Assets/Scripts/Quest.cs b/Assets/Scripts/Quest.cs index 2e69ce547064ab961b7b60fff122dc4c9580b383..e48068ced9192019403371286303d85fd78eda03 100644 --- a/Assets/Scripts/Quest.cs +++ b/Assets/Scripts/Quest.cs @@ -7,4 +7,21 @@ public class Quest : MonoBehaviour public double timeLimit; public bool winIfTimeLimit; public int kerocoReq, kepalaReq, jenderalReq, rajaReq; + + private void Awake() + { + int difficultyLvl = PlayerPrefs.GetInt("Difficulty", 0); + if (difficultyLvl == 1) + { + kerocoReq *= 2; + kepalaReq *= 2; + jenderalReq *= 2; + } + else if (difficultyLvl == 2) + { + kerocoReq *= 3; + kepalaReq *= 3; + jenderalReq *= 3; + } + } }