2024-06-20 11:29:31 +00:00
import { _ as e , c as t , o as i , ag as a } from "./chunks/framework.VBE0TPts.js" ; const m = JSON . parse ( '{"title":"Achievements","description":"","frontmatter":{},"headers":[],"relativePath":"public/lit/docs/achievements.md","filePath":"public/lit/docs/achievements.md"}' ) , s = { name : "public/lit/docs/achievements.md" } , n = a ( ` <h1 id="achievements" tabindex="-1">Achievements <a class="header-anchor" href="#achievements" aria-label="Permalink to "Achievements""> </a></h1><p>Achievements are awarded to the player when they meet a certain goal, and optionally give some benefit. Currently they are pretty basic, but additional features will be added later to help.</p><p>You can make global achievements by putting them in a side layer by making its row equal to "side" instead of a number.</p><p>Useful functions for dealing with achievements and implementing their effects:</p><ul><li>hasAchievement(layer, id): determine if the player has the Achievement.</li><li>achievementEffect(layer, id): Returns the current effects of the achievement, if any.</li></ul><p>Achievements should be formatted like this:</p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">achievements</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
2024-06-17 04:46:30 +00:00
< span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > rows < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : # < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > o f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > r o w s , < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > cols < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : # < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # D 7 3 A 4 9 ; - - s h i k i - d a r k : # F 9 7 5 8 3 ; " > o f < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > c o l u m n s , < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 11 < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > : { < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > name : < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 0 3 2 F 6 2 ; - - s h i k i - d a r k : # 9 E C B F F ; " > & q u o t ; B l a h & q u o t ; < / s p a n > < s p a n s t y l e = " - - s h i k i - l i g h t : # 2 4 2 9 2 E ; - - s h i k i - d a r k : # E 1 E 4 E 8 ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > more features < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > } , < / s p a n > < / s p a n >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > etc < / s p a n > < / s p a n >
2024-06-20 11:29:31 +00:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > } < / s p a n > < / s p a n > < / c o d e > < / p r e > < / d i v > < p > E a c h a c h i e v e m e n t s h o u l d h a v e a n i d w h e r e t h e f i r s t d i g i t i s t h e r o w a n d t h e s e c o n d d i g i t i s t h e c o l u m n . < / p > < p > I n d i v i d u a l a c h i e v e m e n t c a n h a v e t h e s e f e a t u r e s : < / p > < u l > < l i > < p > n a m e : < s t r o n g > o p t i o n a l < / s t r o n g > . d i s p l a y e d a t t h e t o p o f t h e a c h i e v e m e n t . T h e o n l y v i s i b l e t e x t . I t c a n a l s o b e a f u n c t i o n t h a t r e t u r n s u p d a t i n g t e x t . C a n u s e b a s i c H T M L . < / p > < / l i > < l i > < p > d o n e ( ) : A f u n c t i o n r e t u r n i n g a b o o l e a n t o d e t e r m i n e i f t h e a c h i e v e m e n t s h o u l d b e a w a r d e d . < / p > < / l i > < l i > < p > t o o l t i p : D e f a u l t t o o l t i p f o r t h e a c h i e v e m e n t , a p p e a r s w h e n i t i s h o v e r e d o v e r . S h o u l d c o n v e y t h e g o a l a n d a n y r e w a r d f o r c o m p l e t i n g t h e a c h i e v e m e n t . I t c a n a l s o b e a f u n c t i o n t h a t r e t u r n s u p d a t i n g t e x t . C a n u s e b a s i c H T M L . S e t t i n g t h i s t o & q u o t ; & q u o t ; d i s a b l e s t h e t o o l t i p . < / p > < / l i > < l i > < p > e f f e c t ( ) : < s t r o n g > o p t i o n a l < / s t r o n g > . A f u n c t i o n t h a t c a l c u l a t e s a n d r e t u r n s t h e c u r r e n t v a l u e s o f a n y b o n u s e s f r o m t h e a c h i e v e m e n t . C a n r e t u r n a v a l u e o r a n o b j e c t c o n t a i n i n g m u l t i p l e v a l u e s . < / p > < / l i > < l i > < p > u n l o c k e d ( ) : < s t r o n g > o p t i o n a l < / s t r o n g > . A f u n c t i o n r e t u r n i n g a b o o l t o d e t e r m i n e i f t h e a c h i e v e m e n t i s v i s i b l e o r n o t . D e f a u l t i s u n l o c k e d . < / p > < / l i > < l i > < p > o n C o m p l e t e ( ) - < s t r o n g > o p t i o n a l < / s t r o n g > . t h i s f u n c t i o n w i l l b e c a l l e d w h e n t h e a c h i e v e m e n t i s c o m p l e t e d . < / p > < / l i > < l i > < p > i m a g e : < s t r o n g > o p t i o n a l < / s t r o n g > , p u t s t h e i m a g e f r o m t h e g i v e n U R L ( r e l a t i v e o r a b s o l u t e ) i n t h e a c h i e v e m e n t < / p > < / l i > < l i > < p > s t y l e : < s t r o n g > o p t i o n a l < / s t r o n g > . A p p l i e s C S S t o t h i s a c h i e v e m e n t , i n t h e f o r m o f a n o b j e c t w h e r e t h e k e y s a r e C S S a t t r i b u t e s , a n d t h e v a l u e s a r e t h e v a l u e s f o r t h o s e a t t r i b u t e s ( b o t h a s s t r i n g s ) . < / p > < / l i > < l i > < p > t e x t S t y l e : < s t r o n g > o p t i o n a l < / s t r o n g > . A p p l i e s C S S t o t h e t e x t , i n t h e f o r m o f a n o b j e c t w h e r e t h e k e y s a r e C S S a t t r i b u t e s , a n d t h e v a l u e s a r e t h e v a l u e s f o r t h o s e a t t r i b u t e s ( b o t h a s s t r i n g s ) . < / p > < / l i > < l i > < p > l a y e r : < s t r o n g > a s s i g n e d a u t o m a g i c a l l y < / s t r o n g > . I t & # 3 9 ; s t h e s a m e v a l u e a s t h e n a m e o f t h i s l a y e r , s o y o u c a n d o < c o d e > p l a y e r [ t h i s . l a y e r ] . p o i n t s < / c o d e > o r s i m i l a r . < / p > < / l i > < l i > < p > i d : < s t r o n g > a s s i g n e d a u t o m a g i c a l l y < / s t r o n g > . I t & # 3 9 ; s t h e & q u o t ; k e y & q u o t ; w h i c h t h e a c h i e v e m e n t w a s s t o r e d u n d e r , f o r c o n v e n i e n t a c c e s s . T h e a c h i e v e m e n t i n t h e e x a m p l e & # 3 9 ; s i d i s 1 1 . < / p > < / l i > < l i > < p > g o a l T o o l t i p : < s t r o n g > o p t i o n a l , d e p r e c a t e d < / s t r o n g > . A p p e a r s w h e n t h e a c h i e v e m e n t i s h o v e r e d o v e r a n d l o c k e d , o v e r r i d e s t h e b a s i c t o o l t i p . T h i s i s t o d i s p l a y t h e g o a l ( o r a h i n t ) . I t c a n a l s o b e a f u n c t i o n t h a t r e t u r n s u p d a t i n g t e x t . C a n u s e b a s i c H T M L . < / p > < / l i > < l i > < p > d o n e T o o l t i p : < s t r o n g > o p t i o n a l , d e p r e c a t e d < / s t r o n g > . A p p e a r s w h e n t h e a c h i e v e m e n t i s h o v e r e d o v e r a n d c o m p l e t e d , o v e r r i d e s t h e b a s i c t o o l t i p . T h i s c a n d i s p l a y w h a t t h e p l a y e r a c h i e v e d ( t h e g o a l ) , a n d t h e r e w a r d s , i f a n y . I t c a n a l s o b e a f u n c t i o n t h a t r e t u r n s u p d a t i n g t e x t . C a n u s e b a s i c H T M L . < / p > < / l i > < / u l > < p > D i s a b l e a c h i e v e m e n t p o p u p s b y a d d i n g < c o d e > a c h i e v e m e n t s P o p u p s : f a l s e < / c o d e > t o t h e l a y e r . < / p > ` , 1 1 ) , l = [ n ] ; f u n c t i o n o ( h , p , r , c , d , u ) { r e t u r n i ( ) , t ( " d i v " , n u l l , l ) } c o n s t k = e ( s , [ [ " r e n d e r " , o ] ] ) ; e x p o r t { m a s _ _ p a g e D a t a , k a s d e f a u l t } ;