diff --git a/My project/Assets/Scripts/Controllers/StateController.cs b/My project/Assets/Scripts/Controllers/StateController.cs index bb22e4dbb18da61ea1e0181e81efaab7493f1b49..75320ca3f2c1711502343bb196c6ec7820ed4f5f 100644 --- a/My project/Assets/Scripts/Controllers/StateController.cs +++ b/My project/Assets/Scripts/Controllers/StateController.cs @@ -24,6 +24,7 @@ public class StateController : MonoBehaviour public static bool showSaveUI = true; public static int playerHealth = 100; public static string saveSlotName; + public static int attBuff = 0; public static void reset() { @@ -44,6 +45,7 @@ public class StateController : MonoBehaviour petTag = 3; petCurrentHealth = 0; slot = "0"; + attBuff = 0; resetShop(); } diff --git a/My project/Assets/Scripts/Pet/PetMovement.cs b/My project/Assets/Scripts/Pet/PetMovement.cs index f534e19ce3a005360e8bac5492c39095f0868cbd..42750c26e641ef8cb833bcc35bbbc8f1f0909a83 100644 --- a/My project/Assets/Scripts/Pet/PetMovement.cs +++ b/My project/Assets/Scripts/Pet/PetMovement.cs @@ -54,7 +54,7 @@ public class PetMovement : MonoBehaviour return; } - if(nav.remainingDistance > 3){ + if(nav.remainingDistance > nav.stoppingDistance){ anim.SetBool("isWalking", true); } else{ @@ -62,7 +62,6 @@ public class PetMovement : MonoBehaviour } playerCurrentPosition = player.position; - Debug.Log(StateController.petCurrentHealth); if(petHealth.currentHealth > 0 && playerHealth.currentHealth > 0) { if(playerCurrentPosition != playerLastPosition) diff --git a/My project/Assets/Scripts/Pet/RobotSkill.cs b/My project/Assets/Scripts/Pet/RobotSkill.cs index 114eb29fd9c9c6dc31962c841fbdb334fe5d26b5..56ff36c835ec9c629ff75c9fc31a8172a1df374e 100644 --- a/My project/Assets/Scripts/Pet/RobotSkill.cs +++ b/My project/Assets/Scripts/Pet/RobotSkill.cs @@ -21,48 +21,31 @@ public class RobotSkill : MonoBehaviour void Awake() { player = GameObject.FindGameObjectWithTag("Player"); - playerShooting = player.GetComponentInChildren<PlayerShooting>(); - sword = player.GetComponentInChildren<Sword>(); - arrow = player.GetComponentInChildren<Arrow>(); - shotgun = player.GetComponentInChildren<ShotgunBullet>(); - initialDamageGun = playerShooting.damagePerShot; - initialDamageSword = sword.attackDamage; - initialDamageArrow = arrow.damage; - initialDamageShotgun = shotgun.damagePerShot; playerSkin = GameObject.FindGameObjectWithTag("PlayerMaterial"); skinnedMeshRenderer = playerSkin?.GetComponent<SkinnedMeshRenderer>(); material = skinnedMeshRenderer?.material; + StateController.attBuff = 50; } void Update() { - playerShooting.damagePerShot = 50 + initialDamageGun; - sword.attackDamage = 70 + initialDamageSword; - arrow.damage = 30 + initialDamageArrow; - shotgun.damagePerShot = 30 + initialDamageShotgun; - + StateController.attBuff = 50; if(player != null) { if(playerSkin != null) material.color = new Color(0.992f, 0.506f, 0.423f, 1.0f); float distance = Vector3.Distance(player.transform.position, transform.position); if(distance > 10) { + StateController.attBuff = 0; if(playerSkin != null) material.color = new Color(1f, 1f, 1f, 1.0f); - playerShooting.damagePerShot = initialDamageGun; - sword.attackDamage = initialDamageSword; - arrow.damage = initialDamageArrow; - shotgun.damagePerShot = initialDamageShotgun; } } } void OnDestroy() { - playerShooting.damagePerShot = initialDamageGun; - sword.attackDamage = initialDamageSword; - arrow.damage = initialDamageArrow; - shotgun.damagePerShot = initialDamageShotgun; if(playerSkin != null) material.color = new Color(1f, 1f, 1f, 1.0f); + StateController.attBuff = 0; } diff --git a/My project/Assets/Scripts/Player/PlayerShooting.cs b/My project/Assets/Scripts/Player/PlayerShooting.cs index 30248c10f33bcabd50910ea5e50ab293ab67f87f..feda2fa92a8b5c93b3262a2148ffa3acf11e565d 100644 --- a/My project/Assets/Scripts/Player/PlayerShooting.cs +++ b/My project/Assets/Scripts/Player/PlayerShooting.cs @@ -69,14 +69,14 @@ public class PlayerShooting : MonoBehaviour if (enemyHealth != null) { - enemyHealth.TakeDamage((int)(damagePerShot * StateController.gunMultiplier), shootHit.point); + enemyHealth.TakeDamage((int)(damagePerShot * StateController.gunMultiplier + StateController.attBuff), shootHit.point); } BossHealth bossHealth = shootHit.collider.GetComponent<BossHealth>(); if (bossHealth != null) { - bossHealth.TakeDamage((int)(damagePerShot * StateController.gunMultiplier), shootHit.point); + bossHealth.TakeDamage((int)(damagePerShot * StateController.gunMultiplier + StateController.attBuff), shootHit.point); } gunLine.SetPosition(1, shootHit.point); diff --git a/My project/Assets/Scripts/Weapon/Arrow.cs b/My project/Assets/Scripts/Weapon/Arrow.cs index aa6347c61223cf5278ad490714a31b8c22a4dc71..42afe9dda69521eeeb69eb489dd58131a4e81fc5 100644 --- a/My project/Assets/Scripts/Weapon/Arrow.cs +++ b/My project/Assets/Scripts/Weapon/Arrow.cs @@ -38,18 +38,19 @@ public class Arrow : MonoBehaviour { if (hit || flying == false) return; hit = true; + Debug.Log(damage); EnemyHealth enemy = other.GetComponent<EnemyHealth>(); if (enemy != null) { - enemy.TakeDamage((int)(damage * StateController.bowMultiplier), other.ClosestPointOnBounds(transform.position)); + enemy.TakeDamage((int)(damage * StateController.bowMultiplier + StateController.attBuff), other.ClosestPointOnBounds(transform.position)); } BossHealth boss = other.GetComponent<BossHealth>(); if (boss != null) { - boss.TakeDamage((int)(damage * StateController.bowMultiplier), other.ClosestPointOnBounds(transform.position)); + boss.TakeDamage((int)(damage * StateController.bowMultiplier + StateController.attBuff), other.ClosestPointOnBounds(transform.position)); } rigidbody.velocity = Vector3.zero; diff --git a/My project/Assets/Scripts/Weapon/ShotgunBullet.cs b/My project/Assets/Scripts/Weapon/ShotgunBullet.cs index 30748a5104c3005544877f49a70d71c371add19c..2d3d0fc432822a59f2c086b0d6fa2e85e75e9964 100644 --- a/My project/Assets/Scripts/Weapon/ShotgunBullet.cs +++ b/My project/Assets/Scripts/Weapon/ShotgunBullet.cs @@ -72,13 +72,13 @@ public class ShotgunBullet : MonoBehaviour if (enemyHealth != null) { - enemyHealth.TakeDamage((int) (damagePerShot * StateController.shotGunMultiplier), shootHit.point); + enemyHealth.TakeDamage((int) (damagePerShot * StateController.shotGunMultiplier + StateController.attBuff), shootHit.point); } BossHealth bossHealth = shootHit.collider.GetComponent<BossHealth>(); if (bossHealth != null) { - bossHealth.TakeDamage((int)(damagePerShot * StateController.shotGunMultiplier), shootHit.point); + bossHealth.TakeDamage((int)(damagePerShot * StateController.shotGunMultiplier + StateController.attBuff), shootHit.point); } gunLine.SetPosition(1, shootHit.point); diff --git a/My project/Assets/Scripts/Weapon/Sword.cs b/My project/Assets/Scripts/Weapon/Sword.cs index 543219240a3aac25425833b76b0a595bb53133e3..bc00695534336c0d8d2bf261059f6375b413a115 100644 --- a/My project/Assets/Scripts/Weapon/Sword.cs +++ b/My project/Assets/Scripts/Weapon/Sword.cs @@ -56,13 +56,13 @@ public class Sword : MonoBehaviour EnemyHealth enemyHealth = enemy.GetComponent<EnemyHealth>(); if (enemyHealth != null) { - enemyHealth.TakeDamage(attackDamage, enemy.ClosestPointOnBounds(transform.position)); + enemyHealth.TakeDamage(attackDamage + StateController.attBuff, enemy.ClosestPointOnBounds(transform.position)); } BossHealth bossHealth = enemy.GetComponent<BossHealth>(); if (bossHealth != null) { - bossHealth.TakeDamage(attackDamage, enemy.ClosestPointOnBounds(transform.position)); + bossHealth.TakeDamage(attackDamage + StateController.attBuff, enemy.ClosestPointOnBounds(transform.position)); } } diff --git a/README.md b/README.md index 5fd437627379116387ae609e1395d3cea64f2b8a..cc3d7f423c3e1225fa7a4be0f6603dcd0973108d 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ Adapun aplikasi ini memiliki beberapa spesifikasi , yaitu : NIM | Nama | Tugas | Jam Persiapan | Jam Pengerjaan --- | --- | --- | --- | --- -13520021 | Gede Sumerta Yoga | inisialisasi game, pet | | +13520021 | Gede Sumerta Yoga | inisialisasi game, pet | 9 jam | 16 jam 13520090 | Rahmat Rafid Akbar | Cheat, Main Menu, Game Over, Local Scoreboard, Bug Tester | 10 jam | 24 jam 13520133 | Jevant Jedidia Augustine | Inisialisasi game, story mode, Save & Load, Integrasi | 10 jam | 36 jam 13520141 | Yoseph Alexander Siregar | Shop, Bonus Upgrade Weapon | 9 jam | 15 jam