mirror of
https://github.com/zoriya/Magical-Garden.git
synced 2025-12-06 07:16:15 +00:00
Merge branch 'master' of https://github.com/AnonymusRaccoon/New-Unity-Project
This commit is contained in:
@@ -124,6 +124,8 @@ public class InventoryManager : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
plots[index].startIndex = index;
|
||||
|
||||
CallPowers(index);
|
||||
}
|
||||
|
||||
@@ -338,6 +340,53 @@ public class InventoryManager : MonoBehaviour
|
||||
await Task.Delay(1000);
|
||||
}
|
||||
}
|
||||
else if (plots[i].treePlaced == TreeType.RoundabboutTree)
|
||||
{
|
||||
if(plots[i].startIndex == i)
|
||||
{
|
||||
if (i - 1 >= 0 && i % 5 != 0 && i + 5 <= 24)
|
||||
{
|
||||
TreeType firstType = plots[i - 1].treePlaced;
|
||||
TreeType secondType = plots[i + 4].treePlaced;
|
||||
TreeType thirdType = plots[i + 5].treePlaced;
|
||||
PlaceTree(items[(int)TreeType.RoundabboutTree], i - 1);
|
||||
PlaceTree(items[(int)firstType], i + 4);
|
||||
PlaceTree(items[(int)secondType], i + 5);
|
||||
PlaceTree(items[(int)thirdType], i );
|
||||
}
|
||||
}
|
||||
else if (plots[i].startIndex == i + 1)
|
||||
{
|
||||
TreeType firstType = plots[i + 5].treePlaced;
|
||||
TreeType secondType = plots[i + 6].treePlaced;
|
||||
TreeType thirdType = plots[i + 1].treePlaced;
|
||||
PlaceTree(items[(int)TreeType.RoundabboutTree], i + 5);
|
||||
PlaceTree(items[(int)firstType], i + 6);
|
||||
PlaceTree(items[(int)secondType], i + 1);
|
||||
PlaceTree(items[(int)thirdType], i);
|
||||
}
|
||||
else if (plots[i].startIndex == i + 4)
|
||||
{
|
||||
TreeType firstType = plots[i + 1].treePlaced;
|
||||
TreeType secondType = plots[i - 4].treePlaced;
|
||||
TreeType thirdType = plots[i - 5].treePlaced;
|
||||
PlaceTree(items[(int)TreeType.RoundabboutTree], i + 1);
|
||||
PlaceTree(items[(int)firstType], i - 4);
|
||||
PlaceTree(items[(int)secondType], i - 5);
|
||||
PlaceTree(items[(int)thirdType], i);
|
||||
}
|
||||
else if (plots[i].startIndex == i + 5)
|
||||
{
|
||||
TreeType firstType = plots[i - 5].treePlaced;
|
||||
TreeType secondType = plots[i - 4].treePlaced;
|
||||
TreeType thirdType = plots[i - 1].treePlaced;
|
||||
PlaceTree(items[(int)TreeType.RoundabboutTree], i - 5);
|
||||
PlaceTree(items[(int)firstType], i - 4);
|
||||
PlaceTree(items[(int)secondType], i - 1);
|
||||
PlaceTree(items[(int)thirdType], i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (UserHasWon())
|
||||
|
||||
@@ -4,6 +4,8 @@ public class Plot
|
||||
[EnumFlags]
|
||||
public PlotType type;
|
||||
public TreeType treePlaced;
|
||||
|
||||
public int startIndex;
|
||||
}
|
||||
|
||||
[System.Flags]
|
||||
|
||||
@@ -19,7 +19,7 @@ public enum TreeType
|
||||
{
|
||||
Nothing,
|
||||
AppleTree,
|
||||
Unamed0,
|
||||
RoundabboutTree,
|
||||
TribbleTree,
|
||||
Unamed1,
|
||||
SwapTree,
|
||||
|
||||
Reference in New Issue
Block a user