ó
Ä‚Œ\c           @  s  d  d l  m Z d  d l m Z m Z d  d l Z d  d l Z d e j j	 f d „  ƒ  YZ
 d e j j	 f d „  ƒ  YZ d e j j j f d	 „  ƒ  YZ d
 e j j j e j j f d „  ƒ  YZ d e j j f d „  ƒ  YZ d e j j f d „  ƒ  YZ d d d d d e e d „ Z d S(   iÿÿÿÿ(   t   print_function(   t   rendert   BLITNt   SpriteCachec           B  s   e  Z d  Z RS(   sï   
    This stores information about a displayble, including the identity
    of the displayable, and when it was first displayed. It is also
    responsible for caching the displayable surface, so it doesn't
    need to be re-rendered.
    (   t   __name__t
   __module__t   __doc__(    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR       s   t   Spritec           B  s    e  Z d  Z d „  Z d „  Z RS(   s‰  
    :doc: sprites class

    This represents a sprite that is managed by the SpriteManager. It contains
    fields that control the placement of the sprite on the screen. Sprites
    should not be created directly. Instead, they should be created by
    calling :meth:`SpriteManager.create`.

    The fields of a sprite object are:

    `x`, `y`
        The x and y coordinates of the upper-left corner of the sprite,
        relative to the SpriteManager.

    `zorder`
        An integer that's used to control the order of this sprite in the
        relative to the other sprites in the SpriteManager. The larger the
        number is, the closer to the viewer the sprite is.

    `events`
        If True, then events are passed to child. If False, the default,
        the children ignore events (and hence don't spend time processing
        them).

    The methods of a Sprite object are:
        c         C  sº   t  | ƒ } |  j j j | d ƒ } | d k r­ t j j | ƒ } t ƒ  } d | _	 | | _
 d | _ | j r‘ | j d ƒ | _ | j j ƒ  n	 | | _ | |  j j | <n  | |  _ d S(   sk   
        :doc: sprites method

        Changes the Displayable associated with this sprite to `d`.
        N(   t   idt   managert   displayable_mapt   gett   Nonet   renpyt   easyt   displayableR   R   t   childt   stt   _duplicatablet
   _duplicatet
   child_copyt   _uniquet   cache(   t   selft   dt   id_dt   sc(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt	   set_childX   s    						c         C  s"   t  |  j _ t |  _ t |  _ d S(   s˜   
        :doc: sprites method

        Destroys this sprite, preventing it from being displayed and
        removing it from the SpriteManager.
        N(   t   TrueR	   t
   dead_childt   Falset   livet   events(   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   destroyt   s    	(   R   R   R   R   R!   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR   5   s   		t   SpriteManagerc           B  se   e  Z d  Z d
 d
 d
 e d „ Z d „  Z d „  Z d d „ Z d „  Z	 d „  Z
 d „  Z d	 „  Z RS(   s‰   
    :doc: sprites class

    This displayable manages a collection of sprites, and displays
    them at the fastest speed possible.
    c         K  sw   t  t |  ƒ j |  |  | |  _ | |  _ | |  _ | |  _ i  |  _ g  |  _ t	 |  _
 t	 |  _ d |  _ d |  _ d S(   s½  
        `update`
            If not None, a function that is called each time a sprite
            is rendered by this sprite manager. It is called with one
            argument, the time in seconds since this sprite manager
            was first displayed.  It is expected to return the number
            of seconds until the function is called again, and the
            SpriteManager is rendered again.

        `event`
            If not None, a function that is called when an event occurs.
            It takes as arguments:
            * A pygame event object.
            * The x coordinate of the event.
            * The y coordinate of the event.
            * The time since the sprite manager was first shown.
            If it returns a non-None value, the interaction ends, and
            that value is returned.

        `predict`
            If not None, a function that returns a list of
            displayables. These displayables are predicted when the
            sprite manager is.

        `ignore_time`
            If True, then time is ignored when rendering displayables. This
            should be used when the sprite manager is used with a relatively
            small pool of images, and those images do not change over time.
            This should only be used with a small number of displayables, as
            it will keep all displayables used in memory for the life of the
            SpriteManager.

        After being rendered once (before the `update` function is called),
        SpriteManagers have the following fields:

        `width`, `height`

             The width and height of this SpriteManager, in pixels.


        SpriteManagers have the following methods:
        N(   t   superR"   t   __init__t   update_functiont   event_functiont   predict_functiont   ignore_timeR
   t   childrenR   R   R    R   t   widtht   height(   R   t   updatet   eventt   predictR(   t
   properties(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR$   ‰   s    ,									c         C  s`   t  ƒ  } d | _ d | _ d | _ t | _ |  | _ t | _ | j	 | ƒ |  j
 j | ƒ | S(   sˆ   
        :doc: sprites method

        Creates a new Sprite for the displayable `d`, and adds it to this
        SpriteManager.
        i    (   R   t   xt   yt   zorderR   R   R	   R   R    R   R)   t   append(   R   R   t   s(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   createÎ   s    							c         C  s@   |  j  d  k	 r< x* |  j  ƒ  D] } t j j j | ƒ q Wn  d  S(   N(   R'   R   R   t   displayR.   R   (   R   t   i(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   predict_oneä   s    i    c         C  s   t  j j j |  | ƒ d S(   sk   
        :doc: sprites method

        Causes this SpriteManager to be redrawn in `delay` seconds.
        N(   R   R6   R   t   redraw(   R   t   delay(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR9   é   s    c         C  s`  | |  _  | |  _ |  j d  k	 rX |  j | ƒ } | d  k	 rX t j j j |  | ƒ qX n  |  j sq |  j	 j
 ƒ  n  |  j r¥ g  |  j D] } | j r„ | ^ q„ |  _ n  |  j j d d „  ƒ g  } t j j j | | ƒ } t }	 x`|  j D]U} |	 | j O}	 | j }
 | j j } |
 j d  k rÆ|
 j d  k r;| |
 _ n  | |
 j } t |
 j | | | | ƒ |
 _ } | j t k o£| j d  k o£| j d k o£| j d k |
 _ | j | ƒ | j |
 ƒ n  |
 j r"xl | j D]B \ } } } } } | j j | | | j | | j t t f ƒ qÙWqé | j | | j | j f ƒ qé Wx | D] } d  | _ qIW| S(   Nt   keyc         S  s   |  j  S(   N(   R2   (   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   <lambda>  s    g      ð?(    R*   R+   R%   R   R   R6   R   R9   R(   R
   t   clearR   R)   R   t   sortt   RenderR   R    R   R   R   t	   operationR   t   forwardt   alphat   overt   fastt
   depends_onR3   R0   R1   t   subpixel_blit(   R   R*   R+   R   t   atR9   R7   t   cachest   rvR    R   t   rt   cstR   t   xot   yot   _focust   _main(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR   ò   sJ    				+	"?	

 c         C  s¶   x† t  t |  j ƒ d d d ƒ D]e } |  j | } | j r  | j j j | | | j | | j | | j j	 ƒ } | d  k	 r… | Sq  q  W|  j d  k	 r® |  j | | | | ƒ Sd  Sd  S(   Ni   iÿÿÿÿ(   t   xranget   lenR)   R    R   R   R-   R0   R1   R   R   R&   (   R   t   evR0   R1   R   R7   R4   RI   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR-   .  s    &	6c         C  s`   g  } yL |  j  rQ |  j  ƒ  } x0 | D]% } t j j | ƒ } | j | ƒ q% Wn  Wn n X| S(   N(   R'   R   R   R   R3   (   R   RI   t   plR7   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   visit<  s    	c         C  s   g  |  _  d  S(   N(   R)   (   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   destroy_allJ  s    N(   R   R   R   R   R   R$   R5   R8   R9   R   R-   RT   RU   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR"      s   E				<		t	   Particlesc           B  sS   e  Z d  Z d Z d g Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   s6   
    Supports particle motion, using the old API.
    i   t	   particlesc         C  s1   | d k  r- t  d |  j d |  j ƒ |  _ n  d  S(   Ni   R,   R.   (   R"   t   update_callbackt   predict_callbackt   sm(   R   t   version(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   after_upgradeW  s    c         C  s   d  |  _ d  S(   N(   R   RW   (   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   after_setstate[  s    c         K  sJ   t  t |  ƒ j |   t d |  j d |  j ƒ |  _ | |  _ d |  _	 d S(   s3   
        @param factory: A factory object.
        R,   R.   N(
   R#   RV   R$   R"   RX   RY   RZ   t   factoryR   RW   (   R   R^   R/   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR$   ^  s    	c         C  s  |  j  } | d k s! | d  k r7 |  j j ƒ  g  } n  |  j j | | ƒ } g  } x˜ | D] \ } } | j | ƒ } | d  k r | j ƒ  qY n  | \ } }	 }
 } | | j j	 k	 rÄ | j
 | ƒ n  | | _ |	 | _ | j | | f ƒ qY W| rƒx | D]‚ } | j | ƒ } | d  k r!qú n  | \ } }	 }
 } | d  k rEqú n  |  j j | ƒ } | | _ |	 | _ | j | | f ƒ qú Wn  | |  _  d S(   Ni    (   RW   R   RZ   RU   R^   R5   R,   R!   R   R   R   R0   R1   R3   (   R   R   RW   t	   add_partst   new_particlest   spritet   pR,   R0   R1   t   _tR   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyRX   j  s>    		
					c         C  s   |  j  j ƒ  S(   N(   R^   R.   (   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyRY     s    c         C  s"   t  j j j |  j | | | | ƒ S(   N(   R   R6   R   RZ   (   R   t   wt   hR   RG   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR      s    (   R   R   R   t   __version__t   nosaveR\   R]   R$   RX   RY   R   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyRV   N  s   					3	t   SnowBlossomFactoryc           B  s>   e  Z e Z d  „  Z e d „ Z d „  Z d „  Z d „  Z RS(   c         C  s*   d |  _  t |  ƒ j | ƒ |  j ƒ  d  S(   Ni    (   t   startt   varsR,   t   init(   R   t   state(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   __setstate__¨  s    	c	   	      C  sb   t  j j | ƒ |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _	 | |  _
 |  j ƒ  d  S(   N(   R   R   R   t   imaget   countt   xspeedt   yspeedt   borderRi   RD   t   rotateRk   (	   R   Rn   Ro   Rp   Rq   Rr   Ri   RD   Rs   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR$   ­  s    							c         C  s[   g  t  d |  j ƒ D] } t j d |  j ƒ ^ q |  _ |  j j |  j ƒ |  j j ƒ  d  S(   Ni    (   RP   Ro   t   randomt   uniformRi   t   startsR3   R>   (   R   t   _i(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyRk   ¸  s    7c         C  s8  d „  } | d k r¡ | r¡ |  j  r¡ g  } xo t d |  j ƒ D][ } | j t |  j | |  j ƒ | |  j ƒ |  j | t	 j
 d d ƒ d t d |  j ƒƒ q> W| S| d  k sÂ t | ƒ |  j k  r4| rå | |  j t | ƒ k  rå d  St |  j | |  j ƒ | |  j ƒ |  j | t	 j
 d d ƒ d t d |  j ƒg Sd  S(   Nc         S  s/   t  |  t ƒ r' t j |  d |  d ƒ S|  Sd  S(   Ni    i   (   t
   isinstancet   tupleRt   Ru   (   t   n(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   ranged¿  s    i    id   RD   Rs   (   RD   RP   Ro   R3   t   SnowBlossomParticleRn   Rp   Rq   Rr   Rt   Ru   R   Rs   R   RQ   Rv   R   (   R   RW   R   R{   RI   Rw   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR5   ½  s0    	!	c         C  s
   |  j  g S(   N(   Rn   (   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR.   ã  s    (	   R   R   R   Rs   Rm   R$   Rk   R5   R.   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyRh   ¤  s   			&R|   c           B  s   e  Z d  „  Z d „  Z RS(   c	         C  sL  | d k r d } n  | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | su t j j	 }	 t j j
 }
 n t j j	 }
 t j j
 }	 |  j d k r© | |  _ n |	 | |  _ d | |	 t | ƒ } | | } t | d ƒ } t |
 | |
 ƒ } t j | | ƒ |  _ | rHt j | |	 | ƒ |  _ t j d |
 ƒ |  _ n  d  S(   Ni    i   g       @(   Rn   Rp   Rq   Rr   Ri   t   offsetRs   R   t   configt   screen_heightt   screen_widtht   ystartt   abst   mint   maxRt   Ru   t   xstart(   R   Rn   Rp   Rq   Rr   Ri   R}   RD   Rs   t   sht   swt   travel_timet   xdistt   x0t   x1(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR$   é  s2    								
c         C  sÝ   | |  j  } |  j | |  j } |  j | |  j } |  j sM t j j } n t j j	 } | | |  j
 k rp d  S| |  j
 k  r„ d  S|  j s³ t | ƒ t | ƒ | |  j |  j f St | ƒ t | ƒ | |  j |  j f Sd  S(   N(   Ri   R…   Rp   R   Rq   Rs   R   R~   R   R€   Rr   R   t   intR}   Rn   (   R   R   t   tot   xpost   yposR†   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR,     s    		&(   R   R   R$   R,   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyR|   ç  s   	'i
   i2   i   id   iÈ   i    c         C  sS   | r | | } } n  t  t d |  d | d | d | d | d | d | d | ƒ ƒ S(	   s   
    :doc: sprites_extra

    The snowblossom effect moves multiple instances of a sprite up,
    down, left or right on the screen. When a sprite leaves the screen, it
    is returned to the start.

    `d`
        The displayable to use for the sprites.

    `border`
        The size of the border of the screen. The sprite is considered to be
        on the screen until it clears the border, ensuring that sprites do
        not disappear abruptly.

    `xspeed`, `yspeed`
        The speed at which the sprites move, in the horizontal and vertical
        directions, respectively. These can be a single number or a tuple of
        two numbers. In the latter case, each particle is assigned a random
        speed between the two numbers. The speeds can be positive or negative,
        as long as the second number in a tuple is larger than the first.

    `start`
        The delay, in seconds, before each particle is added. This can be
        allows the particles to start at the top of the screen, while not
        looking like a "wave" effect.

    `fast`
        If true, particles start in the center of the screen, rather than
        only at the edges.

    `horizontal`
        If true, particles appear on the left or right side of the screen,
        rather than the top or bottom.
        Rn   Ro   Rr   Rp   Rq   Ri   RD   Rs   (   RV   Rh   (   R   Ro   Rr   Rp   Rq   Ri   RD   t
   horizontal(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   SnowBlossom'  s    -(   i   i2   (   id   iÈ   (   t
   __future__R    t   renpy.display.renderR   R   t   renpy.displayR   Rt   t   objectt   ObjectR   R   R6   t   coret   DisplayableR"   t   pythont
   NoRollbackRV   Rh   R|   R   R‘   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\particle.pyt   <module>   s    LÍ(VCA