2023-11-28 02:32:46 +00:00
import { _ as e , o as s , c as a , Q as n } from "./chunks/framework.1169fbc9.js" ; const y = JSON . parse ( '{"title":"Achievements","description":"","frontmatter":{},"headers":[],"relativePath":"public/gamedevtree/docs/achievements.md","filePath":"public/gamedevtree/docs/achievements.md","lastUpdated":1701137241000}' ) , t = { name : "public/gamedevtree/docs/achievements.md" } , o = n ( ` <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 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 (make its row "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 github-dark vp-code-dark"><code><span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">achievements</span><span style="color:#E1E4E8;">: {</span></span>
2023-11-07 00:46:27 +00:00
< span class = "line" > < span style = "color:#E1E4E8;" > < / s p a n > < s p a n s t y l e = " c o l o r : # B 3 9 2 F 0 ; " > r o w s < / s p a n > < s p a n s t y l e = " c o l o r : # E 1 E 4 E 8 ; " > : # < / s p a n > < s p a n s t y l e = " c o l o r : # F 9 7 5 8 3 ; " > o f < / s p a n > < s p a n s t y l e = " c o l o r : # E 1 E 4 E 8 ; " > r o w s < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#E1E4E8;" > < / s p a n > < s p a n s t y l e = " c o l o r : # B 3 9 2 F 0 ; " > c o l s < / s p a n > < s p a n s t y l e = " c o l o r : # E 1 E 4 E 8 ; " > : # < / s p a n > < s p a n s t y l e = " c o l o r : # F 9 7 5 8 3 ; " > o f < / s p a n > < s p a n s t y l e = " c o l o r : # 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 = "color:#E1E4E8;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 7 9 B 8 F F ; " > 1 1 < / s p a n > < s p a n s t y l e = " c o l o r : # E 1 E 4 E 8 ; " > : { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#E1E4E8;" > name : < / s p a n > < s p a n s t y l e = " c o l o r : # 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 = " c o l o r : # E 1 E 4 E 8 ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#E1E4E8;" > more features < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#E1E4E8;" > } < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#E1E4E8;" > etc < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#E1E4E8;" > } < / s p a n > < / s p a n > < / c o d e > < / p r e > < p r e c l a s s = " s h i k i g i t h u b - l i g h t v p - c o d e - l i g h t " > < c o d e > < s p a n c l a s s = " l i n e " > < s p a n s t y l e = " c o l o r : # 2 4 2 9 2 E ; " > < / s p a n > < s p a n s t y l e = " c o l o r : # 6 F 4 2 C 1 ; " > a c h i e v e m e n t s < / s p a n > < s p a n s t y l e = " c o l o r : # 2 4 2 9 2 E ; " > : { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 6 F 4 2 C 1 ; " > r o w s < / s p a n > < s p a n s t y l e = " c o l o r : # 2 4 2 9 2 E ; " > : # < / s p a n > < s p a n s t y l e = " c o l o r : # D 7 3 A 4 9 ; " > o f < / s p a n > < s p a n s t y l e = " c o l o r : # 2 4 2 9 2 E ; " > r o w s < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 6 F 4 2 C 1 ; " > c o l s < / s p a n > < s p a n s t y l e = " c o l o r : # 2 4 2 9 2 E ; " > : # < / s p a n > < s p a n s t y l e = " c o l o r : # D 7 3 A 4 9 ; " > o f < / s p a n > < s p a n s t y l e = " c o l o r : # 2 4 2 9 2 E ; " > c o l u m n s < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > < / s p a n > < s p a n s t y l e = " c o l o r : # 0 0 5 C C 5 ; " > 1 1 < / s p a n > < s p a n s t y l e = " c o l o r : # 2 4 2 9 2 E ; " > : { < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > name : < / s p a n > < s p a n s t y l e = " c o l o r : # 0 3 2 F 6 2 ; " > & 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 = " c o l o r : # 2 4 2 9 2 E ; " > , < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > more features < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > } < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > etc < / s p a n > < / s p a n >
< span class = "line" > < span style = "color:#24292E;" > } < / 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 . 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 . < / 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 > 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 > 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 p l a y e r [ t h i s . l a y e r ] . p o i n t s 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 a 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 a 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 > ` , 9 ) , l = [ o ] ; f u n c t i o n p ( i , c , r , h , d , u ) { r e t u r n s ( ) , a ( " d i v " , n u l l , l ) } c o n s t E = e ( t , [ [ " r e n d e r " , p ] ] ) ; e x p o r t { y a s _ _ p a g e D a t a , E a s d e f a u l t } ;