Tweak stats
This commit is contained in:
parent
a346efc487
commit
db575d3178
@ -167,7 +167,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 197677485360569566, guid: b25a487d193f24049b6a791adf592b2e, type: 3}
|
||||
propertyPath: attackCooldown
|
||||
value: 5
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 197677485360569566, guid: b25a487d193f24049b6a791adf592b2e, type: 3}
|
||||
propertyPath: <cost>k__BackingField
|
||||
|
||||
@ -171,7 +171,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2399377275812995974, guid: 5f633c05dee3f4b4784f5702b2365f02, type: 3}
|
||||
propertyPath: attackCooldown
|
||||
value: 5
|
||||
value: 2
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2399377275812995974, guid: 5f633c05dee3f4b4784f5702b2365f02, type: 3}
|
||||
propertyPath: <cost>k__BackingField
|
||||
@ -187,7 +187,7 @@ PrefabInstance:
|
||||
objectReference: {fileID: 1175205805}
|
||||
- target: {fileID: 2399377275812995974, guid: 5f633c05dee3f4b4784f5702b2365f02, type: 3}
|
||||
propertyPath: <attackDmg>k__BackingField
|
||||
value: 40
|
||||
value: 30
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2399377275812995974, guid: 5f633c05dee3f4b4784f5702b2365f02, type: 3}
|
||||
propertyPath: <movementSpeed>k__BackingField
|
||||
|
||||
@ -149,11 +149,15 @@ public class AIEntity : Entity {
|
||||
}
|
||||
|
||||
protected class SeekState : BaseStateAI {
|
||||
|
||||
float currentSeekResetTimer;
|
||||
|
||||
public SeekState(AIEntity entity) : base(entity) {
|
||||
|
||||
}
|
||||
|
||||
public override void EnterState() {
|
||||
currentSeekResetTimer = entity.AIStats.targetCheckTime;
|
||||
if (!entity.animator.GetCurrentAnimatorStateInfo(0).IsName("Attack")) {
|
||||
entity.animator.Play("Running");
|
||||
}
|
||||
@ -168,13 +172,18 @@ public class AIEntity : Entity {
|
||||
if (targetEntity.IsAlive()) {//target is alive, keep chasing it
|
||||
return null;
|
||||
} else {//target is dead, go to findTargetState
|
||||
return new FindTargetState(entity); ;
|
||||
return new FindTargetState(entity);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public override BaseState? FixedUpdateState() {
|
||||
currentSeekResetTimer -= Time.deltaTime;
|
||||
if(currentSeekResetTimer <= 0f) {
|
||||
return new FindTargetState(entity);
|
||||
}
|
||||
|
||||
entity.direction = Vector3.RotateTowards(entity.direction, (entity.target.position - entity.transform.position), entity.rotSpeed * Time.fixedDeltaTime, 0.0f).normalized;
|
||||
if (entity.IsTargetable(entity.target.GetComponent<Entity>())) {
|
||||
if (!entity.IsInAttackRange()) {
|
||||
|
||||
@ -5,6 +5,7 @@ public class AIStats : ScriptableObject {
|
||||
[field: Min(0f)]public float closeEnough = 1f;
|
||||
[field: Min(0f)]public float decayTime = 5f;
|
||||
[field: Min(0f)]public float stuckCheckTime = 3f;
|
||||
[field: Min(0f)] public float targetCheckTime = 1f;
|
||||
|
||||
public Vector3[] roamPositions = null!;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user