Forráskód Böngészése

Try some rebalancing changes.

- no more auto fire
- hold button longer to charge shot
- takes multiple shots to kill enemy
- reduce spawn rate
- increase day length
- reduce powerup despawn time
- NavMesh seems to be broken, dying agents now throw exceptions
sometimes(?)
Niels Meyering 9 éve
szülő
commit
4b2aeb907b

+ 1 - 1
game/Assets/3DArt/Anim/EnemyController.controller

@@ -5,7 +5,7 @@ AnimatorController:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
-  m_Name: Enemy 1
+  m_Name: EnemyController
   serializedVersion: 5
   m_AnimatorParameters: []
   m_AnimatorLayers: []

+ 1 - 1
game/Assets/3DArt/Anim/EnemyWalking.anim

@@ -5,7 +5,7 @@ AnimationClip:
   m_ObjectHideFlags: 0
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 0}
-  m_Name: EnemyAnimation
+  m_Name: EnemyWalking
   serializedVersion: 6
   m_Legacy: 0
   m_Compressed: 0

+ 1 - 0
game/Assets/Prefabs/Enemy.prefab

@@ -1901,6 +1901,7 @@ MonoBehaviour:
   IndicatorCoverMedium: {fileID: 1106222134264392}
   IndicatorCoverHigh: {fileID: 1601112143768466}
   IndicatorCoverFull: {fileID: 1507475458156676}
+  maxHealth: 2.5
 --- !u!114 &114593885084691842
 MonoBehaviour:
   m_ObjectHideFlags: 1

+ 4 - 2
game/Assets/Prefabs/Player.prefab

@@ -1816,9 +1816,9 @@ MonoBehaviour:
   bulletDegenRate: 0.07
   startSpeed: 5
   lookSmoothingSeconds: 0.05
-  cameraSmoothingSeconds: 1
+  cameraSmoothingSeconds: 0.8
   bulletUpBias: 0.1
-  bulletForce: 20
+  bulletForce: 5
   powerLevelMax: 20
   gunTransform: {fileID: 4475041197474250}
   bulletPrefab: {fileID: 54376493206981186, guid: b7a50776d2afe4da29c642bd08d6e556,
@@ -1826,6 +1826,8 @@ MonoBehaviour:
   muzzleLight: {fileID: 108365963384445830}
   gauge: {fileID: 4874332323323470}
   fidgetSpin: 60
+  maxChargingTime: 2
+  maxBulletForce: 30
 --- !u!135 &135266388922568280
 SphereCollider:
   m_ObjectHideFlags: 1

+ 3 - 3
game/Assets/Prefabs/PowerCore.prefab

@@ -176,7 +176,7 @@ GameObject:
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
+  m_StaticEditorFlags: 4294967295
   m_IsActive: 1
 --- !u!4 &4153255920313556
 Transform:
@@ -237,7 +237,7 @@ Transform:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1330355620010116}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: -4.65, y: -2.6483585e-17, z: 2.61}
+  m_LocalPosition: {x: -15.1, y: -2.6483585e-17, z: 2.61}
   m_LocalScale: {x: 0.8949458, y: 0.89494604, z: 0.89494604}
   m_Children:
   - {fileID: 4165165924441886}
@@ -758,7 +758,7 @@ ParticleSystem:
   moveWithTransform: 0
   moveWithCustomTransform: {fileID: 0}
   scalingMode: 1
-  randomSeed: -1611859948
+  randomSeed: 390031730
   InitialModule:
     serializedVersion: 3
     enabled: 1

+ 8 - 8
game/Assets/Prefabs/Spinner.prefab

@@ -19,6 +19,7 @@ GameObject:
   serializedVersion: 5
   m_Component:
   - component: {fileID: 4910722841464584}
+  - component: {fileID: 65805253561915420}
   m_Layer: 0
   m_Name: SpinnerPivot
   m_TagString: Bullet
@@ -36,7 +37,6 @@ GameObject:
   - component: {fileID: 4929338172196046}
   - component: {fileID: 33866552146231046}
   - component: {fileID: 23775418827657386}
-  - component: {fileID: 65616611097211800}
   m_Layer: 0
   m_Name: Spinner
   m_TagString: Bullet
@@ -94,7 +94,7 @@ Transform:
   m_PrefabInternal: {fileID: 100100000}
   m_GameObject: {fileID: 1823419480998182}
   m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalPosition: {x: 0, y: 0.282, z: -1.355}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   - {fileID: 4910722841464584}
@@ -149,21 +149,21 @@ Rigidbody:
   serializedVersion: 2
   m_Mass: 1
   m_Drag: 0
-  m_AngularDrag: 0.05
+  m_AngularDrag: 0
   m_UseGravity: 1
   m_IsKinematic: 0
   m_Interpolate: 0
   m_Constraints: 0
-  m_CollisionDetection: 0
---- !u!65 &65616611097211800
+  m_CollisionDetection: 1
+--- !u!65 &65805253561915420
 BoxCollider:
   m_ObjectHideFlags: 1
   m_PrefabParentObject: {fileID: 0}
   m_PrefabInternal: {fileID: 100100000}
-  m_GameObject: {fileID: 1770017527029210}
+  m_GameObject: {fileID: 1023692998934438}
   m_Material: {fileID: 0}
   m_IsTrigger: 0
   m_Enabled: 1
   serializedVersion: 2
