Randomized mob shooting
And other balancing
This commit is contained in:
parent
fdfc33e759
commit
69f013755e
4 changed files with 14 additions and 12 deletions
|
@ -16,12 +16,12 @@ namespace Assets.Scripts.Entities {
|
|||
}
|
||||
|
||||
protected override void Start() {
|
||||
base.Start();
|
||||
SingleShot s = new SingleShot(this.gameObject, 8, 3, 8 );
|
||||
s.SetRange(3);
|
||||
s.SetPrefab(bullet);
|
||||
s.SetSpawn(bulletSpawn);
|
||||
SetAttack(s);
|
||||
SetAttack(s);
|
||||
base.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,11 +33,11 @@ namespace Assets.Scripts.Entities {
|
|||
victim = ply.gameObject;
|
||||
}
|
||||
|
||||
|
||||
if (attack != null)
|
||||
nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime() * (UnityEngine.Random.value + 0.5f);
|
||||
}
|
||||
|
||||
void Update() {
|
||||
|
||||
if ( victim == null || attack == null ) {
|
||||
if ( objective != null ) {
|
||||
Player ply = objective.GetPlayer();
|
||||
|
@ -53,8 +53,8 @@ namespace Assets.Scripts.Entities {
|
|||
RaycastHit2D hit = rh.Find(x => x.fraction != 0);
|
||||
if ( hit.collider != null && hit.collider.gameObject == victim ) {
|
||||
Debug.Log("Attacking Player!!!");
|
||||
attack.Attack();
|
||||
nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime();
|
||||
attack.Attack();
|
||||
nextAttackTime = Time.timeSinceLevelLoad + attack.GetCooldownTime() * (UnityEngine.Random.value + 0.25f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,12 +16,12 @@ namespace Assets.Scripts.Entities {
|
|||
}
|
||||
|
||||
protected override void Start() {
|
||||
base.Start();
|
||||
SingleShot s = new SingleShot(this.gameObject, 25, 4, 2);
|
||||
s.SetRange(10);
|
||||
s.SetPrefab(bullet);
|
||||
s.SetSpawn(bulletSpawn);
|
||||
SetAttack(s);
|
||||
SetAttack(s);
|
||||
base.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -461,9 +461,11 @@ public class DungeonGenerator {
|
|||
|
||||
Objective o = null;
|
||||
|
||||
int rand = UnityEngine.Random.Range(0, 7);
|
||||
int rand = UnityEngine.Random.Range(0, 8);
|
||||
switch (rand) {
|
||||
case 0: {
|
||||
case 0:
|
||||
case 7:
|
||||
{
|
||||
// Scorpion Attack!!!!:
|
||||
List<GameObject> lg = new List<GameObject>();
|
||||
int count = UnityEngine.Random.Range(1, ( int ) Math.Min(Mathf.Floor(r.GetSpawnpoints().Count), 4));
|
||||
|
@ -505,7 +507,7 @@ public class DungeonGenerator {
|
|||
{
|
||||
// Siders!!!!:
|
||||
List<GameObject> lg = new List<GameObject>();
|
||||
int count = Math.Min(UnityEngine.Random.Range(1, (int)Mathf.Floor(r.GetSpawnpoints().Count)), 3);
|
||||
int count = Math.Min(UnityEngine.Random.Range(1, (int)Mathf.Floor(r.GetSpawnpoints().Count)), 5);
|
||||
for (int c = 0; c < count; c++)
|
||||
{
|
||||
lg.Add(enemyPrefabs[Entity.Entities.SPIDER]);
|
||||
|
|
Loading…
Add table
Reference in a new issue