Skip to content

Commit

Permalink
Final boss is killable and most attacks work
Browse files Browse the repository at this point in the history
  • Loading branch information
someone42 committed Feb 5, 2023
1 parent 3dd4a02 commit 38e1f77
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Assets/Prefabs/Potato.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ MonoBehaviour:
acceleration: 5
maximumSpeed: 5
startRight: 1
flyIgnoreCollisions: 0.5
flyIgnoreCollisions: 0.6
isFlying: 0
BossScObj: {fileID: 0}
--- !u!114 &4134442384279228947
Expand Down
56 changes: 48 additions & 8 deletions Assets/Prefabs/TreeBoss.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 23277807598548147}
- component: {fileID: 23277807598548146}
- component: {fileID: 3598015847216710403}
m_Layer: 0
m_Name: ColliderScaler
m_TagString: Enemy
Expand Down Expand Up @@ -46,6 +47,22 @@ MeshCollider:
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: -723090040655550300, guid: 02ab5630437a1384dbeae27f352a822d, type: 3}
--- !u!54 &3598015847216710403
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 23277807598548148}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!1 &23277807649979601
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -60,6 +77,7 @@ GameObject:
- component: {fileID: 7708893993313149470}
- component: {fileID: 6708470962637682533}
- component: {fileID: 3770758557608109406}
- component: {fileID: 7195456913371833138}
m_Layer: 0
m_Name: TreeBoss
m_TagString: Enemy
Expand All @@ -76,7 +94,7 @@ Transform:
m_GameObject: {fileID: 23277807649979601}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 20, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalScale: {x: 0.9, y: 0.9, z: 0.9}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 565213263614195373}
Expand All @@ -97,6 +115,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ee51ddf97717c9f41aeb36b49cb90c2e, type: 3}
m_Name:
m_EditorClassIdentifier:
health: 300
player: {fileID: 0}
stageController: {fileID: 0}
rb: {fileID: 7195456913371833138}
deathEffect: {fileID: 647739838954711788, guid: e09491246e1671a4bb8cd66c1d277f1a,
type: 3}
spike: {fileID: 1396250162364260641, guid: 9a61359e32e7c374a93d60af9344f8fd, type: 3}
root: {fileID: 4329808208691645257, guid: 74a322c512dbce546aac6550c4eb7c3b, type: 3}
chanceOfSpecialIdle: 0.15
Expand Down Expand Up @@ -125,8 +149,8 @@ MonoBehaviour:
numRootWaveSpawns: 3
initialDelay: 3
rootWaveTimeInterval: 0.8
rootWaveDistanceMin: 10
rootWaveDistanceMax: 15
rootWaveDistanceMin: 8
rootWaveDistanceMax: 12
initialDistanceFactor: 1.5
isPlayer: 1
rootWavePrefab: {fileID: 4329808208691645257, guid: 74a322c512dbce546aac6550c4eb7c3b,
Expand All @@ -143,10 +167,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 6608113060153e44b81f998fecb336e1, type: 3}
m_Name:
m_EditorClassIdentifier:
numRootSpikeSpawns: 10
numRootSpikeSpawns: 8
initialDelay: 3
rootSpikeTimeInterval: 0.3
rootSpikeDistance: 4
rootSpikeDistance: 2
initialDistanceFactor: 3
rootSpikePrefab: {fileID: 1396250162364260641, guid: 9a61359e32e7c374a93d60af9344f8fd,
type: 3}
Expand All @@ -165,7 +189,7 @@ MonoBehaviour:
numSpawns: 4
initialDelay: 3
spawnTimeInterval: 0.2
potatoSpeed: 20
potatoSpeed: 15
minAngle: 20
maxAngle: 40
spawnDisplacement: {x: 0, y: 9, z: 0}
Expand All @@ -182,8 +206,24 @@ BoxCollider:
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 6.14, y: 13.160121, z: 5.3378067}
m_Center: {x: -0.79, y: 6.0800614, z: 0.9223024}
m_Size: {x: 5, y: 13.160121, z: 5.3378067}
m_Center: {x: -0.82, y: 6.0800614, z: 0.9223024}
--- !u!54 &7195456913371833138
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 23277807649979601}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 126
m_CollisionDetection: 0
--- !u!1 &6398156130726698676
GameObject:
m_ObjectHideFlags: 0
Expand Down
69 changes: 64 additions & 5 deletions Assets/Scenes/FinalScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ MonoBehaviour:
player: {fileID: 454267269}
spawnParticles: {fileID: 647739838954711788, guid: e09491246e1671a4bb8cd66c1d277f1a,
type: 3}
stageNumber: 0
stageNumber: 1
waves:
- spawns:
- enemy: {fileID: 8260980253245367828, guid: 5c718ccc8cfd5034da7727c27e0cfad8,
Expand Down Expand Up @@ -482,7 +482,7 @@ MonoBehaviour:
player: {fileID: 454267269}
spawnParticles: {fileID: 647739838954711788, guid: e09491246e1671a4bb8cd66c1d277f1a,
type: 3}
stageNumber: 0
stageNumber: 2
waves:
- spawns:
- enemy: {fileID: 8975402790696339599, guid: e6c5d94959eb57841aa04ed65cfe03ee,
Expand Down Expand Up @@ -603,7 +603,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 444796485}
m_RootOrder: 4
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &57934318
AudioSource:
Expand Down Expand Up @@ -6617,7 +6617,7 @@ MonoBehaviour:
player: {fileID: 454267269}
spawnParticles: {fileID: 647739838954711788, guid: e09491246e1671a4bb8cd66c1d277f1a,
type: 3}
stageNumber: 0
stageNumber: 3
waves:
- spawns:
- enemy: {fileID: 8975402790696339599, guid: e6c5d94959eb57841aa04ed65cfe03ee,
Expand Down Expand Up @@ -7520,6 +7520,7 @@ Transform:
- {fileID: 6449199}
- {fileID: 46775648}
- {fileID: 323286085}
- {fileID: 1604122734}
- {fileID: 57934317}
- {fileID: 457310373}
m_Father: {fileID: 0}
Expand All @@ -7543,6 +7544,7 @@ MonoBehaviour:
- {fileID: 6449200}
- {fileID: 46775649}
- {fileID: 323286086}
- {fileID: 1604122733}
environments:
- {fileID: 10532818}
- {fileID: 1038356723}
Expand Down Expand Up @@ -7885,7 +7887,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 444796485}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &457310374
MonoBehaviour:
Expand Down Expand Up @@ -15781,6 +15783,63 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1588817402}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1604122732
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1604122734}
- component: {fileID: 1604122733}
m_Layer: 0
m_Name: Wave 5
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1604122733
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1604122732}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9e98aafa94e8f6f47b5f8be97de7a6bf, type: 3}
m_Name:
m_EditorClassIdentifier:
gameManager: {fileID: 444796486}
intermissionDuration: 3
player: {fileID: 454267269}
spawnParticles: {fileID: 647739838954711788, guid: e09491246e1671a4bb8cd66c1d277f1a,
type: 3}
stageNumber: 4
waves:
- spawns:
- enemy: {fileID: 23277807649979601, guid: 8d1a5c0cb9ffa9c4fb6011fd611520e5, type: 3}
spawnPos: {x: 11, y: 0, z: 0}
waveStarted: 0
currentWave: 0
livingEnemies: []
--- !u!4 &1604122734
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1604122732}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 444796485}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1605503640
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
5 changes: 5 additions & 0 deletions Assets/Scripts/PotatoSpammer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ public void Spawn()
IEnumerator SpawnPotatoes()
{
yield return new WaitForSeconds(initialDelay);
StageController sc = FindObjectOfType<StageController>();
Player myPlayer = FindObjectOfType<Player>();
for (int i = 0; i < numSpawns; i++)
{
GameObject g = Instantiate(potatoPrefab, transform);

g.GetComponent<Enemy>().Setup(myPlayer, sc);
sc.AddLivingEnemy(g);
g.transform.rotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, Random.Range(0.0f, 360.0f)));
g.transform.position = transform.position + spawnDisplacement;
Debug.DrawLine(transform.position, g.transform.position);
Expand Down
5 changes: 5 additions & 0 deletions Assets/Scripts/StageController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ public void TriggerGameEnd()

}

public void AddLivingEnemy(GameObject enemy)
{
livingEnemies.Add(enemy);
}

public void RemoveDeadEnemy(GameObject gameObject)
{
livingEnemies.Remove(gameObject);
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/TreeBossController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using UnityEngine;

public class TreeBossController : MonoBehaviour
public class TreeBossController : Enemy
{

public GameObject spike, root;
Expand Down

0 comments on commit 38e1f77

Please sign in to comment.