Skip to content
Snippets Groups Projects
Commit 30860c7f authored by Salomo309's avatar Salomo309
Browse files

refactor: fix class name, add increase attack from pet

parent 6ba56208
No related merge requests found
...@@ -4,7 +4,7 @@ using System.Collections.Generic; ...@@ -4,7 +4,7 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.AI; using UnityEngine.AI;
public class Jenderal : PausibleObject public class JenderalAttack : PausibleObject
{ {
public float timeBetweenAttacks = 0.5f; public float timeBetweenAttacks = 0.5f;
public int attackDamage = 10; public int attackDamage = 10;
...@@ -99,4 +99,14 @@ public class Jenderal : PausibleObject ...@@ -99,4 +99,14 @@ public class Jenderal : PausibleObject
{ {
playerHealth.TakeDamage(playerDamagePerSecond); playerHealth.TakeDamage(playerDamagePerSecond);
} }
public void IncreaseAttack(float percentage)
{
float increaseAmount = attackDamage * (percentage / 100f);
attackDamage += Mathf.RoundToInt(increaseAmount);
Debug.Log("Attack damage increased by " + percentage + "%");
}
} }
...@@ -4,7 +4,7 @@ using System.Collections.Generic; ...@@ -4,7 +4,7 @@ using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.AI; using UnityEngine.AI;
public class Raja : PausibleObject public class RajaAttack : PausibleObject
{ {
public float timeBetweenAttacks = 0.5f; public float timeBetweenAttacks = 0.5f;
public int attackDamage = 10; public int attackDamage = 10;
...@@ -13,6 +13,7 @@ public class Raja : PausibleObject ...@@ -13,6 +13,7 @@ public class Raja : PausibleObject
public float playerSlowdownFactor = 0.5f; public float playerSlowdownFactor = 0.5f;
public int playerDamagePerSecond = 5; public int playerDamagePerSecond = 5;
public float kerocoSpawnTimer; public float kerocoSpawnTimer;
private int petIncreaserCount = 0;
public GameObject kerocoPrefab; public GameObject kerocoPrefab;
public Transform[] spawnPoints; public Transform[] spawnPoints;
...@@ -134,4 +135,19 @@ public class Raja : PausibleObject ...@@ -134,4 +135,19 @@ public class Raja : PausibleObject
Debug.LogWarning("KerocoPrefab atau SpawnPoints belum ditentukan!"); Debug.LogWarning("KerocoPrefab atau SpawnPoints belum ditentukan!");
} }
} }
public void IncreaseAttack(float percentage)
{
float increaseAmount = attackDamage * (percentage / 100f);
attackDamage += Mathf.RoundToInt(increaseAmount);
Debug.Log("Attack damage increased by " + percentage + "%");
if (petIncreaserCount >= 1)
{
attackDamage += Mathf.RoundToInt(increaseAmount * 0.2f);
Debug.Log("Additional 20% increase applied due to having multiple Pet Increasers");
}
}
} }
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment