import es

import wcs
from wcs import wcs

wcs.Item('Socks of Feathers').registerItem('enhancement', 3000, 'Lower your gravity.', True)

def item_bought(ev):
    userid = ev['userid']
    if ev['item'] == 'Socks of Feathers':
        wcs.Command(userid).ChangeGravity(-0.35)
        
def player_spawn(ev):
    count = wcs.Command(ev['userid']).GetItemCount('Socks of Feathers')
    while count:
        wcs.Command(ev['userid']).ChangeGravity(-0.35)
        count -= 1
        
def player_death(ev):
    wcs.Command(ev['userid']).RemoveItem('Socks of Feathers')
