1153 lines
39 KiB
Python
1153 lines
39 KiB
Python
import ui
|
|
import localeInfo
|
|
import uiScriptLocale
|
|
import chr
|
|
import item
|
|
import app
|
|
import skill
|
|
import player
|
|
import uiToolTip
|
|
|
|
import math
|
|
import constInfo
|
|
|
|
if app.ENABLE_OFFLINESHOP_SYSTEM:
|
|
import constInfo
|
|
|
|
if app.ENABLE_VOTE4BUFF:
|
|
voteBuffData = [0,0]
|
|
|
|
if app.ENABLE_MULTI_FARM_BLOCK:
|
|
import uiCommon
|
|
import net
|
|
class MultiFarmImage(ui.ExpandedImageBox):
|
|
def __del__(self):
|
|
ui.ExpandedImageBox.__del__(self)
|
|
def Destroy(self):
|
|
self.multiFarmStatus = 0
|
|
self.players = []
|
|
def __init__(self):
|
|
ui.ExpandedImageBox.__init__(self)
|
|
self.Destroy()
|
|
def SetMultiFarmInfo(self, multiFarmStatus):
|
|
self.multiFarmStatus = multiFarmStatus
|
|
if multiFarmStatus:
|
|
self.LoadImage("d:/ymir work/ui/game/farm/can_farm.tga")
|
|
else:
|
|
self.LoadImage("d:/ymir work/ui/game/farm/cant_farm.tga")
|
|
def OnMouseOverIn(self):
|
|
interface = constInfo.GetInterfaceInstance()
|
|
if interface != None:
|
|
if interface.tooltipItem:
|
|
interface.tooltipItem.ClearToolTip()
|
|
interface.tooltipItem.AutoAppendTextLineSpecial("|cffF1E6C0"+localeInfo.MULTI_FARM_TITLE)
|
|
interface.tooltipItem.AppendSpace(5)
|
|
interface.tooltipItem.AutoAppendTextLineSpecial(localeInfo.MULTI_FARM_TEXT)
|
|
interface.tooltipItem.AppendSpace(5)
|
|
for name in self.players:
|
|
interface.tooltipItem.AutoAppendTextLineSpecial("|cffF1E6C0"+name)
|
|
interface.tooltipItem.ShowToolTip()
|
|
def OnMouseOverOut(self):
|
|
interface = constInfo.GetInterfaceInstance()
|
|
if interface != None:
|
|
if interface.tooltipItem:
|
|
interface.tooltipItem.HideToolTip()
|
|
|
|
if app.ENABLE_NEW_AFFECT_POTION:
|
|
AFFECT_POTION = {
|
|
"affect" : {
|
|
1 : 303,
|
|
2 : 304,
|
|
3 : 305,
|
|
4 : 306,
|
|
5 : 307,
|
|
6 : 308,
|
|
|
|
7 : 309,
|
|
8 : 310,
|
|
9 : 311,
|
|
10 : 312,
|
|
11 : 313,
|
|
},
|
|
"image" : {
|
|
1 : "flag/50821.tga",
|
|
2 : "flag/50822.tga",
|
|
3 : "flag/50823.tga",
|
|
4 : "flag/50824.tga",
|
|
5 : "flag/50825.tga",
|
|
6 : "flag/50826.tga",
|
|
|
|
7 : "flag/51003.tga",
|
|
8 : "flag/51004.tga",
|
|
9 : "flag/51005.tga",
|
|
10 : "flag/51006.tga",
|
|
11 : "flag/51007.tga",
|
|
},
|
|
}
|
|
|
|
if app.ENABLE_CONQUEROR_LEVEL:
|
|
#Sungma
|
|
class SungMaAffectImage(ui.ExpandedImageBox):
|
|
FILE_PATH_SUNGMA = "d:/ymir work/ui/skill/common/affect/sungma_buff.sub"
|
|
|
|
def __init__(self, str, hp, move, inmune):
|
|
ui.ExpandedImageBox.__init__(self)
|
|
|
|
self.str = str
|
|
self.hp = hp
|
|
self.move = move
|
|
self.inmune = inmune
|
|
|
|
self.toolTip = uiToolTip.ToolTip(300)
|
|
self.toolTip.HideToolTip()
|
|
|
|
def __del__(self):
|
|
ui.ExpandedImageBox.__del__(self)
|
|
|
|
def SetSungmaValue(self, str, hp, move, inmune):
|
|
self.str = str
|
|
self.hp = hp
|
|
self.move = move
|
|
self.inmune = inmune
|
|
|
|
self.__Refresh()
|
|
|
|
def __Refresh(self):
|
|
self.str = self.str
|
|
self.hp = self.hp
|
|
self.move = self.move
|
|
self.inmune = self.inmune
|
|
|
|
fileName = self.FILE_PATH_SUNGMA
|
|
|
|
try:
|
|
self.LoadImage(fileName)
|
|
except:
|
|
import dbg
|
|
dbg.TraceError("SungmaPointImage.(STR=%d, HP %d, MOVE %d, INMUNE %d) - LoadError %s" % (self.str, self.hp, self.move, self.inmune, fileName))
|
|
|
|
self.SetScale(0.7, 0.7)
|
|
|
|
self.toolTip.ClearToolTip()
|
|
self.toolTip.SetTitle(localeInfo.TOOLTIP_AFFECT_SUNGMA_DESC)
|
|
self.toolTip.AppendTextLine(localeInfo.TOOLTIP_AFFECT_SUNGMA_STR % (self.str))
|
|
self.toolTip.AppendTextLine(localeInfo.TOOLTIP_AFFECT_SUNGMA_HP % (self.hp))
|
|
self.toolTip.AppendTextLine(localeInfo.TOOLTIP_AFFECT_SUNGMA_MOVE % (self.move))
|
|
self.toolTip.AppendTextLine(localeInfo.TOOLTIP_AFFECT_SUNGMA_IMMUNE % (self.inmune))
|
|
self.toolTip.ResizeToolTip()
|
|
|
|
def OnMouseOverIn(self):
|
|
self.toolTip.ShowToolTip()
|
|
|
|
def OnMouseOverOut(self):
|
|
self.toolTip.HideToolTip()
|
|
|
|
class LovePointImage(ui.ExpandedImageBox):
|
|
|
|
FILE_PATH = "d:/ymir work/ui/pattern/LovePoint/"
|
|
FILE_DICT = {
|
|
0 : FILE_PATH + "01.dds",
|
|
1 : FILE_PATH + "02.dds",
|
|
2 : FILE_PATH + "02.dds",
|
|
3 : FILE_PATH + "03.dds",
|
|
4 : FILE_PATH + "04.dds",
|
|
5 : FILE_PATH + "05.dds",
|
|
}
|
|
|
|
def __init__(self):
|
|
ui.ExpandedImageBox.__init__(self)
|
|
|
|
self.loverName = ""
|
|
self.lovePoint = 0
|
|
|
|
self.toolTip = uiToolTip.ToolTip(100)
|
|
self.toolTip.HideToolTip()
|
|
|
|
def __del__(self):
|
|
ui.ExpandedImageBox.__del__(self)
|
|
|
|
def SetLoverInfo(self, name, lovePoint):
|
|
self.loverName = name
|
|
self.lovePoint = lovePoint
|
|
self.__Refresh()
|
|
|
|
def OnUpdateLovePoint(self, lovePoint):
|
|
self.lovePoint = lovePoint
|
|
self.__Refresh()
|
|
|
|
def __Refresh(self):
|
|
self.lovePoint = max(0, self.lovePoint)
|
|
self.lovePoint = min(100, self.lovePoint)
|
|
|
|
if 0 == self.lovePoint:
|
|
loveGrade = 0
|
|
else:
|
|
loveGrade = self.lovePoint / 25 + 1
|
|
fileName = self.FILE_DICT.get(loveGrade, self.FILE_PATH+"00.dds")
|
|
|
|
try:
|
|
self.LoadImage(fileName)
|
|
except:
|
|
import dbg
|
|
dbg.TraceError("LovePointImage.SetLoverInfo(lovePoint=%d) - LoadError %s" % (self.lovePoint, fileName))
|
|
|
|
self.SetScale(0.7, 0.7)
|
|
|
|
self.toolTip.ClearToolTip()
|
|
self.toolTip.SetTitle(self.loverName)
|
|
self.toolTip.AppendTextLine(localeInfo.AFF_LOVE_POINT % (self.lovePoint))
|
|
self.toolTip.ResizeToolTip()
|
|
|
|
def OnMouseOverIn(self):
|
|
self.toolTip.ShowToolTip()
|
|
|
|
def OnMouseOverOut(self):
|
|
self.toolTip.HideToolTip()
|
|
# END_OF_WEDDING
|
|
|
|
|
|
class HorseImage(ui.ExpandedImageBox):
|
|
|
|
FILE_PATH = "d:/ymir work/ui/pattern/HorseState/"
|
|
|
|
FILE_DICT = {
|
|
00 : FILE_PATH+"00.dds",
|
|
01 : FILE_PATH+"00.dds",
|
|
02 : FILE_PATH+"00.dds",
|
|
03 : FILE_PATH+"00.dds",
|
|
10 : FILE_PATH+"10.dds",
|
|
11 : FILE_PATH+"11.dds",
|
|
12 : FILE_PATH+"12.dds",
|
|
13 : FILE_PATH+"13.dds",
|
|
20 : FILE_PATH+"20.dds",
|
|
21 : FILE_PATH+"21.dds",
|
|
22 : FILE_PATH+"22.dds",
|
|
23 : FILE_PATH+"23.dds",
|
|
30 : FILE_PATH+"30.dds",
|
|
31 : FILE_PATH+"31.dds",
|
|
32 : FILE_PATH+"32.dds",
|
|
33 : FILE_PATH+"33.dds",
|
|
}
|
|
|
|
def __init__(self):
|
|
ui.ExpandedImageBox.__init__(self)
|
|
|
|
#self.textLineList = []
|
|
self.toolTip = uiToolTip.ToolTip(100)
|
|
self.toolTip.HideToolTip()
|
|
|
|
def __GetHorseGrade(self, level):
|
|
if 0 == level:
|
|
return 0
|
|
|
|
return (level-1)/10 + 1
|
|
|
|
def SetState(self, level, health, battery):
|
|
#self.textLineList=[]
|
|
self.toolTip.ClearToolTip()
|
|
|
|
if level>0:
|
|
|
|
try:
|
|
grade = self.__GetHorseGrade(level)
|
|
self.__AppendText(localeInfo.LEVEL_LIST[grade])
|
|
except IndexError:
|
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
|
|
return
|
|
|
|
try:
|
|
healthName=localeInfo.HEALTH_LIST[health]
|
|
if len(healthName)>0:
|
|
self.__AppendText(healthName)
|
|
except IndexError:
|
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
|
|
return
|
|
|
|
if health>0:
|
|
if battery==0:
|
|
self.__AppendText(localeInfo.NEEFD_REST)
|
|
|
|
try:
|
|
fileName=self.FILE_DICT[health*10+battery]
|
|
except KeyError:
|
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - KeyError" % (level, health, battery)
|
|
|
|
try:
|
|
self.LoadImage(fileName)
|
|
except:
|
|
print "HorseImage.SetState(level=%d, health=%d, battery=%d) - LoadError %s" % (level, health, battery, fileName)
|
|
|
|
self.SetScale(0.7, 0.7)
|
|
|
|
def __AppendText(self, text):
|
|
|
|
self.toolTip.AppendTextLine(text)
|
|
self.toolTip.ResizeToolTip()
|
|
|
|
#x=self.GetWidth()/2
|
|
#textLine = ui.TextLine()
|
|
#textLine.SetParent(self)
|
|
#textLine.SetSize(0, 0)
|
|
#textLine.SetOutline()
|
|
#textLine.Hide()
|
|
#textLine.SetPosition(x, 40+len(self.textLineList)*16)
|
|
#textLine.SetText(text)
|
|
#self.textLineList.append(textLine)
|
|
|
|
def OnMouseOverIn(self):
|
|
#for textLine in self.textLineList:
|
|
# textLine.Show()
|
|
|
|
self.toolTip.ShowToolTip()
|
|
|
|
def OnMouseOverOut(self):
|
|
#for textLine in self.textLineList:
|
|
# textLine.Hide()
|
|
|
|
self.toolTip.HideToolTip()
|
|
|
|
class MountImage(ui.ExpandedImageBox):
|
|
|
|
|
|
AFFECT_DICT = uiToolTip.ItemToolTip.AFFECT_DICT
|
|
|
|
def __init__(self):
|
|
ui.ExpandedImageBox.__init__(self)
|
|
|
|
self.toolTip = uiToolTip.ToolTip(100)
|
|
self.toolTip.HideToolTip()
|
|
|
|
def SetState(self, vnum):
|
|
self.toolTip.ClearToolTip()
|
|
|
|
item.SelectItem(vnum)
|
|
for i in xrange(item.ITEM_APPLY_MAX_NUM):
|
|
(affectType, affectValue) = item.GetAffect(i)
|
|
if affectType != 0:
|
|
affectString = self.AFFECT_DICT[affectType](affectValue)
|
|
if affectString:
|
|
self.__AppendText(affectString)
|
|
self.LoadImage("d:/ymir work/ui/pattern/HorseState/33.dds")
|
|
|
|
|
|
self.SetScale(0.7, 0.7)
|
|
|
|
def __AppendText(self, text):
|
|
|
|
self.toolTip.AppendTextLine(text)
|
|
self.toolTip.ResizeToolTip()
|
|
|
|
def OnMouseOverIn(self):
|
|
self.toolTip.ShowToolTip()
|
|
|
|
def OnMouseOverOut(self):
|
|
self.toolTip.HideToolTip()
|
|
|
|
# AUTO_POTION
|
|
class AutoPotionImage(ui.ExpandedImageBox):
|
|
|
|
FILE_PATH_HP = "d:/ymir work/ui/pattern/auto_hpgauge/"
|
|
FILE_PATH_SP = "d:/ymir work/ui/pattern/auto_spgauge/"
|
|
|
|
def __init__(self):
|
|
ui.ExpandedImageBox.__init__(self)
|
|
|
|
self.loverName = ""
|
|
self.lovePoint = 0
|
|
self.potionType = player.AUTO_POTION_TYPE_HP
|
|
self.filePath = ""
|
|
|
|
self.toolTip = uiToolTip.ToolTip(100)
|
|
self.toolTip.HideToolTip()
|
|
|
|
def __del__(self):
|
|
ui.ExpandedImageBox.__del__(self)
|
|
|
|
def SetPotionType(self, type):
|
|
self.potionType = type
|
|
|
|
if player.AUTO_POTION_TYPE_HP == type:
|
|
self.filePath = self.FILE_PATH_HP
|
|
elif player.AUTO_POTION_TYPE_SP == type:
|
|
self.filePath = self.FILE_PATH_SP
|
|
|
|
|
|
def OnUpdateAutoPotionImage(self):
|
|
self.__Refresh()
|
|
|
|
def __Refresh(self):
|
|
print "__Refresh"
|
|
|
|
isActivated, currentAmount, totalAmount, slotIndex = player.GetAutoPotionInfo(self.potionType)
|
|
|
|
amountPercent = (float(currentAmount) / totalAmount) * 100.0
|
|
grade = math.ceil(amountPercent / 20)
|
|
|
|
if 5.0 > amountPercent:
|
|
grade = 0
|
|
|
|
if 80.0 < amountPercent:
|
|
grade = 4
|
|
if 90.0 < amountPercent:
|
|
grade = 5
|
|
|
|
fmt = self.filePath + "%.2d.dds"
|
|
fileName = fmt % grade
|
|
|
|
print self.potionType, amountPercent, fileName
|
|
|
|
try:
|
|
self.LoadImage(fileName)
|
|
except:
|
|
import dbg
|
|
dbg.TraceError("AutoPotionImage.__Refresh(potionType=%d) - LoadError %s" % (self.potionType, fileName))
|
|
|
|
self.SetScale(0.7, 0.7)
|
|
|
|
self.toolTip.ClearToolTip()
|
|
|
|
if player.AUTO_POTION_TYPE_HP == type:
|
|
self.toolTip.SetTitle(localeInfo.TOOLTIP_AUTO_POTION_HP)
|
|
else:
|
|
self.toolTip.SetTitle(localeInfo.TOOLTIP_AUTO_POTION_SP)
|
|
|
|
self.toolTip.AppendTextLine(localeInfo.TOOLTIP_AUTO_POTION_REST % (amountPercent))
|
|
self.toolTip.ResizeToolTip()
|
|
|
|
def OnMouseOverIn(self):
|
|
self.toolTip.ShowToolTip()
|
|
|
|
def OnMouseOverOut(self):
|
|
self.toolTip.HideToolTip()
|
|
# END_OF_AUTO_POTION
|
|
|
|
|
|
class AffectImage(ui.ExpandedImageBox):
|
|
|
|
def __init__(self):
|
|
ui.ExpandedImageBox.__init__(self)
|
|
|
|
self.toolTipText = None
|
|
self.isSkillAffect = True
|
|
self.description = None
|
|
self.endTime = 0
|
|
self.affect = None
|
|
self.isClocked = True
|
|
|
|
def SetAffect(self, affect):
|
|
self.affect = affect
|
|
|
|
def GetAffect(self):
|
|
return self.affect
|
|
|
|
def SetToolTipText(self, text, x = 0, y = -19):
|
|
|
|
if not self.toolTipText:
|
|
textLine = ui.TextLine()
|
|
textLine.SetParent(self)
|
|
textLine.SetSize(0, 0)
|
|
textLine.SetOutline()
|
|
textLine.Hide()
|
|
self.toolTipText = textLine
|
|
|
|
self.toolTipText.SetText(text)
|
|
w, h = self.toolTipText.GetTextSize()
|
|
self.toolTipText.SetPosition(max(0, x + self.GetWidth()/2 - w/2), y)
|
|
|
|
def SetDescription(self, description):
|
|
self.description = description
|
|
|
|
def SetDuration(self, duration):
|
|
self.endTime = 0
|
|
if duration > 0:
|
|
self.endTime = app.GetGlobalTimeStamp() + duration
|
|
|
|
def UpdateAutoPotionDescription(self):
|
|
|
|
potionType = 0
|
|
if self.affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
|
potionType = player.AUTO_POTION_TYPE_HP
|
|
elif self.affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
|
potionType = player.AUTO_POTION_TYPE_SP
|
|
|
|
|
|
isActivated, currentAmount, totalAmount, slotIndex = player.GetAutoPotionInfo(potionType)
|
|
|
|
#print "UpdateAutoPotionDescription ", isActivated, currentAmount, totalAmount, slotIndex
|
|
|
|
amountPercent = 0.0
|
|
|
|
try:
|
|
amountPercent = (float(currentAmount) / totalAmount) * 100.0
|
|
except:
|
|
amountPercent = 100.0
|
|
|
|
self.SetToolTipText(self.description % amountPercent, 0, 40)
|
|
|
|
def SetClock(self, isClocked):
|
|
self.isClocked = isClocked
|
|
|
|
def UpdateDescription(self):
|
|
if not self.isClocked:
|
|
self.__UpdateDescription2()
|
|
return
|
|
|
|
if not self.description:
|
|
return
|
|
|
|
toolTip = self.description
|
|
if self.endTime > 0:
|
|
time = self.endTime - app.GetGlobalTimeStamp()
|
|
day = int(int((time / 60) / 60) / 24)
|
|
if day > 30:
|
|
leftTime = uiScriptLocale.FOREVER
|
|
else:
|
|
leftTime = localeInfo.SecondToDHM(self.endTime - app.GetGlobalTimeStamp())
|
|
toolTip += " (%s : %s)" % (localeInfo.LEFT_TIME, leftTime)
|
|
self.SetToolTipText(toolTip, 0, 40)
|
|
|
|
#µ¶ÀϹöÀü¿¡¼ ½Ã°£À» Á¦°ÅÇϱâ À§Çؼ »ç¿ë
|
|
def __UpdateDescription2(self):
|
|
if not self.description:
|
|
return
|
|
|
|
toolTip = self.description
|
|
self.SetToolTipText(toolTip, 0, 40)
|
|
|
|
def SetSkillAffectFlag(self, flag):
|
|
self.isSkillAffect = flag
|
|
|
|
def IsSkillAffect(self):
|
|
return self.isSkillAffect
|
|
|
|
def OnMouseOverIn(self):
|
|
|
|
if app.ENABLE_VOTE4BUFF:
|
|
if self.GetAffect() == chr.NEW_AFFECT_VOTE4BUFF:
|
|
global voteBuffData
|
|
interface = constInfo.GetInterfaceInstance()
|
|
if interface:
|
|
if interface.tooltipItem:
|
|
interface.tooltipItem.ClearToolTip()
|
|
interface.tooltipItem.AutoAppendNewTextLineResize(self.description)
|
|
interface.tooltipItem.AppendSpace(5)
|
|
interface.tooltipItem.AutoAppendNewTextLineResize(uiToolTip.ItemToolTip.POINT_DICT[voteBuffData[0]](voteBuffData[1]))
|
|
interface.tooltipItem.AppendSpace(5)
|
|
if self.endTime > 0:
|
|
time = self.endTime - app.GetGlobalTimeStamp()
|
|
day = int(int((time / 60) / 60) / 24)
|
|
if day > 30:
|
|
leftTime = uiScriptLocale.FOREVER
|
|
else:
|
|
leftTime = localeInfo.SecondToDHM(self.endTime - app.GetGlobalTimeStamp())
|
|
interface.tooltipItem.AutoAppendNewTextLineResize(" (%s : %s)" % (localeInfo.LEFT_TIME, leftTime))
|
|
interface.tooltipItem.ShowToolTip()
|
|
return
|
|
|
|
if self.toolTipText:
|
|
self.toolTipText.Show()
|
|
|
|
def OnMouseOverOut(self):
|
|
if app.ENABLE_VOTE4BUFF:
|
|
if self.GetAffect() == chr.NEW_AFFECT_VOTE4BUFF:
|
|
interface = constInfo.GetInterfaceInstance()
|
|
if interface:
|
|
if interface.tooltipItem:
|
|
interface.tooltipItem.HideToolTip()
|
|
return
|
|
if self.toolTipText:
|
|
self.toolTipText.Hide()
|
|
|
|
class AffectShower(ui.Window):
|
|
|
|
MALL_DESC_IDX_START = 1000
|
|
IMAGE_STEP = 25
|
|
IMAGE_HEIGHT = 26
|
|
|
|
COUNT_LINE = 14
|
|
|
|
AFFECT_MAX_NUM = 32
|
|
|
|
|
|
INFINITE_AFFECT_DURATION = 0x1FFFFFFF
|
|
|
|
AFFECT_DATA_DICT = {
|
|
chr.AFFECT_POISON : (localeInfo.SKILL_TOXICDIE, "d:/ymir work/ui/skill/common/affect/poison.sub"),
|
|
chr.AFFECT_SLOW : (localeInfo.SKILL_SLOW, "d:/ymir work/ui/skill/common/affect/slow.sub"),
|
|
chr.AFFECT_STUN : (localeInfo.SKILL_STUN, "d:/ymir work/ui/skill/common/affect/stun.sub"),
|
|
|
|
chr.AFFECT_ATT_SPEED_POTION : (localeInfo.SKILL_INC_ATKSPD, "flag/27102.tga"),
|
|
chr.AFFECT_MOV_SPEED_POTION : (localeInfo.SKILL_INC_MOVSPD, "flag/27105.tga"),
|
|
chr.AFFECT_FISH_MIND : (localeInfo.SKILL_FISHMIND, "d:/ymir work/ui/skill/common/affect/fishmind.sub"),
|
|
|
|
chr.AFFECT_JEONGWI : (localeInfo.SKILL_JEONGWI, "d:/ymir work/ui/skill/warrior/jeongwi_03.sub",),
|
|
chr.AFFECT_GEOMGYEONG : (localeInfo.SKILL_GEOMGYEONG, "d:/ymir work/ui/skill/warrior/geomgyeong_03.sub",),
|
|
chr.AFFECT_CHEONGEUN : (localeInfo.SKILL_CHEONGEUN, "d:/ymir work/ui/skill/warrior/cheongeun_03.sub",),
|
|
chr.AFFECT_GYEONGGONG : (localeInfo.SKILL_GYEONGGONG, "d:/ymir work/ui/skill/assassin/gyeonggong_03.sub",),
|
|
chr.AFFECT_EUNHYEONG : (localeInfo.SKILL_EUNHYEONG, "d:/ymir work/ui/skill/assassin/eunhyeong_03.sub",),
|
|
chr.AFFECT_GWIGEOM : (localeInfo.SKILL_GWIGEOM, "d:/ymir work/ui/skill/sura/gwigeom_03.sub",),
|
|
chr.AFFECT_GONGPO : (localeInfo.SKILL_GONGPO, "d:/ymir work/ui/skill/sura/gongpo_03.sub",),
|
|
chr.AFFECT_JUMAGAP : (localeInfo.SKILL_JUMAGAP, "d:/ymir work/ui/skill/sura/jumagap_03.sub"),
|
|
chr.AFFECT_HOSIN : (localeInfo.SKILL_HOSIN, "d:/ymir work/ui/skill/shaman/hosin_03.sub",),
|
|
chr.AFFECT_BOHO : (localeInfo.SKILL_BOHO, "d:/ymir work/ui/skill/shaman/boho_03.sub",),
|
|
chr.AFFECT_KWAESOK : (localeInfo.SKILL_KWAESOK, "d:/ymir work/ui/skill/shaman/kwaesok_03.sub",),
|
|
chr.AFFECT_HEUKSIN : (localeInfo.SKILL_HEUKSIN, "d:/ymir work/ui/skill/sura/heuksin_03.sub",),
|
|
chr.AFFECT_MUYEONG : (localeInfo.SKILL_MUYEONG, "d:/ymir work/ui/skill/sura/muyeong_03.sub",),
|
|
chr.AFFECT_GICHEON : (localeInfo.SKILL_GICHEON, "d:/ymir work/ui/skill/shaman/gicheon_03.sub",),
|
|
chr.AFFECT_JEUNGRYEOK : (localeInfo.SKILL_JEUNGRYEOK, "d:/ymir work/ui/skill/shaman/jeungryeok_03.sub",),
|
|
chr.AFFECT_PABEOP : (localeInfo.SKILL_PABEOP, "d:/ymir work/ui/skill/sura/pabeop_03.sub",),
|
|
chr.AFFECT_FALLEN_CHEONGEUN : (localeInfo.SKILL_CHEONGEUN, "d:/ymir work/ui/skill/warrior/cheongeun_03.sub",),
|
|
28 : (localeInfo.SKILL_FIRE, "d:/ymir work/ui/skill/sura/hwayeom_03.sub",),
|
|
chr.AFFECT_CHINA_FIREWORK : (localeInfo.SKILL_POWERFUL_STRIKE, "d:/ymir work/ui/skill/common/affect/powerfulstrike.sub",),
|
|
|
|
#64 - END
|
|
chr.NEW_AFFECT_EXP_BONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/exp_bonus.sub",),
|
|
|
|
chr.NEW_AFFECT_ITEM_BONUS : (localeInfo.TOOLTIP_MALL_ITEMBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/item_bonus.sub",),
|
|
chr.NEW_AFFECT_SAFEBOX : (localeInfo.TOOLTIP_MALL_SAFEBOX, "d:/ymir work/ui/skill/common/affect/safebox.sub",),
|
|
chr.NEW_AFFECT_AUTOLOOT : (localeInfo.TOOLTIP_MALL_AUTOLOOT, "d:/ymir work/ui/skill/common/affect/autoloot.sub",),
|
|
chr.NEW_AFFECT_FISH_MIND : (localeInfo.TOOLTIP_MALL_FISH_MIND, "d:/ymir work/ui/skill/common/affect/fishmind.sub",),
|
|
chr.NEW_AFFECT_MARRIAGE_FAST : (localeInfo.TOOLTIP_MALL_MARRIAGE_FAST, "d:/ymir work/ui/skill/common/affect/marriage_fast.sub",),
|
|
chr.NEW_AFFECT_GOLD_BONUS : (localeInfo.TOOLTIP_MALL_GOLDBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub",),
|
|
|
|
chr.NEW_AFFECT_NO_DEATH_PENALTY : (localeInfo.TOOLTIP_APPLY_NO_DEATH_PENALTY, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
|
chr.NEW_AFFECT_SKILL_BOOK_BONUS : (localeInfo.TOOLTIP_APPLY_SKILL_BOOK_BONUS, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
|
chr.NEW_AFFECT_SKILL_BOOK_NO_DELAY : (localeInfo.TOOLTIP_APPLY_SKILL_BOOK_NO_DELAY, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
|
|
|
# ÀÚµ¿¹°¾à hp, sp
|
|
chr.NEW_AFFECT_AUTO_HP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "icon/item/elixir_rojo.tga"),
|
|
chr.NEW_AFFECT_AUTO_SP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "icon/item/elixir_azul.tga"),
|
|
#chr.NEW_AFFECT_AUTO_HP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
|
#chr.NEW_AFFECT_AUTO_SP_RECOVERY : (localeInfo.TOOLTIP_AUTO_POTION_REST, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub"),
|
|
|
|
MALL_DESC_IDX_START+player.POINT_MALL_ATTBONUS : (localeInfo.TOOLTIP_MALL_ATTBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/att_bonus.sub",),
|
|
MALL_DESC_IDX_START+player.POINT_MALL_DEFBONUS : (localeInfo.TOOLTIP_MALL_DEFBONUS_STATIC, "d:/ymir work/ui/skill/common/affect/def_bonus.sub",),
|
|
MALL_DESC_IDX_START+player.POINT_MALL_EXPBONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS, "d:/ymir work/ui/skill/common/affect/exp_bonus.sub",),
|
|
MALL_DESC_IDX_START+player.POINT_MALL_ITEMBONUS : (localeInfo.TOOLTIP_MALL_ITEMBONUS, "d:/ymir work/ui/skill/common/affect/item_bonus.sub",),
|
|
MALL_DESC_IDX_START+player.POINT_MALL_GOLDBONUS : (localeInfo.TOOLTIP_MALL_GOLDBONUS, "d:/ymir work/ui/skill/common/affect/gold_bonus.sub",),
|
|
MALL_DESC_IDX_START+player.POINT_CRITICAL_PCT : (localeInfo.TOOLTIP_APPLY_CRITICAL_PCT,"d:/ymir work/ui/skill/common/affect/critical.sub"),
|
|
MALL_DESC_IDX_START+player.POINT_PENETRATE_PCT : (localeInfo.TOOLTIP_APPLY_PENETRATE_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
|
MALL_DESC_IDX_START+player.POINT_MAX_HP_PCT : (localeInfo.TOOLTIP_MAX_HP_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
|
MALL_DESC_IDX_START+player.POINT_MAX_SP_PCT : (localeInfo.TOOLTIP_MAX_SP_PCT, "d:/ymir work/ui/skill/common/affect/gold_premium.sub"),
|
|
|
|
MALL_DESC_IDX_START+player.POINT_PC_BANG_EXP_BONUS : (localeInfo.TOOLTIP_MALL_EXPBONUS_P_STATIC, "d:/ymir work/ui/skill/common/affect/EXP_Bonus_p_on.sub",),
|
|
MALL_DESC_IDX_START+player.POINT_PC_BANG_DROP_BONUS: (localeInfo.TOOLTIP_MALL_ITEMBONUS_P_STATIC, "d:/ymir work/ui/skill/common/affect/Item_Bonus_p_on.sub",),
|
|
}
|
|
if app.ENABLE_VOTE4BUFF:
|
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_VOTE4BUFF] = (localeInfo.NEW_AFFECT_VOTE4BUFF, "icon/affectshower/vote4buff.tga")
|
|
|
|
if app.ENABLE_MULTI_FARM_BLOCK:
|
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_MULTI_FARM] = (localeInfo.MULTI_FARM_PREMIUM_EFFECT, "d:/ymir work/ui/game/farm/can_farm_premimum.tga")
|
|
|
|
if app.ENABLE_NEW_AUTOPOTION:
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_ATTACK_SPEED_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_ATTACK_SPEED_RECOVERY, "icon/item/verde_arriba.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_MOV_SPEED_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_MOV_SPEED_RECOVERY, "icon/item/morada.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_CRITICAL_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_CRITICAL_RECOVERY, "icon/item/79051_1.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_PENETRATE_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_PENETRATE_RECOVERY, "icon/item/79052_1.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_VIT_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_VIT_RECOVERY, "icon/item/79053_1.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_STR_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_STR_RECOVERY, "icon/item/79054_1.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_INT_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_INT_RECOVERY, "icon/item/79055_1.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_DEX_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_DEX_RECOVERY, "icon/item/79056_1.tga")
|
|
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_RED_POTION_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_RED_POTION_RECOVERY, "icon/item/50821.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_ORANGE_POTION_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_ORANGE_POTION_RECOVERY, "icon/item/50822.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_YELLOW_POTION_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_YELLOW_POTION_RECOVERY, "icon/item/50823.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_GREEN_POTION_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_GREEN_POTION_RECOVERY, "icon/item/50824.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_BLUE_POTION_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_BLUE_POTION_RECOVERY, "icon/item/50825.tga")
|
|
AFFECT_DATA_DICT[chr.AFFECT_AUTO_WHITE_POTION_RECOVERY + 20] = (localeInfo.TOOLTIP_AUTO_WHITE_POTION_RECOVERY, "icon/item/50826.tga")
|
|
|
|
if app.ENABLE_DRAGON_SOUL_SYSTEM:
|
|
# ¿ëÈ¥¼® õ, Áö µ¦.
|
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK1] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK1, "d:/ymir work/ui/dragonsoul/buff_ds_sky1.tga")
|
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_DRAGON_SOUL_DECK2] = (localeInfo.TOOLTIP_DRAGON_SOUL_DECK2, "d:/ymir work/ui/dragonsoul/buff_ds_land1.tga")
|
|
if app.ENABLE_WOLFMAN_CHARACTER:
|
|
AFFECT_DATA_DICT[chr.AFFECT_BLEEDING] = (localeInfo.SKILL_BLEEDING, "d:/ymir work/ui/skill/common/affect/poison.sub")
|
|
AFFECT_DATA_DICT[chr.AFFECT_RED_POSSESSION] = ("Red Possession", "d:/ymir work/ui/skill/wolfman/red_possession_03.sub")
|
|
AFFECT_DATA_DICT[chr.AFFECT_BLUE_POSSESSION] = ("Blue Possession", "d:/ymir work/ui/skill/wolfman/blue_possession_03.sub")
|
|
if (app.WJ_COMBAT_ZONE):
|
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_COMBAT_ZONE_POTION] = (localeInfo.COMBAT_ZONE_TOOLTIP_BATTLE_POTION, "icon/item/27125.tga")
|
|
if app.ENABLE_OFFLINESHOP_SYSTEM:
|
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_DECORATION] = (localeInfo.NEW_AFFECT_DECORATION, "d:/ymir work/ui/game/offlineshop/decoration.dds")
|
|
|
|
if app.ENABLE_NEW_AFFECT_POTION:
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][1]] = (localeInfo.TOOLTIP_AFFECT_POTION_1, AFFECT_POTION["image"][1])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][2]] = (localeInfo.TOOLTIP_AFFECT_POTION_2, AFFECT_POTION["image"][2])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][3]] = (localeInfo.TOOLTIP_AFFECT_POTION_3, AFFECT_POTION["image"][3])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][4]] = (localeInfo.TOOLTIP_AFFECT_POTION_4, AFFECT_POTION["image"][4])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][5]] = (localeInfo.TOOLTIP_AFFECT_POTION_5, AFFECT_POTION["image"][5])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][6]] = (localeInfo.TOOLTIP_AFFECT_POTION_6, AFFECT_POTION["image"][6])
|
|
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][7]] = (localeInfo.TOOLTIP_AFFECT_CRISTALES_1, AFFECT_POTION["image"][7])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][8]] = (localeInfo.TOOLTIP_AFFECT_CRISTALES_2, AFFECT_POTION["image"][8])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][9]] = (localeInfo.TOOLTIP_AFFECT_CRISTALES_3, AFFECT_POTION["image"][9])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][10]] = (localeInfo.TOOLTIP_AFFECT_CRISTALES_4, AFFECT_POTION["image"][10])
|
|
AFFECT_DATA_DICT[AFFECT_POTION["affect"][11]] = (localeInfo.TOOLTIP_AFFECT_CRISTALES_5, AFFECT_POTION["image"][11])
|
|
|
|
if app.ENABLE_AUTOMATIC_PICK_UP_SYSTEM:
|
|
AFFECT_DATA_DICT[chr.NEW_AFFECT_AUTO_PICK_UP] = (localeInfo.NEW_AFFECT_AUTO_PICK_UP, "d:/ymir work/ui/game/farm/premium_pickup.tga")
|
|
|
|
AFFECT_PET_DATA_DICT ={
|
|
5401 : ("Rezistenza (Guerriero)", "d:/ymir work/ui/skill/pet/jijoong.sub"),
|
|
5402 : ("Rezistenza (Sura)", "d:/ymir work/ui/skill/pet/jijoong.sub"),
|
|
5403 : ("Rezistenza (Ninja)", "d:/ymir work/ui/skill/pet/jijoong.sub"),
|
|
5404 : ("Rezistenza (Samano)", "d:/ymir work/ui/skill/pet/jijoong.sub"),
|
|
5405 : ("Rezistenza (Lycan)", "d:/ymir work/ui/skill/pet/jijoong.sub"),
|
|
5406 : ("Berserker", "d:/ymir work/ui/skill/pet/pacheon.sub"),
|
|
5407 : ("Anti-Magia", "d:/ymir work/ui/skill/pet/cheonryeong.sub"),
|
|
5408 : ("Accelerazione", "d:/ymir work/ui/skill/pet/banya.sub"),
|
|
5409 : ("Perforazione", "d:/ymir work/ui/skill/pet/choehoenbimu.sub"),
|
|
5410 : ("Rinnovo", "d:/ymir work/ui/skill/pet/heal.sub"),
|
|
5411 : ("Vampirismo", "d:/ymir work/ui/skill/pet/stealhp.sub"),
|
|
5412 : ("Fantasmi", "d:/ymir work/ui/skill/pet/stealmp.sub"),
|
|
5413 : ("Intoppo", "d:/ymir work/ui/skill/pet/block.sub"),
|
|
5414 : ("Specchio", "d:/ymir work/ui/skill/pet/reflect_melee.sub"),
|
|
5415 : ("Drop Yang", "d:/ymir work/ui/skill/pet/gold_drop.sub"),
|
|
5416 : ("Portata", "d:/ymir work/ui/skill/pet/bow_distance.sub"),
|
|
5417 : ("Invincibilta", "d:/ymir work/ui/skill/pet/invincibility.sub"),
|
|
5418 : ("Guarigione", "d:/ymir work/ui/skill/pet/removal.sub"),
|
|
}
|
|
|
|
|
|
|
|
def __init__(self):
|
|
ui.Window.__init__(self)
|
|
|
|
self.serverPlayTime=0
|
|
self.clientPlayTime=0
|
|
|
|
self.lastUpdateTime=0
|
|
self.affectImageDict={}
|
|
self.horseImage=None
|
|
self.mountImage=None
|
|
self.lovePointImage=None
|
|
if app.ENABLE_MULTI_FARM_BLOCK:
|
|
self.multiFarmBlockDialog=None
|
|
self.farmStatusImage=None
|
|
if app.ENABLE_CONQUEROR_LEVEL:
|
|
self.SungmaImage = None
|
|
|
|
self.autoPotionImageHP = AutoPotionImage()
|
|
self.autoPotionImageSP = AutoPotionImage()
|
|
self.SetPosition(10, 10)
|
|
if app.TOURNAMENT_PVP_SYSTEM:
|
|
if player.IsTournamentMap():
|
|
self.Hide()
|
|
else:
|
|
self.Show()
|
|
else:
|
|
self.Show()
|
|
|
|
def ClearAllAffects(self):
|
|
self.horseImage=None
|
|
self.mountImage=None
|
|
self.lovePointImage=None
|
|
if app.ENABLE_MULTI_FARM_BLOCK:
|
|
self.multiFarmBlockDialog=None
|
|
self.farmStatusImage=None
|
|
if app.ENABLE_CONQUEROR_LEVEL:
|
|
self.SungmaImage = None
|
|
self.affectImageDict={}
|
|
self.__ArrangeImageList()
|
|
|
|
def ClearAffects(self): ## ½ºÅ³ ÀÌÆåÆ®¸¸ ¾ø¾Û´Ï´Ù.
|
|
self.living_affectImageDict={}
|
|
for key, image in self.affectImageDict.items():
|
|
if not image.IsSkillAffect():
|
|
self.living_affectImageDict[key] = image
|
|
self.affectImageDict = self.living_affectImageDict
|
|
self.__ArrangeImageList()
|
|
|
|
def BINARY_NEW_AddAffect(self, type, pointIdx, value, duration):
|
|
|
|
print "BINARY_NEW_AddAffect", type, pointIdx, value, duration
|
|
|
|
if app.ENABLE_NEW_AFFECT_POTION:
|
|
if type < 500 and not type == AFFECT_POTION["affect"][1] and not type == AFFECT_POTION["affect"][2] and not type == AFFECT_POTION["affect"][3] and not type == AFFECT_POTION["affect"][4] and not type == AFFECT_POTION["affect"][5] and not type == AFFECT_POTION["affect"][6] and not type == AFFECT_POTION["affect"][7] and not type == AFFECT_POTION["affect"][8] and not type == AFFECT_POTION["affect"][9] and not type == AFFECT_POTION["affect"][10] and not type == AFFECT_POTION["affect"][11]:
|
|
return
|
|
else:
|
|
if type < 500:
|
|
return
|
|
|
|
if type == chr.NEW_AFFECT_MALL:
|
|
affect = self.MALL_DESC_IDX_START + pointIdx
|
|
else:
|
|
affect = type
|
|
|
|
if self.affectImageDict.has_key(affect):
|
|
return
|
|
|
|
if not self.AFFECT_DATA_DICT.has_key(affect) and not self.AFFECT_PET_DATA_DICT.has_key(affect):
|
|
return
|
|
|
|
if app.ENABLE_VOTE4BUFF:
|
|
if type == chr.NEW_AFFECT_VOTE4BUFF:
|
|
global voteBuffData
|
|
voteBuffData = [pointIdx, value]
|
|
|
|
|
|
## ¿ë½ÅÀÇ °¡È£, ¼±ÀÎÀÇ ±³ÈÆÀº Duration À» 0 À¸·Î ¼³Á¤ÇÑ´Ù.
|
|
if affect == chr.NEW_AFFECT_NO_DEATH_PENALTY or\
|
|
affect == chr.NEW_AFFECT_SKILL_BOOK_BONUS or\
|
|
affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or\
|
|
affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY or\
|
|
affect == chr.NEW_AFFECT_SKILL_BOOK_NO_DELAY:
|
|
duration = 0
|
|
|
|
if affect >= 5400 and affect <= 5419:
|
|
affectData = self.AFFECT_PET_DATA_DICT[affect]
|
|
#chat.AppendChat(chat.CHAT_TYPE_INFO, "prova")
|
|
else:
|
|
affectData = self.AFFECT_DATA_DICT[affect]
|
|
description = affectData[0]
|
|
filename = affectData[1]
|
|
|
|
if pointIdx == player.POINT_MALL_ITEMBONUS or\
|
|
pointIdx == player.POINT_MALL_GOLDBONUS:
|
|
value = 1 + float(value) / 100.0
|
|
|
|
trashValue = 123
|
|
#if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
|
if trashValue == 1:
|
|
try:
|
|
#image = AutoPotionImage()
|
|
#image.SetParent(self)
|
|
image = None
|
|
|
|
if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
|
|
image.SetPotionType(player.AUTO_POTION_TYPE_SP)
|
|
image = self.autoPotionImageSP
|
|
#self.autoPotionImageSP = image;
|
|
else:
|
|
image.SetPotionType(player.AUTO_POTION_TYPE_HP)
|
|
image = self.autoPotionImageHP
|
|
#self.autoPotionImageHP = image;
|
|
|
|
image.SetParent(self)
|
|
image.Show()
|
|
image.OnUpdateAutoPotionImage()
|
|
|
|
self.affectImageDict[affect] = image
|
|
self.__ArrangeImageList()
|
|
|
|
except Exception, e:
|
|
print "except Aff auto potion affect ", e
|
|
pass
|
|
|
|
else:
|
|
if affect != chr.NEW_AFFECT_AUTO_SP_RECOVERY and affect != chr.NEW_AFFECT_AUTO_HP_RECOVERY and not self.AFFECT_PET_DATA_DICT.has_key(affect):
|
|
if app.ENABLE_NEW_AUTOPOTION:
|
|
if affect < chr.AFFECT_AUTO_ATTACK_SPEED_RECOVERY + 20 or affect > chr.AFFECT_AUTO_WHITE_POTION_RECOVERY + 20:
|
|
description = description(float(value))
|
|
else:
|
|
description = description(float(value))
|
|
|
|
try:
|
|
print "Add affect %s" % affect
|
|
image = AffectImage()
|
|
image.SetParent(self)
|
|
image.LoadImage(filename)
|
|
image.SetDescription(description)
|
|
image.SetDuration(duration)
|
|
image.SetAffect(affect)
|
|
if affect == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE or\
|
|
affect == chr.NEW_AFFECT_EXP_BONUS_EURO_FREE_UNDER_15 or\
|
|
self.INFINITE_AFFECT_DURATION < duration:
|
|
image.SetClock(False)
|
|
image.UpdateDescription()
|
|
elif affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY or affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
|
image.UpdateAutoPotionDescription()
|
|
else:
|
|
image.UpdateDescription()
|
|
|
|
if affect == chr.NEW_AFFECT_DRAGON_SOUL_DECK1 or affect == chr.NEW_AFFECT_DRAGON_SOUL_DECK2:
|
|
image.SetScale(1, 1)
|
|
else:
|
|
image.SetScale(0.7, 0.7)
|
|
image.SetSkillAffectFlag(False)
|
|
image.Show()
|
|
self.affectImageDict[affect] = image
|
|
self.__ArrangeImageList()
|
|
except Exception, e:
|
|
print "except Aff affect ", e
|
|
pass
|
|
|
|
def BINARY_NEW_RemoveAffect(self, type, pointIdx):
|
|
if type == chr.NEW_AFFECT_MALL:
|
|
affect = self.MALL_DESC_IDX_START + pointIdx
|
|
else:
|
|
affect = type
|
|
|
|
print "Remove Affect %s %s" % ( type , pointIdx )
|
|
self.__RemoveAffect(affect)
|
|
self.__ArrangeImageList()
|
|
|
|
def SetAffect(self, affect):
|
|
self.__AppendAffect(affect)
|
|
self.__ArrangeImageList()
|
|
|
|
def ResetAffect(self, affect):
|
|
self.__RemoveAffect(affect)
|
|
self.__ArrangeImageList()
|
|
|
|
def SetLoverInfo(self, name, lovePoint):
|
|
image = LovePointImage()
|
|
image.SetParent(self)
|
|
image.SetLoverInfo(name, lovePoint)
|
|
self.lovePointImage = image
|
|
self.__ArrangeImageList()
|
|
|
|
def ShowLoverState(self):
|
|
if self.lovePointImage:
|
|
self.lovePointImage.Show()
|
|
self.__ArrangeImageList()
|
|
|
|
def HideLoverState(self):
|
|
if self.lovePointImage:
|
|
self.lovePointImage.Hide()
|
|
self.__ArrangeImageList()
|
|
|
|
def ClearLoverState(self):
|
|
self.lovePointImage = None
|
|
self.__ArrangeImageList()
|
|
|
|
def OnUpdateLovePoint(self, lovePoint):
|
|
if self.lovePointImage:
|
|
self.lovePointImage.OnUpdateLovePoint(lovePoint)
|
|
|
|
def SetMountActive(self):
|
|
if int(constInfo.Mount_Affect["status"]) == 0:
|
|
if self.mountImage:
|
|
self.mountImage.Hide()
|
|
self.mountImage=None
|
|
else:
|
|
image = MountImage()
|
|
image.SetParent(self)
|
|
image.SetState(constInfo.Mount_Affect["vnum"])
|
|
image.Show()
|
|
|
|
self.mountImage=image
|
|
self.__ArrangeImageList()
|
|
|
|
def SetHorseState(self, level, health, battery):
|
|
if level==0:
|
|
self.horseImage=None
|
|
else:
|
|
image = HorseImage()
|
|
image.SetParent(self)
|
|
image.SetState(level, health, battery)
|
|
image.Show()
|
|
|
|
self.horseImage=image
|
|
self.__ArrangeImageList()
|
|
|
|
if app.ENABLE_CONQUEROR_LEVEL:
|
|
def SetSungMaAffectImage(self, str, hp, move, inmune):
|
|
image = SungMaAffectImage(str, hp, move, inmune)
|
|
image.SetParent(self)
|
|
image.SetSungmaValue(str, hp, move, inmune)
|
|
image.Show()
|
|
|
|
self.SungmaImage=image
|
|
self.__ArrangeImageList()
|
|
|
|
def SetPlayTime(self, playTime):
|
|
self.serverPlayTime = playTime
|
|
self.clientPlayTime = app.GetTime()
|
|
|
|
if localeInfo.IsVIETNAM():
|
|
image = PlayTimeImage()
|
|
image.SetParent(self)
|
|
image.SetPlayTime(playTime)
|
|
image.Show()
|
|
|
|
self.playTimeImage=image
|
|
self.__ArrangeImageList()
|
|
|
|
def __AppendAffect(self, affect):
|
|
|
|
if self.affectImageDict.has_key(affect):
|
|
return
|
|
|
|
try:
|
|
affectData = self.AFFECT_DATA_DICT[affect]
|
|
except KeyError:
|
|
return
|
|
|
|
name = affectData[0]
|
|
filename = affectData[1]
|
|
|
|
skillIndex = player.AffectIndexToSkillIndex(affect)
|
|
if 0 != skillIndex:
|
|
name = skill.GetSkillName(skillIndex)
|
|
|
|
image = AffectImage()
|
|
image.SetParent(self)
|
|
image.SetSkillAffectFlag(True)
|
|
|
|
try:
|
|
image.LoadImage(filename)
|
|
except:
|
|
pass
|
|
|
|
image.SetToolTipText(name, 0, 40)
|
|
image.SetScale(0.7, 0.7)
|
|
image.Show()
|
|
self.affectImageDict[affect] = image
|
|
|
|
def __RemoveAffect(self, affect):
|
|
"""
|
|
if affect == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
|
|
self.autoPotionImageSP.Hide()
|
|
|
|
if affect == chr.NEW_AFFECT_AUTO_HP_RECOVERY:
|
|
self.autoPotionImageHP.Hide()
|
|
"""
|
|
|
|
if not self.affectImageDict.has_key(affect):
|
|
print "__RemoveAffect %s ( No Affect )" % affect
|
|
return
|
|
|
|
print "__RemoveAffect %s ( Affect )" % affect
|
|
del self.affectImageDict[affect]
|
|
|
|
self.__ArrangeImageList()
|
|
|
|
def __ArrangeImageList(self):
|
|
import chat
|
|
|
|
width = len(self.affectImageDict) * self.IMAGE_STEP
|
|
height = len(self.affectImageDict) * self.IMAGE_STEP
|
|
|
|
if app.ENABLE_CONQUEROR_LEVEL:
|
|
if self.SungmaImage:
|
|
width+=self.IMAGE_STEP
|
|
|
|
if self.lovePointImage:
|
|
width += self.IMAGE_STEP
|
|
height += self.IMAGE_HEIGHT
|
|
|
|
if app.ENABLE_MULTI_FARM_BLOCK:
|
|
if self.farmStatusImage:
|
|
width+=self.IMAGE_STEP
|
|
height += self.IMAGE_HEIGHT
|
|
|
|
if self.horseImage:
|
|
width += self.IMAGE_STEP
|
|
height += self.IMAGE_HEIGHT
|
|
|
|
|
|
if self.mountImage:
|
|
width += self.IMAGE_STEP
|
|
height += self.IMAGE_HEIGHT
|
|
|
|
height = self.IMAGE_HEIGHT*(((height/self.IMAGE_HEIGHT)/self.COUNT_LINE)+1)
|
|
|
|
if (width/self.IMAGE_STEP) < self.COUNT_LINE:
|
|
width = self.IMAGE_STEP * (width/self.IMAGE_STEP)
|
|
else:
|
|
width = self.IMAGE_STEP * self.COUNT_LINE
|
|
|
|
self.SetSize(width, height)
|
|
|
|
xPos = 0
|
|
yPos = 0
|
|
|
|
|
|
if app.ENABLE_MULTI_FARM_BLOCK:
|
|
if self.farmStatusImage:
|
|
if self.farmStatusImage.IsShow():
|
|
self.farmStatusImage.SetPosition(xPos, 0)
|
|
xPos += self.IMAGE_STEP
|
|
|
|
if app.ENABLE_CONQUEROR_LEVEL:
|
|
if self.SungmaImage:
|
|
if self.SungmaImage.IsShow():
|
|
self.SungmaImage.SetPosition(xPos, 0)
|
|
xPos += self.IMAGE_STEP
|
|
|
|
if self.lovePointImage:
|
|
if self.lovePointImage.IsShow():
|
|
self.lovePointImage.SetPosition(xPos, yPos)
|
|
xPos += self.IMAGE_STEP
|
|
if self.FuncLineCount(xPos):
|
|
yPos += self.IMAGE_HEIGHT
|
|
xPos = 0
|
|
|
|
if self.horseImage:
|
|
self.horseImage.SetPosition(xPos, yPos)
|
|
xPos += self.IMAGE_STEP
|
|
if self.FuncLineCount(xPos):
|
|
yPos += self.IMAGE_HEIGHT
|
|
xPos = 0
|
|
|
|
if self.mountImage:
|
|
self.mountImage.SetPosition(xPos, yPos)
|
|
xPos += self.IMAGE_STEP
|
|
if self.FuncLineCount(xPos):
|
|
yPos += self.IMAGE_HEIGHT
|
|
xPos = 0
|
|
|
|
|
|
for image in self.affectImageDict.values():
|
|
image.SetPosition(xPos, yPos)
|
|
xPos += self.IMAGE_STEP
|
|
if self.FuncLineCount(xPos):
|
|
yPos += self.IMAGE_HEIGHT
|
|
xPos = 0
|
|
|
|
if app.ENABLE_MULTI_FARM_BLOCK:
|
|
def __OnClickMultiFarm(self, emptyArg):
|
|
multiFarmBlockDialog = uiCommon.QuestionDialog()
|
|
if self.farmStatusImage.multiFarmStatus:
|
|
multiFarmBlockDialog.SetText(localeInfo.MULTI_FARM_DEACTIVE_TEXT)
|
|
else:
|
|
multiFarmBlockDialog.SetText(localeInfo.MULTI_FARM_ACTIVE_TEXT)
|
|
multiFarmBlockDialog.SetAcceptEvent(lambda arg = True: self.OnCloseMultiFarm(arg))
|
|
multiFarmBlockDialog.SetCancelEvent(lambda arg = False: self.OnCloseMultiFarm(arg))
|
|
multiFarmBlockDialog.Open()
|
|
self.multiFarmBlockDialog = multiFarmBlockDialog
|
|
def OnCloseMultiFarm(self, answer):
|
|
if not self.multiFarmBlockDialog:
|
|
return
|
|
if answer:
|
|
net.SendChatPacket("/multi_farm")
|
|
self.multiFarmBlockDialog.Close()
|
|
self.multiFarmBlockDialog = None
|
|
def SetMultiFarmPlayer(self, playerName):
|
|
if self.farmStatusImage:
|
|
self.farmStatusImage.players.append(playerName)
|
|
def SetMultiFarmInfo(self, farmStatus):
|
|
image = MultiFarmImage()
|
|
image.SetParent(self)
|
|
image.SetMultiFarmInfo(farmStatus)
|
|
image.SetEvent(ui.__mem_func__(self.__OnClickMultiFarm),"mouse_click")
|
|
image.Show()
|
|
self.farmStatusImage = image
|
|
self.__ArrangeImageList()
|
|
|
|
def FuncLineCount(self,number):
|
|
test = number / self.IMAGE_STEP
|
|
cal = test % self.COUNT_LINE
|
|
if cal == 0:
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
def OnUpdate(self):
|
|
try:
|
|
if app.GetGlobalTime() - self.lastUpdateTime > 500:
|
|
#if 0 < app.GetGlobalTime():
|
|
self.lastUpdateTime = app.GetGlobalTime()
|
|
|
|
for image in self.affectImageDict.values():
|
|
if image.GetAffect() == chr.NEW_AFFECT_AUTO_HP_RECOVERY or image.GetAffect() == chr.NEW_AFFECT_AUTO_SP_RECOVERY:
|
|
image.UpdateAutoPotionDescription()
|
|
continue
|
|
|
|
if not image.IsSkillAffect():
|
|
image.UpdateDescription()
|
|
except Exception, e:
|
|
print "AffectShower::OnUpdate error : ", e
|
|
|