Ejemplo n.º 1
0
	def OnUpdate(self):
		chr.Update()

		(xposEventSet, yposEventSet) = self.textBoard.GetGlobalPosition()
		event.UpdateEventSet(self.descIndex, xposEventSet+7, -(yposEventSet+7))
		self.descriptionBox.SetIndex(self.descIndex)

		for i in xrange(SLOT_COUNT[self.gender]):
			self.curNameAlpha[i] += (self.destNameAlpha[i] - self.curNameAlpha[i]) / 10.0
			self.NameList[self.gender][i].SetAlpha(self.curNameAlpha[i])

		for i in xrange(4):
			self.curGauge[i] += (self.destGauge[i] - self.curGauge[i]) / 10.0
			if abs(self.curGauge[i] - self.destGauge[i]) < 0.005:
				self.curGauge[i] = self.destGauge[i]
			self.GaugeList[i].SetPercentage(self.curGauge[i], 1.0)

		for page in xrange(PAGE_COUNT):
			for i in xrange(SLOT_COUNT[page]):
				chr.SelectInstance(self.__GetSlotChrID(page, i))

				distance = 50.0
				rotRadian = self.curRotation[i] * (math.pi*2) / 360.0
				x = distance*math.sin(rotRadian) + distance*math.cos(rotRadian)
				y = distance*math.cos(rotRadian) - distance*math.sin(rotRadian)
				chr.SetPixelPosition(int(x), int(y), 30)

				if abs(self.destRotation[i] - self.curRotation[i]) < 1.0:
					self.curRotation[i] = self.destRotation[i]

				dir = app.GetRotatingDirection(self.destRotation[i], self.curRotation[i])
				rot = app.GetDegreeDifference(self.destRotation[i], self.curRotation[i])

				if app.DEGREE_DIRECTION_RIGHT == dir:
					self.curRotation[i] += rot / 10.0
				elif app.DEGREE_DIRECTION_LEFT == dir:
					self.curRotation[i] -= rot / 10.0

				self.curRotation[i] = (self.curRotation[i] + 360.0) % 360.0

		###########################################################
		if -1 != self.reservingRaceIndex:
			if app.GetTime() - self.reservingStartTime >= 1.5:

				chrSlot=self.stream.GetCharacterSlot()
				textName = self.editCharacterName.GetText()
				raceIndex = self.reservingRaceIndex
				shapeIndex = self.reservingShapeIndex

				startStat = self.START_STAT[self.reservingRaceIndex]
				statCon = self.stat[0] - startStat[0]
				statInt = self.stat[1] - startStat[1]
				statStr = self.stat[2] - startStat[2]
				statDex = self.stat[3] - startStat[3]

				net.SendCreateCharacterPacket(chrSlot, textName, raceIndex, shapeIndex, statCon, statInt, statStr, statDex)

				self.reservingRaceIndex = -1
Ejemplo n.º 2
0
    def OnUpdate(self):
        chr.Update()

        for page in xrange(PAGE_COUNT):
            for i in xrange(SLOT_COUNT):
                chr.SelectInstance(self.__GetSlotChrID(page, i))
                chr.Show()

        if -1 != self.reservingRaceIndex:
            if app.GetTime() - self.reservingStartTime >= 1.5:

                chrSlot = self.stream.GetCharacterSlot()
                textName = self.editCharacterName.GetText()
                raceIndex = self.reservingRaceIndex
                shapeIndex = self.reservingShapeIndex

                net.SendCreateCharacterPacket(chrSlot, textName, raceIndex,
                                              shapeIndex, 0, 0, 0, 0)

                self.reservingRaceIndex = -1
Ejemplo n.º 3
0
	def CreateCharacterButton(self):
		if self.job_id == self.M2_INIT_VALUE or self.MotionStart :
			return 
		
		textName = self.editCharacterName.GetText()
		
		if False == self.CheckCreateCharacterName(textName): 
			return
		
		self.DisableWindow()
		
		chrSlot=self.stream.GetCharacterSlot()
		raceIndex = self.M2_CONST_ID[self.job_id][self.gender]
		shapeIndex = self.shape
		statCon = self.M2STATPOINT[self.job_id][0]
		statInt = self.M2STATPOINT[self.job_id][1]
		statStr = self.M2STATPOINT[self.job_id][2]
		statDex = self.M2STATPOINT[self.job_id][3]

		chr.PushOnceMotion(chr.MOTION_INTRO_SELECTED)
		net.SendCreateCharacterPacket(chrSlot, textName, raceIndex, shapeIndex, statCon, statInt, statStr, statDex)
		
		self.MotionStart = True
		self.MotionTime = app.GetTime()