//08.09 //플레이어 제작 public void SetCreatorWeapon(CreatorWeapon _weapon, EpicOption _EpicOption) { creatorWeapon = null; creatorWeapon = _weapon; epicOpion = _EpicOption; double dCurComplete; if (changeStats.nEnhanceRepaireLevel <= 10) { dCurComplete = _weapon.dRepair + changeStats.nEnhanceRepaireLevel; } else { dCurComplete = _weapon.dRepair * Math.Pow(1.022f, (Mathf.Floor((changeStats.nEnhanceRepaireLevel - 11) * 0.1f))) * (1 + ((changeStats.nEnhanceRepaireLevel - 10) * 0.03f)); dCurComplete += changeStats.nEnhanceRepaireLevel; } SetBasicRepairPower(dCurComplete); PlayerStatsSetting(); }
private bool CheckData(CreatorWeapon _equiment, int nIndex, int _nInsertValue) { switch (nIndex) { case (int)E_CREATOR.E_ARBAIT: if (_equiment.fArbaitRepair == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fArbaitRepair = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "아르바이트 수리력"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_HONOR: if (_equiment.fPlusHonorPercent == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fPlusHonorPercent = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_HONOR; plusItem.strOptionName = "명예 추가 증가량"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_GOLD: if (_equiment.fPlusGoldPercent == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fPlusGoldPercent = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "골드 추가 증가량"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_WATERCHARGE: if (_equiment.fWaterPlus == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fWaterPlus = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "물 증가량"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_WATERUSE: if (_equiment.fActiveWater == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fActiveWater = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "물 추가 증가량"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_CRITICAL: if (_equiment.fCriticalChance == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fCriticalChance = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "크리티컬 확률 증가"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_CRITICALD: if (_equiment.fCriticalDamage == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fCriticalDamage = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "크리티컬 데미지 증가"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_BIGCRITICAL: if (_equiment.fBigSuccessed == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fBigSuccessed = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "대성공 확률 증가"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; case (int)E_CREATOR.E_ACCURACY: if (_equiment.fAccuracyRate == 0) { CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); _equiment.fAccuracyRate = _nInsertValue; plusItem.nIndex = (int)E_CREATOR.E_ARBAIT; plusItem.strOptionName = "명중률 증가"; plusItem.nValue = _nInsertValue; plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); return(true); } break; } return(false); }
void MakeWeapon() { if (int.Parse(CostDayText.text) <= 0) { return; } int nDight = 0; int nDightCost = int.Parse(CostDayText.text); playerData.SetDay(playerData.GetDay() - nDightCost); float fCostDay = (float)nDightCost; while (fCostDay >= 10) { fCostDay *= 0.1f; nDight++; } CreatorWeapon createWeapon = new CreatorWeapon(); //제작 비용 nCalcGoldCost = (int)Mathf.Round(m_nBasicGold + m_nBasicGold * (m_nPlusGoldPercent * fCostDay * 0.01f)); nCalcHonorCost = (int)Mathf.Round(m_nBasicHonor + m_nBasicHonor * (m_nPlusHonorPercent * nDight * 0.01f)); //수리력 createWeapon.fRepair = (int)Mathf.Round(Random.Range(nCalcMinRepair, nCalcMaxRepair + 1)); int nOptionLength = 3; //추가 옵션 범위 nCalcAddMinOption = (int)Mathf.Round(m_nBasicMinOption + (float)(m_nBasicMinOption * (m_nPlusOptionMinPercent * nDight * 0.01f))); nCalcAddMaxOption = (int)Mathf.Round(m_nBasicMaxOption + (float)(m_nBasicMaxOption * (m_nPlusOptionMaxPercent * nDight * 0.01f))); for (int nIndex = 0; nIndex < LIST_OPTION.Count; nIndex++) { if (LIST_OPTION [nIndex].bIsLock == false) { LIST_OPTION.Remove(LIST_OPTION [nIndex--]); } else { nOptionLength--; nInsertValue = Random.Range(nCalcAddMinOption, nCalcAddMaxOption + 1); switch (LIST_OPTION [nIndex].nIndex) { case (int)E_CREATOR.E_ARBAIT: createWeapon.fArbaitRepair = nInsertValue; break; case (int)E_CREATOR.E_HONOR: createWeapon.fPlusHonorPercent = nInsertValue; break; case (int)E_CREATOR.E_GOLD: createWeapon.fPlusGoldPercent = nInsertValue; break; case (int)E_CREATOR.E_WATERCHARGE: createWeapon.fWaterPlus = nInsertValue; break; case (int)E_CREATOR.E_WATERUSE: createWeapon.fActiveWater = nInsertValue; break; case (int)E_CREATOR.E_CRITICAL: createWeapon.fCriticalChance = nInsertValue; break; case (int)E_CREATOR.E_CRITICALD: createWeapon.fCriticalDamage = nInsertValue; break; case (int)E_CREATOR.E_BIGCRITICAL: createWeapon.fBigSuccessed = nInsertValue; break; case (int)E_CREATOR.E_ACCURACY: createWeapon.fAccuracyRate = nInsertValue; break; } } } int nInsertIndex = 0; while (nOptionLength > 0) { nInsertIndex = Random.Range((int)E_CREATOR.E_ARBAIT, (int)E_CREATOR.E_MAX); nInsertValue = Random.Range(nCalcAddMinOption, nCalcAddMaxOption + 1); if (CheckData(createWeapon, nInsertIndex, nInsertValue)) { nOptionLength--; } } //보스 옵션 셋팅 for (int nIndex = 0; nIndex < BossSoulSlots.Length; nIndex++) { //만약 체크가 됐다면 if (BossSoulSlots [nIndex].bIsCheck) { nInsertValue = Random.Range(nCalcAddMinOption, nCalcAddMaxOption + 1); if (nIndex == (int)E_BOSSNAME.E_BOSSNAME_ICE) { createWeapon.fIceBossValue = nInsertValue; } else if (nIndex == (int)E_BOSSNAME.E_BOSSNAME_SASIN) { createWeapon.fSasinBossValue = nInsertValue; } else if (nIndex == (int)E_BOSSNAME.E_BOSSNAME_FIRE) { createWeapon.fFireBossValue = nInsertValue; } else if (nIndex == (int)E_BOSSNAME.E_BOSSNAME_MUSIC) { createWeapon.fRusiuBossValue = nInsertValue; } CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); plusItem.nIndex = nIndex + (int)E_CREATOR.E_BOSS_ICE; plusItem.strOptionName = strBossExplains [nIndex]; plusItem.nValue = nInsertValue; plusItem.bIsLock = false; BossSoulSlots [nIndex].ReSetting(); LIST_OPTION.Add(plusItem); } } //특수 옵션 미정 NowRepairPower.text = string.Format("{0}", Mathf.RoundToInt(createWeapon.fRepair)); playerData.SetCreatorWeapon(createWeapon); SpawnManager.Instance.SetDayInitInfo(playerData.GetDay()); RefreshDisplay(); CostDayText.text = "0"; }
public void CreateWeapon() { bIsCreate = true; int nDight = 0; int nDightCost = playerData.GetDay(); float fCostDay = (float)nDightCost; while (fCostDay > 10) { fCostDay -= 10; nDight++; } createWeapon = new CreatorWeapon(); int nDay = playerData.GetDay(); float fOriValue = nDay + 10; float fMinusValue = Mathf.Floor((nDay + 10) * 0.1f) * 10; float result = fOriValue - fMinusValue; double dCurComplete = 3 * Math.Max(Math.Pow(1.83, (Math.Floor((nDay + 20) * 0.1f))), 1) * (1 + (result) * 0.05f); dCalcMinRepair = dCurComplete - dCurComplete * 0.1f; int nPlusCount = 0; while (dCalcMinRepair >= 400000000) { dCalcMinRepair *= 0.1; dCurComplete *= 0.1; nPlusCount++; } float fResult = UnityEngine.Random.Range((float)dCalcMinRepair, (float)dCurComplete); dCurComplete = fResult * Math.Pow(10, nPlusCount); RepairText.text = ScoreManager.ScoreInstance.ChangeMoney(dCurComplete); //수리력 설정 createWeapon.dRepair = dCurComplete; int nOptionLength = 3; //리스트에서 지움 LIST_OPTION.Clear(); //추가 옵션 범위 nCalcAddMinOption = Mathf.RoundToInt(m_nBasicMinOption + (float)(m_nBasicMinOption * nDight * 0.1f)); nCalcAddMaxOption = Mathf.RoundToInt(m_nBasicMaxOption + (float)(m_nBasicMaxOption * nDight * 0.1f)); //옵션 셋팅 while (nOptionLength > 0) { int nInsertIndex = 0; nInsertIndex = UnityEngine.Random.Range((int)E_CREATOR.E_REPAIRPERCENT, (int)E_CREATOR.E_MAX); nInsertValue = UnityEngine.Random.Range(nCalcAddMinOption, nCalcAddMaxOption + 1); if (CheckData(createWeapon, nInsertIndex, nInsertValue)) { nOptionLength--; } } //보스 옵션 셋팅 for (int nIndex = 0; nIndex < BossSoulSlots.Length; nIndex++) { //만약 체크가 됐다면 if (BossSoulSlots [nIndex].bIsCheck) { nInsertValue = UnityEngine.Random.Range(nCalcAddMinOption, nCalcAddMaxOption + 1); if (nIndex == (int)E_BOSSNAME.E_BOSSNAME_ICE) { createWeapon.fIceBossValue = nInsertValue; } else if (nIndex == (int)E_BOSSNAME.E_BOSSNAME_SASIN) { createWeapon.fSasinBossValue = nInsertValue; } else if (nIndex == 3) { createWeapon.fFireBossValue = nInsertValue; } else if (nIndex == 2) { createWeapon.fRusiuBossValue = nInsertValue; } CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); plusItem.nIndex = nIndex + (int)E_CREATOR.E_BOSS_ICE; plusItem.strOptionName = strBossExplains [nIndex]; plusItem.nValue = nInsertValue; plusItem.strOptionExplain = string.Format("{0} : {1}%", plusItem.strOptionName, plusItem.nValue); plusItem.bIsLock = false; LIST_OPTION.Add(plusItem); } } //만약 전 에픽이 있을 경우 락을 했는지 안했는지 넣어 줌 if (playerData.GetCreatorWeapon() != null) { createWeapon.bIsLock = playerData.GetCreatorWeapon().bIsLock; createWeapon.nEpicIndex = playerData.GetCreatorWeapon().nEpicIndex; createWeapon.nUnicodeIndex = playerData.GetCreatorWeapon().nUnicodeIndex; } //락이 아닐 경우 다시 에픽 확률을 계산 해서 넣어 줌 if (createWeapon.bIsLock == false) { if (createEpic != null) { createEpic.Relive(); } //특수 옵션 미정 if (UnityEngine.Random.Range(0, 100) <= 10) { int nRandomIndex = (int)UnityEngine.Random.Range(0, (int)E_EPIC_INDEX.E_EPIC_MAX); createEpic = EpicFactory(nRandomIndex); createWeapon.nEpicIndex = nRandomIndex; createWeapon.nUnicodeIndex = nRandomIndex + 175; createWeapon.nCostDay = playerData.GetDay(); createWeapon.strName = GameManager.Instance.cUnicodeData [createWeapon.nUnicodeIndex].strName; if (createEpic != null) { createEpic.Init(playerData.GetDay(), playerData); } } else { createEpic = null; } } //락 일경우 추가 된 일차로 옵션 수치만 다시 설정 해준다. else { createEpic = EpicFactory(createWeapon.nEpicIndex); createEpic.Init(playerData.GetDay(), playerData); createWeapon.nCostDay = playerData.GetDay(); createWeapon.strName = GameManager.Instance.cUnicodeData [createWeapon.nUnicodeIndex].strName; createWeapon.bIsLock = false; } if (createEpic != null) { //에픽 옵션 추가 CGameMainWeaponOption EpicOption = new CGameMainWeaponOption(); EpicOption.nIndex = (int)E_CREATOR.E_EPIC; EpicOption.strOptionName = createEpic.strExplain; EpicOption.nValue = (int)createEpic.fValue; EpicOption.strOptionExplain = createEpic.strExplain; EpicOption.bIsLock = false; createEpic.bIsLock = false; LIST_OPTION.Add(EpicOption); createWeapon.WeaponSprite = Resources.Load <Sprite> ("Crafts/CreatorWeapon/" + createEpic.nIndex); SoundManager.instance.PlaySound(eSoundArray.ES_CraftSound_GreatFinish); } else { int nRandomWeaponIndex = (int)UnityEngine.Random.Range(184, 211); //184,211 createWeapon.nEpicIndex = -1; createWeapon.nCostDay = playerData.GetDay(); createWeapon.WeaponSprite = Resources.Load <Sprite> ("Crafts/CreatorWeapon/" + (nRandomWeaponIndex - 175).ToString()); createWeapon.strName = GameManager.Instance.cUnicodeData [nRandomWeaponIndex].strName; createWeapon.nUnicodeIndex = nRandomWeaponIndex; SoundManager.instance.PlaySound(eSoundArray.ES_CraftSound_Finish); } createWeapon.nOptionChangeCount = 1; WeaponImage.sprite = createWeapon.WeaponSprite; WeaponNameText.text = createWeapon.strName; }
public void Init(List <CGameEquiment> _itemList, CGamePlayerData _defaultStats, CreatorWeapon _creatorWeapon) { List_items = _itemList; creatorWeapon = _creatorWeapon; changeStats = new CGamePlayerData(_defaultStats); }
//08.09 //플레이어 제작 public void SetCreatorWeapon(CreatorWeapon _weapon) { creatorWeapon = _weapon; PlayerStatsSetting(); }
void Awake() { playerData = GameManager.Instance.GetPlayer(); MakingButton.onClick.AddListener(MakeWeapon); for (int nIndex = 0; nIndex < BossSoulSlots.Length; nIndex++) { BossSoulSlots [nIndex].SetUp(this, playerData, nIndex); } if (playerData.GetCreatorWeapon().dRepair == 0) { //playerData.SetDay (11); //MakeWeapon (); } else { BossSlotOne.sprite = null; BossSlotTwo.sprite = null; CreatorWeapon createWeapon = new CreatorWeapon(); //저장 된 데이터를 미리 캐싱해 둔다 CreatorWeapon LoadCreateWeapon = playerData.GetCreatorWeapon(); #region SetCreateWeaponSetting createWeapon.dRepair = LoadCreateWeapon.dRepair; createWeapon.nOptionChangeCount = LoadCreateWeapon.nOptionChangeCount; createWeapon.bIsLock = LoadCreateWeapon.bIsLock; if (LoadCreateWeapon.fRepairPercent != 0) { CheckData(createWeapon, (int)E_CREATOR.E_REPAIRPERCENT, (int)LoadCreateWeapon.fRepairPercent); } if (LoadCreateWeapon.fArbaitRepair != 0) { CheckData(createWeapon, (int)E_CREATOR.E_ARBAIT, (int)LoadCreateWeapon.fArbaitRepair); } if (LoadCreateWeapon.fPlusHonorPercent != 0) { CheckData(createWeapon, (int)E_CREATOR.E_HONOR, (int)LoadCreateWeapon.fPlusHonorPercent); } if (LoadCreateWeapon.fPlusGoldPercent != 0) { CheckData(createWeapon, (int)E_CREATOR.E_GOLD, (int)LoadCreateWeapon.fPlusGoldPercent); } if (LoadCreateWeapon.fWaterPlus != 0) { CheckData(createWeapon, (int)E_CREATOR.E_WATERCHARGE, (int)LoadCreateWeapon.fWaterPlus); } if (LoadCreateWeapon.fCriticalChance != 0) { CheckData(createWeapon, (int)E_CREATOR.E_CRITICAL, (int)LoadCreateWeapon.fCriticalChance); } if (LoadCreateWeapon.fCriticalDamage != 0) { CheckData(createWeapon, (int)E_CREATOR.E_CRITICALD, (int)LoadCreateWeapon.fCriticalDamage); } if (LoadCreateWeapon.fBigSuccessed != 0) { CheckData(createWeapon, (int)E_CREATOR.E_BIGCRITICAL, (int)LoadCreateWeapon.fBigSuccessed); } if (LoadCreateWeapon.fAccuracyRate != 0) { CheckData(createWeapon, (int)E_CREATOR.E_ACCURACY, (int)LoadCreateWeapon.fAccuracyRate); } if (LoadCreateWeapon.fIceBossValue != 0) { createWeapon.fIceBossValue = LoadCreateWeapon.fIceBossValue; CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); plusItem.nIndex = (int)E_CREATOR.E_BOSS_ICE; plusItem.strOptionName = strBossExplains [0]; plusItem.nValue = (int)LoadCreateWeapon.fIceBossValue; plusItem.bIsLock = false; plusItem.strOptionExplain = string.Format("{0} : {1}%", plusItem.strOptionName, plusItem.nValue); LIST_OPTION.Add(plusItem); } if (LoadCreateWeapon.fRusiuBossValue != 0) { createWeapon.fRusiuBossValue = LoadCreateWeapon.fRusiuBossValue; CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); plusItem.nIndex = (int)E_CREATOR.E_BOSS_RUSIU; plusItem.strOptionName = strBossExplains [1]; plusItem.nValue = (int)LoadCreateWeapon.fRusiuBossValue; plusItem.bIsLock = false; plusItem.strOptionExplain = string.Format("{0} : {1}%", plusItem.strOptionName, plusItem.nValue); LIST_OPTION.Add(plusItem); } if (LoadCreateWeapon.fSasinBossValue != 0) { createWeapon.fSasinBossValue = LoadCreateWeapon.fSasinBossValue; CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); plusItem.nIndex = (int)E_CREATOR.E_BOSS_SASIN; plusItem.strOptionName = strBossExplains [2]; plusItem.nValue = (int)LoadCreateWeapon.fSasinBossValue; plusItem.bIsLock = false; plusItem.strOptionExplain = string.Format("{0} : {1}%", plusItem.strOptionName, plusItem.nValue); LIST_OPTION.Add(plusItem); } if (LoadCreateWeapon.fFireBossValue != 0) { createWeapon.fFireBossValue = LoadCreateWeapon.fFireBossValue; CGameMainWeaponOption plusItem = new CGameMainWeaponOption(); plusItem.nIndex = (int)E_CREATOR.E_BOSS_FIRE; plusItem.strOptionName = strBossExplains [3]; plusItem.nValue = (int)LoadCreateWeapon.fFireBossValue; plusItem.bIsLock = false; plusItem.strOptionExplain = string.Format("{0} : {1}%", plusItem.strOptionName, plusItem.nValue); LIST_OPTION.Add(plusItem); } if (LoadCreateWeapon.fIceBossValue != 0) { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/IceSoul"); } if (LoadCreateWeapon.fSasinBossValue != 0) { if (BossSlotOne.sprite != null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SasinSoul"); } else { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SasinSoul"); } } if (LoadCreateWeapon.fRusiuBossValue != 0) { if (BossSlotOne.sprite != null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/DodomSoul"); } else { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/DodomSoul"); } } if (LoadCreateWeapon.fFireBossValue != 0) { if (BossSlotOne.sprite != null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SkullSoul"); } else { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SkullSoul"); } } if (BossSlotOne.sprite == null) { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/crafts_bosssoul_slot_check_unactive"); } if (BossSlotTwo.sprite == null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/crafts_bosssoul_slot_check_unactive"); } if (LoadCreateWeapon.nEpicIndex != (int)E_EPIC_INDEX.E_EPIC_FAIEL) { createWeapon.nEpicIndex = LoadCreateWeapon.nEpicIndex; createEpic = EpicFactory(createWeapon.nEpicIndex); createEpic.Init(LoadCreateWeapon.nCostDay, playerData); //에픽 옵션 추가 CGameMainWeaponOption EpicOption = new CGameMainWeaponOption(); EpicOption.nIndex = (int)E_CREATOR.E_EPIC; EpicOption.strOptionName = createEpic.strExplain; EpicOption.nValue = (int)createEpic.fValue; EpicOption.strOptionExplain = createEpic.strExplain; EpicOption.bIsLock = createWeapon.bIsLock; createEpic.bIsLock = createWeapon.bIsLock; LIST_OPTION.Add(EpicOption); createWeapon.WeaponSprite = Resources.Load <Sprite> ("Crafts/CreatorWeapon/" + createEpic.nIndex); } else { createWeapon.WeaponSprite = Resources.Load <Sprite> ("Crafts/CreatorWeapon/" + (LoadCreateWeapon.nUnicodeIndex - 175).ToString()); } createWeapon.nUnicodeIndex = LoadCreateWeapon.nUnicodeIndex; WeaponNameText.text = GameManager.Instance.cUnicodeData[LoadCreateWeapon.nUnicodeIndex].strName; createWeapon.strName = WeaponNameText.text; WeaponImage.sprite = createWeapon.WeaponSprite; PlayerWeaponImage.sprite = createWeapon.WeaponSprite; playerData.SetCreatorWeapon(createWeapon, createEpic); SpawnManager.Instance.SetDayInitInfo(playerData.GetDay()); RefreshDisplay(); SetShowText(); #endregion } }
public void CreateWeapon(CreatorWeapon _weapon, EpicOption _epicOption, List <CGameMainWeaponOption> _List_Option) { BossSlotOne.sprite = null; BossSlotTwo.sprite = null; LIST_OPTION = _List_Option; WeaponNameText.text = _weapon.strName; WeaponImage.sprite = _weapon.WeaponSprite; PlayerWeaponImage.sprite = _weapon.WeaponSprite; playerData.SetCreatorWeapon(_weapon, _epicOption); repairUI.ChagneRepairData(); if (_weapon.fIceBossValue != 0) { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/IceSoul"); } if (_weapon.fSasinBossValue != 0) { if (BossSlotOne.sprite != null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SasinSoul"); } else { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SasinSoul"); } } if (_weapon.fRusiuBossValue != 0) { if (BossSlotOne.sprite != null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/DodomSoul"); } else { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/DodomSoul"); } } if (_weapon.fFireBossValue != 0) { if (BossSlotOne.sprite != null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SkullSoul"); } else { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/SkullSoul"); } } if (BossSlotOne.sprite == null) { BossSlotOne.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/crafts_bosssoul_slot_check_unactive"); } if (BossSlotTwo.sprite == null) { BossSlotTwo.sprite = ObjectCashing.Instance.LoadSpriteFromCache("Crafts/crafts_bosssoul_slot_check_unactive"); } SpawnManager.Instance.SetDayInitInfo(playerData.GetDay()); RefreshDisplay(); SetShowText(); }
public void ChageOption() { CreatorWeapon weapon = GameManager.Instance.GetPlayer().GetCreatorWeapon(); weapon.nOptionChangeCount++; int nRandomOptionLength = 1; //옵션 셋팅 while (nRandomOptionLength > 0) { int nInsertIndex = 0; nInsertIndex = UnityEngine.Random.Range((int)E_CREATOR.E_REPAIRPERCENT, (int)E_CREATOR.E_MAX); if (makingUI.CheckData(weapon, nInsertIndex, (int)WeaponOption.nValue)) { nRandomOptionLength--; } } switch (WeaponOption.nIndex) { case (int)E_CREATOR.E_REPAIRPERCENT: weapon.fRepairPercent = 0; break; case (int)E_CREATOR.E_ARBAIT: weapon.fArbaitRepair = 0; break; case (int)E_CREATOR.E_HONOR: weapon.fPlusHonorPercent = 0; break; case (int)E_CREATOR.E_GOLD: weapon.fPlusGoldPercent = 0; break; case (int)E_CREATOR.E_WATERCHARGE: weapon.fWaterPlus = 0; break; case (int)E_CREATOR.E_CRITICAL: weapon.fCriticalChance = 0; break; case (int)E_CREATOR.E_CRITICALD: weapon.fCriticalDamage = 0; break; case (int)E_CREATOR.E_BIGCRITICAL: weapon.fBigSuccessed = 0; break; case (int)E_CREATOR.E_ACCURACY: weapon.fAccuracyRate = 0; break; } makingUI.DeleteOption(WeaponOption); }