Commit 6f9cfb7b authored by 박찬수's avatar 박찬수

Add cheif's logic

parent 25de06e5
Pipeline #571 skipped
......@@ -9,7 +9,7 @@ GameObject:
m_Component:
- 4: {fileID: 458296}
- 212: {fileID: 21243648}
- 114: {fileID: 11449084}
- 114: {fileID: 11417670}
m_Layer: 0
m_Name: Cheif3
m_TagString: Boss
......@@ -312,6 +312,32 @@ MonoBehaviour:
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
--- !u!114 &11417670
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 101830}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 78f9f501699f71848abf2f7955e565f3, type: 3}
m_Name:
m_EditorClassIdentifier:
mainLogic: {fileID: 0}
reflectPercentage: 25
bossLines:
- "2\uB300 \uC138\uC2B5"
- "3\uB300 \uC138\uC2B5"
- "\uCD95\uC9C0\uBC95"
- "\uC194\uBC29\uC6B8 \uD3ED\uD0C4"
- "\uC694\uACA9"
speechBubble: {fileID: 120112}
hpSlider: {fileID: 11483000}
HP: 4349
Atk: 30
speed: 0.5
generalSprite: {fileID: 0}
enemyManager: {fileID: 0}
--- !u!114 &11421156
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -360,25 +386,6 @@ MonoBehaviour:
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &11449084
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 101830}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f8b2b3a6aa6767f40a92a0ee9cb231d4, type: 3}
m_Name:
m_EditorClassIdentifier:
mainLogic: {fileID: 0}
reflectPercentage: 0
bossLines: []
speechBubble: {fileID: 120112}
hpSlider: {fileID: 11483000}
HP: 100
Atk: 10
speed: 0.5
--- !u!114 &11456336
MonoBehaviour:
m_ObjectHideFlags: 1
......@@ -829,10 +836,55 @@ Prefab:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 0}
propertyPath: bossLines.Array.size
value: 5
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_TagString
value: Boss
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: reflectPercentage
value: 25
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: speechBubble
value:
objectReference: {fileID: 120112}
- target: {fileID: 0}
propertyPath: HP
value: 4349
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: Atk
value: 30
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: bossLines.Array.data[2]
value: "\uCD95\uC9C0\uBC95"
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: bossLines.Array.data[3]
value: "\uC194\uBC29\uC6B8 \uD3ED\uD0C4"
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: bossLines.Array.data[4]
value: "\uC694\uACA9"
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: bossLines.Array.data[0]
value: "2\uB300 \uC138\uC2B5"
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: bossLines.Array.data[1]
value: "3\uB300 \uC138\uC2B5"
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: generalSprite
value:
objectReference: {fileID: 21300000, guid: 411692e03ad48c947b83154c12a26eeb,
type: 3}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 101830}
......
80
00 160
120
00 10
\ No newline at end of file
10
00 16
15
00 5
\ No newline at end of file
30
00 60
10
00 20
10
00 5
\ No newline at end of file
......@@ -1726,7 +1726,7 @@ MonoBehaviour:
- {fileID: 11462880, guid: 5fdda3d4fe0d652449199b2ba2ba312e, type: 2}
- boss:
- {fileID: 11485702, guid: a8b6c9633a8e2a348915dbc6d3cd50ae, type: 2}
- {fileID: 11449084, guid: 6e3357ea2a18c524e87c9eff057d09ae, type: 2}
- {fileID: 11417670, guid: 6e3357ea2a18c524e87c9eff057d09ae, type: 2}
- boss:
- {fileID: 11471628, guid: 59e5ded143c44ea43b07f5ee0a07d5da, type: 2}
- {fileID: 11429156, guid: 4c55e935f64983441965b0f776e5c635, type: 2}
......
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
public class General : Boss {
public Sprite generalSprite;
float cameraHeight;
float cameraWidth;
public SpriteRenderer generalSprite;
bool suc1 = false;
bool suc2 = false;
public EnemyManager enemyManager;
// Use this for initialization
void Start()
{
base.speed = 0.0f;
generalSprite = base.GetComponent<Sprite>();
generalSprite = base.GetComponent<SpriteRenderer>();
Debug.Log(generalSprite);
generalSprite.sprite = Resources.Load<Sprite>("Boss/Cheif The Great_3_Image");
cameraWidth = cameraHeight * Camera.main.aspect;
cameraHeight = 2 * Camera.main.orthographicSize;
base.maxHP = base.HP;
base.patternList = new List<pattern>() {
Shukuchi
};
enemyManager = mainLogic.enemyManager;
StartCoroutine(HPCheck());
StartCoroutine(base.BossPattern());
}
IEnumerator Shukuchi()
IEnumerator HPCheck()
{
base.transform.position = new Vector3(-cameraWidth / 2, Random.Range((float)(-1) / 9 * cameraHeight, (float)4 / 9 * cameraHeight), 0.0f);
SayLine(0);
while (suc1 == false && base.maxHP * 0.55f < base.HP) // 45년 재임
{
yield return new WaitForFixedUpdate();
}
if (suc1 == false)
{
Debug.Log("Succeeding KIS");
suc1 = true;
SayLine(0);
generalSprite.sprite = Resources.Load<Sprite>("Boss/Cheif The Great_3_Image_1");
base.speed = 0.5f;
base.transform.position = new Vector3(-6.5f, 2.0f, 0.0f);
base.patternList.Add(PineBomb);
}
while(suc2 == false && base.maxHP * 0.33f < base.HP) // KJE 33살
{
yield return new WaitForFixedUpdate();
}
if(suc2 == false)
{
Debug.Log("Succedding KJI");
suc2 = true;
SayLine(1);
generalSprite.sprite = Resources.Load<Sprite>("Boss/Cheif The Great_3_Image_2");
base.patternList.Add(Sniping);
}
yield return null;
}
// Have to implement KJI and KJE's skill with HP conditional
IEnumerator KyeongBakSanSeong()
IEnumerator Shukuchi()
{
base.transform.position = new Vector3(Random.Range(-cameraWidth / 2, 0.0f), Random.Range((float)(-1) / 9 * cameraHeight, (float)4 / 9 * cameraHeight), 0.0f);
SayLine(2);
var pastHP = HP;
var pastReflect = reflectPercentage;
HP += 5000;
reflectPercentage = 0;
yield return new WaitForSeconds(2.0f);
HP = HP > pastHP ? pastHP : HP;
reflectPercentage = pastReflect;
enemyManager.SpawnEnemyWithoutRestriction(2);
enemyManager.SpawnEnemyWithoutRestriction(5);
float rand = Random.Range(0.0f, 1.0f);
if (rand < 0.2f) enemyManager.SpawnEnemyWithoutRestriction(9);
yield return null;
}
IEnumerator PineBomb()
{
// 전체 deal.
SayLine(3);
foreach(Unit u in mainLogic.activeUnitList)
{
u.HP -= (int)(0.2f * u.MaxHP);
}
yield return null;
}
IEnumerator Sniping()
{
// 요격 즉사.
SayLine(4);
int unitCount = mainLogic.activeUnitList.Count;
int[] indexes = new int[5];
for (int i = 0; i < (5 <= unitCount ? 5 : unitCount); i++)
{
indexes[i] = -1;
while (true)
{
indexes[i] = Random.Range(0, unitCount);
bool dup = false;
for (int j = 0; j < i; j++)
{
if (indexes[j] == indexes[i]) dup = true;
}
if (!dup) break;
}
mainLogic.activeUnitList[i].HP -= mainLogic.activeUnitList[i].MaxHP;
}
yield return null;
}
}
......@@ -51,6 +51,8 @@ public class SeontaekJang : Boss {
enemyManager.SpawnEnemyWithoutRestriction(2);
enemyManager.SpawnEnemyWithoutRestriction(3);
enemyManager.SpawnEnemyWithoutRestriction(5);
float rand = Random.Range(0.0f, 1.0f);
if (rand < 0.4f) enemyManager.SpawnEnemyWithoutRestriction(9);
SayLine(1);
yield return null;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment