86 lines
2.7 KiB
C#
86 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Reflection;
|
|
using System.IO;
|
|
using BrewMonster;
|
|
using ModelRenderer.Scripts.Common;
|
|
using ModelRenderer.Scripts.GameData;
|
|
using UnityEngine;
|
|
using PerfectWorld.Scripts.Managers;
|
|
using BrewMonster.Network;
|
|
using BrewMonster.Scripts.Managers;
|
|
using BrewMonster.Scripts;
|
|
using CSNetwork.GPDataType;
|
|
using System.Runtime.InteropServices;
|
|
namespace PerfectWorld.Scripts.Managers
|
|
{
|
|
/// <summary>
|
|
/// Task Dice Item (Tui qua random).
|
|
/// This is a part of IvtrTaskItem(C++)
|
|
/// </summary>
|
|
public class EC_IvtrTaskDice : EC_IvtrItem
|
|
{
|
|
protected TASKDICE_ESSENCE m_pDBEssence;
|
|
|
|
/// <summary>
|
|
/// Task Dice Item
|
|
/// </summary>
|
|
/// <param name="tid"></param>
|
|
/// <param name="expire_date"></param>
|
|
public EC_IvtrTaskDice(int tid, int expire_date) : base(tid, expire_date)
|
|
{
|
|
m_iCID = (int)InventoryClassId.ICID_TASKDICE;
|
|
elementdataman pDB = ElementDataManProvider.GetElementDataMan();
|
|
DATA_TYPE DataType = DATA_TYPE.DT_INVALID;
|
|
m_pDBEssence = (TASKDICE_ESSENCE)pDB.get_data_ptr((uint)tid, ID_SPACE.ID_SPACE_ESSENCE, ref DataType);
|
|
m_iPileLimit = m_pDBEssence.pile_num_max;
|
|
m_iPrice = 0;
|
|
m_iShopPrice = 0;
|
|
m_iProcType = (int)m_pDBEssence.proc_type;
|
|
m_bUseable = true;
|
|
m_bNeedUpdate = false;
|
|
}
|
|
|
|
public EC_IvtrTaskDice(EC_IvtrTaskDice other) : base(other)
|
|
{
|
|
m_pDBEssence = other.m_pDBEssence;
|
|
}
|
|
public override bool SetItemInfo(byte[] pInfoData, int iDataLen)
|
|
{
|
|
base.SetItemInfo(pInfoData, iDataLen);
|
|
return true;
|
|
}
|
|
public override string GetIconFile()
|
|
{
|
|
return m_pDBEssence.FileIcon;
|
|
}
|
|
protected override string GetNormalDesc(bool bRepair)
|
|
{
|
|
m_strDesc = "";
|
|
// Try to build item description
|
|
CECStringTab pDescTab = EC_Game.GetItemDesc();
|
|
int white = (int)DescriptipionMsg.ITEMDESC_COL_WHITE;
|
|
int namecol = DecideNameCol();
|
|
|
|
if (m_iCount > 1)
|
|
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAMENUMBER), GetName(), m_iCount);
|
|
else
|
|
AddDescText(namecol, true, pDescTab.GetWideString((int)DescriptipionMsg.ITEMDESC_NAME), GetName());
|
|
AddIDDescText();
|
|
AddExpireTimeDesc();
|
|
|
|
AddPriceDesc(white, bRepair);
|
|
|
|
// Extend description
|
|
AddExtDescText();
|
|
|
|
return m_strDesc;
|
|
}
|
|
public override string GetDropModel()
|
|
{
|
|
return m_pDBEssence.FileMatter;
|
|
}
|
|
}
|
|
}
|
|
|