- UID
- 3
- 积分
- 8169
- 帖子
- 259
- 主题
- 68
- 论坛币
- 5016
- 威望
- 54
- EP值
- 2533
- MP值
- 20
- 阅读权限
- 200
- 注册时间
- 2011-8-3
- 在线时间
- 1097 小时
- 最后登录
- 2022-10-8
|
- # -*- coding: utf-8 -*-
- from math import *
- from random import *
- from tcaxPy import *
- ################MOD TAG######################
- def frs(a):
- FRS = '\\frs' + str(a)
- return FRS
- def fsvp(a):
- FSVP = '\\fsvp' + str(a)
- return FSVP
- def distort(u1,v1,u2,v2,u3,v3):
- X = [u1,v1,u2,v2,u3,v3]
- DISTORT = '\\distort('+','.join(str(x) for x in X)+')'
- return DISTORT
- def z(a):
- Z = '\\z'+str(a)
- return Z
- def rnd(a):
- RND = '\\rnd' + str(a)
- return RND
- def rndx(a):
- RNDX = '\\rndx' + str(a)
- return RNDX
- def rndy(a):
- RNDY = '\\rndy' + str(a)
- return RNDY
- def rndz(a):
- RNDZ = '\\rndz' + str(a)
- return RNDZ
- def vc1(ltc,rtc,lbc,rbc):
- X = [ltc,rtc,lbc,rbc]
- VC1 = '\\1vc('+','.join('&H'+str(x)+'&' for x in X )+')'
- return VC1
- def vc2(ltc,rtc,lbc,rbc):
- X = [ltc,rtc,lbc,rbc]
- VC2 = '\\2vc('+','.join('&H'+str(x)+'&' for x in X )+')'
- return VC2
- def vc3(ltc,rtc,lbc,rbc):
- X = [ltc,rtc,lbc,rbc]
- VC3 = '\\3vc('+','.join('&H'+str(x)+'&' for x in X )+')'
- return VC3
- def vc4(ltc,rtc,lbc,rbc):
- X = [ltc,rtc,lbc,rbc]
- VC4 = '\\4vc('+','.join('&H'+str(x)+'&' for x in X )+')'
- return VC4
-
- def va1(ltt,rtt,lbt,rbt):
- X = [ltt,rtt,lbt,rbt]
- VA1 = '\\1va('+','.join('&H'+ FmtHex(x) +'&' for x in X )+')'
- return VA1
- def va2(ltt,rtt,lbt,rbt):
- X = [ltt,rtt,lbt,rbt]
- VA2 = '\\2va('+','.join('&H'+ FmtHex(x) +'&' for x in X )+')'
- return VA2
- def va3(ltt,rtt,lbt,rbt):
- X = [ltt,rtt,lbt,rbt]
- VA3 = '\\3va('+','.join('&H'+ FmtHex(x) +'&' for x in X )+')'
- return VA3
- def va4(ltt,rtt,lbt,rbt):
- X = [ltt,rtt,lbt,rbt]
- VA4 = '\\4va('+','.join('&H'+ FmtHex(x) +'&' for x in X )+')'
- return VA4
- def img1(pngpath,xoffset = None,yoffset = None):
- X = [pngpath,xoffset,yoffset]
- IMG1 = '\\1img('+','.join(str(x) for x in X if x != None ) + ')'
- return IMG1
- def mover(x1,y1,x2,y2,angle1,angle2,radius1,radius2,t1 = None,t2 = None) :
- A1 = int(angle1)
- A2 = int(angle2)
- R1 = int(radius1)
- R2 = int(radius2)
- if x1 == int(x1) and y1 == int(y1) and x2 == int(x2) and y2 == int(y2):
- X1 = int(x1)
- Y1 = int(y1)
- X2 = int(x2)
- Y2 = int(y2)
- else:
- X1 = format(x1, '.2f')
- Y1 = format(y1, '.2f')
- X2 = format(x2, '.2f')
- Y2 = format(y2, '.2f')
- X = [X1,Y1,X2,Y2,A1,A2,R1,R2,t1,t2]
- MOVER = '\\mover('+','.join(str(x) for x in X if x != None) + ')'
- return MOVER
- def moves3(x1,y1,x2,y2,x3,y3,t1 = None,t2 = None):
- if x1 == int(x1) and y1 == int(y1) and x2 == int(x2) and y2 == int(y2):
- X1 = int(x1)
- Y1 = int(y1)
- X2 = int(x2)
- Y2 = int(y2)
- X3 = int(x3)
- Y3 = int(y3)
- else:
- X1 = format(x1, '.2f')
- Y1 = format(y1, '.2f')
- X2 = format(x2, '.2f')
- Y2 = format(y2, '.2f')
- X3 = format(x3, '.2f')
- Y3 = format(y3, '.2f')
- X = [X1,Y1,X2,Y2,X3,Y3,t1,t2]
- MOVES3 = '\\moves3('+','.join(str(x) for x in X if x != None) + ')'
- return MOVES3
- def moves4(x1,y1,x2,y2,x3,y3,x4,y4,t1 = None,t2 = None):
- if x1 == int(x1) and y1 == int(y1) and x2 == int(x2) and y2 == int(y2):
- X1 = int(x1)
- Y1 = int(y1)
- X2 = int(x2)
- Y2 = int(y2)
- X3 = int(x3)
- Y3 = int(y3)
- X4 = int(x4)
- Y4 = int(y4)
- else:
- X1 = format(x1, '.2f')
- Y1 = format(y1, '.2f')
- X2 = format(x2, '.2f')
- Y2 = format(y2, '.2f')
- X3 = format(x3, '.2f')
- Y3 = format(y3, '.2f')
- X4 = format(x4, '.2f')
- Y4 = format(y4, '.2f')
- X = [X1,Y1,X2,Y2,X3,Y3,X4,Y4,t1,t2]
- MOVES4 = '\\moves4('+','.join(str(x) for x in X if x != None) + ')'
- return MOVES4
- def jitter(left,right,up,down,period,seed = None):
- X = [left,right,up,down,period,seed]
- JITTER = '\\jitter('+ ','.join(str(x) for x in X if x != None) + ')'
- return JITTER
- def movevc(x1,y1,x2 = None,y2 = None,t1 = None,t2 = None):
- X = [x1,y1,x2,y2,t1,t2]
- MOVEVC = '\\movevc('+','.join(str(x) for x in X if x != None) + ')'
- return MOVEVC
- ###################################### EXTRA FUNCTION #########################################################
- def alt(BT,ET, t = 100 , FX1 = alpha(255), FX2 = alpha(0), offset = 0, a1 = None,a2 = None): #交替t效果 默认闪烁
- n = 1
- T = ''
- for i in range(int(t)+ int(offset),(ET-BT)*10,int(t)):
- if n % 2 != 0 :
- X1 = [str(i-t),str(i),a1,FX1]
- T1 = '\\t('+','.join(str(x) for x in X1 if x != None)+ ')'
- T += T1
- else:
- X2 = [str(i-t),str(i),a2,FX2]
- T2 = '\\t('+','.join(str(x) for x in X2 if x != None)+ ')'
- T += T2
- n += 1
- return T
- #################### ASS DRAW ############################
- def pbri(n = 4): #绘制十字闪光
- BRI = 'm 0 100 l 1 1 100 0 1 -1 0 -100 -1 -1 -100 0 -1 1 c m 6 6 s 6 -6 -6 -6 -6 6 c'
- PBRI = '{\\p'+str(n)+'}'+BRI
- return PBRI
- def pflame(n = 4): #绘制火焰
- FLAME = 'm 0 9 b 3 3 6 3 9 6 b 12 9 15 2 19 4 b 24 5 23 11 18 13 b 15 13 13 13 10 10 b 6 6 2 6 0 10'
- PFLAME = '{\\p'+str(n)+'}'+FLAME
- return PFLAME
- def poval(n = 4): #绘制椭圆
- OVAL = 'm 50 0 b 100 0 100 100 50 100 b 0 100 0 0 50 0'
- POVAL = '{\\p'+str(n)+'}'+ OVAL
- return POVAL
- def pdrop(n = 4): #绘制水滴
- DROP = 'm 0 -5 b -8 7 8 7 0 -5'
- PDROP = '{\\p'+str(n)+'}'+ DROP
- return PDROP
- def psakura(n = 2): #绘制樱花
- SAKURA = 'm 3 9 b -6 9 -7 -7 2 -12 7 -8 6 1 3 9'
- PSAKURA = '{\\p'+str(n)+'}'+ SAKURA
- return PSAKURA
- def phane(n = 1): #绘制羽毛
- HANE = 'm 12 -15 b 12 -12 11 -10 9 -7 9 -6 9 -5 9 -4 11 -5 11 -3 8 -3 l 9 -2 6 -1 5 0 3 -2 b -3 12 -20 11 -25 6 -26 5 -25 3 -23 3 -20 3 -9 5 2 -3 l -1 -4 b -1 -6 1 -6 2 -6 2 -7 1 -8 1 -9 2 -9 4 -8 5 -8 4 -10 4 -12 5 -11 6 -11 6 -9 7 -8 9 -10 10 -13 10 -16 c'
- PHANE = '{\\p'+str(n)+'}'+ HANE
- return PHANE
复制代码 |
|