mobs balance

This commit is contained in:
dart 2022-04-03 16:22:58 +03:00
parent bf33a2a32f
commit ef33df92b6
5 changed files with 25 additions and 86 deletions

View File

@ -541,7 +541,7 @@ PrefabInstance:
m_Modifications:
- target: {fileID: 4220328572880531123, guid: a2d345161907c714abc1cd72fdda75d8, type: 3}
propertyPath: m_RootOrder
value: 3
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: a2d345161907c714abc1cd72fdda75d8, type: 3}
propertyPath: m_LocalPosition.x
@ -852,63 +852,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 772746139284061350, guid: d184a3354ad54784ead4da1d908feaf2, type: 3}
m_PrefabInstance: {fileID: 1080547517}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &1177075715
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 1869821417}
m_Modifications:
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_RootOrder
value: 2
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalPosition.x
value: -1.8834
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalPosition.y
value: 0.72714
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalPosition.z
value: -2.1158
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4220328572880531123, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6863736067666425520, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
propertyPath: m_Name
value: Pistol
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: e8a2d39c1daf04448aee13c8f05c0017, type: 3}
--- !u!1001 &1279967480
PrefabInstance:
m_ObjectHideFlags: 0
@ -1089,7 +1032,7 @@ MonoBehaviour:
overMind: {fileID: 1682053525}
timeOnStart: 30
DeathScreen: {fileID: 732765870}
balanceScale: 1.6
balanceScale: 1.5
--- !u!1 &1506820044
GameObject:
m_ObjectHideFlags: 0
@ -1422,16 +1365,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a35c03cf584d904acac0d316af6a31fb, type: 3}
m_Name:
m_EditorClassIdentifier:
mob: {fileID: 4086673825482164031, guid: e47d96f25248114df8e596380d90afc6, type: 3}
megaMob: {fileID: 0}
pullSize: 20
characterObject: {fileID: 1869821414}
gamePlay: {fileID: 1483883356}
mobMoveSpeed: 0.2
mobHealth: 100
mobDamage: 10
mobAddedTime: 0.5
mobPull: {fileID: 0}
activeMobs: {fileID: 1560770443}
mobs:
- mobName: standartMob

View File

@ -31,7 +31,7 @@ void Update()
{
horInpt = Input.GetAxis("Horizontal");
verInpt = Input.GetAxis("Vertical");
if (-0.1f > horInpt || horInpt > 0.1f)
if (moveSpeed > horInpt || horInpt > moveSpeed)
{
characterAnimator.SetBool("IsRun", true);
transform.position += new Vector3(horInpt * moveSpeed,0,0);

View File

@ -35,13 +35,14 @@ private IEnumerator AutoBalance()
{
yield return new WaitForSeconds(30f);
print("autobalance");
if (balanceScale > 1.1f)
if (balanceScale > 1.1f && balanceScale < 1.5f)
{
balanceScale -= 0.1f;
}
_characterCharacterClass.SetHealth(_characterCharacterClass.GetHealth() * balanceScale);
_characterCharacterClass.SetDamage(_characterCharacterClass.GetDamage() * balanceScale);
// _characterCharacterClass.SetHealth(_characterCharacterClass.GetHealth() * balanceScale);
// _characterCharacterClass.SetDamage(_characterCharacterClass.GetDamage() * balanceScale);
overMind.GetComponent<OverMind>().SetBalanceScale(balanceScale);
}
}

View File

@ -104,17 +104,17 @@ void OnTriggerEnter2D(Collider2D col)
IEnumerator waiter()
{
yield return new WaitForSecondsRealtime(0.5f);
//overMind.DeathGoToPull(gameObject, mobAddedTime);
Destroy(gameObject);
overMind.DeathGoToPull(gameObject, mobAddedTime);
//Destroy(gameObject);
}
public void SetupMob(OverMind.MobParameters mobParameters)
public void SetupMob(OverMind.MobParameters mobParameters, float balanceScale)
{
moveSpeed = mobParameters.MoveSpeed;
characterObject = mobParameters.Character;
overMind = mobParameters.OverMind;
health = mobParameters.Health;
damage = mobParameters.Damage;
health = mobParameters.Health * balanceScale;
damage = mobParameters.Damage * balanceScale;
mobAddedTime = mobParameters.AddedTime;
}
}

View File

@ -4,19 +4,14 @@
public class OverMind : MonoBehaviour
{
[SerializeField] private GameObject mob;
[SerializeField] private GameObject megaMob;
[SerializeField] private int pullSize;
[SerializeField] private GameObject characterObject;
[SerializeField] private Gameplay gamePlay;
[SerializeField] private float mobMoveSpeed;
[SerializeField] private float mobHealth;
[SerializeField] private float mobDamage;
[SerializeField] private float mobAddedTime;
[SerializeField] private GameObject mobPull;
// [SerializeField] private GameObject mobPull;
[SerializeField] private GameObject activeMobs;
private float balanceScale = 1.5f;
private List<GameObject> _pullEnemies;
@ -154,19 +149,26 @@ IEnumerator spawnMobsCourutine()
var mobToSpawn = mobs[Random.Range(0, mobs.Count-1)];
var mobToSpawnObject = Instantiate(mobToSpawn.mobPrefab ,activeMobs.transform);
mobToSpawnObject.transform.position = GenerateRandomSpawnMobPoint();
mobToSpawnObject.GetComponent<Mob>().SetupMob(mobToSpawn);
mobToSpawnObject.GetComponent<Mob>().SetupMob(mobToSpawn, balanceScale);
}
}
public void DeathGoToPull(GameObject mob, float addedTime)
{
gamePlay.SendMessage("AddTime", addedTime);
mob.SetActive(false);
mob.transform.parent = mobPull.transform;
Destroy(mob);
//mob.SetActive(false);
//mob.transform.parent = mobPull.transform;
}
// Update is called once per frame
void Update()
{
}
public void SetBalanceScale(float newBalanceScale)
{
print(newBalanceScale);
balanceScale = newBalanceScale;
}
}