-  m_Size: {x: 0.06, y: 0.06, z: 0.003}
-  m_Center: {x: 0.000060200917, y: -0.02377817, z: 0.001505636}
+  m_Size: {x: 0.07, y: 0.07, z: 0.01}
+  m_Center: {x: 0, y: 0, z: 0}

+ 8 - 3
game/Assets/Scenes/Main.unity

@@ -154,7 +154,7 @@ Prefab:
     - target: {fileID: 114228307958694658, guid: 33baed11feb9da44b9aa11678990fc51,
         type: 2}
       propertyPath: cooldownForSpawning
-      value: 1
+      value: 10
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: 33baed11feb9da44b9aa11678990fc51, type: 2}
@@ -291,7 +291,7 @@ Prefab:
     - target: {fileID: 114228307958694658, guid: 33baed11feb9da44b9aa11678990fc51,
         type: 2}
       propertyPath: cooldownForSpawning
-      value: 1
+      value: 10
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: 33baed11feb9da44b9aa11678990fc51, type: 2}
@@ -1179,7 +1179,7 @@ Prefab:
     - target: {fileID: 114228307958694658, guid: 33baed11feb9da44b9aa11678990fc51,
         type: 2}
       propertyPath: cooldownForSpawning
-      value: 1
+      value: 10
       objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: 33baed11feb9da44b9aa11678990fc51, type: 2}
@@ -1951,6 +1951,11 @@ Prefab:
       propertyPath: NightColor.b
       value: 1
       objectReference: {fileID: 0}
+    - target: {fileID: 114806071709842584, guid: 673629bba9f02458cacf9d13115e1078,
+        type: 2}
+      propertyPath: secondsPerDay
+      value: 60
+      objectReference: {fileID: 0}
     m_RemovedComponents: []
   m_ParentPrefab: {fileID: 100100000, guid: 673629bba9f02458cacf9d13115e1078, type: 2}
   m_IsPrefabParent: 0

+ 7 - 3
game/Assets/Scripts/Enemy/Enemy.cs

@@ -23,10 +23,11 @@ public class Enemy : MonoBehaviour
     private enum PowerLevels { VeryLow, Low, Medium, High, Full }
     private EnemyAI.BehaviorController behaviorController;
     private DayTimeManager dayTimeManager;
-    private bool dead = false;
+    private float health;
 
     private DayTimeLabel lastCharging;
-
+    public float maxHealth = 2.5f;
+    private bool dead;
 
 
     void OnCollisionEnter(Collision collision)
@@ -35,14 +36,17 @@ public class Enemy : MonoBehaviour
         {
             if (collision.collider.tag == "Bullet")
             {
-                Death();
+                health -= 1f;
             }
         }
+        if (health <= 0)
+            Death();
     }
 
     // Use this for initialization
     void Start()
     {
+        health = maxHealth;
         dayTimeManager = GameObject.FindObjectOfType<DayTimeManager>();
 
         behaviorController = new EnemyAI.BehaviorController();

+ 14 - 3
game/Assets/Scripts/Player.cs

@@ -234,10 +234,10 @@ public class Player : MonoBehaviour
 
         if (shooting)
         {
+            Shoot();
             if (Time.frameCount % 4 == 0)
             {
                 muzzleLight.intensity = 0;
-                Shoot();
             }
             else
             {
@@ -253,6 +253,10 @@ public class Player : MonoBehaviour
     public float fidgetSpin = 30.0f;
 
     int bulletCounter = 5;
+    private float chargingStart;
+    public float maxChargingTime;
+    public float maxBulletForce;
+
     private void Shoot()
     {
         var rb = Instantiate<Rigidbody>(bulletPrefab);
@@ -260,7 +264,9 @@ public class Player : MonoBehaviour
         rb.transform.forward = gunTransform.forward;
         rb.maxAngularVelocity = 300;
         rb.AddTorque(transform.up * fidgetSpin, ForceMode.VelocityChange);
-        rb.AddForce(bulletForce * (transform.forward + Vector3.up * bulletUpBias), ForceMode.VelocityChange);
+        rb.AddForce( 
+            Mathf.Lerp(bulletForce, maxBulletForce, (Time.time - chargingStart) / maxChargingTime)
+            * (transform.forward + Vector3.up * bulletUpBias), ForceMode.VelocityChange);
         Destroy(rb.gameObject, 2f);
         if (bulletCounter == 5)
         {
@@ -283,7 +289,12 @@ public class Player : MonoBehaviour
 
     void GetInput()
     {
-        shooting = Input.GetButton("Fire1");
+        if (Input.GetButtonDown("Fire1"))
+        {
+            chargingStart = Time.time;
+        }
+
+        shooting = Input.GetButtonUp("Fire1");
         var padLook = new Vector3(
             Input.GetAxis("LookX"),
             0,

+ 2 - 2
game/Assets/Scripts/PowerDrop.cs

@@ -29,8 +29,8 @@ public class PowerDrop : MonoBehaviour
 	void Start () 
     {
         textField.text = "+" +powerAmount.ToString();
-        timeTillSelfPop = 5.2f;
-	}
+        timeTillSelfPop = 10.4f;
+    }
 	
 	// Update is called once per frame
 	void Update ()