7368 lines
184 KiB
C#
7368 lines
184 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using I2.Loc;
|
|
using Rewired;
|
|
using Steamworks;
|
|
using UFS2.Gameplay;
|
|
using UFS2.Tokens;
|
|
using UnityEngine;
|
|
using UnityEngine.SceneManagement;
|
|
|
|
public class GameManager : MonoBehaviour
|
|
{
|
|
public enum GameState
|
|
{
|
|
Presentation = 0,
|
|
ProfileChange = 1,
|
|
MainMenu = 2,
|
|
LoadingMap = 3,
|
|
Gameplay = 4,
|
|
FishFight = 5,
|
|
FishCatchPanel = 6
|
|
}
|
|
|
|
public enum ePlatform
|
|
{
|
|
Steam = 0,
|
|
XBox = 1,
|
|
PS4 = 2
|
|
}
|
|
|
|
public enum ControllerType
|
|
{
|
|
KeyboardMouse = 0,
|
|
GamePad = 1
|
|
}
|
|
|
|
public enum SceneLoadedType
|
|
{
|
|
Main = 0,
|
|
FreeFishing = 1,
|
|
Tournament = 2
|
|
}
|
|
|
|
[HideInInspector]
|
|
public enum ItemType
|
|
{
|
|
Rod = 0,
|
|
Reel = 1,
|
|
Line = 2,
|
|
Float = 3,
|
|
Leader = 4,
|
|
Feeder = 5,
|
|
Hook = 6,
|
|
Bait = 7,
|
|
Weight = 8,
|
|
Accesories = 9,
|
|
Groundbaits = 10
|
|
}
|
|
|
|
public enum Skills
|
|
{
|
|
cash_boost_5p = 0,
|
|
dealer_5p = 1,
|
|
merchant_5p = 2,
|
|
scrooge = 3,
|
|
iron_bait = 4,
|
|
merchant_10p = 5,
|
|
cash_boost_10p = 6,
|
|
dealer_10p = 7,
|
|
free_repair = 8,
|
|
rentier = 9,
|
|
attractive_player_5p = 10,
|
|
breeder_5p = 11,
|
|
exp_boost_5p = 12,
|
|
lure_master_5p = 13,
|
|
strongman_5p = 14,
|
|
Eagle_eye = 15,
|
|
eagle_sens = 16,
|
|
attractive_player_10p = 17,
|
|
strongman_10p = 18,
|
|
breeder_10p = 19,
|
|
exp_boost_10p = 20,
|
|
lure_master_10p = 21
|
|
}
|
|
|
|
public enum FishSpecies
|
|
{
|
|
BlackBullhead = 0,
|
|
Perch = 1,
|
|
SalmonSockeye = 2,
|
|
TroutRainbow = 3,
|
|
BassSmallmouth = 4,
|
|
PerchYellow = 5,
|
|
Asp = 6,
|
|
CommonBarbel = 7,
|
|
CommonBream = 8,
|
|
BreamSilver = 9,
|
|
Burbot = 10,
|
|
CarpCommon = 11,
|
|
CarpMirror = 12,
|
|
CarpSezan = 13,
|
|
CarpGrass = 14,
|
|
CarpSilver = 15,
|
|
CarpCrucian = 16,
|
|
CarpPrussian = 17,
|
|
CatfishChannel = 18,
|
|
CatfishFlathead = 19,
|
|
CatfishRedtail = 20,
|
|
CatfishWels = 21,
|
|
Chub = 22,
|
|
EuropeanGrayling = 23,
|
|
Ide = 24,
|
|
PickerelChain = 25,
|
|
PickerelGrass = 26,
|
|
PickerelRedfin = 27,
|
|
PikeAmur = 28,
|
|
PikeNorthern = 29,
|
|
PikeSoutherm = 30,
|
|
PikeMuskellunge = 31,
|
|
Roach = 32,
|
|
Tench = 33,
|
|
Zander = 34,
|
|
BassLargemouth = 35,
|
|
Bluegill = 36,
|
|
Pumpkinseed = 37,
|
|
AtlanticSalmon = 38,
|
|
CommonBleak = 39,
|
|
Huchen = 40,
|
|
BrookTrout = 41,
|
|
BrownTrout = 42,
|
|
EuropeanBass = 43,
|
|
AtlanticCod = 44,
|
|
CrocodileNeedlefish = 45,
|
|
EuropeanEel = 46,
|
|
EuropeanFlounder = 47,
|
|
Garfish = 48,
|
|
EuropeanSeaSturgeon = 49,
|
|
SeaTrout = 50,
|
|
Beluga = 51,
|
|
BaikalBlackGrayling = 52,
|
|
ChumSalmon = 53,
|
|
CohoSalmon = 54,
|
|
PinkSalmon = 55,
|
|
BarracudaGreat = 56,
|
|
BarracudaYellowtail = 57,
|
|
GrouperGiant = 58,
|
|
GrouperMalabar = 59,
|
|
LionfishRed = 60,
|
|
MahiMahi = 61,
|
|
SharkBlacktipReef = 62,
|
|
SharkTiger = 63,
|
|
SnapperGrey = 64,
|
|
TreadfishIndian = 65,
|
|
TrevallyGiant = 66,
|
|
TunaYellowfin = 67,
|
|
ZombieBass = 68,
|
|
BassStriped = 69,
|
|
DrumBlack = 70,
|
|
DrumRed = 71,
|
|
MarlinBlue = 72,
|
|
SharkDusky = 73,
|
|
SharkSandbar = 74,
|
|
SharkSilky = 75,
|
|
SharkSpinner = 76,
|
|
TunaBlackfin = 77,
|
|
TunnyLittle = 78,
|
|
SeabassBlack = 79,
|
|
MulletFlatheadGrey = 80,
|
|
SharkBlacktip = 81,
|
|
CharArctic = 82,
|
|
TroutDollyVarden = 83,
|
|
SalmonChinook = 84,
|
|
TroutCutthroat = 85,
|
|
TroutBull = 86,
|
|
WhitefishAlaska = 87,
|
|
SturgeonWhite = 88,
|
|
SturgeonGreen = 89
|
|
}
|
|
|
|
public class MessageBox
|
|
{
|
|
public enum Status
|
|
{
|
|
Wait = 0,
|
|
Yes = 1,
|
|
No = 2
|
|
}
|
|
|
|
public int indexOfPrefabs;
|
|
|
|
public string message_key = "";
|
|
|
|
private GameObject msg;
|
|
|
|
public Status status;
|
|
|
|
public int indexOfMessageType = -1;
|
|
|
|
public Transform dstParent;
|
|
|
|
public void View()
|
|
{
|
|
msg = UnityEngine.Object.Instantiate(instance.MessageBoxesPrefab[indexOfPrefabs], dstParent);
|
|
msg.GetComponent<MessageBoxScript>().Setup(LanguageManager.Instance.GetText(message_key), indexOfMessageType);
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameRods
|
|
{
|
|
public enum Type
|
|
{
|
|
Universal = 0,
|
|
Float = 1,
|
|
Spinning = 2,
|
|
Casting = 3,
|
|
Catfish = 4,
|
|
UnderIce = 5,
|
|
Feeder = 6
|
|
}
|
|
|
|
public enum Action
|
|
{
|
|
Slow = 0,
|
|
Medium = 1,
|
|
Fast = 2,
|
|
ExtraFast = 3
|
|
}
|
|
|
|
public enum ConstructionType
|
|
{
|
|
Segments = 0,
|
|
Telescopic = 1
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_key = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Rods/";
|
|
|
|
public string model3dViewPath = "Models/Rods/";
|
|
|
|
public string imagePath = "Icons/Rods/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public string length;
|
|
|
|
public string weight;
|
|
|
|
public float strength = 2f;
|
|
|
|
public int maxRange = 15;
|
|
|
|
public Vector2 cw;
|
|
|
|
public Action action;
|
|
|
|
public ConstructionType constructionType;
|
|
|
|
public int numOfSegments = 3;
|
|
|
|
public int Level = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Rods/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameReels
|
|
{
|
|
public enum Type
|
|
{
|
|
Universal = 0,
|
|
Spinning = 1,
|
|
Casting = 2,
|
|
Feeder = 3
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_key = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Reels/";
|
|
|
|
public string model3dViewPath = "Models/Reels/";
|
|
|
|
public string imagePath = "Icons/Reels/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public float strength = 1f;
|
|
|
|
public Vector2 gearRatio;
|
|
|
|
public int size = 2000;
|
|
|
|
public int Level = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Reels/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameLines
|
|
{
|
|
public enum Type
|
|
{
|
|
Mono = 0,
|
|
Braid = 1,
|
|
Fluro = 2
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_key = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Lines/";
|
|
|
|
public string model3dViewPath = "Models/Lines/";
|
|
|
|
public string materialPath = "Materials/Lines/";
|
|
|
|
public string materialSzpulaPath = "Materials/Lines/";
|
|
|
|
public string imagePath = "Icons/Lines/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public int length = 125;
|
|
|
|
public float strength = 1f;
|
|
|
|
public float size = 0.12f;
|
|
|
|
public int Level = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Material GetMaterial()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + materialPath) as Material;
|
|
}
|
|
|
|
public Material GetMaterialSzpula()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + materialSzpulaPath) as Material;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Lines/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameLeaders
|
|
{
|
|
public enum Type
|
|
{
|
|
Mono = 0,
|
|
Wire = 1,
|
|
Steel = 2,
|
|
Titanium = 3
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_EN = "";
|
|
|
|
public string name_language_PL = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Leaders/";
|
|
|
|
public string model3dViewPath = "Models/Leaders/";
|
|
|
|
public string materialPath = "Materials/Leaders/";
|
|
|
|
public string imagePath = "Icons/Leaders/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public float strength = 1f;
|
|
|
|
public float size = 0.12f;
|
|
|
|
public int Level = 1;
|
|
|
|
public int amount = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Material GetMaterial()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + materialPath) as Material;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Leaders/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetName()
|
|
{
|
|
string result = name;
|
|
string currentLanguage = LocalizationManager.CurrentLanguage;
|
|
if (!(currentLanguage == "English"))
|
|
{
|
|
if (currentLanguage == "Polish" && !string.IsNullOrEmpty(name_language_PL))
|
|
{
|
|
result = name_language_PL;
|
|
}
|
|
}
|
|
else if (!string.IsNullOrEmpty(name_language_EN))
|
|
{
|
|
result = name_language_EN;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameBaits
|
|
{
|
|
public enum Type
|
|
{
|
|
Natural = 0,
|
|
Spinning = 1
|
|
}
|
|
|
|
public enum TypeBait
|
|
{
|
|
None = 0,
|
|
Natural = 1,
|
|
Live = 2
|
|
}
|
|
|
|
public enum LureColor
|
|
{
|
|
White = 0,
|
|
Green = 1,
|
|
Red = 2,
|
|
Silver = 3,
|
|
Yellow = 4,
|
|
Opalescence = 5,
|
|
Gold = 6,
|
|
Blue = 7,
|
|
Black = 8,
|
|
Orange = 9,
|
|
Pink = 10,
|
|
Brown = 11,
|
|
Grey = 12
|
|
}
|
|
|
|
public enum TypeLure
|
|
{
|
|
None = 0,
|
|
Spoons = 1,
|
|
Spinners = 2,
|
|
SpinnersBait = 3,
|
|
Softbaits = 4,
|
|
Minnows = 5,
|
|
TopWaters = 6,
|
|
Frogs = 7,
|
|
Crankbaits = 8
|
|
}
|
|
|
|
public enum CategoryLure
|
|
{
|
|
None = 0,
|
|
Minnows = 1,
|
|
TopWaters = 2,
|
|
Crankbaits = 3,
|
|
SoftBaits = 4
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_languageKey = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public Type type;
|
|
|
|
public string modelPath = "Models/Baits/";
|
|
|
|
public string model3dViewPath = "Models/Baits/";
|
|
|
|
public string imagePath = "Icons/Baits/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public FishSpecies[] acceptFish;
|
|
|
|
public Vector2 weightFishAccept = new Vector2(0f, 3f);
|
|
|
|
[Range(0f, 100f)]
|
|
public int efficacyBase = 20;
|
|
|
|
[Range(0f, 100f)]
|
|
public int efficacyMorning;
|
|
|
|
[Range(0f, 100f)]
|
|
public int efficacyNoon;
|
|
|
|
[Range(0f, 100f)]
|
|
public int efficacyEvening;
|
|
|
|
[Range(0f, 100f)]
|
|
public int efficacyNight;
|
|
|
|
public float weight = 10f;
|
|
|
|
public float lenght;
|
|
|
|
public int amount = 1;
|
|
|
|
public TypeBait typeOfBait;
|
|
|
|
public LureColor[] lureColor;
|
|
|
|
public TypeLure typeOfLure;
|
|
|
|
public CategoryLure categoryOfLure;
|
|
|
|
public int Level = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
private Vector2 startedbaitValues;
|
|
|
|
public string GetColorsListString()
|
|
{
|
|
string text = "";
|
|
for (int i = 0; i < lureColor.Length; i++)
|
|
{
|
|
text = text + LanguageManager.Instance.GetText(lureColor[i].ToString().ToUpper()) + " ";
|
|
}
|
|
return text;
|
|
}
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Baits/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetName()
|
|
{
|
|
string text = name;
|
|
if (!string.IsNullOrEmpty(name_languageKey))
|
|
{
|
|
text = LanguageManager.Instance.GetText(name_languageKey);
|
|
}
|
|
return text;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
switch (descType)
|
|
{
|
|
case "SHORT":
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
case "FULL":
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
case "FISHATRACTIVE":
|
|
{
|
|
string text = LanguageManager.Instance.GetText("ATTRACTIVE_FOR") + ": \n";
|
|
for (int i = 0; i < acceptFish.Length; i++)
|
|
{
|
|
text = text + "• " + instance.gameFish[(int)acceptFish[i]].GetFishName() + "\n";
|
|
}
|
|
return text;
|
|
}
|
|
default:
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
public bool CheckIsFishAccept(FishSpecies fishSpecies, float fishWeight = 0f)
|
|
{
|
|
if (instance.gameFish[(int)fishSpecies].type == GameFish.Type.Predator && type == Type.Spinning)
|
|
{
|
|
Vector2 vector = weightFishAccept;
|
|
Debug.Log("Startowa wartosc przynety:" + vector.ToString());
|
|
vector = startedbaitValues;
|
|
Debug.Log("Kolejna wartosc przynety 1:" + vector.ToString());
|
|
Vector2 vector2 = new Vector2(0f, 0f);
|
|
if (startedbaitValues == vector2)
|
|
{
|
|
if (weightFishAccept.x > 0.01f && weightFishAccept.x <= 2.5f)
|
|
{
|
|
weightFishAccept.x = 0.01f;
|
|
}
|
|
else if (weightFishAccept.x > 2.5f && weightFishAccept.x <= 9.2f)
|
|
{
|
|
weightFishAccept.x = 2.5f;
|
|
}
|
|
else if (weightFishAccept.x > 9.2f && weightFishAccept.x <= 20f)
|
|
{
|
|
weightFishAccept.x = 8f;
|
|
}
|
|
else if (weightFishAccept.x > 20f && weightFishAccept.x <= 50f)
|
|
{
|
|
weightFishAccept.x = 14f;
|
|
}
|
|
else if (weightFishAccept.x > 50f && weightFishAccept.x <= 700f)
|
|
{
|
|
weightFishAccept.x = 22f;
|
|
}
|
|
else if (weightFishAccept.x > 700f)
|
|
{
|
|
weightFishAccept.x = 150f;
|
|
}
|
|
if (weightFishAccept.y > 0.1f && weightFishAccept.y <= 3f)
|
|
{
|
|
weightFishAccept.y = 3f;
|
|
}
|
|
else if (weightFishAccept.y > 3f && weightFishAccept.y <= 9f)
|
|
{
|
|
weightFishAccept.y = 12f;
|
|
}
|
|
else if (weightFishAccept.y > 9f && weightFishAccept.y <= 24f)
|
|
{
|
|
weightFishAccept.y = 60f;
|
|
}
|
|
else if (weightFishAccept.y > 24f && weightFishAccept.y <= 50f)
|
|
{
|
|
weightFishAccept.y = 120f;
|
|
}
|
|
else if (weightFishAccept.y > 50f && weightFishAccept.y <= 105f)
|
|
{
|
|
weightFishAccept.y = 350f;
|
|
}
|
|
else if (weightFishAccept.y > 105f && weightFishAccept.y <= 170f)
|
|
{
|
|
weightFishAccept.y = 650f;
|
|
}
|
|
else if (weightFishAccept.y > 170f && weightFishAccept.y <= 500f)
|
|
{
|
|
weightFishAccept.y = 900f;
|
|
}
|
|
else if (weightFishAccept.y > 500f)
|
|
{
|
|
weightFishAccept.y = 1800f;
|
|
}
|
|
startedbaitValues = weightFishAccept;
|
|
vector = startedbaitValues;
|
|
Debug.Log("Kolejna wartosc przynety: 2" + vector.ToString());
|
|
}
|
|
if (fishWeight >= weightFishAccept.x && fishWeight <= weightFishAccept.y)
|
|
{
|
|
vector = weightFishAccept;
|
|
Debug.Log("Fish accept lure: " + vector.ToString() + " weight:" + fishWeight);
|
|
return true;
|
|
}
|
|
}
|
|
else if (instance.gameFish[(int)fishSpecies].type == GameFish.Type.WhiteFish && type == Type.Natural)
|
|
{
|
|
if (acceptFish.Contains(fishSpecies))
|
|
{
|
|
Debug.Log("Fish accept bait weight:" + fishWeight);
|
|
return true;
|
|
}
|
|
}
|
|
else if (instance.gameFish[(int)fishSpecies].type == GameFish.Type.Predator && type == Type.Natural && acceptFish.Contains(fishSpecies))
|
|
{
|
|
Debug.Log("Fish accept bait predator weight:" + fishWeight);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameHooks
|
|
{
|
|
public enum Type
|
|
{
|
|
Aberdeen = 0,
|
|
Bait = 1,
|
|
Circle = 2,
|
|
Treble = 3,
|
|
Octopus = 4,
|
|
Carp = 5,
|
|
LiveBait = 6,
|
|
WideGap = 7
|
|
}
|
|
|
|
public enum Zadzior
|
|
{
|
|
None = 0,
|
|
Barbless = 1
|
|
}
|
|
|
|
public enum Size
|
|
{
|
|
_16 = 0,
|
|
_14 = 1,
|
|
_12 = 2,
|
|
_10 = 3,
|
|
_9 = 4,
|
|
_8 = 5,
|
|
_7 = 6,
|
|
_6 = 7,
|
|
_5 = 8,
|
|
_4 = 9,
|
|
_3 = 10,
|
|
_2 = 11,
|
|
_1 = 12,
|
|
_1x0 = 13,
|
|
_2x0 = 14,
|
|
_3x0 = 15,
|
|
_4x0 = 16,
|
|
_5x0 = 17,
|
|
_6x0 = 18,
|
|
_7x0 = 19,
|
|
_8x0 = 20,
|
|
_9x0 = 21,
|
|
_10x0 = 22,
|
|
_11x0 = 23,
|
|
_12x0 = 24,
|
|
_13x0 = 25,
|
|
_14x0 = 26
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_EN = "";
|
|
|
|
public string name_language_PL = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Hooks/";
|
|
|
|
public string model3dViewPath = "Models/Hooks/";
|
|
|
|
public string imagePath = "Icons/Hooks/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public string color = "Nickel";
|
|
|
|
public Type type;
|
|
|
|
public Zadzior zadzior;
|
|
|
|
public Size size;
|
|
|
|
public int amount = 1;
|
|
|
|
public int Level = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public string GetSizetext()
|
|
{
|
|
return size.ToString().Replace("_", "#").Replace("x", "/");
|
|
}
|
|
|
|
public Vector2 GetFishAcceptWeightBySize()
|
|
{
|
|
Vector2 result = Vector2.zero;
|
|
switch (size)
|
|
{
|
|
case Size._16:
|
|
result = new Vector2(0f, 3.5f);
|
|
break;
|
|
case Size._14:
|
|
result = new Vector2(0.4f, 5.3f);
|
|
break;
|
|
case Size._12:
|
|
result = new Vector2(0.5f, 7.4f);
|
|
break;
|
|
case Size._10:
|
|
result = new Vector2(0.7f, 10.3f);
|
|
break;
|
|
case Size._9:
|
|
result = new Vector2(1f, 14.4f);
|
|
break;
|
|
case Size._8:
|
|
result = new Vector2(1.4f, 20.2f);
|
|
break;
|
|
case Size._7:
|
|
result = new Vector2(1.6f, 26.2f);
|
|
break;
|
|
case Size._6:
|
|
result = new Vector2(1.8f, 31.5f);
|
|
break;
|
|
case Size._5:
|
|
result = new Vector2(2.2f, 34.6f);
|
|
break;
|
|
case Size._4:
|
|
result = new Vector2(2.4f, 45f);
|
|
break;
|
|
case Size._3:
|
|
result = new Vector2(3.1f, 58.5f);
|
|
break;
|
|
case Size._2:
|
|
result = new Vector2(4.1f, 81.9f);
|
|
break;
|
|
case Size._1:
|
|
result = new Vector2(5.7f, 114.6f);
|
|
break;
|
|
case Size._1x0:
|
|
result = new Vector2(9.2f, 160.5f);
|
|
break;
|
|
case Size._2x0:
|
|
result = new Vector2(12.8f, 216.7f);
|
|
break;
|
|
case Size._3x0:
|
|
result = new Vector2(17.3f, 292.5f);
|
|
break;
|
|
case Size._4x0:
|
|
result = new Vector2(23.4f, 394.9f);
|
|
break;
|
|
case Size._5x0:
|
|
result = new Vector2(31.6f, 533.1f);
|
|
break;
|
|
case Size._6x0:
|
|
result = new Vector2(42.6f, 693f);
|
|
break;
|
|
case Size._7x0:
|
|
result = new Vector2(55.4f, 935f);
|
|
break;
|
|
case Size._8x0:
|
|
result = new Vector2(74.8f, 1122f);
|
|
break;
|
|
case Size._9x0:
|
|
result = new Vector2(89f, 1342f);
|
|
break;
|
|
case Size._10x0:
|
|
result = new Vector2(107f, 1616f);
|
|
break;
|
|
case Size._11x0:
|
|
result = new Vector2(129f, 1940f);
|
|
break;
|
|
case Size._12x0:
|
|
result = new Vector2(155f, 2328f);
|
|
break;
|
|
case Size._13x0:
|
|
result = new Vector2(186f, 2793f);
|
|
break;
|
|
case Size._14x0:
|
|
result = new Vector2(223f, 3352f);
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Hooks/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal + (float)PriceNormal * ((float)size * 0.1f) - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetName()
|
|
{
|
|
string result = name;
|
|
string currentLanguage = LocalizationManager.CurrentLanguage;
|
|
if (!(currentLanguage == "English"))
|
|
{
|
|
if (currentLanguage == "Polish" && !string.IsNullOrEmpty(name_language_PL))
|
|
{
|
|
result = name_language_PL;
|
|
}
|
|
}
|
|
else if (!string.IsNullOrEmpty(name_language_EN))
|
|
{
|
|
result = name_language_EN;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
|
|
public bool CheckIsFishAccept(float fishWeight)
|
|
{
|
|
if (fishWeight >= GetFishAcceptWeightBySize().x && fishWeight <= GetFishAcceptWeightBySize().y)
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameFloats
|
|
{
|
|
public enum Type
|
|
{
|
|
Slider = 0,
|
|
Waggler = 1,
|
|
PoleFloats = 2,
|
|
Sport = 3,
|
|
Ball = 4,
|
|
Sinker = 5
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_key = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Floats/";
|
|
|
|
public string model3dViewPath = "Models/Floats/";
|
|
|
|
public string imagePath = "Icons/Floats/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public float weight = 10f;
|
|
|
|
public float displacement = 10f;
|
|
|
|
public bool isNightLight;
|
|
|
|
public int Level = 1;
|
|
|
|
public int amount = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Floats/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameFeeders
|
|
{
|
|
public enum Type
|
|
{
|
|
Feeder = 0,
|
|
Sinker = 1
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_key = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Feeders/";
|
|
|
|
public string model3dViewPath = "Models/Feeders/";
|
|
|
|
public string imagePath = "Icons/Feeders/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public float weight = 10f;
|
|
|
|
public float capacity = 10f;
|
|
|
|
public int Level = 1;
|
|
|
|
public int amount = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Feeders/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameWeights
|
|
{
|
|
public enum Type
|
|
{
|
|
Ball = 0,
|
|
Teardrop = 1,
|
|
Olive = 2
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_EN = "";
|
|
|
|
public string name_language_PL = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Weights/";
|
|
|
|
public string model3dViewPath = "Models/Weights/";
|
|
|
|
public string imagePath = "Icons/Weights/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public float weight = 0.1f;
|
|
|
|
public int Level = 1;
|
|
|
|
public int amount = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public string GetName()
|
|
{
|
|
string result = name;
|
|
string currentLanguage = LocalizationManager.CurrentLanguage;
|
|
if (!(currentLanguage == "English"))
|
|
{
|
|
if (currentLanguage == "Polish" && !string.IsNullOrEmpty(name_language_PL))
|
|
{
|
|
result = name_language_PL;
|
|
}
|
|
}
|
|
else if (!string.IsNullOrEmpty(name_language_EN))
|
|
{
|
|
result = name_language_EN;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameAccesories
|
|
{
|
|
public enum Type
|
|
{
|
|
RodSupport = 0,
|
|
Signalizers = 1,
|
|
Slingshots = 2
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_EN = "";
|
|
|
|
public string name_language_PL = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Accessories/";
|
|
|
|
public string model3dViewPath = "Models/Accessories/";
|
|
|
|
public string imagePath = "Icons/Accessories/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public Type type;
|
|
|
|
public int Level = 1;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
Debug.Log(modelPath);
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath.Length == 0)
|
|
{
|
|
return null;
|
|
}
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public string GetName()
|
|
{
|
|
string result = name;
|
|
string currentLanguage = LocalizationManager.CurrentLanguage;
|
|
if (!(currentLanguage == "English"))
|
|
{
|
|
if (currentLanguage == "Polish" && !string.IsNullOrEmpty(name_language_PL))
|
|
{
|
|
result = name_language_PL;
|
|
}
|
|
}
|
|
else if (!string.IsNullOrEmpty(name_language_EN))
|
|
{
|
|
result = name_language_EN;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameGroundbait
|
|
{
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string name_language_EN = "";
|
|
|
|
public string name_language_PL = "";
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string modelPath = "Models/Groundbait/";
|
|
|
|
public string model3dViewPath = "Models/Groundbait/";
|
|
|
|
public string imagePath = "Icons/Groundbait/";
|
|
|
|
public string logoBrandImagePath = "";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public string materialCoverPath = "Groundbaits/";
|
|
|
|
public string materialParticlePath = "Groundbaits/";
|
|
|
|
public int Level = 1;
|
|
|
|
public float capacity = 1000f;
|
|
|
|
public FishSpecies fishSpecies;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public GameObject GetModelPrefab()
|
|
{
|
|
Debug.Log(modelPath);
|
|
return Resources.Load("GameItemsPrefabs/" + modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject Get3DModelViewPrefab()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + model3dViewPath) as GameObject;
|
|
}
|
|
|
|
public Sprite GetIconImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/" + imagePath);
|
|
}
|
|
|
|
public Sprite GetLogoBrandImage()
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Brand Loga/" + logoBrandImagePath);
|
|
}
|
|
|
|
public Material GetCoverMaterial()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + materialCoverPath) as Material;
|
|
}
|
|
|
|
public Material GetParticleMaterial()
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/" + materialParticlePath) as Material;
|
|
}
|
|
|
|
public Sprite GetRenderImage(int index)
|
|
{
|
|
if (imageRendersPath.Length == 0)
|
|
{
|
|
return null;
|
|
}
|
|
if (imageRendersPath[index] == null)
|
|
{
|
|
return null;
|
|
}
|
|
return Resources.Load<Sprite>("Renders/Groundbait/" + imageRendersPath[index]);
|
|
}
|
|
|
|
public string GetName()
|
|
{
|
|
string result = name;
|
|
string currentLanguage = LocalizationManager.CurrentLanguage;
|
|
if (!(currentLanguage == "English"))
|
|
{
|
|
if (currentLanguage == "Polish" && !string.IsNullOrEmpty(name_language_PL))
|
|
{
|
|
result = name_language_PL;
|
|
}
|
|
}
|
|
else if (!string.IsNullOrEmpty(name_language_EN))
|
|
{
|
|
result = name_language_EN;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameDLC
|
|
{
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string name_language_key;
|
|
|
|
public string imagePath = "DLC/";
|
|
|
|
public string[] imageRendersPath;
|
|
|
|
public float GetPrice()
|
|
{
|
|
return 10f;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GamePackages
|
|
{
|
|
[Serializable]
|
|
public class ItemsPackage
|
|
{
|
|
public ItemType itemType;
|
|
|
|
public int itemId;
|
|
|
|
public int itemAmount = 1;
|
|
}
|
|
|
|
public string name;
|
|
|
|
public int id;
|
|
|
|
public string descriptionLangKeyShort = "";
|
|
|
|
public string descriptionLangKeyFull = "";
|
|
|
|
public string name_language_key;
|
|
|
|
public string imagePath = "Packages/";
|
|
|
|
public int Level = 1;
|
|
|
|
public bool isComimngSooon = true;
|
|
|
|
public bool isInShop = true;
|
|
|
|
public bool isNew;
|
|
|
|
public int PriceNormal;
|
|
|
|
public int SaleOff;
|
|
|
|
public ItemsPackage[] itemsPackage;
|
|
|
|
public Sprite GetImage()
|
|
{
|
|
return Resources.Load<Sprite>("Packages/" + imagePath);
|
|
}
|
|
|
|
public float GetPrice()
|
|
{
|
|
float num = (float)PriceNormal - (float)PriceNormal * ((float)SaleOff * 0.01f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_10p))
|
|
{
|
|
num -= num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.merchant_5p))
|
|
{
|
|
num -= num * 0.05f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public string GetDescription(string descType = "SHORT")
|
|
{
|
|
if (descType == "SHORT")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyShort))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyShort);
|
|
}
|
|
if (descType == "FULL")
|
|
{
|
|
if (string.IsNullOrEmpty(descriptionLangKeyFull))
|
|
{
|
|
return "";
|
|
}
|
|
return LanguageManager.Instance.GetText(descriptionLangKeyFull);
|
|
}
|
|
return "desription incorect type";
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class AcceptFishBait
|
|
{
|
|
public string baitName;
|
|
|
|
public int baitId;
|
|
|
|
public float min;
|
|
|
|
public float max;
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameFish
|
|
{
|
|
public enum Type
|
|
{
|
|
WhiteFish = 0,
|
|
Predator = 1
|
|
}
|
|
|
|
public string Name;
|
|
|
|
public FishSpecies speciesName;
|
|
|
|
public bool isEnabled = true;
|
|
|
|
public Type type = Type.Predator;
|
|
|
|
public float maxWeight = 10f;
|
|
|
|
public float speciesCoins = 4f;
|
|
|
|
public int rankingPoint = 1;
|
|
|
|
public string[] modelPath;
|
|
|
|
public string[] imagePath;
|
|
|
|
public string[] modelTrophyPath;
|
|
|
|
public Vector2[] weightLenghtValues;
|
|
|
|
public AnimationCurve weightLengthCurve;
|
|
|
|
public List<AcceptFishBait> acceptFishBaits;
|
|
|
|
public List<AcceptFishBait> acceptFishLures;
|
|
|
|
public Sprite GetIconImage(int index)
|
|
{
|
|
return Resources.Load<Sprite>("Icons/Fish/" + imagePath[index]);
|
|
}
|
|
|
|
public float ConvertWeightFishToLength(float weight)
|
|
{
|
|
return FishWeightToLength.Instance.ConvertWeightFishToLength(speciesName, weight);
|
|
}
|
|
|
|
public void SetupCurvesWeight()
|
|
{
|
|
weightLengthCurve.keys = null;
|
|
for (int i = 0; i < weightLenghtValues.Length; i++)
|
|
{
|
|
weightLengthCurve.AddKey(weightLenghtValues[i].x, weightLenghtValues[i].y);
|
|
}
|
|
}
|
|
|
|
public Vector3 GetFishScale(float weight)
|
|
{
|
|
if (!FishWeightToLength.Instance)
|
|
{
|
|
return Vector3.one;
|
|
}
|
|
float num = FishWeightToLength.Instance.ConvertWeightFishToLength(speciesName, weight) * 0.0185f;
|
|
return Vector3.one * num;
|
|
}
|
|
|
|
public GameObject GetModelPrefab(string _modelPath)
|
|
{
|
|
return Resources.Load("GameItemsPrefabs/Fish/" + _modelPath) as GameObject;
|
|
}
|
|
|
|
public GameObject GetTrophyModelPrefab(float weight)
|
|
{
|
|
if (weight > maxWeight)
|
|
{
|
|
weight = maxWeight;
|
|
}
|
|
float num = maxWeight / (float)modelTrophyPath.Length;
|
|
int num2 = (int)(weight / num);
|
|
if (num2 >= modelTrophyPath.Length)
|
|
{
|
|
num2 = modelTrophyPath.Length - 1;
|
|
}
|
|
return Resources.Load("GameItemsPrefabs/Fish Trophies/" + modelTrophyPath[num2]) as GameObject;
|
|
}
|
|
|
|
public GameObject GetFishModel(float weight)
|
|
{
|
|
if (weight > maxWeight)
|
|
{
|
|
weight = maxWeight;
|
|
}
|
|
float num = maxWeight / (float)modelPath.Length;
|
|
int num2 = (int)(weight / num);
|
|
if (num2 >= modelPath.Length)
|
|
{
|
|
num2 = modelPath.Length - 1;
|
|
}
|
|
return GetModelPrefab(modelPath[num2]);
|
|
}
|
|
|
|
public Sprite GetFishIcon(float weight)
|
|
{
|
|
if (weight > maxWeight)
|
|
{
|
|
weight = maxWeight;
|
|
}
|
|
float num = maxWeight / (float)modelPath.Length;
|
|
int num2 = (int)(weight / num);
|
|
if (num2 >= modelPath.Length)
|
|
{
|
|
num2 = modelPath.Length - 1;
|
|
}
|
|
return GetIconImage(num2);
|
|
}
|
|
|
|
public string GetFishName()
|
|
{
|
|
return GetFishNameFromSpecies(speciesName);
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameLocations
|
|
{
|
|
public string name;
|
|
|
|
public string sceneName;
|
|
|
|
public int sceneID;
|
|
|
|
public string descriptionLangKey = "_MAP_DESCRIPTION";
|
|
|
|
public string[] screensMapPath;
|
|
|
|
public bool isEnabled;
|
|
|
|
public bool isNew;
|
|
|
|
public bool isCommingSoon;
|
|
|
|
public int levelrequired = 1;
|
|
|
|
public int licensePrize = 50;
|
|
|
|
public Sprite mapLogo;
|
|
|
|
public Sprite[] mapScreens;
|
|
|
|
[HideInInspector]
|
|
public int startWeatherIndex;
|
|
|
|
[HideInInspector]
|
|
public int startDayTimeIndex = 1;
|
|
|
|
public FishSpecies[] fishSpecies;
|
|
|
|
public Sprite GetScreenMapImage(int screenIndex)
|
|
{
|
|
return Resources.Load<Sprite>("Maps/Screens/" + screensMapPath[screenIndex]);
|
|
}
|
|
|
|
public string GetDescriptionLocationWithFish()
|
|
{
|
|
string text = LanguageManager.Instance.GetText(descriptionLangKey);
|
|
if (fishSpecies.Length != 0)
|
|
{
|
|
text = text + "\n\n<color=#03A0F2><b>" + LanguageManager.Instance.GetText("FISH_ON_THE_MAP") + "</b></color>\n\n";
|
|
for (int i = 0; i < fishSpecies.Length; i++)
|
|
{
|
|
text = ((i != fishSpecies.Length - 1) ? (text + GetFishNameFromSpecies(fishSpecies[i]) + ", ") : (text + GetFishNameFromSpecies(fishSpecies[i])));
|
|
}
|
|
}
|
|
return text;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameQuest
|
|
{
|
|
public enum Type
|
|
{
|
|
Common = 0,
|
|
Epic = 1,
|
|
Legendary = 2,
|
|
Weekly = 3,
|
|
Monthly = 4
|
|
}
|
|
|
|
public enum QuestObjectiveType
|
|
{
|
|
Catch_fish = 0,
|
|
Spend_time = 1,
|
|
Catch_fish_by_weight = 2,
|
|
Catch_fish_total_weight = 3,
|
|
Catch_fish_by_species = 4
|
|
}
|
|
|
|
public int index;
|
|
|
|
public bool isEnabled = true;
|
|
|
|
public Type type;
|
|
|
|
public QuestObjectiveType questObjectiveType;
|
|
|
|
public float objectiveValue;
|
|
|
|
public FishSpecies objectivefishSpecies = FishSpecies.BassSmallmouth;
|
|
|
|
public int reward;
|
|
|
|
public int points;
|
|
|
|
public string titleLangKey = "";
|
|
|
|
public int levelAvailable = 1;
|
|
}
|
|
|
|
[Serializable]
|
|
public class GameSkills
|
|
{
|
|
[Serializable]
|
|
public class Skill
|
|
{
|
|
public Skills skillenum;
|
|
|
|
public Sprite icon;
|
|
|
|
public int[] requireSkillsId;
|
|
|
|
public int costSkillPoints = 1;
|
|
|
|
public string titleSkillLangKey;
|
|
|
|
public string descSkillLangKey;
|
|
}
|
|
|
|
public Skill[] skill;
|
|
}
|
|
|
|
[Serializable]
|
|
public class RankingRewards
|
|
{
|
|
public float cash;
|
|
|
|
public float exp;
|
|
|
|
public int questPoints;
|
|
}
|
|
|
|
[Serializable]
|
|
public class RentierRewards
|
|
{
|
|
public float cash;
|
|
|
|
public float exp;
|
|
|
|
public int questPoint;
|
|
}
|
|
|
|
[Serializable]
|
|
public class PlayerData
|
|
{
|
|
[Serializable]
|
|
public class CPlayer
|
|
{
|
|
public enum GameMode
|
|
{
|
|
None = 0,
|
|
Demo = 1,
|
|
Normal = 2,
|
|
Realistic = 3,
|
|
Sandbox = 4
|
|
}
|
|
|
|
private const int PLAYER_CASH = 200;
|
|
|
|
public bool tutPopHide;
|
|
|
|
public bool isEnabled;
|
|
|
|
public GameMode gameMode;
|
|
|
|
public string playerName = "";
|
|
|
|
public int playerLevel = 1;
|
|
|
|
public float playerExp;
|
|
|
|
public float playerMaxExp = 100f;
|
|
|
|
public int playerSkillsPoint;
|
|
|
|
public int playerSelectedTree = -1;
|
|
|
|
public float playerCash = 200f;
|
|
|
|
public int playerRewards;
|
|
|
|
public int playerFishNetLevel = 1;
|
|
|
|
public int playerFishNetExp;
|
|
|
|
public int playerRankingPoints;
|
|
|
|
public int playerTournamentsWon;
|
|
|
|
public float timeBoostExp;
|
|
|
|
public float timeBoostCash;
|
|
|
|
public int totalFish;
|
|
|
|
public int playerSexIndex;
|
|
|
|
public bool blurSetting;
|
|
|
|
public bool bloomSetting;
|
|
|
|
public bool chromaticAbberation;
|
|
|
|
public int antiAliasing = 3;
|
|
|
|
public bool ambientOccultion = true;
|
|
|
|
public float mouseSensitivity = 2f;
|
|
|
|
public float cursorSensitivity = 2f;
|
|
|
|
public bool invertMouse;
|
|
|
|
public bool invertMouseX;
|
|
|
|
public float fov = 50f;
|
|
|
|
public ControllerType currentController = ControllerType.GamePad;
|
|
|
|
public bool fishCursor = true;
|
|
|
|
public int lastPlayLocationIndex;
|
|
|
|
public float gameTime;
|
|
|
|
public int vSync = 1;
|
|
|
|
public int textureQualityMode;
|
|
|
|
public int controllerSetup = 1;
|
|
|
|
public bool controllerVibration = true;
|
|
|
|
public int LastChoosenRefreshRate;
|
|
|
|
public int MaxFpsIndex;
|
|
|
|
public int[] MaxFps = new int[9] { 0, 30, 60, 75, 100, 120, 144, 240, 360 };
|
|
|
|
public int waterMeshDetail;
|
|
|
|
public int waterWavesDetail;
|
|
|
|
public int waterReflectionsDetail;
|
|
|
|
public int waterDynamicWavesDetail;
|
|
|
|
public int waterVolumetric;
|
|
|
|
public int waterCaustic = 2;
|
|
|
|
public long timerQuest;
|
|
|
|
public long weeklytimerQuest;
|
|
|
|
public long monthlytimerQuest;
|
|
|
|
public int questPoints;
|
|
|
|
public int changeQuestCount = 1;
|
|
|
|
public float fisheryTime;
|
|
|
|
public int pointsCap = 200;
|
|
|
|
public float totalFishWeight;
|
|
|
|
public int totalZombiesFish;
|
|
|
|
public long lastAquariumUpdateTime;
|
|
|
|
public long lastRentierReward;
|
|
|
|
public bool toggleFirstStartHelpPanel;
|
|
|
|
public float mainSoundVolume = 1f;
|
|
|
|
public bool smoothCamera;
|
|
|
|
public float ambienVolume = 0.5f;
|
|
|
|
public float fxVolume = 0.2f;
|
|
|
|
public bool lightshaft = true;
|
|
|
|
public float fogIntesity = 1f;
|
|
|
|
public int unitWeight;
|
|
|
|
public int unitLenght;
|
|
|
|
public int timeZone;
|
|
|
|
public int temperature;
|
|
|
|
public float shadowDistance = 500f;
|
|
|
|
public float floatSize = 1f;
|
|
|
|
public bool depthOfField = true;
|
|
|
|
public bool shadowOnWater;
|
|
|
|
public bool waterReflection = true;
|
|
|
|
public bool SkillPointAnim = true;
|
|
|
|
public bool realisticLineIndicator;
|
|
|
|
public bool showChat = true;
|
|
|
|
public string Set1Name = "Custom 1";
|
|
|
|
public string Set2Name = "Custom 2";
|
|
|
|
public string Set3Name = "Custom 3";
|
|
|
|
public string Set4Name = "Custom 4";
|
|
|
|
public string Set5Name = "Custom 5";
|
|
|
|
public int completedDailyQuests;
|
|
|
|
public int completedWeeklyQuests;
|
|
|
|
public int completedMonthlyQuests;
|
|
|
|
public bool backgroundMusic = true;
|
|
|
|
public void ResetProfile(int clickedProfileIndex)
|
|
{
|
|
tutPopHide = false;
|
|
isEnabled = false;
|
|
gameMode = GameMode.None;
|
|
playerName = "";
|
|
playerLevel = 1;
|
|
playerExp = 0f;
|
|
playerMaxExp = 100f;
|
|
playerSkillsPoint = 0;
|
|
playerSelectedTree = -1;
|
|
playerCash = 200f;
|
|
playerRewards = 0;
|
|
playerFishNetLevel = 1;
|
|
playerFishNetExp = 0;
|
|
playerRankingPoints = 0;
|
|
playerTournamentsWon = 0;
|
|
lastAquariumUpdateTime = 0L;
|
|
timeBoostExp = 0f;
|
|
timeBoostCash = 0f;
|
|
totalFish = 0;
|
|
totalZombiesFish = 0;
|
|
playerSexIndex = 0;
|
|
toggleFirstStartHelpPanel = false;
|
|
mainSoundVolume = 1f;
|
|
ambienVolume = 0.5f;
|
|
fxVolume = 0.2f;
|
|
blurSetting = false;
|
|
bloomSetting = false;
|
|
chromaticAbberation = false;
|
|
antiAliasing = 3;
|
|
ambientOccultion = true;
|
|
mouseSensitivity = 2f;
|
|
invertMouse = false;
|
|
invertMouseX = false;
|
|
fov = 50f;
|
|
currentController = ControllerType.KeyboardMouse;
|
|
fishCursor = true;
|
|
lastPlayLocationIndex = 0;
|
|
gameTime = 0f;
|
|
smoothCamera = false;
|
|
lightshaft = true;
|
|
controllerSetup = 1;
|
|
controllerVibration = true;
|
|
fogIntesity = 1f;
|
|
unitWeight = 0;
|
|
unitLenght = 0;
|
|
timeZone = 0;
|
|
temperature = 0;
|
|
shadowDistance = 500f;
|
|
depthOfField = true;
|
|
shadowOnWater = false;
|
|
waterReflection = true;
|
|
vSync = 1;
|
|
textureQualityMode = 0;
|
|
LastChoosenRefreshRate = 0;
|
|
MaxFpsIndex = 0;
|
|
Application.targetFrameRate = -1;
|
|
floatSize = 1f;
|
|
Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerFishNet?.Clear();
|
|
Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerTrophy?.Clear();
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerAquarium?.Count; i++)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerAquarium[i]?.fish.Clear();
|
|
}
|
|
timerQuest = 0L;
|
|
weeklytimerQuest = 0L;
|
|
monthlytimerQuest = 0L;
|
|
Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerSkills?.Clear();
|
|
Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerPersonalRecords?.Clear();
|
|
Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerLicenses?.Clear();
|
|
for (int j = 0; j < Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerBoostTokens?.Count; j++)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetSpecifiedPlayerData(clickedProfileIndex).PlayerBoostTokens[j]?.ResetAmount();
|
|
}
|
|
changeQuestCount = 1;
|
|
pointsCap = 200;
|
|
questPoints = 0;
|
|
totalFishWeight = 0f;
|
|
SkillPointAnim = true;
|
|
realisticLineIndicator = false;
|
|
showChat = true;
|
|
Set1Name = "Custom 1";
|
|
Set2Name = "Custom 2";
|
|
Set3Name = "Custom 3";
|
|
Set4Name = "Custom 4";
|
|
Set5Name = "Custom 5";
|
|
completedDailyQuests = 0;
|
|
completedWeeklyQuests = 0;
|
|
completedMonthlyQuests = 0;
|
|
backgroundMusic = true;
|
|
}
|
|
|
|
public void ResetToDefault()
|
|
{
|
|
mainSoundVolume = 1f;
|
|
ambienVolume = 0.5f;
|
|
fxVolume = 0.2f;
|
|
blurSetting = false;
|
|
bloomSetting = false;
|
|
chromaticAbberation = false;
|
|
antiAliasing = 3;
|
|
ambientOccultion = true;
|
|
mouseSensitivity = 2f;
|
|
invertMouse = false;
|
|
invertMouseX = false;
|
|
fov = 50f;
|
|
smoothCamera = false;
|
|
lightshaft = true;
|
|
controllerSetup = 1;
|
|
controllerVibration = true;
|
|
fogIntesity = 1f;
|
|
unitWeight = 0;
|
|
unitLenght = 0;
|
|
timeZone = 0;
|
|
temperature = 0;
|
|
shadowDistance = 500f;
|
|
depthOfField = true;
|
|
shadowOnWater = false;
|
|
waterReflection = true;
|
|
waterMeshDetail = (waterWavesDetail = (waterReflectionsDetail = (waterDynamicWavesDetail = (waterVolumetric = (waterCaustic = 2)))));
|
|
showChat = true;
|
|
vSync = 1;
|
|
textureQualityMode = 0;
|
|
LastChoosenRefreshRate = 0;
|
|
MaxFpsIndex = 0;
|
|
Application.targetFrameRate = -1;
|
|
floatSize = 1f;
|
|
QualitySettings.SetQualityLevel(3);
|
|
Singleton<SaveDataManager>.Instance.LoadSettingsDataFromGameManager();
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CLicences
|
|
{
|
|
public int mapId;
|
|
}
|
|
|
|
[Serializable]
|
|
public class CBasket
|
|
{
|
|
[Serializable]
|
|
public class CBasketItem
|
|
{
|
|
public int id;
|
|
|
|
public int itemID = -1;
|
|
|
|
public ShopManager.Categories category;
|
|
|
|
public string sortname = "All";
|
|
|
|
public int amount = 1;
|
|
|
|
public float priceItem;
|
|
|
|
public float GetPrize()
|
|
{
|
|
return priceItem * (float)amount;
|
|
}
|
|
}
|
|
|
|
public List<CBasketItem> basketItems;
|
|
|
|
public CBasket(CBasket otherBasket)
|
|
{
|
|
basketItems = new List<CBasketItem>();
|
|
for (int i = 0; i < otherBasket.basketItems.Count; i++)
|
|
{
|
|
CBasketItem cBasketItem = otherBasket.basketItems[i];
|
|
CBasketItem item = new CBasketItem
|
|
{
|
|
id = cBasketItem.id,
|
|
itemID = cBasketItem.itemID,
|
|
category = cBasketItem.category,
|
|
sortname = cBasketItem.sortname,
|
|
amount = cBasketItem.amount,
|
|
priceItem = cBasketItem.priceItem
|
|
};
|
|
basketItems.Add(item);
|
|
}
|
|
}
|
|
|
|
public CBasket()
|
|
{
|
|
basketItems = new List<CBasketItem>();
|
|
}
|
|
|
|
public float GetTotalPrice()
|
|
{
|
|
float num = 0f;
|
|
for (int i = 0; i < basketItems.Count; i++)
|
|
{
|
|
num += basketItems[i].priceItem * (float)basketItems[i].amount;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
public void AddToBasket(ShopManager.Categories itemCategory, int itemID, float itemPrice, string sortname = "ALL")
|
|
{
|
|
int num = CheckIsInBasket(itemCategory, itemID);
|
|
if (num > -1)
|
|
{
|
|
basketItems[num].amount++;
|
|
return;
|
|
}
|
|
CBasketItem cBasketItem = new CBasketItem();
|
|
cBasketItem.id = GetUniqueNumber();
|
|
cBasketItem.amount = 1;
|
|
cBasketItem.category = itemCategory;
|
|
cBasketItem.itemID = itemID;
|
|
cBasketItem.priceItem = itemPrice;
|
|
cBasketItem.sortname = sortname;
|
|
basketItems.Add(cBasketItem);
|
|
}
|
|
|
|
private int CheckIsInBasket(ShopManager.Categories itemCategory, int itemID)
|
|
{
|
|
for (int i = 0; i < basketItems.Count; i++)
|
|
{
|
|
if (basketItems[i].category == itemCategory && basketItems[i].itemID == itemID)
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CRods
|
|
{
|
|
public enum Status
|
|
{
|
|
InEquip = 0,
|
|
InHand = 1,
|
|
InUse = 2,
|
|
InOut = 3
|
|
}
|
|
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public Status status;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CRods newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CReels
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float currentSpeed = 0.5f;
|
|
|
|
public float currentDrag = 0.7f;
|
|
|
|
public float buyPrice;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
currentSpeed = -1f;
|
|
currentDrag = -1f;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CReels newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
currentSpeed = newValue.currentSpeed;
|
|
currentDrag = newValue.currentDrag;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CLines
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public float lenght;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
lenght = -1f;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CLines newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
lenght = newValue.lenght;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CLeaders
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CLeaders newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CBaits
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CBaits newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CHooks
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CHooks newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CFloats
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public float lastSetGroundValue;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
lastSetGroundValue = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CFloats newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
lastSetGroundValue = newValue.lastSetGroundValue;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CFeeders
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CFeeders newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CWeights
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public float buyPrice;
|
|
|
|
public bool isNull;
|
|
|
|
public void SetToNull()
|
|
{
|
|
ID = -1;
|
|
amount = -1;
|
|
uniqueId = -1;
|
|
wear = -1;
|
|
buyPrice = -1f;
|
|
isNull = true;
|
|
}
|
|
|
|
public void CopyValues(CWeights newValue)
|
|
{
|
|
ID = newValue.ID;
|
|
amount = newValue.amount;
|
|
uniqueId = newValue.uniqueId;
|
|
wear = newValue.wear;
|
|
buyPrice = newValue.buyPrice;
|
|
isNull = newValue.isNull;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CAccesories
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public bool isUse;
|
|
|
|
public float buyPrice;
|
|
|
|
public int signalizerSlotUniqid_1 = -1;
|
|
|
|
public int signalizerSlotUniqid_2 = -1;
|
|
|
|
public int signalizerSlotUniqid_3 = -1;
|
|
}
|
|
|
|
[Serializable]
|
|
public class CGroundbaits
|
|
{
|
|
public int ID;
|
|
|
|
public int amount;
|
|
|
|
public int uniqueId;
|
|
|
|
public int wear;
|
|
|
|
public bool isUse;
|
|
|
|
public float buyPrice;
|
|
|
|
public float capacity;
|
|
|
|
public float currentCapacity;
|
|
}
|
|
|
|
[Serializable]
|
|
public class CFishNet
|
|
{
|
|
public int uid;
|
|
|
|
public FishSpecies species;
|
|
|
|
public float weight;
|
|
|
|
public float price;
|
|
}
|
|
|
|
[Serializable]
|
|
public class CAquarium
|
|
{
|
|
public int id;
|
|
|
|
public bool isAvailable = true;
|
|
|
|
public int maxCapacity = 10;
|
|
|
|
public float maxFishWeight = 1.5f;
|
|
|
|
public float maxFishGrowthWeight = 1.5f;
|
|
|
|
public List<CFishAquarium> fish = new List<CFishAquarium>();
|
|
}
|
|
|
|
[Serializable]
|
|
public class CFishAquarium
|
|
{
|
|
public int uid;
|
|
|
|
public FishSpecies species;
|
|
|
|
public float weight;
|
|
|
|
public float growthWeight;
|
|
|
|
public float currentFeed = 1f;
|
|
|
|
public long timeDrop;
|
|
|
|
public float lifeTime = 1f;
|
|
|
|
public void AddFeed(float feedValue)
|
|
{
|
|
currentFeed += feedValue;
|
|
currentFeed = Mathf.Clamp(currentFeed, 0f, 1f);
|
|
}
|
|
|
|
public float GetTotalWeight()
|
|
{
|
|
return weight + growthWeight;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CTrophy
|
|
{
|
|
public int uid;
|
|
|
|
public FishSpecies fishSpecies;
|
|
|
|
public float fishWeight;
|
|
}
|
|
|
|
[Serializable]
|
|
public class CQuest
|
|
{
|
|
public GameQuest gameQuest;
|
|
|
|
public float curentObjectiveProgress;
|
|
|
|
public bool isChanged;
|
|
|
|
public bool isShowed;
|
|
|
|
public int uid;
|
|
}
|
|
|
|
[Serializable]
|
|
public class CSlots
|
|
{
|
|
public enum Status
|
|
{
|
|
Empty = 0,
|
|
NoCompleted = 1,
|
|
Completed = 2
|
|
}
|
|
|
|
public enum Method
|
|
{
|
|
None = 0,
|
|
Float = 1,
|
|
Spinning = 2,
|
|
Feeder = 3
|
|
}
|
|
|
|
public string name = "Custom";
|
|
|
|
public CRods rod;
|
|
|
|
public CReels reel;
|
|
|
|
public CLines line;
|
|
|
|
public CLeaders leader;
|
|
|
|
public CFloats ffloat;
|
|
|
|
public CHooks hook;
|
|
|
|
public CBaits bait;
|
|
|
|
public CFeeders feeder;
|
|
|
|
public CWeights weight;
|
|
|
|
public Status status;
|
|
|
|
public Method method;
|
|
|
|
public GameObject GetPrefabModel(ItemType itemType)
|
|
{
|
|
GameObject result = null;
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
result = instance.gameRods[instance.GetIndexByItemId(itemType, rod.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Reel:
|
|
result = instance.gameReels[instance.GetIndexByItemId(itemType, reel.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Line:
|
|
result = instance.gameLines[instance.GetIndexByItemId(itemType, line.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Leader:
|
|
result = instance.gameLeaders[instance.GetIndexByItemId(itemType, leader.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Float:
|
|
result = instance.gameFloats[instance.GetIndexByItemId(itemType, ffloat.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Hook:
|
|
result = instance.gameHooks[instance.GetIndexByItemId(itemType, hook.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Bait:
|
|
result = instance.gameBaits[instance.GetIndexByItemId(itemType, bait.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Feeder:
|
|
result = instance.gameFeeders[instance.GetIndexByItemId(itemType, feeder.ID)].GetModelPrefab();
|
|
break;
|
|
case ItemType.Weight:
|
|
result = instance.gameWeights[instance.GetIndexByItemId(itemType, weight.ID)].GetModelPrefab();
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public int CheckSlotAndRod()
|
|
{
|
|
if (rod.isNull || reel.isNull || bait.isNull)
|
|
{
|
|
return 2;
|
|
}
|
|
if (rod.wear == 0)
|
|
{
|
|
return 0;
|
|
}
|
|
if (reel.wear == 0)
|
|
{
|
|
return 1;
|
|
}
|
|
if (status == Status.NoCompleted)
|
|
{
|
|
return 2;
|
|
}
|
|
if (rod.status == CRods.Status.InOut || rod.status == CRods.Status.InUse)
|
|
{
|
|
return 3;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public void SetWearRodReel(ItemType itemType, int val)
|
|
{
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
rod.wear = val;
|
|
if (rod.wear == 0)
|
|
{
|
|
status = Status.NoCompleted;
|
|
}
|
|
break;
|
|
case ItemType.Reel:
|
|
reel.wear = val;
|
|
if (reel.wear == 0)
|
|
{
|
|
status = Status.NoCompleted;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void SetReelSettings(int setType, float val, bool saveToPrefs = false)
|
|
{
|
|
if (setType == 0)
|
|
{
|
|
reel.currentSpeed = val;
|
|
}
|
|
if (setType == 1)
|
|
{
|
|
reel.currentDrag = val;
|
|
}
|
|
}
|
|
|
|
public void SubNaturalBait(GameObject currentBait)
|
|
{
|
|
if (bait.isNull)
|
|
{
|
|
return;
|
|
}
|
|
bool flag = false;
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[i].ID == bait.ID)
|
|
{
|
|
bait.CopyValues(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[i]);
|
|
bait.amount = 1;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[i].amount--;
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[i].amount <= 0)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits.Remove(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[i]);
|
|
}
|
|
flag = true;
|
|
}
|
|
}
|
|
if (!flag)
|
|
{
|
|
bait.SetToNull();
|
|
Instance.ShowMessagePopup(LanguageManager.Instance.GetText("BAIT_ON_HOOK_EMPTY"), FScriptsHandler.Instance.m_Canvas.transform);
|
|
UnityEngine.Object.Destroy(currentBait);
|
|
}
|
|
}
|
|
|
|
public void SubLine(float subValue)
|
|
{
|
|
if (!line.isNull)
|
|
{
|
|
line.lenght -= subValue;
|
|
if (line.lenght <= 0f)
|
|
{
|
|
line.SetToNull();
|
|
status = Status.NoCompleted;
|
|
Instance.ShowMessagePopup(LanguageManager.Instance.GetText("LINE_EMPTY"), FScriptsHandler.Instance.m_Canvas.transform);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void SubLastLeaderItemsByCut(ItemType itemType = ItemType.Bait, FRod currentRod = null)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.iron_bait))
|
|
{
|
|
return;
|
|
}
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Bait:
|
|
if ((bool)currentRod.currentLure)
|
|
{
|
|
UnityEngine.Object.Destroy(currentRod.currentLure.gameObject);
|
|
currentRod.currentLure = null;
|
|
bait.SetToNull();
|
|
Debug.Log("Zniszczylo obiekt przynety");
|
|
}
|
|
status = Status.NoCompleted;
|
|
break;
|
|
case ItemType.Hook:
|
|
if ((bool)currentRod.currentBait)
|
|
{
|
|
UnityEngine.Object.Destroy(currentRod.currentBait.gameObject);
|
|
currentRod.currentBait = null;
|
|
bait.SetToNull();
|
|
}
|
|
if (!hook.isNull)
|
|
{
|
|
if ((bool)currentRod.currentHook)
|
|
{
|
|
UnityEngine.Object.Destroy(currentRod.currentHook.gameObject);
|
|
currentRod.currentHook = null;
|
|
hook.SetToNull();
|
|
}
|
|
status = Status.NoCompleted;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
public int GetEquipmentLevel(ItemType itemType)
|
|
{
|
|
int result = -1;
|
|
int num = -1;
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
if (rod != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Rod, rod.ID);
|
|
}
|
|
break;
|
|
case ItemType.Reel:
|
|
if (reel != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Reel, reel.ID);
|
|
}
|
|
break;
|
|
case ItemType.Float:
|
|
if (ffloat != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Float, ffloat.ID);
|
|
}
|
|
break;
|
|
case ItemType.Feeder:
|
|
if (feeder != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Feeder, feeder.ID);
|
|
}
|
|
break;
|
|
case ItemType.Hook:
|
|
if (hook != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Hook, hook.ID);
|
|
}
|
|
break;
|
|
case ItemType.Bait:
|
|
if (bait != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Bait, bait.ID);
|
|
}
|
|
break;
|
|
case ItemType.Line:
|
|
if (line != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Line, line.ID);
|
|
}
|
|
break;
|
|
case ItemType.Weight:
|
|
if (weight != null)
|
|
{
|
|
num = Instance._playerData.GetGameItemIndexByItemId(ItemType.Weight, weight.ID);
|
|
}
|
|
break;
|
|
}
|
|
if (num != -1)
|
|
{
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
result = Instance.gameRods[num].Level;
|
|
break;
|
|
case ItemType.Reel:
|
|
result = Instance.gameReels[num].Level;
|
|
break;
|
|
case ItemType.Float:
|
|
result = Instance.gameFloats[num].Level;
|
|
break;
|
|
case ItemType.Feeder:
|
|
result = Instance.gameFeeders[num].Level;
|
|
break;
|
|
case ItemType.Hook:
|
|
result = Instance.gameHooks[num].Level;
|
|
break;
|
|
case ItemType.Bait:
|
|
result = Instance.gameBaits[num].Level;
|
|
break;
|
|
case ItemType.Line:
|
|
result = Instance.gameLines[num].Level;
|
|
break;
|
|
case ItemType.Weight:
|
|
result = Instance.gameWeights[num].Level;
|
|
break;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public class CSkills
|
|
{
|
|
public Skills skill;
|
|
|
|
public bool isBuyed;
|
|
}
|
|
|
|
[Serializable]
|
|
public class CPersonalRecords
|
|
{
|
|
public FishSpecies fishSpecies;
|
|
|
|
public float weight;
|
|
|
|
public string catchDate;
|
|
|
|
public int mapId;
|
|
|
|
public bool isNew = true;
|
|
}
|
|
|
|
public int currentPlayerProfileIndex = -1;
|
|
|
|
public bool startHelpPanelViaStart;
|
|
|
|
public List<CPlayer> Player;
|
|
|
|
public List<CRods> PlayerRods;
|
|
|
|
public List<CReels> PlayerReels;
|
|
|
|
public List<CLines> PlayerLines;
|
|
|
|
public List<CLeaders> PlayerLeaders;
|
|
|
|
public List<CBaits> PlayerBaits;
|
|
|
|
public List<CHooks> PlayerHooks;
|
|
|
|
public List<CFloats> PlayerFloats;
|
|
|
|
public List<CFeeders> PlayerFeeders;
|
|
|
|
public List<CWeights> PlayerWeights;
|
|
|
|
public List<CAccesories> PlayerAccesories;
|
|
|
|
public List<CGroundbaits> PlayerGroundbaits;
|
|
|
|
public List<CSlots> PlayerSlotsEquip;
|
|
|
|
public List<CSlots> PlayerSlotsEquipTemplate;
|
|
|
|
public CBasket PlayerShopBasket;
|
|
|
|
public List<CFishNet> PlayerFishNet;
|
|
|
|
public List<CAquarium> PlayerAquarium;
|
|
|
|
public List<CTrophy> PlayerTrophy;
|
|
|
|
public List<CQuest> PlayerQuest;
|
|
|
|
public List<CQuest> PlayerWeeklyQuest;
|
|
|
|
public List<CQuest> PlayerMonthlyQuest;
|
|
|
|
public List<CSkills> PlayerSkills;
|
|
|
|
public List<CPersonalRecords> PlayerPersonalRecords;
|
|
|
|
public List<CLicences> PlayerLicences;
|
|
|
|
public List<BoostToken> PlayerBoostTokens;
|
|
|
|
public int[] fishNetMaxExp;
|
|
|
|
public float[] fishNetCapacity;
|
|
|
|
public string steamPlayerName;
|
|
|
|
public Texture2D steamAvatar;
|
|
|
|
public bool forceShowFishNet;
|
|
|
|
public float eagleEyesCoolDown;
|
|
|
|
public float eagleEyesViewTimer;
|
|
|
|
private List<GameQuest> tempQuests = new List<GameQuest>();
|
|
|
|
public int GetItemIdByUniqueId(ItemType itemType, int uniqueItemId)
|
|
{
|
|
int result = -1;
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
{
|
|
for (int l = 0; l < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerRods.Count; l++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerRods[l].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerRods[l].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Reel:
|
|
{
|
|
for (int num2 = 0; num2 < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerReels.Count; num2++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerReels[num2].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerReels[num2].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Line:
|
|
{
|
|
for (int num4 = 0; num4 < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLines.Count; num4++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLines[num4].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLines[num4].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Leader:
|
|
{
|
|
for (int n = 0; n < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLeaders.Count; n++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLeaders[n].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLeaders[n].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Float:
|
|
{
|
|
for (int j = 0; j < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFloats.Count; j++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFloats[j].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFloats[j].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Hook:
|
|
{
|
|
for (int num3 = 0; num3 < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerHooks.Count; num3++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerHooks[num3].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerHooks[num3].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Bait:
|
|
{
|
|
for (int num = 0; num < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits.Count; num++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[num].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[num].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Feeder:
|
|
{
|
|
for (int m = 0; m < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFeeders.Count; m++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFeeders[m].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFeeders[m].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Weight:
|
|
{
|
|
for (int k = 0; k < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeights.Count; k++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeights[k].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeights[k].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Accesories:
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAccessories.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAccessories[i].uniqueId == uniqueItemId)
|
|
{
|
|
result = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAccessories[i].ID;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public int GetGameItemIndexByItemId(ItemType itemType, int itemId)
|
|
{
|
|
int result = -1;
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
{
|
|
for (int n = 0; n < instance.gameRods.Length; n++)
|
|
{
|
|
if (instance.gameRods[n].id == itemId)
|
|
{
|
|
result = n;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Reel:
|
|
{
|
|
for (int num4 = 0; num4 < instance.gameReels.Length; num4++)
|
|
{
|
|
if (instance.gameReels[num4].id == itemId)
|
|
{
|
|
result = num4;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Line:
|
|
{
|
|
for (int j = 0; j < instance.gameLines.Length; j++)
|
|
{
|
|
if (instance.gameLines[j].id == itemId)
|
|
{
|
|
result = j;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Leader:
|
|
{
|
|
for (int num2 = 0; num2 < instance.gameLeaders.Length; num2++)
|
|
{
|
|
if (instance.gameLeaders[num2].id == itemId)
|
|
{
|
|
result = num2;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Float:
|
|
{
|
|
for (int l = 0; l < instance.gameFloats.Length; l++)
|
|
{
|
|
if (instance.gameFloats[l].id == itemId)
|
|
{
|
|
result = l;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Hook:
|
|
{
|
|
for (int num5 = 0; num5 < instance.gameHooks.Length; num5++)
|
|
{
|
|
if (instance.gameHooks[num5].id == itemId)
|
|
{
|
|
result = num5;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Bait:
|
|
{
|
|
for (int num3 = 0; num3 < instance.gameBaits.Length; num3++)
|
|
{
|
|
if (instance.gameBaits[num3].id == itemId)
|
|
{
|
|
result = num3;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Feeder:
|
|
{
|
|
for (int num = 0; num < instance.gameFeeders.Length; num++)
|
|
{
|
|
if (instance.gameFeeders[num].id == itemId)
|
|
{
|
|
result = num;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Weight:
|
|
{
|
|
for (int m = 0; m < instance.gameWeights.Length; m++)
|
|
{
|
|
if (instance.gameWeights[m].id == itemId)
|
|
{
|
|
result = m;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Accesories:
|
|
{
|
|
for (int k = 0; k < instance.gameAccesories.Length; k++)
|
|
{
|
|
if (instance.gameAccesories[k].id == itemId)
|
|
{
|
|
result = k;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Groundbaits:
|
|
{
|
|
for (int i = 0; i < instance.gameGroundbaits.Length; i++)
|
|
{
|
|
if (instance.gameGroundbaits[i].id == itemId)
|
|
{
|
|
result = i;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public int GetPlayerItemIndexByUniqueId(ItemType itemType, int uniqueItemId)
|
|
{
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
{
|
|
for (int n = 0; n < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerRods.Count; n++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerRods[n].uniqueId == uniqueItemId)
|
|
{
|
|
return n;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Reel:
|
|
{
|
|
for (int num4 = 0; num4 < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerReels.Count; num4++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerReels[num4].uniqueId == uniqueItemId)
|
|
{
|
|
return num4;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Line:
|
|
{
|
|
for (int j = 0; j < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLines.Count; j++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLines[j].uniqueId == uniqueItemId)
|
|
{
|
|
return j;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Leader:
|
|
{
|
|
for (int num2 = 0; num2 < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLeaders.Count; num2++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLeaders[num2].uniqueId == uniqueItemId)
|
|
{
|
|
return num2;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Float:
|
|
{
|
|
for (int l = 0; l < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFloats.Count; l++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFloats[l].uniqueId == uniqueItemId)
|
|
{
|
|
return l;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Hook:
|
|
{
|
|
for (int num5 = 0; num5 < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerHooks.Count; num5++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerHooks[num5].uniqueId == uniqueItemId)
|
|
{
|
|
return num5;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Bait:
|
|
{
|
|
for (int num3 = 0; num3 < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits.Count; num3++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerBaits[num3].uniqueId == uniqueItemId)
|
|
{
|
|
return num3;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Feeder:
|
|
{
|
|
for (int num = 0; num < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFeeders.Count; num++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFeeders[num].uniqueId == uniqueItemId)
|
|
{
|
|
return num;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Weight:
|
|
{
|
|
for (int m = 0; m < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeights.Count; m++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeights[m].uniqueId == uniqueItemId)
|
|
{
|
|
return m;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Accesories:
|
|
{
|
|
for (int k = 0; k < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAccessories.Count; k++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAccessories[k].uniqueId == uniqueItemId)
|
|
{
|
|
return k;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Groundbaits:
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerGroundbaits.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerGroundbaits[i].uniqueId == uniqueItemId)
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public void UpdateGameTime()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().GameTime += Time.deltaTime;
|
|
}
|
|
}
|
|
|
|
public int GetGameTimeInSeconds()
|
|
{
|
|
return Mathf.RoundToInt(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().GameTime);
|
|
}
|
|
|
|
public string GetGameTime()
|
|
{
|
|
TimeSpan timeSpan = TimeSpan.FromSeconds(GetTimestamp());
|
|
return string.Format("{0:00}h {0:00}min {1:00}sec", timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
|
|
}
|
|
|
|
public string GetExpBoostTime()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp > 0f)
|
|
{
|
|
return Instance._playerData.GetExpBoostTimeMin() + ":" + Instance._playerData.GetExpBoostTimeSec();
|
|
}
|
|
return LanguageManager.Instance.GetText("BOOST_INACTIVE");
|
|
}
|
|
|
|
public string GetExpBoostTimeMin()
|
|
{
|
|
if ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp / 60f) < 10)
|
|
{
|
|
return "0" + (int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp / 60f);
|
|
}
|
|
return ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp / 60f)).ToString();
|
|
}
|
|
|
|
public string GetExpBoostTimeSec()
|
|
{
|
|
if ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp % 60f) < 10)
|
|
{
|
|
return "0" + (int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp % 60f);
|
|
}
|
|
if ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp % 60f) == 0)
|
|
{
|
|
return "00";
|
|
}
|
|
return ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp % 60f)).ToString();
|
|
}
|
|
|
|
public string GetCashBoostTime()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash > 0f)
|
|
{
|
|
return (Instance._playerData.GetCashBoostTimeMin() + ":" + Instance._playerData.GetCashBoostTimeSec()).ToString();
|
|
}
|
|
return LanguageManager.Instance.GetText("BOOST_INACTIVE");
|
|
}
|
|
|
|
public string GetCashBoostTimeMin()
|
|
{
|
|
if ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash / 60f) < 10)
|
|
{
|
|
return "0" + (int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash / 60f);
|
|
}
|
|
return ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash / 60f)).ToString();
|
|
}
|
|
|
|
public string GetCashBoostTimeSec()
|
|
{
|
|
if ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash % 60f) < 10)
|
|
{
|
|
return "0" + (int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash % 60f);
|
|
}
|
|
if ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash % 60f) == 0)
|
|
{
|
|
return "00";
|
|
}
|
|
return ((int)(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash % 60f)).ToString();
|
|
}
|
|
|
|
public bool AddSubPlayerCashValue(float value)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
return true;
|
|
}
|
|
if (value < 0f)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerCash < Mathf.Abs(value))
|
|
{
|
|
return false;
|
|
}
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerCash += value;
|
|
}
|
|
else
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerCash += value;
|
|
}
|
|
Debug.Log(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerCash + " value: " + value);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerCash = Mathf.Round(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerCash * 100f) / 100f;
|
|
return true;
|
|
}
|
|
|
|
public void AddSubPlayerExp(float value)
|
|
{
|
|
if (!Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp > Time.time)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp += value + value * 0.25f;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp = (float)Math.Round(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp, 0);
|
|
}
|
|
else
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp += value;
|
|
}
|
|
CheckLevel();
|
|
}
|
|
}
|
|
|
|
public void AddSubPlayerQuestPoints(int value)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().QuestPoints += value;
|
|
}
|
|
|
|
public void AddSubPlayerRankingPoints(int value)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerRankingPoints += value;
|
|
}
|
|
|
|
public void AddFishNetExp(float fishWeight)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetLevel >= fishNetMaxExp.Length)
|
|
{
|
|
Debug.Log("Siatka osiągneła maxymalny poziom");
|
|
return;
|
|
}
|
|
float num = 0.25f;
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.lure_master_5p))
|
|
{
|
|
num = 0.5f;
|
|
}
|
|
int num2 = (int)Mathf.Ceil(fishWeight * num);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetExp += num2;
|
|
int num3 = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetLevel - 1;
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetExp >= fishNetMaxExp[num3])
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetExp = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetExp - fishNetMaxExp[num3];
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetLevel++;
|
|
Debug.Log("Fish net new level " + Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetLevel);
|
|
}
|
|
}
|
|
|
|
private float CountFishWeightInFishNet()
|
|
{
|
|
float num = 0f;
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNet.Count; i++)
|
|
{
|
|
num += Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNet[i].weight;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
private float GetFreeSpacesInFishNet()
|
|
{
|
|
int num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetLevel - 1;
|
|
float num2 = fishNetCapacity[num] - CountFishWeightInFishNet();
|
|
if (num2 < 0f)
|
|
{
|
|
num2 = 0f;
|
|
}
|
|
return num2;
|
|
}
|
|
|
|
public float GetFishNetCapacity()
|
|
{
|
|
if (currentPlayerProfileIndex == -1)
|
|
{
|
|
return 0f;
|
|
}
|
|
int num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetLevel - 1;
|
|
return fishNetCapacity[num];
|
|
}
|
|
|
|
public float GetFishNetNextCapacity()
|
|
{
|
|
if (currentPlayerProfileIndex == -1)
|
|
{
|
|
return 0f;
|
|
}
|
|
int playerFishNetLevel = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNetLevel;
|
|
if (playerFishNetLevel >= fishNetCapacity.Length)
|
|
{
|
|
return fishNetCapacity[fishNetCapacity.Length - 1];
|
|
}
|
|
return fishNetCapacity[playerFishNetLevel];
|
|
}
|
|
|
|
public float GetUsedFishNet()
|
|
{
|
|
float num = 0f;
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNet.Count; i++)
|
|
{
|
|
num += Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNet[i].weight;
|
|
}
|
|
return num;
|
|
}
|
|
|
|
public bool AddFishToFishNet(FishSpecies fishSpecies, float fishWeight, float price)
|
|
{
|
|
if (currentPlayerProfileIndex == -1)
|
|
{
|
|
return false;
|
|
}
|
|
if (GetFreeSpacesInFishNet() < fishWeight)
|
|
{
|
|
Debug.Log("Siatka zapełniona");
|
|
return false;
|
|
}
|
|
CFishNet cFishNet = new CFishNet();
|
|
cFishNet.uid = GetUniqueNumber();
|
|
cFishNet.species = fishSpecies;
|
|
cFishNet.weight = fishWeight;
|
|
cFishNet.price = price;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerFishNet.Add(cFishNet);
|
|
return true;
|
|
}
|
|
|
|
public bool AddFishToAquarium(FishSpecies fishSpecies, float fishWeight)
|
|
{
|
|
if (!ServerManager.Instance.isServerTimeUpdated)
|
|
{
|
|
return false;
|
|
}
|
|
int num = CheckFreeSpacesInAquariumAndGetIndex(fishWeight);
|
|
if (num == -1)
|
|
{
|
|
Debug.Log("Nie mozna dodac ryby do akwarium");
|
|
return false;
|
|
}
|
|
CFishAquarium cFishAquarium = new CFishAquarium();
|
|
cFishAquarium.uid = GetUniqueNumber();
|
|
cFishAquarium.species = fishSpecies;
|
|
cFishAquarium.weight = fishWeight;
|
|
cFishAquarium.currentFeed = UnityEngine.Random.Range(0.2f, 1f);
|
|
cFishAquarium.timeDrop = ServerManager.Instance.serverTime;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[num].fish.Add(cFishAquarium);
|
|
Residence instance = Singleton<Residence>.Instance;
|
|
if ((bool)instance)
|
|
{
|
|
instance.residenceAquariums[num].AddFish(fishSpecies, fishWeight, cFishAquarium.uid, cFishAquarium.currentFeed, 0f);
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
return true;
|
|
}
|
|
if (SteamUserStats.GetAchievement("FIRST_AQUARIUM_FISH_ACHIEVEMENT", out var pbAchieved) && !pbAchieved && SteamUserStats.SetAchievement("FIRST_AQUARIUM_FISH_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[num].fish.Count >= 10 && SteamUserStats.GetAchievement("ADD_FISH_AQUARIUM_ACHIEVEMENT", out var pbAchieved2) && !pbAchieved2 && SteamUserStats.SetAchievement("ADD_FISH_AQUARIUM_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[0].fish.Count >= 10 && Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[1].fish.Count >= 10 && SteamUserStats.GetAchievement("TWO_AQUARIUM_ACHIEVEMENT", out var pbAchieved3) && !pbAchieved3 && SteamUserStats.SetAchievement("TWO_AQUARIUM_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int CheckFreeSpacesInAquariumAndGetIndex(float fishWeight)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium.Count; i++)
|
|
{
|
|
if (fishWeight <= Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].maxFishWeight && Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish.Count < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].maxCapacity)
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public void AquariumsTimer()
|
|
{
|
|
if (currentPlayerProfileIndex == -1 || !ServerManager.Instance || !ServerManager.Instance.isServerTimeUpdated)
|
|
{
|
|
return;
|
|
}
|
|
bool flag = false;
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium.Count; i++)
|
|
{
|
|
for (int j = 0; j < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish.Count; j++)
|
|
{
|
|
int num = (int)(ServerManager.Instance.serverTime - Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().LastAquariumUpdateTime);
|
|
float value = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].currentFeed - (float)num * 2E-05f;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].currentFeed = Mathf.Clamp01(value);
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].currentFeed > 0f)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].growthWeight < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].maxFishGrowthWeight)
|
|
{
|
|
float num2 = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].weight * ((float)num * 2E-06f);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.breeder_10p))
|
|
{
|
|
num2 += num2 * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.breeder_5p))
|
|
{
|
|
num2 += num2 * 0.1f;
|
|
}
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].growthWeight += num2;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].growthWeight = Mathf.Clamp(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].growthWeight, 0f, Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].maxFishGrowthWeight);
|
|
flag = true;
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].lifeTime <= 1f)
|
|
{
|
|
if (instance.gameFish[(int)Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].species].maxWeight > Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].maxFishGrowthWeight)
|
|
{
|
|
float value2 = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].growthWeight / Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].maxFishGrowthWeight;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].lifeTime = Mathf.Clamp01(value2);
|
|
}
|
|
else
|
|
{
|
|
float value3 = (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].growthWeight + Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].weight) / instance.gameFish[(int)Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].species].maxWeight;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].lifeTime = Mathf.Clamp01(value3);
|
|
}
|
|
flag = true;
|
|
}
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].currentFeed != 0f)
|
|
{
|
|
_ = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerAquarium[i].fish[j].lifeTime;
|
|
_ = 1f;
|
|
}
|
|
}
|
|
}
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().LastAquariumUpdateTime = ServerManager.Instance.serverTime;
|
|
}
|
|
|
|
private void ShowAquariumFishStatusMessage(string msgType)
|
|
{
|
|
Transform transform = null;
|
|
if ((bool)UnityEngine.Object.FindObjectOfType<Canvas>())
|
|
{
|
|
transform = UnityEngine.Object.FindObjectOfType<Canvas>().transform;
|
|
}
|
|
if (!(transform == null))
|
|
{
|
|
Instance.ShowMessagePopup(LanguageManager.Instance.GetText(msgType), transform);
|
|
}
|
|
}
|
|
|
|
public bool AddFishToTrophy(FishSpecies fishSpecies, float fishWeight)
|
|
{
|
|
int num = CheckTrophyAndGetIndex(fishSpecies, fishWeight);
|
|
CTrophy cTrophy = new CTrophy();
|
|
cTrophy.uid = GetUniqueNumber();
|
|
cTrophy.fishSpecies = fishSpecies;
|
|
cTrophy.fishWeight = fishWeight;
|
|
if (num > -1)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerTrophy[num] = cTrophy;
|
|
}
|
|
else
|
|
{
|
|
if (num != -1)
|
|
{
|
|
return false;
|
|
}
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerTrophy.Add(cTrophy);
|
|
}
|
|
if (Singleton<Residence>.Instance != null)
|
|
{
|
|
TrophyPanel[] array = UnityEngine.Object.FindObjectsOfType<TrophyPanel>();
|
|
for (int i = 0; i < array.Length; i++)
|
|
{
|
|
if (array[i].fishSpecies == fishSpecies)
|
|
{
|
|
array[i].ReShowFish();
|
|
}
|
|
}
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerTrophy.Count >= 25 && !Singleton<SaveDataManager>.Instance.IsCurrentlySandbox() && SteamUserStats.GetAchievement("ADD_FISH_TROPHY_ACHIEVEMENT", out var pbAchieved) && !pbAchieved && SteamUserStats.SetAchievement("ADD_FISH_TROPHY_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public int CheckTrophyAndGetIndex(FishSpecies fishSpecies, float fishWeight)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerTrophy.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerTrophy[i].fishSpecies == fishSpecies)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerTrophy[i].fishWeight < fishWeight)
|
|
{
|
|
return i;
|
|
}
|
|
return -2;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public void RandomAndChangeOneQuest(int uid)
|
|
{
|
|
int index = 0;
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[i].uid == uid)
|
|
{
|
|
index = i;
|
|
}
|
|
}
|
|
int num = UnityEngine.Random.Range(0, 100);
|
|
if (!CheckisChangeQuest())
|
|
{
|
|
return;
|
|
}
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().AmountOfQuestChangesAvailable--;
|
|
if (num < 50 && !CheckIsSpecialQuests())
|
|
{
|
|
if (num < 20)
|
|
{
|
|
GameQuest gameQuest = RandomQuestMission(GameQuest.Type.Legendary, Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index].gameQuest);
|
|
CQuest cQuest = new CQuest();
|
|
cQuest.gameQuest = gameQuest;
|
|
cQuest.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index] = cQuest;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index].isChanged = true;
|
|
}
|
|
else
|
|
{
|
|
GameQuest gameQuest2 = RandomQuestMission(GameQuest.Type.Epic, Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index].gameQuest);
|
|
CQuest cQuest2 = new CQuest();
|
|
cQuest2.gameQuest = gameQuest2;
|
|
cQuest2.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index] = cQuest2;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index].isChanged = true;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GameQuest gameQuest3 = RandomQuestMission(GameQuest.Type.Common, Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index].gameQuest);
|
|
CQuest cQuest3 = new CQuest();
|
|
cQuest3.gameQuest = gameQuest3;
|
|
cQuest3.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index] = cQuest3;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[index].isChanged = true;
|
|
}
|
|
}
|
|
|
|
public void GetRewardFromQuest(int uid)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[i].uid != uid)
|
|
{
|
|
continue;
|
|
}
|
|
GameQuest gameQuest = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[i].gameQuest;
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().QuestPoints < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PointsCap)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().QuestPoints += gameQuest.points;
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().QuestPoints >= Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PointsCap)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().QuestPoints = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PointsCap;
|
|
}
|
|
}
|
|
Instance._playerData.AddSubPlayerCashValue(gameQuest.reward);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.RemoveAt(i);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().CompletedDailyQuests++;
|
|
}
|
|
}
|
|
|
|
public void GetRewardFromWeeklyQuest(int uid)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest[i].uid == uid)
|
|
{
|
|
GameQuest gameQuest = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest[i].gameQuest;
|
|
Instance._playerData.AddSubPlayerCashValue(gameQuest.reward);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest.RemoveAt(i);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().CompletedWeeklyQuests++;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void GetRewardFromMonthlyQuest(int uid)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest[i].uid == uid)
|
|
{
|
|
GameQuest gameQuest = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest[i].gameQuest;
|
|
Instance._playerData.AddSubPlayerCashValue(gameQuest.reward);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest.RemoveAt(i);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().CompletedMonthlyQuests++;
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool CheckIsSpecialQuests()
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[i].gameQuest.type == GameQuest.Type.Epic || Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[i].gameQuest.type == GameQuest.Type.Legendary)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void RandomQuests()
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Clear();
|
|
bool flag = false;
|
|
int num = 3;
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
int num2 = UnityEngine.Random.Range(0, 100);
|
|
if (num2 < 15 && !flag)
|
|
{
|
|
if (num2 < 5)
|
|
{
|
|
GameQuest gameQuest = RandomQuestMission(GameQuest.Type.Legendary);
|
|
CQuest cQuest = new CQuest();
|
|
cQuest.gameQuest = gameQuest;
|
|
cQuest.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Add(cQuest);
|
|
}
|
|
else
|
|
{
|
|
GameQuest gameQuest2 = RandomQuestMission(GameQuest.Type.Epic);
|
|
CQuest cQuest2 = new CQuest();
|
|
cQuest2.gameQuest = gameQuest2;
|
|
cQuest2.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Add(cQuest2);
|
|
}
|
|
flag = true;
|
|
}
|
|
else
|
|
{
|
|
GameQuest gameQuest3 = RandomQuestMission(GameQuest.Type.Common);
|
|
CQuest cQuest3 = new CQuest();
|
|
cQuest3.gameQuest = gameQuest3;
|
|
cQuest3.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Add(cQuest3);
|
|
}
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.scrooge))
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().AmountOfQuestChangesAvailable = 2;
|
|
}
|
|
else
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().AmountOfQuestChangesAvailable = 1;
|
|
}
|
|
QuestManager instance = Singleton<QuestManager>.Instance;
|
|
if (instance != null)
|
|
{
|
|
if (instance.gameObject.activeSelf)
|
|
{
|
|
instance.ShowQuests();
|
|
}
|
|
PlayerHeader playerHeader = UnityEngine.Object.FindObjectOfType<PlayerHeader>();
|
|
if (playerHeader != null)
|
|
{
|
|
playerHeader.QuestCompleteImage.SetActive(value: false);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void RandomWeeklyQuests()
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest.Clear();
|
|
int num = 3;
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
GameQuest gameQuest = RandomQuestMission(GameQuest.Type.Weekly);
|
|
CQuest cQuest = new CQuest();
|
|
cQuest.gameQuest = gameQuest;
|
|
cQuest.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest.Add(cQuest);
|
|
}
|
|
if (Singleton<QuestManager>.Instance != null && Singleton<QuestManager>.Instance.gameObject.activeSelf)
|
|
{
|
|
Singleton<QuestManager>.Instance.ShowQuests();
|
|
}
|
|
}
|
|
|
|
public void RandomMonthlyQuests()
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest.Clear();
|
|
int num = 3;
|
|
for (int i = 0; i < num; i++)
|
|
{
|
|
GameQuest gameQuest = RandomQuestMission(GameQuest.Type.Monthly);
|
|
CQuest cQuest = new CQuest();
|
|
cQuest.gameQuest = gameQuest;
|
|
cQuest.uid = GetUniqueNumber();
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest.Add(cQuest);
|
|
}
|
|
QuestManager instance = Singleton<QuestManager>.Instance;
|
|
if (instance != null && instance.gameObject.activeSelf)
|
|
{
|
|
instance.ShowQuests();
|
|
}
|
|
}
|
|
|
|
private GameQuest RandomQuestMission(GameQuest.Type type, GameQuest withoutQuest = null)
|
|
{
|
|
List<GameQuest> list = new List<GameQuest>();
|
|
if (tempQuests.Count == 0)
|
|
{
|
|
tempQuests.AddRange(instance.gameQuests);
|
|
}
|
|
for (int i = 0; i < tempQuests.Count; i++)
|
|
{
|
|
if (tempQuests[i].type == type && tempQuests[i] != withoutQuest && tempQuests[i].isEnabled && Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel >= tempQuests[i].levelAvailable)
|
|
{
|
|
list.Add(tempQuests[i]);
|
|
}
|
|
}
|
|
int index = UnityEngine.Random.Range(0, list.Count - 1);
|
|
GameQuest gameQuest = list[index];
|
|
tempQuests.Remove(gameQuest);
|
|
return gameQuest;
|
|
}
|
|
|
|
private bool CheckPlayerQuest(GameQuest quest)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[i].gameQuest == quest)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private bool CheckPlayerWeeklyQuest(GameQuest quest)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest[i].gameQuest == quest)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
private bool CheckMonthlyPlayerQuest(GameQuest quest)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest[i].gameQuest == quest)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public bool CheckisChangeQuest()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().AmountOfQuestChangesAvailable != 0)
|
|
{
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void AddFishToQuest(FishSpecies species, float weight)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest.Count; i++)
|
|
{
|
|
CQuest cQuest = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerQuest[i];
|
|
switch (cQuest.gameQuest.questObjectiveType)
|
|
{
|
|
case GameQuest.QuestObjectiveType.Catch_fish:
|
|
if (cQuest.gameQuest.objectiveValue > cQuest.curentObjectiveProgress)
|
|
{
|
|
cQuest.curentObjectiveProgress += 1f;
|
|
}
|
|
else
|
|
{
|
|
cQuest.curentObjectiveProgress = cQuest.gameQuest.objectiveValue;
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_weight:
|
|
if (cQuest.gameQuest.objectiveValue > cQuest.curentObjectiveProgress)
|
|
{
|
|
cQuest.curentObjectiveProgress = weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest.curentObjectiveProgress = cQuest.gameQuest.objectiveValue;
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_total_weight:
|
|
if (cQuest.gameQuest.objectiveValue > cQuest.curentObjectiveProgress)
|
|
{
|
|
cQuest.curentObjectiveProgress += weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest.curentObjectiveProgress = cQuest.gameQuest.objectiveValue;
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_species:
|
|
if (cQuest.gameQuest.objectivefishSpecies == species)
|
|
{
|
|
if (cQuest.gameQuest.objectiveValue > cQuest.curentObjectiveProgress)
|
|
{
|
|
cQuest.curentObjectiveProgress += weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest.curentObjectiveProgress = cQuest.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
for (int j = 0; j < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest.Count; j++)
|
|
{
|
|
CQuest cQuest2 = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerWeeklyQuest[j];
|
|
switch (cQuest2.gameQuest.questObjectiveType)
|
|
{
|
|
case GameQuest.QuestObjectiveType.Catch_fish:
|
|
if (cQuest2.isShowed)
|
|
{
|
|
if (cQuest2.gameQuest.objectiveValue > cQuest2.curentObjectiveProgress)
|
|
{
|
|
cQuest2.curentObjectiveProgress += 1f;
|
|
}
|
|
else
|
|
{
|
|
cQuest2.curentObjectiveProgress = cQuest2.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_weight:
|
|
if (cQuest2.isShowed)
|
|
{
|
|
if (cQuest2.gameQuest.objectiveValue > cQuest2.curentObjectiveProgress)
|
|
{
|
|
cQuest2.curentObjectiveProgress = weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest2.curentObjectiveProgress = cQuest2.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_total_weight:
|
|
if (cQuest2.isShowed)
|
|
{
|
|
if (cQuest2.gameQuest.objectiveValue > cQuest2.curentObjectiveProgress)
|
|
{
|
|
cQuest2.curentObjectiveProgress += weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest2.curentObjectiveProgress = cQuest2.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_species:
|
|
if (cQuest2.isShowed && cQuest2.gameQuest.objectivefishSpecies == species)
|
|
{
|
|
if (cQuest2.gameQuest.objectiveValue > cQuest2.curentObjectiveProgress)
|
|
{
|
|
cQuest2.curentObjectiveProgress += weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest2.curentObjectiveProgress = cQuest2.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
for (int k = 0; k < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest.Count; k++)
|
|
{
|
|
CQuest cQuest3 = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMonthlyQuest[k];
|
|
switch (cQuest3.gameQuest.questObjectiveType)
|
|
{
|
|
case GameQuest.QuestObjectiveType.Catch_fish:
|
|
if (cQuest3.isShowed)
|
|
{
|
|
if (cQuest3.gameQuest.objectiveValue > cQuest3.curentObjectiveProgress)
|
|
{
|
|
cQuest3.curentObjectiveProgress += 1f;
|
|
}
|
|
else
|
|
{
|
|
cQuest3.curentObjectiveProgress = cQuest3.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_weight:
|
|
if (cQuest3.isShowed)
|
|
{
|
|
if (cQuest3.gameQuest.objectiveValue > cQuest3.curentObjectiveProgress)
|
|
{
|
|
cQuest3.curentObjectiveProgress = weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest3.curentObjectiveProgress = cQuest3.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_total_weight:
|
|
if (cQuest3.isShowed)
|
|
{
|
|
if (cQuest3.gameQuest.objectiveValue > cQuest3.curentObjectiveProgress)
|
|
{
|
|
cQuest3.curentObjectiveProgress += weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest3.curentObjectiveProgress = cQuest3.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_species:
|
|
if (cQuest3.isShowed && cQuest3.gameQuest.objectivefishSpecies == species)
|
|
{
|
|
if (cQuest3.gameQuest.objectiveValue > cQuest3.curentObjectiveProgress)
|
|
{
|
|
cQuest3.curentObjectiveProgress += weight;
|
|
}
|
|
else
|
|
{
|
|
cQuest3.curentObjectiveProgress = cQuest3.gameQuest.objectiveValue;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
Debug.LogWarning(species.ToString() + " waga: " + weight);
|
|
}
|
|
|
|
public DateTime UnixTimeStampToDateTime(double unixTimeStamp)
|
|
{
|
|
return new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local).AddSeconds(unixTimeStamp).ToLocalTime();
|
|
}
|
|
|
|
public void QuestTimer()
|
|
{
|
|
if (!(ServerManager.Instance == null) && currentPlayerProfileIndex != -1)
|
|
{
|
|
long timerQuest = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimerQuest;
|
|
long serverTime = ServerManager.Instance.serverTime;
|
|
if (serverTime > timerQuest || Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimerQuest == 0L)
|
|
{
|
|
DateTimeOffset dateTimeOffset = DateTime.Now.AddDays(1.0).Date;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimerQuest = dateTimeOffset.ToUnixTimeSeconds();
|
|
tempQuests.Clear();
|
|
RandomQuests();
|
|
Debug.Log("Quest Random current" + serverTime + " tomorrow " + timerQuest);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void WeeklyQuestTimer()
|
|
{
|
|
if (currentPlayerProfileIndex != -1 && !(ServerManager.Instance == null))
|
|
{
|
|
long weeklyTimerQuest = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().WeeklyTimerQuest;
|
|
if (ServerManager.Instance.serverTime > weeklyTimerQuest || Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().WeeklyTimerQuest == 0L)
|
|
{
|
|
DateTimeOffset dateTimeOffset = DateTime.Now.AddDays(7.0).Date;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().WeeklyTimerQuest = dateTimeOffset.ToUnixTimeSeconds();
|
|
RandomWeeklyQuests();
|
|
}
|
|
}
|
|
}
|
|
|
|
public void MonthlyQuestTimer()
|
|
{
|
|
if (!(ServerManager.Instance == null) && currentPlayerProfileIndex != -1)
|
|
{
|
|
long monthlyTimerQuest = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().MonthlyTimerQuest;
|
|
if (ServerManager.Instance.serverTime > monthlyTimerQuest || Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().MonthlyTimerQuest == 0L)
|
|
{
|
|
DateTimeOffset dateTimeOffset = DateTime.Now.AddMonths(1).Date;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().MonthlyTimerQuest = dateTimeOffset.ToUnixTimeSeconds();
|
|
RandomMonthlyQuests();
|
|
}
|
|
}
|
|
}
|
|
|
|
private string GetMonthlyMidnightDay()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().MonthlyTimerQuest - ServerManager.Instance.serverTime;
|
|
return UnixTimeStampToDateTime(num).Day.ToString("00");
|
|
}
|
|
|
|
private string GetWeeklyMidnightDay()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().WeeklyTimerQuest - ServerManager.Instance.serverTime;
|
|
return UnixTimeStampToDateTime(num).Day.ToString("00");
|
|
}
|
|
|
|
private string GetMidnightHour()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimerQuest - ServerManager.Instance.serverTime;
|
|
_ = DateTime.Now;
|
|
return UnixTimeStampToDateTime(num).Hour.ToString("00");
|
|
}
|
|
|
|
private string GetWeeklyMidnightHour()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().WeeklyTimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Hour).ToString("00");
|
|
}
|
|
|
|
private string GetMonthlyMidnightHour()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().MonthlyTimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Hour).ToString("00");
|
|
}
|
|
|
|
private string GetMonthlyMidnightMinutes()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().MonthlyTimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Minute).ToString("00");
|
|
}
|
|
|
|
private string GetMidnightMinutes()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Minute).ToString("00");
|
|
}
|
|
|
|
private string GetWeeklyMidnightMinutes()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().WeeklyTimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Minute).ToString("00");
|
|
}
|
|
|
|
private string GetMidnightSeconds()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Second).ToString("00");
|
|
}
|
|
|
|
private string GetWeeklyMidnightSeconds()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().WeeklyTimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Second).ToString("00");
|
|
}
|
|
|
|
private string GetMonthlyMidnightSeconds()
|
|
{
|
|
long num = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().MonthlyTimerQuest - ServerManager.Instance.serverTime;
|
|
return ((double)UnixTimeStampToDateTime(num).Second).ToString("00");
|
|
}
|
|
|
|
public string GetMidnightTime()
|
|
{
|
|
return GetMidnightHour() + " " + LanguageManager.Instance.GetText("HOURS") + " " + GetMidnightMinutes() + " " + LanguageManager.Instance.GetText("MINUTES") + " " + GetMidnightSeconds() + " " + LanguageManager.Instance.GetText("SECONDS");
|
|
}
|
|
|
|
public string GetWeeklyMidnightTime()
|
|
{
|
|
return GetWeeklyMidnightDay() + " " + LanguageManager.Instance.GetText("DAYS") + " " + GetWeeklyMidnightHour() + " " + LanguageManager.Instance.GetText("HOURS") + " " + GetWeeklyMidnightMinutes() + " " + LanguageManager.Instance.GetText("MINUTES") + " " + GetWeeklyMidnightSeconds() + " " + LanguageManager.Instance.GetText("SECONDS");
|
|
}
|
|
|
|
public string GetMonthlyMidnightTime()
|
|
{
|
|
return GetMonthlyMidnightDay() + " " + LanguageManager.Instance.GetText("DAYS") + " " + GetMonthlyMidnightHour() + " " + LanguageManager.Instance.GetText("HOURS") + " " + GetMonthlyMidnightMinutes() + " " + LanguageManager.Instance.GetText("MINUTES") + " " + GetMonthlyMidnightSeconds() + " " + LanguageManager.Instance.GetText("SECONDS");
|
|
}
|
|
|
|
public void RentierReward()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
return;
|
|
}
|
|
long lastRentierRewardTime = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().LastRentierRewardTime;
|
|
long serverTime = ServerManager.Instance.serverTime;
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.rentier) && (serverTime > lastRentierRewardTime || Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().LastRentierRewardTime == 0L))
|
|
{
|
|
DateTimeOffset dateTimeOffset = DateTime.Now.AddDays(1.0).Date;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().LastRentierRewardTime = dateTimeOffset.ToUnixTimeSeconds();
|
|
int num = UnityEngine.Random.Range(0, instance.rentierRewards.Length - 1);
|
|
float cash = instance.rentierRewards[num].cash;
|
|
float exp = instance.rentierRewards[num].exp;
|
|
int questPoint = instance.rentierRewards[num].questPoint;
|
|
RentierItem component = UnityEngine.Object.Instantiate(instance.rentierRewardPopUp, UnityEngine.Object.FindObjectOfType<MainGameScene>().gameObject.transform).GetComponent<RentierItem>();
|
|
component.moneyText.text = "$" + cash.ToString("F0");
|
|
component.expText.text = exp.ToString("F0");
|
|
component.questPointText.text = questPoint.ToString();
|
|
component.id = num;
|
|
if (!(cash > 0f))
|
|
{
|
|
component.DisableParentItem(component.moneyText.gameObject);
|
|
}
|
|
if (!(exp > 0f))
|
|
{
|
|
component.DisableParentItem(component.expText.gameObject);
|
|
}
|
|
if (questPoint <= 0)
|
|
{
|
|
component.DisableParentItem(component.questPointText.gameObject);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void CheckLevel()
|
|
{
|
|
if (!(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp >= Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMaxExp))
|
|
{
|
|
return;
|
|
}
|
|
float playerExp = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp - Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMaxExp;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel++;
|
|
BoostTokens.GetBoostToken(10, BoostToken.tokenType.TokenXP).AddAmount(1);
|
|
BoostTokens.GetBoostToken(10, BoostToken.tokenType.TokenCash).AddAmount(1);
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel % 2 == 0 && Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel < 41)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerSkillsPoint++;
|
|
}
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp = playerExp;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMaxExp *= 1.26f;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp = (float)Math.Round(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp, 0);
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMaxExp = (float)Math.Round(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMaxExp, 0);
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerExp >= Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMaxExp)
|
|
{
|
|
CheckLevel();
|
|
}
|
|
else
|
|
{
|
|
Transform canvas_tramsform = ((!(FScriptsHandler.Instance != null)) ? UnityEngine.Object.FindObjectOfType<MainGameScene>().transform : FScriptsHandler.Instance.m_Canvas.transform);
|
|
if (!Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
Instance.ShowLevelUpPopUp(canvas_tramsform);
|
|
}
|
|
}
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().ShowSkillsAnimation = true;
|
|
if (!Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel >= 5 && SteamUserStats.GetAchievement("FIVE_LEVEL_ACHIEVEMENT", out var pbAchieved) && !pbAchieved && SteamUserStats.SetAchievement("FIVE_LEVEL_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel >= 10 && SteamUserStats.GetAchievement("TEN_LEVEL_ACHIEVEMENT", out var pbAchieved2) && !pbAchieved2 && SteamUserStats.SetAchievement("TEN_LEVEL_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel >= 30 && SteamUserStats.GetAchievement("THIRTIETH_LEVEL_ACHIEVEMENT", out var pbAchieved3) && !pbAchieved3 && SteamUserStats.SetAchievement("THIRTIETH_LEVEL_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLevel >= 80 && SteamUserStats.GetAchievement("EIGHTIETH_LEVEL_ACHIEVEMENT", out var pbAchieved4) && !pbAchieved4 && SteamUserStats.SetAchievement("EIGHTIETH_LEVEL_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool CheckLicences(int mapId)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLicenses.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLicenses[i].mapId == mapId)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public bool BuyLicence(int mapId)
|
|
{
|
|
int licensePrize = Instance.gameLocations[mapId].licensePrize;
|
|
if (AddSubPlayerCashValue(-licensePrize))
|
|
{
|
|
CLicences cLicences = new CLicences();
|
|
cLicences.mapId = mapId;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerLicenses.Add(cLicences);
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void AddExpBoostTime(float value)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.exp_boost_5p))
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp += (float)((double)value + (double)value * 0.05);
|
|
}
|
|
else
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp += value;
|
|
}
|
|
Debug.Log("Add time to exp token");
|
|
Debug.Log("time boost exp: " + Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp);
|
|
}
|
|
|
|
public void AddCashBoostTime(float value)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.cash_boost_10p))
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash += (float)((double)value + (double)value * 0.1);
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.cash_boost_5p))
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash += (float)((double)value + (double)value * 0.05);
|
|
}
|
|
else
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash += value;
|
|
}
|
|
Debug.Log("Add time to cash token");
|
|
Debug.Log("time boost cash: " + Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash);
|
|
}
|
|
|
|
public void AddFishAmount()
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TotalFish++;
|
|
if (!Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TotalFish >= 20 && SteamUserStats.GetAchievement("TOTAL_FISH_20_ACHIEVEMENT", out var pbAchieved) && !pbAchieved && SteamUserStats.SetAchievement("TOTAL_FISH_20_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TotalFish >= 300 && SteamUserStats.GetAchievement("TOTAL_FISH_300_ACHIEVEMENT", out var pbAchieved2) && !pbAchieved2 && SteamUserStats.SetAchievement("TOTAL_FISH_300_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TotalFish >= 5000 && SteamUserStats.GetAchievement("TOTAL_FISH_5K_ACHIEVEMENT", out var pbAchieved3) && !pbAchieved3 && SteamUserStats.SetAchievement("TOTAL_FISH_5K_ACHIEVEMENT"))
|
|
{
|
|
SteamUserStats.StoreStats();
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool PlayerHasSkill(Skills skill)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().GameMode == CPlayer.GameMode.Realistic)
|
|
{
|
|
return false;
|
|
}
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerSkills.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerSkills[i].skill == skill)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public void CollectRewardFromRankingButton(int pos)
|
|
{
|
|
for (int i = 0; i < Instance.rankingReward.Length; i++)
|
|
{
|
|
if (i == pos)
|
|
{
|
|
instance._playerData.AddSubPlayerCashValue(instance.rankingReward[pos].cash);
|
|
instance._playerData.AddSubPlayerExp(instance.rankingReward[pos].exp);
|
|
instance._playerData.AddSubPlayerQuestPoints(instance.rankingReward[pos].questPoints);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void ShowStartTutorialPanel()
|
|
{
|
|
if (!Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().HideTutorialPopUp)
|
|
{
|
|
UnityEngine.Object.Instantiate(instance.WelcomeTutorialPopUp, UnityEngine.Object.FindObjectOfType<MainGameScene>().gameObject.transform);
|
|
}
|
|
}
|
|
|
|
public void LoadPlayerProfiles()
|
|
{
|
|
string text = SPrefs.GetString("PLAYER_PROFILES");
|
|
if (string.IsNullOrEmpty(text))
|
|
{
|
|
Debug.Log("PlayerPrefs are empty!");
|
|
return;
|
|
}
|
|
CPlayer[] collection = JsonHelper.FromJson<CPlayer>(text);
|
|
List<CPlayer> list = new List<CPlayer>();
|
|
list.AddRange(collection);
|
|
Player = list;
|
|
Debug.Log("Load player profiles");
|
|
foreach (CPlayer item in Instance._playerData.Player)
|
|
{
|
|
Debug.Log("LoadPlayerProfiles: " + item.playerName);
|
|
}
|
|
}
|
|
|
|
private void SetSlotsTemplates()
|
|
{
|
|
}
|
|
|
|
public void LoadEquipment(ItemType itemType)
|
|
{
|
|
if (currentPlayerProfileIndex == -1)
|
|
{
|
|
return;
|
|
}
|
|
string text = "";
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
PlayerRods.Clear();
|
|
text = SPrefs.GetString("PLAYER_RODS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CRods[] collection6 = JsonHelper.FromJson<CRods>(text);
|
|
List<CRods> list6 = new List<CRods>();
|
|
list6.AddRange(collection6);
|
|
PlayerRods = list6;
|
|
Debug.Log("Load player rods");
|
|
}
|
|
break;
|
|
case ItemType.Reel:
|
|
PlayerReels.Clear();
|
|
text = SPrefs.GetString("PLAYER_REELS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CReels[] collection10 = JsonHelper.FromJson<CReels>(text);
|
|
List<CReels> list10 = new List<CReels>();
|
|
list10.AddRange(collection10);
|
|
PlayerReels = list10;
|
|
Debug.Log("Load player reels");
|
|
}
|
|
break;
|
|
case ItemType.Line:
|
|
PlayerLines.Clear();
|
|
text = SPrefs.GetString("PLAYER_LINES_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CLines[] collection2 = JsonHelper.FromJson<CLines>(text);
|
|
List<CLines> list2 = new List<CLines>();
|
|
list2.AddRange(collection2);
|
|
PlayerLines = list2;
|
|
Debug.Log("Load player lines");
|
|
}
|
|
break;
|
|
case ItemType.Float:
|
|
PlayerFloats.Clear();
|
|
text = SPrefs.GetString("PLAYER_FLOATS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CFloats[] collection8 = JsonHelper.FromJson<CFloats>(text);
|
|
List<CFloats> list8 = new List<CFloats>();
|
|
list8.AddRange(collection8);
|
|
PlayerFloats = list8;
|
|
Debug.Log("Load player floats");
|
|
}
|
|
break;
|
|
case ItemType.Leader:
|
|
PlayerLeaders.Clear();
|
|
text = SPrefs.GetString("PLAYER_LEADERS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CLeaders[] collection4 = JsonHelper.FromJson<CLeaders>(text);
|
|
List<CLeaders> list4 = new List<CLeaders>();
|
|
list4.AddRange(collection4);
|
|
PlayerLeaders = list4;
|
|
Debug.Log("Load player leaders");
|
|
}
|
|
break;
|
|
case ItemType.Feeder:
|
|
PlayerFeeders.Clear();
|
|
text = SPrefs.GetString("PLAYER_FEEDERS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CFeeders[] collection11 = JsonHelper.FromJson<CFeeders>(text);
|
|
List<CFeeders> list11 = new List<CFeeders>();
|
|
list11.AddRange(collection11);
|
|
PlayerFeeders = list11;
|
|
Debug.Log("Load player feeders");
|
|
}
|
|
break;
|
|
case ItemType.Hook:
|
|
PlayerHooks.Clear();
|
|
text = SPrefs.GetString("PLAYER_HOOKS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CHooks[] collection9 = JsonHelper.FromJson<CHooks>(text);
|
|
List<CHooks> list9 = new List<CHooks>();
|
|
list9.AddRange(collection9);
|
|
PlayerHooks = list9;
|
|
Debug.Log("Load player hooks");
|
|
}
|
|
break;
|
|
case ItemType.Bait:
|
|
PlayerBaits.Clear();
|
|
text = SPrefs.GetString("PLAYER_BAITS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CBaits[] collection7 = JsonHelper.FromJson<CBaits>(text);
|
|
List<CBaits> list7 = new List<CBaits>();
|
|
list7.AddRange(collection7);
|
|
PlayerBaits = list7;
|
|
Debug.Log("Load player baits");
|
|
}
|
|
break;
|
|
case ItemType.Weight:
|
|
PlayerWeights.Clear();
|
|
text = SPrefs.GetString("PLAYER_WEIGHTS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CWeights[] collection5 = JsonHelper.FromJson<CWeights>(text);
|
|
List<CWeights> list5 = new List<CWeights>();
|
|
list5.AddRange(collection5);
|
|
PlayerWeights = list5;
|
|
Debug.Log("Load player weights");
|
|
}
|
|
break;
|
|
case ItemType.Accesories:
|
|
PlayerAccesories.Clear();
|
|
text = SPrefs.GetString("PLAYER_ACCESORIES_" + currentPlayerProfileIndex);
|
|
Debug.Log("equipmentData:" + text);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CAccesories[] collection3 = JsonHelper.FromJson<CAccesories>(text);
|
|
List<CAccesories> list3 = new List<CAccesories>();
|
|
list3.AddRange(collection3);
|
|
PlayerAccesories = list3;
|
|
Debug.Log("Load player accesories");
|
|
}
|
|
break;
|
|
case ItemType.Groundbaits:
|
|
PlayerGroundbaits.Clear();
|
|
text = SPrefs.GetString("PLAYER_GROUNDBAITS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CGroundbaits[] collection = JsonHelper.FromJson<CGroundbaits>(text);
|
|
List<CGroundbaits> list = new List<CGroundbaits>();
|
|
list.AddRange(collection);
|
|
PlayerGroundbaits = list;
|
|
Debug.Log("Load player groundbaits");
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
public void LoadAllPlayerData()
|
|
{
|
|
LoadEquipment(ItemType.Rod);
|
|
LoadEquipment(ItemType.Reel);
|
|
LoadEquipment(ItemType.Line);
|
|
LoadEquipment(ItemType.Float);
|
|
LoadEquipment(ItemType.Leader);
|
|
LoadEquipment(ItemType.Feeder);
|
|
LoadEquipment(ItemType.Hook);
|
|
LoadEquipment(ItemType.Bait);
|
|
LoadEquipment(ItemType.Weight);
|
|
LoadEquipment(ItemType.Accesories);
|
|
LoadEquipment(ItemType.Groundbaits);
|
|
LoadEquipmentSlots();
|
|
LoadShopBasket();
|
|
LoadFishNet();
|
|
LoadQuests();
|
|
LoadWeeklyQuests();
|
|
LoadMonthlyQuests();
|
|
LoadAquarium();
|
|
LoadTrophy();
|
|
LoadSkills();
|
|
LoadPersonalRecords();
|
|
LoadLicences();
|
|
LoadTokens();
|
|
SetValuesForSandboxMode();
|
|
}
|
|
|
|
private void SetValuesForSandboxMode()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.IsCurrentlySandbox())
|
|
{
|
|
SaveDataManager.SavePlayerDataClass currentPlayerData = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData();
|
|
currentPlayerData.PlayerCash = 1000000f;
|
|
currentPlayerData.QuestPoints = 1000000;
|
|
currentPlayerData.PlayerExp = 1f;
|
|
currentPlayerData.PlayerMaxExp = 1f;
|
|
currentPlayerData.PlayerLevel = 99;
|
|
currentPlayerData.PlayerSkillsPoint = 1000000;
|
|
currentPlayerData.PlayerFishNetLevel = Instance._playerData.fishNetMaxExp.Length;
|
|
currentPlayerData.AmountOfQuestChangesAvailable = 1000000;
|
|
currentPlayerData.PlayerLicenses.Clear();
|
|
currentPlayerData.PlayerLicenses.Add(new CLicences
|
|
{
|
|
mapId = 0
|
|
});
|
|
currentPlayerData.PlayerLicenses.Add(new CLicences
|
|
{
|
|
mapId = 1
|
|
});
|
|
currentPlayerData.PlayerLicenses.Add(new CLicences
|
|
{
|
|
mapId = 3
|
|
});
|
|
currentPlayerData.PlayerLicenses.Add(new CLicences
|
|
{
|
|
mapId = 4
|
|
});
|
|
currentPlayerData.PlayerLicenses.Add(new CLicences
|
|
{
|
|
mapId = 5
|
|
});
|
|
currentPlayerData.PlayerLicenses.Add(new CLicences
|
|
{
|
|
mapId = 6
|
|
});
|
|
currentPlayerData.PlayerLicenses.Add(new CLicences
|
|
{
|
|
mapId = 7
|
|
});
|
|
}
|
|
}
|
|
|
|
public void LoadEquipmentSlots()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerSlotsEquip.Clear();
|
|
SetSlotsTemplates();
|
|
string text = SPrefs.GetString("PLAYER_EQUIPSLOTS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CSlots[] collection = JsonHelper.FromJson<CSlots>(text);
|
|
List<CSlots> list = new List<CSlots>();
|
|
list.AddRange(collection);
|
|
PlayerSlotsEquip = list;
|
|
Debug.Log("Load player equipment slots");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadShopBasket()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerShopBasket.basketItems.Clear();
|
|
string text = SPrefs.GetString("PLAYER_BASKET_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CBasket.CBasketItem[] collection = JsonHelper.FromJson<CBasket.CBasketItem>(text);
|
|
List<CBasket.CBasketItem> list = new List<CBasket.CBasketItem>();
|
|
list.AddRange(collection);
|
|
PlayerShopBasket.basketItems = list;
|
|
Debug.Log("Load player shop basket");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadFishNet()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerFishNet.Clear();
|
|
string text = SPrefs.GetString("PLAYER_FISHNET_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CFishNet[] collection = JsonHelper.FromJson<CFishNet>(text);
|
|
List<CFishNet> list = new List<CFishNet>();
|
|
list.AddRange(collection);
|
|
PlayerFishNet = list;
|
|
Debug.Log("Load player fishnet");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadTrophy()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerTrophy.Clear();
|
|
string text = SPrefs.GetString("PLAYER_TROPHY_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CTrophy[] collection = JsonHelper.FromJson<CTrophy>(text);
|
|
List<CTrophy> list = new List<CTrophy>();
|
|
list.AddRange(collection);
|
|
PlayerTrophy = list;
|
|
Debug.Log("Load player trophy");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadLicences()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerLicences.Clear();
|
|
string text = SPrefs.GetString("PLAYER_LICENCES_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CLicences[] collection = JsonHelper.FromJson<CLicences>(text);
|
|
List<CLicences> list = new List<CLicences>();
|
|
list.AddRange(collection);
|
|
PlayerLicences = list;
|
|
Debug.Log("Load player licences");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadAquarium()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
for (int i = 0; i < PlayerAquarium.Count; i++)
|
|
{
|
|
PlayerAquarium[i].fish.Clear();
|
|
}
|
|
string text = SPrefs.GetString("PLAYER_AQUARIUM_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CAquarium[] collection = JsonHelper.FromJson<CAquarium>(text);
|
|
List<CAquarium> list = new List<CAquarium>();
|
|
list.AddRange(collection);
|
|
PlayerAquarium = list;
|
|
Debug.Log("Load player aquarium");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadSkills()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerSkills.Clear();
|
|
string text = SPrefs.GetString("PLAYER_SKILLS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CSkills[] collection = JsonHelper.FromJson<CSkills>(text);
|
|
List<CSkills> list = new List<CSkills>();
|
|
list.AddRange(collection);
|
|
PlayerSkills = list;
|
|
Debug.Log("Load player skills");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadPersonalRecords()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerPersonalRecords.Clear();
|
|
string text = SPrefs.GetString("PLAYER_PERSONAL_RECORDS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CPersonalRecords[] collection = JsonHelper.FromJson<CPersonalRecords>(text);
|
|
List<CPersonalRecords> list = new List<CPersonalRecords>();
|
|
list.AddRange(collection);
|
|
PlayerPersonalRecords = list;
|
|
Debug.Log("Load player personal records");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadQuests()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerQuest.Clear();
|
|
string text = SPrefs.GetString("PLAYER_QUESTS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CQuest[] collection = JsonHelper.FromJson<CQuest>(text);
|
|
List<CQuest> list = new List<CQuest>();
|
|
list.AddRange(collection);
|
|
PlayerQuest = list;
|
|
Debug.Log("Load player quests");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadWeeklyQuests()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerWeeklyQuest.Clear();
|
|
string text = SPrefs.GetString("PLAYER_WEEKLY_QUESTS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CQuest[] collection = JsonHelper.FromJson<CQuest>(text);
|
|
List<CQuest> list = new List<CQuest>();
|
|
list.AddRange(collection);
|
|
PlayerWeeklyQuest = list;
|
|
Debug.Log("Load player weekly quests");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadMonthlyQuests()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
PlayerMonthlyQuest.Clear();
|
|
string text = SPrefs.GetString("PLAYER_MONTHLY_QUESTS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
CQuest[] collection = JsonHelper.FromJson<CQuest>(text);
|
|
List<CQuest> list = new List<CQuest>();
|
|
list.AddRange(collection);
|
|
PlayerMonthlyQuest = list;
|
|
Debug.Log("Load player monthly quests");
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadTokens()
|
|
{
|
|
if (currentPlayerProfileIndex != -1)
|
|
{
|
|
for (int i = 0; i < instance._playerData.PlayerBoostTokens.Count; i++)
|
|
{
|
|
instance._playerData.PlayerBoostTokens[i].ResetAmount();
|
|
}
|
|
string text = SPrefs.GetString("PLAYER_TOKENS_" + currentPlayerProfileIndex);
|
|
if (!string.IsNullOrEmpty(text))
|
|
{
|
|
BoostToken[] collection = JsonHelper.FromJson<BoostToken>(text);
|
|
List<BoostToken> list = new List<BoostToken>();
|
|
list.AddRange(collection);
|
|
PlayerBoostTokens = list;
|
|
Debug.Log("Load player tokens");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public class PersonalRecordArgs
|
|
{
|
|
public FishSpecies fishSpecies;
|
|
|
|
public float biggestFishWeight;
|
|
|
|
public float currentFishWeight;
|
|
}
|
|
|
|
private static GameManager instance;
|
|
|
|
public static GameState CurrentGameState;
|
|
|
|
public ePlatform Platform;
|
|
|
|
public bool isDevModeAllowed;
|
|
|
|
public string addectiveSceneLoaded = "none";
|
|
|
|
public bool addectiveSceneLoading;
|
|
|
|
public ControllerType controllerType = ControllerType.GamePad;
|
|
|
|
public GameObject sceneLoaderPrefab;
|
|
|
|
public SceneLoadedType currentSceneLoadedType;
|
|
|
|
public BoostTokens boostTokensModule;
|
|
|
|
public GameRods[] gameRods;
|
|
|
|
public GameReels[] gameReels;
|
|
|
|
public GameLines[] gameLines;
|
|
|
|
public GameLeaders[] gameLeaders;
|
|
|
|
public GameBaits[] gameBaits;
|
|
|
|
public GameHooks[] gameHooks;
|
|
|
|
public GameFloats[] gameFloats;
|
|
|
|
public GameFeeders[] gameFeeders;
|
|
|
|
public GameWeights[] gameWeights;
|
|
|
|
public GameAccesories[] gameAccesories;
|
|
|
|
public GameGroundbait[] gameGroundbaits;
|
|
|
|
public GameFish[] gameFish;
|
|
|
|
public GamePackages[] gamePackages;
|
|
|
|
public GameDLC[] gameDLC;
|
|
|
|
public GamePackages[] gameSets;
|
|
|
|
public GameLocations[] gameLocations;
|
|
|
|
public GameQuest[] gameQuests;
|
|
|
|
public GameQuest gameHalloweenQuests;
|
|
|
|
public GameSkills[] gameSkills;
|
|
|
|
public RankingRewards[] rankingReward;
|
|
|
|
public RentierRewards[] rentierRewards;
|
|
|
|
public PlayerData _playerData;
|
|
|
|
public float FISH_EXP_FACTOR = 2.37f;
|
|
|
|
public GameObject MessagePopupPrefab;
|
|
|
|
public GameObject MessagePopupAccesoryPrefab;
|
|
|
|
private GameObject currentMessagePopup;
|
|
|
|
private GameObject currentMessageAccesoryPopup;
|
|
|
|
public GameObject LevelPopUpPrefab;
|
|
|
|
[HideInInspector]
|
|
public GameObject currentLevelPopUp;
|
|
|
|
public GameObject rewardPopUp;
|
|
|
|
public GameObject WelcomeTutorialPopUp;
|
|
|
|
public GameObject rentierRewardPopUp;
|
|
|
|
public GameObject canvasItemViewerPrefab;
|
|
|
|
[HideInInspector]
|
|
public ItemsViewer currentItemsViewer;
|
|
|
|
public AudioSource audioSource;
|
|
|
|
public AudioClip hoverButtonSound;
|
|
|
|
public AudioClip clickButtonSound;
|
|
|
|
public AnimationCurve reelspeedCurve;
|
|
|
|
public Player player;
|
|
|
|
public Transform CurrentlyScrollable;
|
|
|
|
public static Action<PersonalRecordArgs> OnCheckFishPersonalRecord;
|
|
|
|
[HideInInspector]
|
|
public List<MessageBox> messageBoxStack = new List<MessageBox>();
|
|
|
|
public GameObject[] MessageBoxesPrefab;
|
|
|
|
[HideInInspector]
|
|
public MessageBox currentMessageView;
|
|
|
|
[HideInInspector]
|
|
public MessageBox.Status lastMsgStatus;
|
|
|
|
public static bool IsGameLoadedFromFirstScene;
|
|
|
|
private bool isShowedControllerBuggy;
|
|
|
|
private bool isGamePauzed;
|
|
|
|
[HideInInspector]
|
|
public PlayerResidence playerResidence;
|
|
|
|
[HideInInspector]
|
|
public FishCatchPanel fishCatchPanel;
|
|
|
|
private bool? lastCursorStatus;
|
|
|
|
public static GameManager Instance => instance;
|
|
|
|
public static bool IsDevModeAllowed
|
|
{
|
|
get
|
|
{
|
|
if (!instance)
|
|
{
|
|
return false;
|
|
}
|
|
return instance.isDevModeAllowed;
|
|
}
|
|
}
|
|
|
|
private void Awake()
|
|
{
|
|
player = ReInput.players.GetPlayer(0);
|
|
UnityEngine.Object.DontDestroyOnLoad(this);
|
|
if (instance == null)
|
|
{
|
|
instance = this;
|
|
}
|
|
else if (instance != this)
|
|
{
|
|
UnityEngine.Object.Destroy(base.gameObject);
|
|
}
|
|
}
|
|
|
|
public void PlayOnClickSound()
|
|
{
|
|
if ((bool)audioSource)
|
|
{
|
|
audioSource.PlayOneShot(clickButtonSound);
|
|
}
|
|
}
|
|
|
|
public void PlayHoverSound()
|
|
{
|
|
if ((bool)audioSource)
|
|
{
|
|
audioSource.PlayOneShot(hoverButtonSound);
|
|
}
|
|
}
|
|
|
|
public static int GetPlayerSexIndex()
|
|
{
|
|
return Instance._playerData.Player[Instance._playerData.currentPlayerProfileIndex].playerSexIndex;
|
|
}
|
|
|
|
public void ShowItemViewer(GameObject itemObject, Transform canvasTransform, string itemName, Sprite logoBrand = null)
|
|
{
|
|
if (!(itemObject == null) && !currentItemsViewer)
|
|
{
|
|
Debug.Log("Show item: " + itemObject.name);
|
|
PlayerHeader playerHeader = UnityEngine.Object.FindObjectOfType<PlayerHeader>();
|
|
if ((bool)playerHeader)
|
|
{
|
|
canvasTransform = playerHeader.transform.parent;
|
|
}
|
|
currentItemsViewer = UnityEngine.Object.Instantiate(canvasItemViewerPrefab, canvasTransform).GetComponent<ItemsViewer>();
|
|
currentItemsViewer.assignItemView = itemObject;
|
|
currentItemsViewer.nameText.text = itemName;
|
|
if ((bool)logoBrand)
|
|
{
|
|
currentItemsViewer.logoBrand.sprite = logoBrand;
|
|
currentItemsViewer.logoBrand.enabled = true;
|
|
}
|
|
else
|
|
{
|
|
currentItemsViewer.logoBrand.enabled = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void ShowLevelUpPopUp(Transform canvas_tramsform)
|
|
{
|
|
if (!(currentLevelPopUp != null))
|
|
{
|
|
currentLevelPopUp = UnityEngine.Object.Instantiate(LevelPopUpPrefab, canvas_tramsform);
|
|
}
|
|
}
|
|
|
|
public void CloseLevelUpPopUp()
|
|
{
|
|
if (!(currentLevelPopUp == null))
|
|
{
|
|
UnityEngine.Object.Destroy(currentLevelPopUp);
|
|
Instance._playerData.CheckLevel();
|
|
}
|
|
}
|
|
|
|
public void ShowMessagePopup(string MsgText, Transform canvas_tramsform, bool deleteLast = false, bool animEnable = true)
|
|
{
|
|
if (!deleteLast)
|
|
{
|
|
if (currentMessagePopup != null)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
else if (currentMessagePopup != null)
|
|
{
|
|
UnityEngine.Object.Destroy(currentMessagePopup);
|
|
}
|
|
currentMessagePopup = UnityEngine.Object.Instantiate(MessagePopupPrefab, canvas_tramsform);
|
|
currentMessagePopup.GetComponent<MessagePopup>().msgText.text = MsgText;
|
|
if (!animEnable)
|
|
{
|
|
currentMessagePopup.GetComponent<Animator>().enabled = false;
|
|
}
|
|
}
|
|
|
|
public void ShowMessageAccesoryPopup(string MsgText, Transform canvas_tramsform, bool deleteLast = false)
|
|
{
|
|
if (!deleteLast)
|
|
{
|
|
if (currentMessageAccesoryPopup != null)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
else if (currentMessageAccesoryPopup != null)
|
|
{
|
|
UnityEngine.Object.Destroy(currentMessageAccesoryPopup);
|
|
}
|
|
currentMessageAccesoryPopup = UnityEngine.Object.Instantiate(MessagePopupAccesoryPrefab, canvas_tramsform);
|
|
currentMessageAccesoryPopup.GetComponent<MessagePopup>().msgText.text = MsgText;
|
|
}
|
|
|
|
public string formatNumber(long num)
|
|
{
|
|
long num2 = (long)Math.Pow(10.0, (int)Math.Max(0.0, Math.Log10(num) - 2.0));
|
|
if (num >= 1000000000)
|
|
{
|
|
num = num / num2 * num2;
|
|
return ((double)num / 1000000000.0).ToString("0.##") + "B";
|
|
}
|
|
if (num >= 1000000)
|
|
{
|
|
num = num / num2 * num2;
|
|
return ((double)num / 1000000.0).ToString("0.##") + "M";
|
|
}
|
|
if (num >= 1000)
|
|
{
|
|
num = num / num2 * num2;
|
|
return ((double)num / 1000.0).ToString("0.##") + "K";
|
|
}
|
|
return num.ToString("F2");
|
|
}
|
|
|
|
public string FormatTimeSeconds(float elapsed)
|
|
{
|
|
int num = (int)(elapsed * 100f);
|
|
int num2 = num / 6000;
|
|
int num3 = num % 6000 / 100;
|
|
return $"{num2:00}:{num3:00}";
|
|
}
|
|
|
|
public void DeleteCurrentMessageAccesoryPopup()
|
|
{
|
|
if (currentMessageAccesoryPopup != null)
|
|
{
|
|
UnityEngine.Object.Destroy(currentMessageAccesoryPopup);
|
|
}
|
|
}
|
|
|
|
private void CheckMessagesBox()
|
|
{
|
|
if (messageBoxStack.Count == 0)
|
|
{
|
|
return;
|
|
}
|
|
for (int i = 0; i < messageBoxStack.Count; i++)
|
|
{
|
|
if (currentMessageView != null)
|
|
{
|
|
break;
|
|
}
|
|
messageBoxStack[i].View();
|
|
currentMessageView = messageBoxStack[i];
|
|
lastMsgStatus = MessageBox.Status.Wait;
|
|
}
|
|
}
|
|
|
|
public void CreateMessageBox(string msgText, Transform dstParent, int msgCode = -1, int prefabIndex = 0)
|
|
{
|
|
MessageBox messageBox = new MessageBox();
|
|
messageBox.indexOfPrefabs = prefabIndex;
|
|
messageBox.dstParent = dstParent;
|
|
messageBox.message_key = msgText;
|
|
messageBox.indexOfMessageType = msgCode;
|
|
messageBoxStack.Add(messageBox);
|
|
}
|
|
|
|
public void DestroyMessageBoxList()
|
|
{
|
|
messageBoxStack.Remove(currentMessageView);
|
|
currentMessageView = null;
|
|
}
|
|
|
|
public void ControllerVibrate(float stregth, int seconds)
|
|
{
|
|
player.SetVibration(0, stregth, seconds);
|
|
}
|
|
|
|
private IEnumerator StopVibrate(int seconds)
|
|
{
|
|
yield return new WaitForSeconds(seconds);
|
|
player.StopVibration();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
IsGameLoadedFromFirstScene = false;
|
|
if (SceneManager.GetActiveScene().name == "Prezencyjna")
|
|
{
|
|
Debug.Log(">>>>>>>>>>>>>>>>>>>>>>> Game Loaded from Prezencyjna version " + Application.version);
|
|
IsGameLoadedFromFirstScene = true;
|
|
}
|
|
if (PlayerPrefs.HasKey("CHECK_VERSION_DATE"))
|
|
{
|
|
if (uint.TryParse(PlayerPrefs.GetString("CHECK_VERSION_DATE"), out var result))
|
|
{
|
|
Debug.Log("sprawdzanie pliku wersji gry");
|
|
if (result < 1660718648)
|
|
{
|
|
Debug.Log("Data wersji gry przedawniona");
|
|
}
|
|
Debug.Log("Pliku wersji gry... OK");
|
|
CreateCheckFile();
|
|
Debug.Log("Aktualizacja Pliku wersji gry... OK");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
CreateCheckFile();
|
|
}
|
|
InvokeRepeating("AquariumsUpdate", 5f, 5f);
|
|
player = ReInput.players.GetPlayer(0);
|
|
}
|
|
|
|
private void CreateCheckFile()
|
|
{
|
|
DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
string text = ((uint)(DateTime.UtcNow - dateTime).TotalSeconds).ToString();
|
|
PlayerPrefs.SetString("CHECK_VERSION_DATE", text);
|
|
Debug.Log("Create version file: " + text);
|
|
}
|
|
|
|
public string GetQuestDescription(GameQuest gamequest)
|
|
{
|
|
string result = "";
|
|
switch (gamequest.questObjectiveType)
|
|
{
|
|
case GameQuest.QuestObjectiveType.Catch_fish:
|
|
result = LanguageManager.Instance.GetText("QUEST_CATCH_FISH").Replace("{NUMBER}", $"{gamequest.objectiveValue}");
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_species:
|
|
result = LanguageManager.Instance.GetText("QUEST_FISH_BY_SPECIES").Replace("{WEIGHT}", Instance.ConvertWeight(gamequest.objectiveValue) + " ") + ": " + Instance.gameFish[(int)gamequest.objectivefishSpecies].GetFishName();
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_by_weight:
|
|
result = LanguageManager.Instance.GetText("QUEST_FISH_BY_WEIGHT").Replace("{WEIGHT}", Instance.ConvertWeight(gamequest.objectiveValue) ?? "");
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Catch_fish_total_weight:
|
|
result = LanguageManager.Instance.GetText("QUEST_FISH_TOTAL_WEIGHT").Replace("{WEIGHT}", Instance.ConvertWeight(gamequest.objectiveValue) ?? "");
|
|
break;
|
|
case GameQuest.QuestObjectiveType.Spend_time:
|
|
result = LanguageManager.Instance.GetText("QUEST_SPEND_TIME").Replace("{TIME}", $"{gamequest.objectiveValue} min");
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
private void OnDestroy()
|
|
{
|
|
if (!(instance != this))
|
|
{
|
|
Debug.Log("GameManager Destroy");
|
|
if ((bool)ServerManager.Instance)
|
|
{
|
|
ServerManager.Instance.socket.Instance.Close();
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool ChechIfPlayerShouldBeStoppedFromDoingAnything()
|
|
{
|
|
if (Singleton<Boat>.Instance == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (Singleton<Boat>.Instance.currentPlayerCharacter == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (FScriptsHandler.Instance == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (FScriptsHandler.Instance.m_PlayerMain == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (FScriptsHandler.Instance.m_PlayerMain.currentRod == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (FScriptsHandler.Instance.m_PlayerMain.currentRod.currentFish == null)
|
|
{
|
|
return false;
|
|
}
|
|
if (FScriptsHandler.Instance.m_PlayerMain.currentRod.currentFish.isInWater)
|
|
{
|
|
return false;
|
|
}
|
|
if (Time.timeScale == 0f)
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
CheckSceneExit();
|
|
CheckMessagesBox();
|
|
AddectiveScenesControler();
|
|
DevButtons();
|
|
_playerData.UpdateGameTime();
|
|
}
|
|
|
|
private void FixedUpdate()
|
|
{
|
|
}
|
|
|
|
private void AquariumsUpdate()
|
|
{
|
|
_playerData.AquariumsTimer();
|
|
}
|
|
|
|
private void DevButtons()
|
|
{
|
|
if (!new HashSet<ulong> { 76561198005454076uL, 76561198858088612uL, 76561198134227923uL, 76561198053487790uL, 76561198313646091uL, 76561198805769253uL, 76561198396981325uL, 76561199366610894uL }.Contains(SteamUser.GetSteamID().m_SteamID))
|
|
{
|
|
if (!SteamApps.GetCurrentBetaName(out var pchName, 100))
|
|
{
|
|
return;
|
|
}
|
|
pchName = pchName.ToLower();
|
|
if (!pchName.Contains("test"))
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.RightShift))
|
|
{
|
|
isDevModeAllowed = !isDevModeAllowed;
|
|
Transform canvas_tramsform = (FScriptsHandler.Instance ? FScriptsHandler.Instance.m_Canvas.transform : UnityEngine.Object.FindObjectOfType<Canvas>().transform);
|
|
if (isDevModeAllowed)
|
|
{
|
|
instance.ShowMessagePopup("Dev mode ON", canvas_tramsform, deleteLast: true);
|
|
}
|
|
else
|
|
{
|
|
instance.ShowMessagePopup("Dev mode OFF", canvas_tramsform, deleteLast: true);
|
|
}
|
|
}
|
|
if (isDevModeAllowed && _playerData.currentPlayerProfileIndex != -1)
|
|
{
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Alpha1))
|
|
{
|
|
_playerData.AddSubPlayerExp(500f);
|
|
}
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Alpha2))
|
|
{
|
|
_playerData.AddFishToQuest((FishSpecies)UnityEngine.Random.Range(0, 4), UnityEngine.Random.Range(0.2f, 3f));
|
|
}
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Alpha3))
|
|
{
|
|
FishSpecies fishId = (FishSpecies)UnityEngine.Random.Range(0, 8);
|
|
float fishWeight = UnityEngine.Random.Range(0.2f, 2f);
|
|
_playerData.AddFishToFishNet(FishSpecies.GrouperMalabar, fishWeight, Instance.GetFishPrice((int)fishId, fishWeight));
|
|
_playerData.AddFishToFishNet(FishSpecies.BaikalBlackGrayling, fishWeight, Instance.GetFishPrice((int)fishId, fishWeight));
|
|
}
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Alpha4))
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().QuestPoints += 50;
|
|
}
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Alpha5))
|
|
{
|
|
_playerData.AddSubPlayerCashValue(1000f);
|
|
}
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Alpha0))
|
|
{
|
|
PlayerPrefs.DeleteKey("CHECK_VERSION_DATE");
|
|
}
|
|
if (Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.Alpha6))
|
|
{
|
|
float num = (float)Math.Round(Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerMaxExp, 0);
|
|
_playerData.AddSubPlayerExp(num * 0.3f);
|
|
}
|
|
}
|
|
}
|
|
|
|
public static int GetUniqueNumber()
|
|
{
|
|
string text = "";
|
|
for (int i = 0; i < 4; i++)
|
|
{
|
|
int[] array = (from n in Enumerable.Range(0, 5)
|
|
orderby Guid.NewGuid()
|
|
select n).Take(2).ToArray();
|
|
for (int num = 0; num < array.Length; num++)
|
|
{
|
|
text += array[num];
|
|
}
|
|
}
|
|
return int.Parse(text);
|
|
}
|
|
|
|
public int GetGameItemAmount(ItemType itemType, int itemID)
|
|
{
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
{
|
|
for (int l = 0; l < gameRods.Length; l++)
|
|
{
|
|
if (gameRods[l].id == itemID)
|
|
{
|
|
return 1;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Reel:
|
|
{
|
|
for (int num2 = 0; num2 < gameReels.Length; num2++)
|
|
{
|
|
if (gameReels[num2].id == itemID)
|
|
{
|
|
return 1;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Line:
|
|
{
|
|
for (int num4 = 0; num4 < gameLines.Length; num4++)
|
|
{
|
|
if (gameLines[num4].id == itemID)
|
|
{
|
|
return 1;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Leader:
|
|
{
|
|
for (int n = 0; n < gameLeaders.Length; n++)
|
|
{
|
|
if (gameLeaders[n].id == itemID)
|
|
{
|
|
return gameLeaders[n].amount;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Float:
|
|
{
|
|
for (int j = 0; j < gameFloats.Length; j++)
|
|
{
|
|
if (gameFloats[j].id == itemID)
|
|
{
|
|
return gameFloats[j].amount;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Hook:
|
|
{
|
|
for (int num3 = 0; num3 < gameHooks.Length; num3++)
|
|
{
|
|
if (gameHooks[num3].id == itemID)
|
|
{
|
|
return gameHooks[num3].amount;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Bait:
|
|
{
|
|
for (int num = 0; num < gameBaits.Length; num++)
|
|
{
|
|
if (gameBaits[num].id == itemID)
|
|
{
|
|
return gameBaits[num].amount;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Feeder:
|
|
{
|
|
for (int m = 0; m < gameFeeders.Length; m++)
|
|
{
|
|
if (gameFeeders[m].id == itemID)
|
|
{
|
|
return gameFeeders[m].amount;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Weight:
|
|
{
|
|
for (int k = 0; k < gameWeights.Length; k++)
|
|
{
|
|
if (gameWeights[k].id == itemID)
|
|
{
|
|
return gameWeights[k].amount;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Accesories:
|
|
{
|
|
for (int i = 0; i < gameAccesories.Length; i++)
|
|
{
|
|
if (gameAccesories[i].id == itemID)
|
|
{
|
|
return 1;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public string GetGameItemName(ItemType itemType, int itemID)
|
|
{
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
{
|
|
for (int l = 0; l < gameRods.Length; l++)
|
|
{
|
|
if (gameRods[l].id == itemID)
|
|
{
|
|
if (gameRods[l].name_language_key != "")
|
|
{
|
|
return LanguageManager.Instance.GetText(gameRods[l].name_language_key);
|
|
}
|
|
return gameRods[l].name;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Reel:
|
|
{
|
|
for (int num2 = 0; num2 < gameReels.Length; num2++)
|
|
{
|
|
if (gameReels[num2].id == itemID)
|
|
{
|
|
if (gameReels[num2].name_language_key != "")
|
|
{
|
|
return LanguageManager.Instance.GetText(gameReels[num2].name_language_key);
|
|
}
|
|
return gameReels[num2].name;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Line:
|
|
{
|
|
for (int num4 = 0; num4 < gameLines.Length; num4++)
|
|
{
|
|
if (gameLines[num4].id == itemID)
|
|
{
|
|
if (gameLines[num4].name_language_key != "")
|
|
{
|
|
return LanguageManager.Instance.GetText(gameLines[num4].name_language_key);
|
|
}
|
|
return gameLines[num4].name;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Leader:
|
|
{
|
|
for (int n = 0; n < gameLeaders.Length; n++)
|
|
{
|
|
if (gameLeaders[n].id == itemID)
|
|
{
|
|
gameLeaders[n].GetName();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Float:
|
|
{
|
|
for (int j = 0; j < gameFloats.Length; j++)
|
|
{
|
|
if (gameFloats[j].id == itemID)
|
|
{
|
|
if (gameFloats[j].name_language_key != "")
|
|
{
|
|
return LanguageManager.Instance.GetText(gameFloats[j].name_language_key);
|
|
}
|
|
return gameFloats[j].name;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Hook:
|
|
{
|
|
for (int num3 = 0; num3 < gameHooks.Length; num3++)
|
|
{
|
|
if (gameHooks[num3].id == itemID)
|
|
{
|
|
return gameHooks[num3].GetName();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Bait:
|
|
{
|
|
for (int num = 0; num < gameBaits.Length; num++)
|
|
{
|
|
if (gameBaits[num].id == itemID)
|
|
{
|
|
return gameBaits[num].GetName();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Feeder:
|
|
{
|
|
for (int m = 0; m < gameFeeders.Length; m++)
|
|
{
|
|
if (gameFeeders[m].id == itemID)
|
|
{
|
|
if (gameFeeders[m].name_language_key != "")
|
|
{
|
|
return LanguageManager.Instance.GetText(gameFeeders[m].name_language_key);
|
|
}
|
|
return gameFeeders[m].name;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Weight:
|
|
{
|
|
for (int k = 0; k < gameWeights.Length; k++)
|
|
{
|
|
if (gameWeights[k].id == itemID)
|
|
{
|
|
return gameWeights[k].GetName();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Accesories:
|
|
{
|
|
for (int i = 0; i < gameAccesories.Length; i++)
|
|
{
|
|
if (gameAccesories[i].id == itemID)
|
|
{
|
|
return gameAccesories[i].GetName();
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return "brak w funkcji GetGameItemName";
|
|
}
|
|
|
|
public int GetIndexByItemId(ItemType itemType, int itemID)
|
|
{
|
|
switch (itemType)
|
|
{
|
|
case ItemType.Rod:
|
|
{
|
|
for (int l = 0; l < gameRods.Length; l++)
|
|
{
|
|
if (gameRods[l].id == itemID)
|
|
{
|
|
return l;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Reel:
|
|
{
|
|
for (int num2 = 0; num2 < gameReels.Length; num2++)
|
|
{
|
|
if (gameReels[num2].id == itemID)
|
|
{
|
|
return num2;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Line:
|
|
{
|
|
for (int num4 = 0; num4 < gameLines.Length; num4++)
|
|
{
|
|
if (gameLines[num4].id == itemID)
|
|
{
|
|
return num4;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Leader:
|
|
{
|
|
for (int n = 0; n < gameLeaders.Length; n++)
|
|
{
|
|
if (gameLeaders[n].id == itemID)
|
|
{
|
|
return n;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Float:
|
|
{
|
|
for (int j = 0; j < gameFloats.Length; j++)
|
|
{
|
|
if (gameFloats[j].id == itemID)
|
|
{
|
|
return j;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Hook:
|
|
{
|
|
for (int num3 = 0; num3 < gameHooks.Length; num3++)
|
|
{
|
|
if (gameHooks[num3].id == itemID)
|
|
{
|
|
return num3;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Bait:
|
|
{
|
|
for (int num = 0; num < gameBaits.Length; num++)
|
|
{
|
|
if (gameBaits[num].id == itemID)
|
|
{
|
|
return num;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Feeder:
|
|
{
|
|
for (int m = 0; m < gameFeeders.Length; m++)
|
|
{
|
|
if (gameFeeders[m].id == itemID)
|
|
{
|
|
return m;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Weight:
|
|
{
|
|
for (int k = 0; k < gameWeights.Length; k++)
|
|
{
|
|
if (gameWeights[k].id == itemID)
|
|
{
|
|
return k;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
case ItemType.Accesories:
|
|
{
|
|
for (int i = 0; i < gameAccesories.Length; i++)
|
|
{
|
|
if (gameAccesories[i].id == itemID)
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public void PauseGame()
|
|
{
|
|
if (addectiveSceneLoaded != "none")
|
|
{
|
|
return;
|
|
}
|
|
if (!isGamePauzed)
|
|
{
|
|
if (FScriptsHandler.Instance != null && MultiplayerManager.Instance.CanGameBePaused)
|
|
{
|
|
SetMouseCurrsor(val: true);
|
|
Time.timeScale = 0f;
|
|
isGamePauzed = true;
|
|
}
|
|
}
|
|
else if (FScriptsHandler.Instance != null)
|
|
{
|
|
if (!fishCatchPanel)
|
|
{
|
|
SetMouseCurrsor(val: false);
|
|
}
|
|
Time.timeScale = 1f;
|
|
isGamePauzed = false;
|
|
}
|
|
Debug.Log("Pause game " + isGamePauzed);
|
|
}
|
|
|
|
private void CheckSceneExit()
|
|
{
|
|
if (!(addectiveSceneLoaded != "none") && !(FScriptsHandler.Instance == null) && !SRDebug.Instance.IsDebugPanelVisible && !FishEntity.CurrentFishInFight && (InputManager.isExit || InputManager.isExitByMenu) && Instance.messageBoxStack.Count == 0 && !Singleton<QuickMenu>.Instance.transform.GetChild(0).gameObject.activeSelf)
|
|
{
|
|
ChatManager chatManager = Singleton<ChatManager>.Instance;
|
|
if (!chatManager || !chatManager.IsChatOpen)
|
|
{
|
|
Instance.LoadAddectiveScene("EscapeMenu");
|
|
InputManager.isExit = false;
|
|
InputManager.isExitByMenu = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
private void AddectiveScenesControler()
|
|
{
|
|
if (addectiveSceneLoaded == "none")
|
|
{
|
|
if (FScriptsHandler.Instance != null)
|
|
{
|
|
Time.timeScale = 1f;
|
|
if ((bool)FScriptsHandler.Instance.m_PlayerMain && (bool)FScriptsHandler.Instance.m_PlayerMain.m_Camera && !FScriptsHandler.Instance.m_PlayerMain.m_Camera.enabled && FScriptsHandler.Instance.m_PlayerMain.underWaterCamera == null && FScriptsHandler.Instance.m_PlayerMain.currentAnglerFishView == null)
|
|
{
|
|
FScriptsHandler.Instance.m_PlayerMain.m_Camera.enabled = true;
|
|
if (!fishCatchPanel)
|
|
{
|
|
SetMouseCurrsor(val: false);
|
|
}
|
|
}
|
|
}
|
|
if ((bool)playerResidence)
|
|
{
|
|
Time.timeScale = 1f;
|
|
if (!playerResidence.aquariumFishPanel.activeSelf)
|
|
{
|
|
if (lastCursorStatus != false)
|
|
{
|
|
SetMouseCurrsor(val: false);
|
|
lastCursorStatus = false;
|
|
}
|
|
else if (lastCursorStatus != true)
|
|
{
|
|
lastCursorStatus = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (isGamePauzed || (bool)FishEntity.CurrentFishInFight || Instance.messageBoxStack.Count > 0 || (Singleton<ChatManager>.Instance != null && Singleton<ChatManager>.Instance.IsChatOpen && Time.timeScale > 0f))
|
|
{
|
|
return;
|
|
}
|
|
if (InputManager.isOpenEquipmentScene || InputManager.isOpenEquipmentSceneByMenu)
|
|
{
|
|
InputManager.isOpenEquipmentSceneByMenu = false;
|
|
Instance.LoadAddectiveScene("Equipment");
|
|
}
|
|
if (InputManager.isOpenShopScene || InputManager.isOpenShopSceneByMenu)
|
|
{
|
|
InputManager.isOpenShopSceneByMenu = false;
|
|
Instance.LoadAddectiveScene("Shop");
|
|
}
|
|
if ((InputManager.isOpenLocationMapScene || InputManager.isOpenLocationMapSceneByMenu) && Instance.messageBoxStack.Count == 0)
|
|
{
|
|
InputManager.isOpenLocationMapSceneByMenu = false;
|
|
Instance.LoadAddectiveScene("Map");
|
|
}
|
|
if (InputManager.isOpenSettingsScene || InputManager.isOpenSettingsSceneByMenu)
|
|
{
|
|
InputManager.isOpenSettingsSceneByMenu = false;
|
|
Instance.LoadAddectiveScene("Settings");
|
|
}
|
|
if (InputManager.isOpenHelpPanel || InputManager.isOpenHelpPanelByMenu)
|
|
{
|
|
InputManager.isOpenHelpPanelByMenu = false;
|
|
Instance.LoadAddectiveScene("Help");
|
|
}
|
|
if (!(addectiveSceneLoaded != "none"))
|
|
{
|
|
return;
|
|
}
|
|
if (FScriptsHandler.Instance != null)
|
|
{
|
|
if (MultiplayerManager.Instance.CanGameBePaused)
|
|
{
|
|
Time.timeScale = 0f;
|
|
}
|
|
if (FScriptsHandler.Instance.m_PlayerMain.m_Camera.enabled)
|
|
{
|
|
FScriptsHandler.Instance.m_PlayerMain.m_Camera.enabled = false;
|
|
SetMouseCurrsor(val: true);
|
|
}
|
|
}
|
|
if ((bool)playerResidence)
|
|
{
|
|
if (MultiplayerManager.Instance.CanGameBePaused)
|
|
{
|
|
Time.timeScale = 0f;
|
|
}
|
|
if (addectiveSceneLoaded == "EscapeMenu" && lastCursorStatus != true)
|
|
{
|
|
SetMouseCurrsor(val: true);
|
|
lastCursorStatus = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public void LoadAddectiveScene(string name)
|
|
{
|
|
if (!FScriptsHandler.Instance || !(FScriptsHandler.Instance.m_PlayerMain?.underWaterCamera))
|
|
{
|
|
if (addectiveSceneLoaded == name)
|
|
{
|
|
UnloadAddectiveScene();
|
|
}
|
|
else if (!addectiveSceneLoading)
|
|
{
|
|
StartCoroutine(AddectiveSceneSwitch(name));
|
|
}
|
|
}
|
|
}
|
|
|
|
private IEnumerator AddectiveSceneSwitch(string name)
|
|
{
|
|
AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(name, LoadSceneMode.Additive);
|
|
addectiveSceneLoading = true;
|
|
yield return asyncOperation;
|
|
if (addectiveSceneLoaded != "none")
|
|
{
|
|
UnloadAddectiveScene();
|
|
}
|
|
addectiveSceneLoaded = name;
|
|
addectiveSceneLoading = false;
|
|
}
|
|
|
|
public void UnloadAddectiveScene()
|
|
{
|
|
if (!(addectiveSceneLoaded == "none"))
|
|
{
|
|
SceneManager.UnloadSceneAsync(addectiveSceneLoaded);
|
|
addectiveSceneLoaded = "none";
|
|
}
|
|
}
|
|
|
|
public void SetMouseCurrsor(bool val)
|
|
{
|
|
if (val)
|
|
{
|
|
InputManager inputManager = Singleton<InputManager>.Instance;
|
|
if (controllerType == ControllerType.KeyboardMouse)
|
|
{
|
|
Cursor.visible = true;
|
|
}
|
|
inputManager.SetCursorPositionToScreenCenter();
|
|
Cursor.lockState = CursorLockMode.None;
|
|
}
|
|
else if (controllerType == ControllerType.KeyboardMouse)
|
|
{
|
|
Cursor.visible = false;
|
|
}
|
|
Cursor.visible = val;
|
|
if (!val)
|
|
{
|
|
Cursor.lockState = CursorLockMode.Confined;
|
|
}
|
|
}
|
|
|
|
public string ConvertTextGameTime(Vector2 timeVector)
|
|
{
|
|
string text = timeVector.y.ToString();
|
|
if (timeVector.y < 10f)
|
|
{
|
|
text = "0" + timeVector.y;
|
|
}
|
|
string result = timeVector.x + ":" + text;
|
|
if (Singleton<SaveDataManager>.Instance.SettingsData.TimeConventionIndex == 1)
|
|
{
|
|
result = timeVector.x + ":" + text + " AM";
|
|
if (timeVector.x == 13f)
|
|
{
|
|
result = "1:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 14f)
|
|
{
|
|
result = "2:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 15f)
|
|
{
|
|
result = "3:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 16f)
|
|
{
|
|
result = "4:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 17f)
|
|
{
|
|
result = "5:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 18f)
|
|
{
|
|
result = "6:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 19f)
|
|
{
|
|
result = "7:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 20f)
|
|
{
|
|
result = "8:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 21f)
|
|
{
|
|
result = "9:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 22f)
|
|
{
|
|
result = "10:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 23f)
|
|
{
|
|
result = "11:" + text + " PM";
|
|
}
|
|
if (timeVector.x == 0f)
|
|
{
|
|
result = "00:" + text + "AM";
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public string ConvertWeight(float weight_value)
|
|
{
|
|
if (_playerData.currentPlayerProfileIndex == -1)
|
|
{
|
|
return weight_value.ToString("F2") + " kg";
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.SettingsData.WeightUnitIndex == 1)
|
|
{
|
|
return (weight_value * 2.2046f).ToString("F2") + " lb";
|
|
}
|
|
return weight_value.ToString("F2") + " kg";
|
|
}
|
|
|
|
public float ConvertWeightWithoutUnit(float weight_value)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.SettingsData.WeightUnitIndex == 1)
|
|
{
|
|
return weight_value * 2.2046f;
|
|
}
|
|
return weight_value;
|
|
}
|
|
|
|
public string GetUnitWeight()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.SettingsData.WeightUnitIndex == 1)
|
|
{
|
|
return "lb";
|
|
}
|
|
return "kg";
|
|
}
|
|
|
|
public string GetUnitLength()
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.SettingsData.LengthUnitIndex == 1)
|
|
{
|
|
return " inch";
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.SettingsData.LengthUnitIndex == 2)
|
|
{
|
|
return " ft";
|
|
}
|
|
return "cm";
|
|
}
|
|
|
|
public string ConvertWeightFishToLengthWithUnit(FishSpecies fishSpecies, float weight)
|
|
{
|
|
float num = Instance.gameFish[(int)fishSpecies].ConvertWeightFishToLength(weight);
|
|
string result = "";
|
|
switch (Singleton<SaveDataManager>.Instance.SettingsData.LengthUnitIndex)
|
|
{
|
|
case 0:
|
|
result = num.ToString("F2") + " cm";
|
|
break;
|
|
case 1:
|
|
result = (num * 0.3937f).ToString("F2") + " inch";
|
|
break;
|
|
case 2:
|
|
result = (num * 0.0328f).ToString("F2") + " ft";
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public string ConvertWeightGramWithOz(float weight_value)
|
|
{
|
|
return weight_value.ToString("F2");
|
|
}
|
|
|
|
public string ConvertLenghtWithUnit(float meter, string places = "F2")
|
|
{
|
|
string result = "";
|
|
switch (Singleton<SaveDataManager>.Instance.SettingsData.LengthUnitIndex)
|
|
{
|
|
case 0:
|
|
result = meter.ToString(places) + " m";
|
|
break;
|
|
case 1:
|
|
result = (meter * 39.37f).ToString(places) + " inch";
|
|
break;
|
|
case 2:
|
|
result = (meter * 3.28f).ToString(places) + " ft";
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public string ConvertTemperature(float temperature)
|
|
{
|
|
string result = "";
|
|
switch (Singleton<SaveDataManager>.Instance.SettingsData.TemperatureUnitIndex)
|
|
{
|
|
case 0:
|
|
result = temperature.ToString("F0") + "C";
|
|
break;
|
|
case 1:
|
|
result = (temperature * 9f / 5f + 32f).ToString("F0") + "F";
|
|
break;
|
|
case 2:
|
|
result = ((double)temperature + 273.15).ToString("F0") + "K";
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public string ConvertSeccondsToHMS(int secconds)
|
|
{
|
|
TimeSpan timeSpan = TimeSpan.FromSeconds(secconds);
|
|
return $"{timeSpan.Hours:D1} <hours> {timeSpan.Minutes:D2} <minutes> {timeSpan.Seconds:D2} <seconds>".Replace("<hours>", LanguageManager.Instance.GetText("HOURS_SHORT")).Replace("<minutes>", LanguageManager.Instance.GetText("MINUTES_SHORT")).Replace("<seconds>", LanguageManager.Instance.GetText("SECONDS_SHORT"));
|
|
}
|
|
|
|
public float GetFishPrice(int fishId, float fishWeight)
|
|
{
|
|
float num = fishWeight * instance.gameFish[fishId].speciesCoins;
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.cash_boost_10p))
|
|
{
|
|
num += num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.cash_boost_5p))
|
|
{
|
|
num += num * 0.05f;
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.dealer_10p))
|
|
{
|
|
num += num * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.dealer_5p))
|
|
{
|
|
num += num * 0.05f;
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostCash > 0f)
|
|
{
|
|
num += num * 0.25f;
|
|
}
|
|
return Mathf.Round(num * 100f) / 100f;
|
|
}
|
|
|
|
public float GetFishExp(int fishId, float fishWeight)
|
|
{
|
|
float num = fishWeight * (float)gameFish[fishId].rankingPoint;
|
|
if (gameFish[fishId].rankingPoint == 1 || gameFish[fishId].rankingPoint == 2)
|
|
{
|
|
num *= 2f;
|
|
}
|
|
else if (gameFish[fishId].rankingPoint == 3 || gameFish[fishId].rankingPoint == 4)
|
|
{
|
|
num *= 2.2f;
|
|
}
|
|
else if (gameFish[fishId].rankingPoint == 5 || gameFish[fishId].rankingPoint == 6)
|
|
{
|
|
num *= 2.5f;
|
|
}
|
|
else if (gameFish[fishId].rankingPoint >= 7)
|
|
{
|
|
num *= 2.8f;
|
|
}
|
|
float num2 = Mathf.Ceil(num);
|
|
if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.exp_boost_10p))
|
|
{
|
|
num2 += num2 * 0.1f;
|
|
}
|
|
else if (Singleton<SaveDataManager>.Instance.HasCurrentPlayerSkill(Skills.exp_boost_5p))
|
|
{
|
|
num2 += num2 * 0.05f;
|
|
}
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().TimeBoostExp > 0f)
|
|
{
|
|
num2 += num2 * 0.25f;
|
|
}
|
|
return Mathf.Ceil(num2);
|
|
}
|
|
|
|
public float GetFishExpFromEquipment(int fishId, float fishWeight)
|
|
{
|
|
float value = 0f;
|
|
if ((bool)FScriptsHandler.Instance)
|
|
{
|
|
float currentGearStrength = FScriptsHandler.Instance.m_PlayerMain.GetCurrentGearStrength();
|
|
if (currentGearStrength < fishWeight)
|
|
{
|
|
value = fishWeight - currentGearStrength;
|
|
}
|
|
}
|
|
value = Mathf.Clamp(value, 0f, 30f);
|
|
return Mathf.Ceil(value);
|
|
}
|
|
|
|
public bool CheckFishReccord(int fishId, float fishWeight)
|
|
{
|
|
for (int i = 0; i < Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords.Count; i++)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].fishSpecies == (FishSpecies)fishId)
|
|
{
|
|
if (Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].weight < fishWeight)
|
|
{
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].weight = fishWeight;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].catchDate = $"{DateTime.Now.Day}.{DateTime.Now.Month}.{DateTime.Now.Year}";
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].isNew = true;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].mapId = FScriptsHandler.Instance.m_SceneSettings.sceneID;
|
|
Debug.Log("FScriptsHandler.Instance.m_SceneSettings.sceneID: " + FScriptsHandler.Instance.m_SceneSettings.sceneID);
|
|
PersonalRecordArgs personalRecordArgs = new PersonalRecordArgs();
|
|
personalRecordArgs.fishSpecies = (FishSpecies)fishId;
|
|
personalRecordArgs.biggestFishWeight = Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].weight;
|
|
personalRecordArgs.currentFishWeight = fishWeight;
|
|
OnCheckFishPersonalRecord?.Invoke(personalRecordArgs);
|
|
return true;
|
|
}
|
|
Debug.Log($"[PersonalRecords] Record weight({Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords[i].weight}) be less than catch fish weight ({fishWeight})");
|
|
return false;
|
|
}
|
|
}
|
|
CreatePersonalRecord(fishId, FScriptsHandler.Instance.m_SceneSettings.sceneID, fishWeight);
|
|
Debug.Log($"[PersonalRecord] Create new Personal Record for fish: {(FishSpecies)fishId} (ID {fishId}) weight: {fishWeight}");
|
|
PersonalRecordArgs personalRecordArgs2 = new PersonalRecordArgs();
|
|
personalRecordArgs2.fishSpecies = (FishSpecies)fishId;
|
|
personalRecordArgs2.biggestFishWeight = 0f;
|
|
personalRecordArgs2.currentFishWeight = fishWeight;
|
|
OnCheckFishPersonalRecord?.Invoke(personalRecordArgs2);
|
|
return true;
|
|
}
|
|
|
|
public void CreatePersonalRecord(int catchedFishId, int catchedmapId, float catchedFishWeight)
|
|
{
|
|
PlayerData.CPersonalRecords cPersonalRecords = new PlayerData.CPersonalRecords();
|
|
cPersonalRecords.catchDate = DateTime.Now.Day.ToString("00") + "." + DateTime.Now.Month.ToString("00") + "." + DateTime.Now.Year;
|
|
cPersonalRecords.isNew = true;
|
|
cPersonalRecords.fishSpecies = (FishSpecies)catchedFishId;
|
|
cPersonalRecords.mapId = catchedmapId;
|
|
cPersonalRecords.weight = catchedFishWeight;
|
|
instance._playerData.PlayerPersonalRecords.Add(cPersonalRecords);
|
|
cPersonalRecords.mapId = FScriptsHandler.Instance.m_SceneSettings.sceneID;
|
|
Singleton<SaveDataManager>.Instance.GetCurrentPlayerData().PlayerPersonalRecords.Add(cPersonalRecords);
|
|
}
|
|
|
|
public static float Map(float OldMin, float OldMax, float NewMin, float NewMax, float OldValue)
|
|
{
|
|
float num = OldMax - OldMin;
|
|
float num2 = NewMax - NewMin;
|
|
return (OldValue - OldMin) * num2 / num + NewMin;
|
|
}
|
|
|
|
public static void TruncateContainer(Transform container)
|
|
{
|
|
foreach (Transform item in container)
|
|
{
|
|
UnityEngine.Object.Destroy(item.gameObject);
|
|
}
|
|
}
|
|
|
|
public static int GetTimestamp()
|
|
{
|
|
DateTime dateTime = new DateTime(1982, 1, 15, 0, 0, 0, DateTimeKind.Utc);
|
|
return (int)(DateTime.UtcNow - dateTime).TotalSeconds;
|
|
}
|
|
|
|
public static string GetFishNameFromSpecies(FishSpecies speciesName)
|
|
{
|
|
string result = "Fish unnamed";
|
|
switch (speciesName)
|
|
{
|
|
case FishSpecies.BlackBullhead:
|
|
result = LanguageManager.Instance.GetText("BLACKBULLHEAD");
|
|
break;
|
|
case FishSpecies.Perch:
|
|
result = LanguageManager.Instance.GetText("PERCH");
|
|
break;
|
|
case FishSpecies.PerchYellow:
|
|
result = LanguageManager.Instance.GetText("YELLOW_PERCH");
|
|
break;
|
|
case FishSpecies.SalmonSockeye:
|
|
result = LanguageManager.Instance.GetText("SALMON_SOCKEYE");
|
|
break;
|
|
case FishSpecies.TroutRainbow:
|
|
result = LanguageManager.Instance.GetText("TROUT_RAINBOW");
|
|
break;
|
|
case FishSpecies.BassSmallmouth:
|
|
result = LanguageManager.Instance.GetText("BASS_SMALLMOUTH");
|
|
break;
|
|
case FishSpecies.CommonBream:
|
|
result = LanguageManager.Instance.GetText("COMMON_BREAM");
|
|
break;
|
|
case FishSpecies.Asp:
|
|
result = LanguageManager.Instance.GetText("ASP");
|
|
break;
|
|
case FishSpecies.CommonBarbel:
|
|
result = LanguageManager.Instance.GetText("COMMON_BARBEL");
|
|
break;
|
|
case FishSpecies.BreamSilver:
|
|
result = LanguageManager.Instance.GetText("SILVER_BREAM");
|
|
break;
|
|
case FishSpecies.Burbot:
|
|
result = LanguageManager.Instance.GetText("BURBOT");
|
|
break;
|
|
case FishSpecies.CarpCommon:
|
|
result = LanguageManager.Instance.GetText("COMMON_CARP");
|
|
break;
|
|
case FishSpecies.CarpCrucian:
|
|
result = LanguageManager.Instance.GetText("CRUCIAN_CARP");
|
|
break;
|
|
case FishSpecies.CarpGrass:
|
|
result = LanguageManager.Instance.GetText("GRASS_CARP");
|
|
break;
|
|
case FishSpecies.CarpMirror:
|
|
result = LanguageManager.Instance.GetText("MIRROR_CARP");
|
|
break;
|
|
case FishSpecies.CarpPrussian:
|
|
result = LanguageManager.Instance.GetText("PRUSSIAN_CARP");
|
|
break;
|
|
case FishSpecies.CarpSezan:
|
|
result = LanguageManager.Instance.GetText("SEZAN_CARP");
|
|
break;
|
|
case FishSpecies.CarpSilver:
|
|
result = LanguageManager.Instance.GetText("SILVER_CARP");
|
|
break;
|
|
case FishSpecies.CatfishChannel:
|
|
result = LanguageManager.Instance.GetText("CHANNEL_CATFISH");
|
|
break;
|
|
case FishSpecies.CatfishFlathead:
|
|
result = LanguageManager.Instance.GetText("FLATHEAD_CATFISH");
|
|
break;
|
|
case FishSpecies.CatfishRedtail:
|
|
result = LanguageManager.Instance.GetText("REDTAIL_CATFISH");
|
|
break;
|
|
case FishSpecies.CatfishWels:
|
|
result = LanguageManager.Instance.GetText("WELLS_CATFISH");
|
|
break;
|
|
case FishSpecies.Chub:
|
|
result = LanguageManager.Instance.GetText("CHUB");
|
|
break;
|
|
case FishSpecies.EuropeanGrayling:
|
|
result = LanguageManager.Instance.GetText("EUROPEAN_GRAYLING");
|
|
break;
|
|
case FishSpecies.Ide:
|
|
result = LanguageManager.Instance.GetText("IDE");
|
|
break;
|
|
case FishSpecies.PickerelChain:
|
|
result = LanguageManager.Instance.GetText("CHAIN_PICKEREL");
|
|
break;
|
|
case FishSpecies.PickerelGrass:
|
|
result = LanguageManager.Instance.GetText("GRASS_PICKEREL");
|
|
break;
|
|
case FishSpecies.PickerelRedfin:
|
|
result = LanguageManager.Instance.GetText("REDFIN_PICKEREL");
|
|
break;
|
|
case FishSpecies.PikeAmur:
|
|
result = LanguageManager.Instance.GetText("AMUR_PIKE");
|
|
break;
|
|
case FishSpecies.PikeMuskellunge:
|
|
result = LanguageManager.Instance.GetText("MUSKELLUNGE");
|
|
break;
|
|
case FishSpecies.PikeNorthern:
|
|
result = LanguageManager.Instance.GetText("NORTHERN_PIKE");
|
|
break;
|
|
case FishSpecies.PikeSoutherm:
|
|
result = LanguageManager.Instance.GetText("SOUTHERN_PIKE");
|
|
break;
|
|
case FishSpecies.Roach:
|
|
result = LanguageManager.Instance.GetText("ROACH");
|
|
break;
|
|
case FishSpecies.Tench:
|
|
result = LanguageManager.Instance.GetText("TENCH");
|
|
break;
|
|
case FishSpecies.Zander:
|
|
result = LanguageManager.Instance.GetText("ZANDER");
|
|
break;
|
|
case FishSpecies.BassLargemouth:
|
|
result = LanguageManager.Instance.GetText("LARGEMOUNTH_BASS");
|
|
break;
|
|
case FishSpecies.Bluegill:
|
|
result = LanguageManager.Instance.GetText("BLURGILL");
|
|
break;
|
|
case FishSpecies.Pumpkinseed:
|
|
result = LanguageManager.Instance.GetText("PUMPKINSEED");
|
|
break;
|
|
case FishSpecies.AtlanticSalmon:
|
|
result = LanguageManager.Instance.GetText("ATLANTIC_SALMON");
|
|
break;
|
|
case FishSpecies.CommonBleak:
|
|
result = LanguageManager.Instance.GetText("BLEAK_COMMON");
|
|
break;
|
|
case FishSpecies.Huchen:
|
|
result = LanguageManager.Instance.GetText("HUCHEN");
|
|
break;
|
|
case FishSpecies.BrookTrout:
|
|
result = LanguageManager.Instance.GetText("BROOK_TROUT");
|
|
break;
|
|
case FishSpecies.BrownTrout:
|
|
result = LanguageManager.Instance.GetText("BROWN_TROUT");
|
|
break;
|
|
case FishSpecies.EuropeanBass:
|
|
result = LanguageManager.Instance.GetText("EUROPEAN_BASS");
|
|
break;
|
|
case FishSpecies.AtlanticCod:
|
|
result = LanguageManager.Instance.GetText("ATLANTIC_COD");
|
|
break;
|
|
case FishSpecies.CrocodileNeedlefish:
|
|
result = LanguageManager.Instance.GetText("CROCODILE_NEEDLEFISH");
|
|
break;
|
|
case FishSpecies.EuropeanEel:
|
|
result = LanguageManager.Instance.GetText("EUROPEAN_EEL");
|
|
break;
|
|
case FishSpecies.EuropeanFlounder:
|
|
result = LanguageManager.Instance.GetText("EUROPEAN_FLOUNDER");
|
|
break;
|
|
case FishSpecies.Garfish:
|
|
result = LanguageManager.Instance.GetText("GARFISH");
|
|
break;
|
|
case FishSpecies.EuropeanSeaSturgeon:
|
|
result = LanguageManager.Instance.GetText("COMMON_STURGEON");
|
|
break;
|
|
case FishSpecies.SeaTrout:
|
|
result = LanguageManager.Instance.GetText("SEA_TROUT");
|
|
break;
|
|
case FishSpecies.Beluga:
|
|
result = LanguageManager.Instance.GetText("BELUGA_STURGEON");
|
|
break;
|
|
case FishSpecies.BaikalBlackGrayling:
|
|
result = LanguageManager.Instance.GetText("BLACK_GRAILING");
|
|
break;
|
|
case FishSpecies.ChumSalmon:
|
|
result = LanguageManager.Instance.GetText("CHUM_SALMON");
|
|
break;
|
|
case FishSpecies.CohoSalmon:
|
|
result = LanguageManager.Instance.GetText("COHO_SALMON");
|
|
break;
|
|
case FishSpecies.PinkSalmon:
|
|
result = LanguageManager.Instance.GetText("PINK_SALMON");
|
|
break;
|
|
case FishSpecies.BarracudaGreat:
|
|
result = LanguageManager.Instance.GetText("GREAT_BARRACUDA");
|
|
break;
|
|
case FishSpecies.BarracudaYellowtail:
|
|
result = LanguageManager.Instance.GetText("YELOWTAIL_BARRACUDA");
|
|
break;
|
|
case FishSpecies.GrouperGiant:
|
|
result = LanguageManager.Instance.GetText("GIANT_GROUPER");
|
|
break;
|
|
case FishSpecies.GrouperMalabar:
|
|
result = LanguageManager.Instance.GetText("MALABAR_GROUPER");
|
|
break;
|
|
case FishSpecies.LionfishRed:
|
|
result = LanguageManager.Instance.GetText("RED_LIONFISH");
|
|
break;
|
|
case FishSpecies.MahiMahi:
|
|
result = LanguageManager.Instance.GetText("MAHI_MAHI");
|
|
break;
|
|
case FishSpecies.SharkBlacktipReef:
|
|
result = LanguageManager.Instance.GetText("BLACKTIP_REEF_SHARK");
|
|
break;
|
|
case FishSpecies.SharkTiger:
|
|
result = LanguageManager.Instance.GetText("TIGER_SHARK");
|
|
break;
|
|
case FishSpecies.SnapperGrey:
|
|
result = LanguageManager.Instance.GetText("GREY_SNAPPER");
|
|
break;
|
|
case FishSpecies.TreadfishIndian:
|
|
result = LanguageManager.Instance.GetText("INDIAN_THREADFISH");
|
|
break;
|
|
case FishSpecies.TrevallyGiant:
|
|
result = LanguageManager.Instance.GetText("GIANT_TREVALLY");
|
|
break;
|
|
case FishSpecies.TunaYellowfin:
|
|
result = LanguageManager.Instance.GetText("YELLOWFIN_TUNA");
|
|
break;
|
|
case FishSpecies.ZombieBass:
|
|
result = LanguageManager.Instance.GetText("ZOMBIE_BASS");
|
|
break;
|
|
case FishSpecies.BassStriped:
|
|
result = LanguageManager.Instance.GetText("BASS_STRIPED");
|
|
break;
|
|
case FishSpecies.DrumBlack:
|
|
result = LanguageManager.Instance.GetText("DRUM_BLACK");
|
|
break;
|
|
case FishSpecies.DrumRed:
|
|
result = LanguageManager.Instance.GetText("DRUM_RED");
|
|
break;
|
|
case FishSpecies.MarlinBlue:
|
|
result = LanguageManager.Instance.GetText("MARLIN_BLUE");
|
|
break;
|
|
case FishSpecies.SharkDusky:
|
|
result = LanguageManager.Instance.GetText("SHARK_DUSKY");
|
|
break;
|
|
case FishSpecies.SharkSandbar:
|
|
result = LanguageManager.Instance.GetText("SHARK_SANDBAR");
|
|
break;
|
|
case FishSpecies.SharkSilky:
|
|
result = LanguageManager.Instance.GetText("SHARK_SILKY");
|
|
break;
|
|
case FishSpecies.SharkSpinner:
|
|
result = LanguageManager.Instance.GetText("SHARK_SPINNER");
|
|
break;
|
|
case FishSpecies.TunaBlackfin:
|
|
result = LanguageManager.Instance.GetText("TUNA_BLACKFIN");
|
|
break;
|
|
case FishSpecies.TunnyLittle:
|
|
result = LanguageManager.Instance.GetText("TUNNY_LITTLE");
|
|
break;
|
|
case FishSpecies.SeabassBlack:
|
|
result = LanguageManager.Instance.GetText("SEABASS_BLACK");
|
|
break;
|
|
case FishSpecies.MulletFlatheadGrey:
|
|
result = LanguageManager.Instance.GetText("MULLET_FLATHEAD_GREY");
|
|
break;
|
|
case FishSpecies.SharkBlacktip:
|
|
result = LanguageManager.Instance.GetText("SHARK_BLACKTIP");
|
|
break;
|
|
case FishSpecies.CharArctic:
|
|
result = LanguageManager.Instance.GetText("CHAR_ARCTIC");
|
|
break;
|
|
case FishSpecies.TroutDollyVarden:
|
|
result = LanguageManager.Instance.GetText("TROUT_DOLLY_VARDEN");
|
|
break;
|
|
case FishSpecies.SalmonChinook:
|
|
result = LanguageManager.Instance.GetText("CHINOOK_SALMON");
|
|
break;
|
|
case FishSpecies.TroutCutthroat:
|
|
result = LanguageManager.Instance.GetText("TROUT_CUTTHROAT");
|
|
break;
|
|
case FishSpecies.TroutBull:
|
|
result = LanguageManager.Instance.GetText("TROUT_BULL");
|
|
break;
|
|
case FishSpecies.WhitefishAlaska:
|
|
result = LanguageManager.Instance.GetText("WHITEFISH_ALASKA");
|
|
break;
|
|
case FishSpecies.SturgeonWhite:
|
|
result = LanguageManager.Instance.GetText("STURGEON_WHITE");
|
|
break;
|
|
case FishSpecies.SturgeonGreen:
|
|
result = LanguageManager.Instance.GetText("STURGEON_GREEN");
|
|
break;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
public void LoadScene(string scenename, bool goToMenu = false)
|
|
{
|
|
SceneLoader component = UnityEngine.Object.Instantiate(instance.sceneLoaderPrefab, base.transform).GetComponent<SceneLoader>();
|
|
component.sceneLoadName = scenename;
|
|
component.goToMenu = goToMenu;
|
|
}
|
|
}
|