|
@@ -18,6 +18,9 @@ public class Award
|
|
|
public static int BonusDiamond;
|
|
|
public static string Info;
|
|
|
|
|
|
+ public static int FlowerID;
|
|
|
+ public static bool FlowerLock;
|
|
|
+
|
|
|
public int DiamondMin;
|
|
|
public int DiamondMax;
|
|
|
|
|
@@ -117,6 +120,8 @@ public class Award
|
|
|
|
|
|
FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[1];
|
|
|
|
|
|
+ ManaReso.SetActive("Da_FlowerIcon", true);
|
|
|
+
|
|
|
ManaReso.Get<Image>("Da_FlowerIcon").sprite = flowerInfo.Icon;
|
|
|
ManaReso.Get<Image>("Da_FlowerIcon").Resize(0.2f, 0.2f);
|
|
|
|
|
@@ -126,17 +131,19 @@ public class Award
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (!ManaMiniGame.FlowerLock)
|
|
|
+ if (!FlowerLock)
|
|
|
{
|
|
|
+ flowerFlag = true;
|
|
|
+
|
|
|
if (Random.Range(0, 1f) <= Odds[rate])
|
|
|
{
|
|
|
- flowerFlag = true;
|
|
|
-
|
|
|
- FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[ManaMiniGame.Flower];
|
|
|
+ FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic[FlowerID];
|
|
|
|
|
|
flowerInfo.Unlock = true;
|
|
|
|
|
|
|
|
|
+ ManaReso.SetActive("Da_Flower", true);
|
|
|
+
|
|
|
ManaReso.Get<Image>("Da_FlowerIcon").sprite = flowerInfo.Icon;
|
|
|
ManaReso.Get<Image>("Da_FlowerIcon").Resize(0.2f, 0.2f);
|
|
|
|
|
@@ -144,6 +151,12 @@ public class Award
|
|
|
|
|
|
sb.AppendFormat("{0}{1}{2}", Language.GetStr("UI", "J_Info0"), "<(花朵)>", flowerInfo.Name);
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ManaReso.SetActive("Da_Flower", false);
|
|
|
+
|
|
|
+ ManaReso.SetText("Da_FlowerLab", Language.GetStr("UI", "Da_HigherScore"));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -606,7 +619,6 @@ public class ManaMiniGame : Regist
|
|
|
public static List<Flower> OpList = new List<Flower>();
|
|
|
public static List<Flower> IdleList = new List<Flower>();
|
|
|
|
|
|
- public static int Flower;
|
|
|
public static int MiniGameIndex;
|
|
|
public static string ScoreLab;
|
|
|
|
|
@@ -809,6 +821,37 @@ public class ManaMiniGame : Regist
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static void InitializeFlower()
|
|
|
+ {
|
|
|
+ float flowerRate = (float)Auxiliary.FmlParse(Award.FlowerFml, "l", ManaCenter.Level.ToString(), "f", ManaGarden.MyFlower.ToString());
|
|
|
+
|
|
|
+ if (Random.Range(0, 1f) <= flowerRate)
|
|
|
+ {
|
|
|
+ if (ManaGarden.MyFlower < ManaGarden.TotalFlower)
|
|
|
+ {
|
|
|
+ foreach (var kv in ManaGarden.FlowerInfoDic)
|
|
|
+ {
|
|
|
+ if (kv.Value.Unlock == false)
|
|
|
+ {
|
|
|
+ Award.FlowerID = kv.Value.ID_;
|
|
|
+
|
|
|
+ Award.FlowerLock = false;
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Award.FlowerLock = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Award.FlowerLock = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static void GameEnd()
|
|
|
{
|
|
@@ -859,48 +902,45 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
ManaCenter.MiniGameAmt++;
|
|
|
|
|
|
+ FlowerLock = false;
|
|
|
+
|
|
|
GameEnd();
|
|
|
}
|
|
|
|
|
|
public static void GameEnter()
|
|
|
{
|
|
|
- float flowerRate = (float)Auxiliary.FmlParse(Award.FlowerFml, "l", ManaCenter.Level.ToString(), "f", ManaGarden.MyFlower.ToString());
|
|
|
+ if (ManaTutorial.TutorialA)
|
|
|
+ {
|
|
|
+ Award.FlowerID = 1;
|
|
|
+ Award.FlowerLock = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (!FlowerLock)
|
|
|
+ {
|
|
|
+ InitializeFlower();
|
|
|
|
|
|
- if (Random.Range(0, 1f) <= flowerRate)
|
|
|
+ FlowerLock = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (Award.FlowerLock)
|
|
|
{
|
|
|
- if (ManaGarden.MyFlower < ManaGarden.TotalFlower)
|
|
|
+ for (int i = 1; i < 10; i++)
|
|
|
{
|
|
|
while (true)
|
|
|
{
|
|
|
FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic.Random();
|
|
|
|
|
|
- if (!flowerInfo.Unlock)
|
|
|
+ if (flowerInfo.Unlock)
|
|
|
{
|
|
|
- Flower = flowerInfo.ID_;
|
|
|
-
|
|
|
- FlowerLock = false;
|
|
|
+ IdleList.Add(ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + i)));
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- FlowerLock = true;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- FlowerLock = true;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- if (FlowerLock)
|
|
|
- {
|
|
|
- for (int i = 1; i < 10; i++)
|
|
|
- {
|
|
|
- IdleList.Add(ManaReso.GetFlower(ManaGarden.FlowerInfoDic[1], ManaReso.Get("SlotMini" + i)));
|
|
|
- }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -908,11 +948,21 @@ public class ManaMiniGame : Regist
|
|
|
|
|
|
int special = idList.Random(true);
|
|
|
|
|
|
- IdleList.Add(ManaReso.GetFlower(ManaGarden.FlowerInfoDic[Flower], ManaReso.Get("SlotMini" + special)));
|
|
|
+ IdleList.Add(ManaReso.GetFlower(ManaGarden.FlowerInfoDic[Award.FlowerID], ManaReso.Get("SlotMini" + special)));
|
|
|
|
|
|
for (int i = 0; i < idList.Count; i++)
|
|
|
{
|
|
|
- IdleList.Add(ManaReso.GetFlower(ManaGarden.FlowerInfoDic[1], ManaReso.Get("SlotMini" + idList[i])));
|
|
|
+ while (true)
|
|
|
+ {
|
|
|
+ FlowerInfo flowerInfo = ManaGarden.FlowerInfoDic.Random();
|
|
|
+
|
|
|
+ if (flowerInfo.Unlock)
|
|
|
+ {
|
|
|
+ IdleList.Add(ManaReso.GetFlower(flowerInfo, ManaReso.Get("SlotMini" + idList[i])));
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -935,6 +985,8 @@ public class ManaMiniGame : Regist
|
|
|
Game = true;
|
|
|
MiniGameIndex++;
|
|
|
|
|
|
+ Score = 0;
|
|
|
+
|
|
|
OpTimer = OpTime;
|
|
|
GoldTimer = Random.Range(3f, 6f);
|
|
|
GameTimer = 0;
|