Esempio n. 1
0
    def charge_p(this, name, sp):
        if type(sp) == str and sp[-1] == '%':
            charge = int(sp[:-1]) / 100
        elif type(sp) == int:
            charge = sp
        elif type(sp) == float:
            charge = sp
        else:
            charge = 0

        this.s1.charge(floatsingle.ceiling(this.conf['s1']['sp'] * charge))
        this.s2.charge(floatsingle.ceiling(this.conf['s2']['sp'] * charge))
        this.s3.charge(floatsingle.ceiling(this.conf['s3']['sp'] * charge))
        if this.logsp:
            this.logsp(this.name, name, '%d%%'%(charge*100),
                    '%d/%d, %d/%d, %d/%d'%( \
                    this.s1.sp.cur, this.s1.sp.max,
                    this.s2.sp.cur, this.s2.sp.max,
                    this.s3.sp.cur, this.s3.sp.max)
                    )
Esempio n. 2
0
 def charge(this, name, sp):
     sp = int(sp) * floatsingle.tofloat(this.mod('sp'))
     sp = floatsingle.tofloat(sp)
     sp = floatsingle.ceiling(sp)
     this.s1.charge(sp)
     this.s2.charge(sp)
     this.s3.charge(sp)
     if this.logsp :
         this.logsp('%s, %s'%(this.name, name), sp,
                 '%d/%d, %d/%d, %d/%d'%( \
                 this.s1.sp['cur'], this.s1.sp['max'],
                 this.s2.sp['cur'], this.s2.sp['max'],
                 this.s3.sp['cur'], this.s3.sp['max'])
                 )
Esempio n. 3
0
 def charge(this, name, sp):
     sp = int(sp) * floatsingle.tofloat(this.mod('sp'))
     sp = floatsingle.tofloat(sp)
     sp = floatsingle.ceiling(sp)
     this.s1.charge(sp)
     this.s2.charge(sp)
     this.s3.charge(sp)
     if this.logsp:
         this.logsp(this.name, name, sp,
                 '%d/%d, %d/%d, %d/%d'%( \
                 this.s1.sp.cur, this.s1.sp.max,
                 this.s2.sp.cur, this.s2.sp.max,
                 this.s3.sp.cur, this.s3.sp.max)
                 )
     this.e_acl()
     if this.Skill.s_prev:
         this.Skill.s_prev = None