0,]']±>Sï}WÿÍu§ğp8·d%qy)6o;]ÉA¦ösï÷ôôô”°ÂVl†3'e>'e>'e>'e>'e EvE E EvE E EE EE Ee E E``````s`v`````````v``v`vÁq¡q¡ÁÁv¡¡vaza¡X'eX'eX'eX'eX'eÁÁv¡¡va¡avÁÁ EeE E EeE E E eeE E eeEve e````v``v¡vX'… ` ` `€ `€€€€ ` ` ` `€ `€€€€ `aaa aaaaa aaaaa aaaaa aaaaaaaaaaaaaaaaaaaA   ÀÀÀ       ÀÀÀ   À   À   €€ € €aaaaaaaa¡¡¡¡¡ÁÁÁ¡ÁÁÁááááaaááaa   ÀÀÀ       ÀÀÀ   À   À€    €    €    €   €€ € € € €  €   €€ € € € € Á¡Á¡Á¡Á¡Á¡aÁ¡aÁ¡AÁ¡Aa–    â$ , 4 8 4D,,ìX`dllx|!€ì"Œ"Œ&œ(¤(¤¨ ¤è ¤- ¸h À2 Ìö$ì%ì5Ø5Ü8ä:ä;ğÀ?w"'""3"wwwwwwww""3"#wwwwww'24"2r""#2#r"2#"C#"#2#""""#"C#"rww""#wwww"wwwwwwwwwwww‚‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡www"'"rwwwwwwww"#"24rwwwww'2#"C#'24""p""""3"24""'2"24"3""ww'"24rww'2rwwwwwwwww"'rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwww"wwwwwwww'24"2#rwwww"w"""3""2#"2"2$2$""2#"r"C#2#"""rw""#2#rww"C#'rwwwww'"2"ƒ‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡wwwwww"wwwwwww'2#r""wwww'2r""'"B#"""C#2#2#"p""ww"3"""w""w'2"3""www"3""#www'r""C"sxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwww'2rwww"www""w'rwwww"C#24r"3""2"3"""""pw'rww'"r'r'2r'"C#""rwww'""24rww"#2"3"‚‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡wwwww"C#ww'2r"w'"rwwwwww"3"2#""""#2#"" rwwwwwww"www"C#"#3""wwwwww"'2#rw'2$2#"rrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwww"3"ww"C#2"r"#wwwwww'"r"""#"24""" 2pwwwwwwwwwww"3"24"2rwwww'rww""w'"2#"""w‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡wwwww'"rww"3"C##24rwwwwww""'"24"2#""2"C#wwwwwwwwwww'""2#"C#ww'r"#ww'rw"#""'rwwrxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwww"www'""3"$2#rwwwwww'2r"2#""""#C#3"wwwwwwwwwwww"w"""3"'r"#24rwww'24"rwwww‚‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡wwwwwwwwwww"'"2#""rwwwwww"C#"""2""242""ww'rwwwwwwwwww'r'"r"#2$2#rwww'2#rwwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxr"wwwwwwwwwww"""""rwwwwww"3"2""C#"2#"""ww"#wwwwwwwwwwwww""2$2#""wwwww""wwwwww‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡#2r"wwwwwwwww'2r""wwwwwww"""C#"3"#""" 2"'24rw"wwwwwwwww""#2#""'rwwwww'rwwwwwwwxxxxHDtxHDtxHDtxHDt83sxx83sxHDtxHDtxxxx4B#2rwwwwwwww"C#'rwwwwwww'"22"2"24""C#"C#"2#""2rwwwwwww'224""'rwwwwwwwwwwwwwww‡‡‡‡‡GD„‡GD„‡GD„‡GD„73ƒ‡‡73ƒ‡GD„‡GD„‡‡‡‡#2"C#wwwwwwww"3"wwwwwwww'r"C#"C#2#"22"""3""#""#C#wwwwwww"C##"rwwwwwwwwwwwwwwwwwwxxxHtHtHtHtHtHtHtHtxx8s8s8sHtHtHtHtxxxx"""3"wwwwwwww'"rwwwwwwww"#"3""3"#""C# 2"""24"242"wwwwwww"3""#wwwwwwwwwwwwwwwwww‡‡‡‡G„G„G„G„G„G„G„G„‡‡7ƒ7ƒ7ƒG„G„G„G„‡‡‡‡r"'"rwwwwww'rw"'rwwwwww'24""r""24"22""C#2"2#"2#"""wwwwww'""24rwwwwwwww"wwwwwwwwwxxxHtHtHtHtHtHtHtHtx8sx8s8sHtHtHtHtxxxxwww"wwwwwww"#'r"#'rwwww'2#""#2""#"C#2"3"C#""4""""2rwwwwww"'2#"rww'rww'2rwwwwwww‡‡‡‡G„G„G„G„G„G„G„G„‡7ƒ‡7ƒ7ƒG„G„G„G„‡‡‡‡wwww'rwwww'24"#24"#wwwww""22"C#2""3"C# ""3"#2#""#"C#wwwwwwww"""#'r"#ww"C#wwww'r'rxxxHtHtHtHtHtHtHtHt8sxx8s8sHtHtHtHtxxxxwwww"#wwww'2#2$2#24rwwww'"C#"3"C#""22" "#"2"""$24"3"rwwwwwww'"24"#24rw"3"wwww"#"ƒ‡‡‡G„G„G„G„G„G„G„G„7ƒ‡‡7ƒ7ƒG„G„G„G„‡‡‡‡www'24rwwww""2#"""#rwwwww"3""""3"C"B#"24""2"2#2#"""#wwwwwww"#2#2$2#rw'"rwww'2$2txxxHDtxHDtxHDtxHDtx833s83sxHDtxHDtxxxxxwww'2#rwwww'r""""2"wwwwww'""#"'""2"#"""2#2"""""""""24rwwwww'2$""2#""www"w'rw'2#2ƒ‡‡‡GD„‡GD„‡GD„‡GD„‡733ƒ73ƒ‡GD„‡GD„‡‡‡‡‡wwww""wwwwwww'r'"C#wwwwww'"24""#"#24"#2""#""""""B#"##rwwwww'2"""""'rwwwww"#ww"""rxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwww'rwwwwwwwwww"3"wwwwww'"2#2242$2#"2""""""""""3"24"#wwwwww"2"r'rwwwwww'24rw'r'‚‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡wwwwww'rwwwwwwww'"rwwwwww"#""#""""""2""2$"""""#"""2#24rwwwww"C#wwwwwwwww'2#rwwwwwxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxwwwwww"#wwwwwwwww"wwwwww'24""""#"#""C#"2#"2"""""""""2#rwwwww"3"wwwwwwwwww""wwwww‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡G„‡D„‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡ww'rw'24rwwwwww"w'rwwwww'2#"##2424""3"2"""C# """"2""""wwwwww'"r"wwwwwwwww'rwwwwwwxxxxxxxxxxxxxxDtHDDxxxxxxxxxxxxxxxxxxxxw""#w'2#rwwww'"2r"#wwwwww""24"2#2"2"""C#2"3""""2#"24"rwwwwwww"'2rwwwwwwwwww'rwww‡‡‡‡‡‡‡‡‡‡‡‡‡GDDDDDD‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡'224rw""www'r""C#24rwwwww'"2#"#""2"2""3"""""2"""""2#"#wwwwwwww"C#r'r'rwwwww"#wwwwxxxxxxxxxxxHDDDDDDHxxxxxxxxxxxxxxxxxxxx"C##rw'rwww"#2"3""#rwwwwwww""242"#"#""""#"""C#"#""""24rwwwwwww"3"#"#"#wwww'24rww‡‡‡‡‡‡‡‡‡‡‡‡DDDDDDDD‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡#3""wwwwww'242#""2"wwwwwwww'"2"B""#"#""24"""3""3"C#"2#"wwwwww'""2"2$24rwww'2#rwwwxxxxxxxxxxxHDDDDDDtxxxxxxxxxxxxxxxxxxxx"""rwwwwww'2#""""C#wwwwwwww'2"2"2242"""2#""""""""3"C""2rwwwww'2""22#2#rwwww""www‡‡‡‡‡‡‡‡‡‡DGDDDDDD„‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡r"ww'rwwwww""'r'"3"'rwwwwww"C#C#C#"""2"""""2"22""""3""C#wwwwww"""C#"""wwwww'rwwwwxxxxxxxxHDDDDtDtDxxxxxxxxxxxxxxxxxxxxxxwwww"#wwwww'rwww'"r"#rwwwww"3"3"3""2"#"#"r"""C##""""2"3"wwwwww'r"3"r'rwwwwwww"w"‡‡‡‡‡‡‡‡DGDDDDDGDG‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡www'24rwwwwwwwwww"'24"wwwww'"""""2"#""24"w'""3""2$2"C#"rwwwwwwww'"rwwwwww"ww'2"2rxxxxxxHDDDHDDtHtHxxxxxxxxxxxxxxxxxxxxxxwww'2#rwwwwwwwwwww'2#2rwwwww"w"2"C#"#"2#"ww"#"""2"C"3""wwwwwww'rw"wwwwww'2rw"C"Cƒ‡‡‡‡‡G„DDDDDDD„D„‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡ªªªª""ªªªªªªªªªª*¢"""#¢ªªªªªªª"C#3"2"#""ÂÌ,"3"ª"""3"""¢ªªªªªªª"#ªªªªªªªª"C#ª"3"3‚ˆˆˆDˆDDDDDH„Hˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª*¢ª"ªªªªªª*¢"#2$""ªªªªªªªª"3""2"24""İİ"#"",2$"""""#ªªªªªª*24¢ªªªªªªª"3"ª*"""‚ˆˆHDˆDDDDDDD„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªª*2¢ªªªªª"#24"#"¢ªªªªªªªª*"""C#2#Òİİİ"3"2"2#2""#24¢ªªªªª"2#¢ªªªªªªª*"¢ªª"ª"ŠˆˆHDˆD„D„Hˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªª"C#ªªªª*242#2"ªªªªªªªªªªª","3"""İİİİ-""C#""C#*"2#¢ªªªª*2""#"ªªªªªªª"ªªªªªªŠˆˆDDHDD„D„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªª"3"ªªªª*2#""C#*¢ªªªªªªªªÌİİ-"Ò-Òİİİİİ""3"#"3"¢"""¢ªªªª*2#""2¢"ªªªªªªªªªªªªŠˆˆHDDDDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª*¢ª*"¢*¢ªªª""*"3""#¢"ªªªªªÌİİİİ"İİİİİİİ"2$"2"-""#"*"#ªªªªª"""#C#2¢ªªªªª*¢ªªªªŠˆˆD„DDH„„H„H„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª""#ªª"ª"#ªªª*¢ª*""24"2¢ªªªÌİİİİİİİİİİİİ-"2#""2Ò"2$2"24¢ªªªª*"242"C#ªªªªª"#ªªªªŠˆHDDDD„„„„„Dˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª*224¢ªª*24¢ªªªªªª"*2#"C#ªªÌİİİİİİİİİİİİİ"C""İ"C#-2"C#2#¢ªªªªª*2#""3"ªªªª*24¢ªªªŠˆˆDˆD„„„„Dˆˆ„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ*"C##¢ªª*2#¢ªªªªªªª*"""3"ªÊİİİİİİİİİİİİİİ"3"2""3"Ò""3"""ªªªªªªª"""*"¢ªªªª*2#¢ªªªJ„ˆD„D„„HˆH„Dˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ"#3""ªªªª""ªªªªªªª*"#"""¢*Òİİİİİİİİİİİİİ"-""C#"""#-""",¢ªªªªªªª*¢ªª"ªªªªªª""ªªªªD„HDDHDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ24""¢ªªªª*¢ªªªªªªª"#3"¢"ª"#İİİİİİİİİİİİ-2"2"3"#"24Ò-"Òݬªªªªªªªªª"ªªªªªªªª*¢ªªªªJ„HDHˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ2#"ªªªªªªªªªªªªª*"24"¢*¢"24"Òİİİİİİİİİİ"C"C#"2"-2#"İ"#İͪªªªª*¢ª*2¢ªªªªªªªªªªªªªJ„H„Hˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ""ªªªªªªªªªªªªªª"#2#"ª"#2"#"#İİİİİİİİİİ"3"3"""2Ò""2"24Òİ̪ªªª"#ª"C#ªªªªªªªª*¢ªªJDDDD„€€ˆˆˆ€€ˆˆˆ€€ˆˆˆ€€ˆˆ*¢ªªªªªªªªªªªªª*24""ª*24"2"24Òİİ"İİİ-Òİ"""""Ò"C#-"C#2#Òİݬªª*24""3"ªªªªªªªª"#"ªD„H„Dˆ€ˆ€€€€ˆ€€€€ˆ€€€€ˆ€€ªªªªªªªªª"ªªªªª*2#"¢ª*2#"C#2#Òİ-2Òİİ"#"2""#"#"3"İ"3"""İİİͪª*""2""¢ªªªªªªª*242¢B„HDHˆ€€ˆˆ€€€ˆˆ€€€ˆˆ€€€ˆˆªªªªªªªª*2¢ªªªªª""ªªªª"""3"""Ò""C#İ-24"C#2424""2Ò-"Ò-"İİİݬªª"#C#"¢ªªªªªªª*2#B#B„H„Hˆ€UUXU…€€UUXU…€€UUXU…€€UUXU…ªªªªªªªª"C#ªªªªª*¢ªªª*"2""Ò"B#2"3"İ"2#"3"2#2#Ò"C#İ"#-2Òİİİͪ*242"C#¢ªªªªªªª""3DDDDD„ˆUU€ˆPUˆUU€ˆPUˆUU€ˆPUˆUU€ˆPUªªªªªªªª"3"ª"ªªªªªªªª"2#Ò"-"2"C#""-2"""""""""İ"3"-24"C#İİİݬ*2#""3"#ªªªªªªª*"BD3DH„ˆˆ€UUXU…€€UUXU…€€UUXU…€€UUXU…ª"ªªªªª*""¢*2¢ªªªªªª*2""İİ""#"3""Ò"C#"#"-"Ò-2Ò-""-2#"3"İİİݬª"""*"24¢ªªª"ªªªª"D"D„„ˆˆ€UUXU…€€UUXU…€€UUXU…€€UUXU…*2¢ªªª*"C"ª"C#ª"ªªªª"C#Òİ-"24""2"""3"24Ò-2Ò"C#İ"2Ò""-"Òİİİ-ª*"ªª"2#¢ªª*2¢ªªªªD"Dˆ„ˆˆ€€ˆˆˆ€€ˆˆˆ€€ˆˆˆ€€ˆˆ"C#ªªª"#3"ª"3"*2¢ªªª"3"İİ-"2#Ò"C#2"""2#""C#"3"İ"C#-Òİ"İİİİ"#¬*2¢ªª""ªªª"C#ªªªJD¤JDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ"3"ª*"24"¢ª*"¢"C#ªªÊ-"Òİİ"#""İ"3"C#"Ò""""3"-""İ"3""#İİİİİ-24""C#ªª*¢ªªª"3"ªªJ¤ªD„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ*"¢ª"#2#"ªªª"ª"3"ªªÊİ"İİ-24"Òİ"""3""İ-"Ò-"Òİ"2Ò-""24Òİİİİ-2#2"3"ªªªªªªª*"¢ªJD¤D¤Dˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"ª"24""ªªªªªª*"¢ªªÜİİİİ-2#Òİ-2"-"B#İ-2Òİ"#İ"C#""-2#Òİİİİİ""C#"¢ªªªªªªªª"ªªDDDDDJˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª*22#"¢ªªªªªªª"ªªÊİİİİİ-""İİ"C#İ"3"İ"C#-24Ò"3"2Òİ""İİİİİİ-"3""ªªªªªªªªªªªªJDDDDJˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"C#"ªªªªªªªªªªªªÊİİİİİ"#Òİİ"3"İ-"Òİ"3"-2#Ò-""C#İ"Òİİİİİİİ-""#ªªªªªªªªªªªªJDD¤D„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"3"¢ªªªªªªªªªªªªÜİİİİ-24Òİ-2"Òİ"#İİ-"Òİ""İİ""3"-2Òİİİİİİİİ"2$"ªªªªªªªª*¢ªDDªD¤Šˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª*"¢ªªªªªªªªªª*¢ªÜİİİİ-2#Òİ"C#İ-24Òİ"#İİ"#İİİ-"Ò"C#İİİİİİİİ-2"#¢ªªªªªªª"#"ªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"ª"ªªªªªªªªªªª"#Ê-Òİİİİ""İİ"3"İ-2#Ò-24Ò-24Òİİ""İ"3"İİİİİİ-Òİ"24"ªªªªªª*242¢ªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ*2¢ªªªªªªªª*¢ª*24Â"#İ-Òİ-Òİİ-"Òİİ""İ-2#Ò-2#Òİ-2Òİ-"Òİİİİ"İ"#İ-2#"ªªªªªª*2#B$¢D¤ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ"C#ªªªªªªªª"#ª*2#"24Ò"#İİİİİİ"İİ-2Òİİ""İİ""İİ"C#İİ"İİİİ-2"24Òİ""¢ªªªªªªª""D$C¤DªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ"3"ªªªªªªª"24¢ª"",2#"24Òİİİİİİİİ"C#İİ-Òİİ-2Òİ"3"İİİİİİİ"C#2#Òİ-"ªªªªªªªª*"B4DDBªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ*"¢ªªªªªª*22#¢ª*Âİ""-2#Òİİİİİİİİ"3"İİİİİİ"C#İ-"Òİİİİİİİ"3"""İİİͪªªªªªªªªJD4D$CªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"ªª*¢ªªª"C#"ªªªÊİ-Òİ""İİİİİİİİİ-"Òİİİİİİ"3"İ""İİİİİİİİ-""#Òİİİͪªªªªªªª*DDD$D4"‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª"#ªª*"3"¢ªªªÊİİİİ-Òİİİİİİ"İİİ"İİ"İİİ-""Ò-2Òİİİİİİİİİ"2$ÒİİİͪªªªJ¤ªD$C¤JDB#"ƒˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª*24¢ª"#"¢ªªªªÜİİİİİİİİİ"İ-2Òİİİİ-2Òİİ"#"İ"C#İİİİ-Òİİİ-2"#İİİݬªªªD¤J$DD¤J¤B"2„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª*2#¢*"4"ªªªªªÜ-Òİİİİ"İ-2Ò"C#İİİİ"C#İ-24Òİ"3"İİİİ"#İİİİ"24ÒİİݬªªªJ¤JDBDDªD$"2ƒˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª""ª"2"¢ªªªªªÜ"#İİİ-2Ò"C#"3"İİ-Ò"3"İ-2#Òİ-"Òİİİ-24Òİİİ-2#"İİݬªªªJ¤J¤B"ªªªªª"‚ˆˆˆˆH„ˆˆˆˆˆˆ„ˆˆDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª*¢*"C#ªªªªªÊ-24Òİİ"C#"3"-"Òİİ"#-"Ò-Ò""İİİ"İİİİ-2#Òİİİİ"""İİİͪªªDDªD$¢ªªªªª*‚ˆˆˆˆ„ˆDˆH„H„ˆDˆHˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªª""3"ªªªªªÊ-2#Òİİ"3"-"Òİ"İİ-24Ò"İ"#-Òİİİİİİİİİ""#İİİİ-"2Òİİͪª*D¢JDªªªªªªªªŠˆˆˆˆHˆ„„„„„ˆ„H„Hˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªª"#"¢ªªªªªÊ"#"İİİ-"Òİ"İİİİ"-2#Òİ-24Òİİİİİİİİİİ-2$Òİİ-Ò"C#İİͪªBD#DJ¤ªªªªªªªŠˆˆˆˆˆ„„„Dˆ„ˆ„„„Hˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªª*""ªªªªªª*24Òİİİİ"İİİİİİ-2Ò""İİ-2#Òİİİİİİİİİİ-2"#İİ"#"3"İİͪª"D"D¤¤ªªªªªªªŠˆˆˆˆDˆDˆH„H„„D„D„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªª"ªªªªªªª"2#Òİİİİİİİİİİİ"C#-Òİİİ""İİİİİİİ"İİİİ"24Ò-24""Òİİͪª*D¢Dª¤ªªªªªªªŠˆˆˆˆˆˆ„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªªªª*2""İİİİİİİİİİİİ"3"İİİİİ-Òİİİİİİ-2Òİİİ-2#Ò-2#Ò"İİİݬªJD¤JDªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªªªª"C#Òİİİİİ"İİİİİİ-"Òİİİİİİİİ-Òİİİ"C#İİİ-""Òİ""İİİİİݬªªªª"#ªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ¢ªªªªªªªªªªªªª"3"İİİİİ-2Òİİİİ-Ò"İİİİİİİİİ"#İİİ"3"İİİ-""Òİ-Òİİİİİݬªªª*24"ªªªªªªªŠˆˆˆˆDDDDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ#ªªªªªªªª*¢ªª*2"Òİİİİİ"C#İİİİ"#İİİİİİİİİ-24Òİİ-""İİİ"""#İİİİİİİİݬª*¢*2#2¢ªªªª*¢ŠˆˆˆˆDDDDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ4¢ªªªªªªª"#ªª"B#İİİİİİ"3"İİİ-24Òİİİİİİİİ-2#Òİİİ"2Òİ-2"24ÒİİİİİİİݬD"CD""C#ªªªª"#ŠˆˆˆˆDDDDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ#¢ªªªªªª*24¢ª"#"İ"İİİ-2"Òİİİ-2#Òİİİ-Òİİİİ""İİİİ"C#İ"C#2#ÒİİİİİİİİLD2DB$"3""ªª*24‚ˆˆˆˆDDDDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ"ªªªªªªª*2#¢*24Ò-2Òİİ"C#İİİİİ""İİİİ"#İİİİ"#İİİİ"3"İ"3"""İİİİİİİİݬD2D¤¤*""2¢ª*2#‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ¢ªªªªªªªª""ª*2#Ò"C#İİ"3"İİİİ-2Òİİİ-24Òİİ-24Òİİ"-"Òİ-"Ò-ÒİİİİİİİİݬD"Dª¤ª""C#¢ª""Šˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªª*¢ªª""Ü"3"İİ""Òİİİİ"C#İİİ-2#Òİİ-2#Òİ-2Ò"#İİ"İİİİİİİİDİMDLD$BDªªª"3"#ª*¢Šˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªªª*¢Ü-"Òİ-2"İİİİİ"3"İİİİ""İİİİ""İİ"C#24"İİİİİİİİİMDİDM¤ªªªªªªª*"24¢ªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ¢ªªªªªªªªªªªªªªÜİ"İİ"C#İİİİİ-"Òİİİİ"#İİİİ-2Òİ"3"2#2ÒİİİİİİİİİDİDÔ¤"ªªªªªªª"2#¢ªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ¢ªªªªªªªªªªªªªªÜİİİİ"2"İİİİİ"#İİİİ-24Òİİİ"C#İ-"Ò""C#İİİİİİİİİDİD-$2¢ªªªªªªª""*¢ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"ªªªªªªªªªªªªÜİİİİ"#Òİİİİ"24Òİİİ-2#"İİİ"3"Òİ"İ-"3"İİİİİİİİMDÔMD"C#ªªªªªªª*¢"#ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª*2¢ªªªªªªªªªªªÜİİİ-24Ò-Òİ-22#Òİİİİ""2Òİİ-""#İİİ"#"Òİİİİİİİİİ"İ-2"3"ªªªªªªªª*24¢Šˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"C#ªªªªªªªªªªªÜİİİ-2#Ò"#İ"C#"İİİİİ""C#İİİ"24Òİİ"3"İİİİİİİİİ-2Ò-2#"¢ªªªªªªªª*2#¢Šˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"3"ªªªªªªªªªªªÊİİİ"#"-24Ò"3"Òİİİİ"2"3"İİ-"2#Òİİ-"Òİİİİİİİİİ"C#İ"""¢ªªªªªªªªª""ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª*"¢ªªªªªªªªªªªÊİİ-24Ò-2#Ò-"B#İİİ-22#"Òİİ"2""İİİİ"İİİİİİİİİİ"3"İ-"C#ªªªªªªªªª*¢ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"ªª*¢ªªªªªªªªÊİİ-2#Òİ""İİ"3"İİİ"C#""İİ-2""ÒİİİİİİİİİİİİİİD-BDİÍ"3"ªªªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªª"#ªªªªªªªªÊİİİ""İİ-Òİİ-"Ò-Òİ"3"Òİİİ"C#ÒİİİİİİİİİİİİİİMDİDMÔÍ*"2¢ªªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª*24¢ªªªªªªªÊİİİ-Òİİİİİİİ"İ"#İ-"B#İİİ"3"İİİİİİİİİİİİİİİİDÒDÔÔͪ"C#ªªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª*2#¢ªªªªªªªªÜİİİİİİİİİİİİ-24Òİ"3"İİİ-"ÒİİİİİİİİİİİİİİİİD#DİÔ¬ª"3"¢ªªªªªª"ªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª"#"ªªªªªªªªªÜİİİİİİİİİİİİ-2#Òİ-"Òİİİİ"İİİİİİİİİİİİİİİİMD4BDݬª*""#ªªªªª*2¢ªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª*24¢ªªªªªªªªªÜİİİİİİİİİİİİİ""İİİ"İİİİİİİİİİİİİİİİİ]UUUU-2#Òİݬªª"24¢ªªªª"C#ªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª"2"¢ªªªªªªªªªÊİİİİİİİİİİİİİ-ÒİİİİİİİİİİİİİİİİİİİİUÕİİİİU%"İİͪªª*2#¢ªªªª"3"ªª‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª*2"2¢ªªªªªªªªªÊİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİUİİİİİİİ]Õİİͪªªª""ªªªªª*"¢ª*‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"C"C#ªª*¢ªªª*¢ÊİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİUİİİİİİİİİ]Õİͪªªª*¢*¢ªªªª"ªª*‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"3"3"ªª"#ªªª"#ªÜİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİ]İ-Òİİİİİİ"İ]ݬªªªªªª"#ªªªªªªªª‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª*2"""¢ª*24¢ª*"4¢ÜİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİÕİ"#İİİİİ-2ÒİÕ¬ªªªªª*24¢ªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"C#ª"ªª*2#¢ª*2"¢Êİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİ]İ-24Òİİİİ"C#İ]ªªªªªª*2#¢ªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"3"ªªªªª""ªª"C#ªÊİİİİİİİİİİİİİİİİİİİİİİİİİİİİİİÕİ"2#Òİİİİ"3"İÍ¥ªªªªªª""ªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª*"¢ªªªªª*¢ªª"3"ªªÜİİİİİİİİİİİİİİİİİİİİİİİİİİİİ]İ-2""İİİİİ-""Ò¬Zªªªªªª*¢ªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"ªªªªªªªªª*""¢ªªÜİİİİİİİİİİİİİİİİİİİİİİİİİİİİÕ-"C#Òİİİİİİ""#¬ª¥ªªªªªªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªª*2"¢ªªÊİİİİİİİİİİİİİİİİİİİİİİİİİİİİÕ"#3"İİİİİİİ-24¢ª¥ªªªªªªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªª"#"ªªªÊİİİİ"İİİİİİİİİİİİİİİİ"İİİİİ]-24"Òİİİİİİİ-2#¢ªZªªªªªªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªª*24¢ªªªªÜİİ-2Òİİ"İİİİ-Òİİİİİ-2Òİİİİ]-2#"#İİİİİİİİ""#ªZªªª"ªªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ¢ªªªªªªªªªª*2#¢ªªªªÊİİ"B#İ-2Òİİİ"#İİİİİ"C#ÒİİİÕİ""24Òİİİİİİİ-24¢ª¥ª*2¢ªªªªªªªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ¢ªªªªªªªªªª*""ªªªª"Êİİ"#"İ"C#İİ-24Òİİİİ"3"#İİİÕİ-"2#Òİİİİİİİ-2#¢ª¥ª"C#ªªªªªªªªªª‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªª"#¢ªªª*2¢Ü-24Òİ"3"İİ-2#Òİ"İİ-"24Òİ"Õİİİ""#İİİİݬ""ªª¥ª"3"ªªªªªªªªª*‚ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªª*24¢ªªª"C#Ê-2#Òİ-"Òİİİ""İ-2Òİİ"2#Ò-RÒİİİ-24İĞĞĞİͪ*¢ªªZª*"¢ªªªªªªªªª*‚ˆˆˆˆH„„ˆˆˆˆˆ„ˆˆˆˆˆ„ˆˆHˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªª*2#¢ªªª"3"ª,""Òİİ"İİİ-2Òİ"C#İİİ""İ"S#İİİ-2#İİĞݬªªªªªZªª"ªªªªªªªªªªª‚ˆˆˆˆ„ˆDˆH„H„„„DˆHˆˆDˆD„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªª""ªªªª*"¢ª,""Òİİİİİİ""#İ"3"İİİ-2Ò"S"İİİİ"" mfÖĞݬªªªªªZªªªªªªª*¢ªªªªªŠˆˆˆˆ„ˆ„„„„„ˆDˆ„„„„„„„Hˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªª*¢ªªªªª"ªªÊ""İİİİİİİ"2"İ-"Òİİİ"C#-RÒİİİİ-2Ò`UİͪªªªªªRªªªªªªª"#ªªªªªŠˆˆˆˆ„ˆ„„Dˆ„ˆDˆ„„„„„„„Hˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªªªªªªªªªªª*2Òİİİİİİİ"C#İİ"İİİİ"3"İRİİİİİ"CmUÖЬªªªªª*R¢ªªªªª*24¢ªªªªŠˆˆˆˆH„„„H„H„„„DˆHˆ„„„ˆ„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªªªªªªªªªªª"C#İİİİİİİ"3"İİİİİİİ-"Òİ]İİİİİ"3mfÖÀªªªªªª"S#ªªªªª*2#¢ªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆ„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªªªªªªªªªªª"3"İİİİİİİ"""İİİİİİİ-2Òİ]İİİİİ-"Òݬªªªªªª"S"ªªªªªª""#ªªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªªªªªªªªªªªªªªªªªªª*"ÂÜİİİİİİ"""İİİİİİİ"C#İ]İİİİİİ"İİİ̪ªªªªªª*R¢ªªªªªª*24¢ª"ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"ªªªªªªªªªªªªªªªªªª"#ªÊİİİİİİ-"Òİİİİİİİ"3"İ]İİİİİİİİİͪªªªªªªªªRªªªªªªª*2#"*2¢ŠˆˆˆˆHD„DD„„ˆ„H„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª*2¢ªªªªªªªªªªªªªªªª*24¢ªÜİİİİİ-2Òİİİİİİİ-"ÒİİÕİİİİİİİݬªªªªªªªªª¥ªªªªªªªª""2"C#ŠˆˆˆˆD„ˆˆH„„„„D„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"C#ªªª*¢ªªªªªªªªªªª*2#¢ªÊÜİİİİ"C#İİİİİİİİ"#İİÕİİİİİİİ̪ªªªªªªªªª¥ªªªªªªªª*"C"3"ŠˆˆˆˆHDˆˆDˆDD„H„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª"3"ªªª"#ªªª*¢ªªªªªªª""ªªªÊİİİİ"3"İİİİİİİ-24ÒİÕİİİİİİͪªªªªªªªªªª¥ªªªªªªªªª"3""¢ŠˆˆˆˆˆD„„H„DD„H„ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆª*"¢ªª*24¢ªª"#ªªªªªªª*¢ªªªªÌİİİ-"Òİİİİİİİ-2#Òİ]İİİİİͬªªªªªªªªªªZªªªªªªªªªª*"""ªŠˆˆˆˆDDˆHDˆDH„DDˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª"ªªª*2#¢ª*24¢ªªªªªªªªªªªªªÌİİİ"İİİİİİİİİ""İİ]İİİİͬªªªªªªªªªªªZªªªªªªªªªªª"24¢Šˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªªª"ªª""ªª*2#¢ªªªªªªªªªªªªªªÌİİİİİİİİİİİİ-ÒİİİÕİİͬªªªªªªªªªªª"¥ªªªªªªªªªªª*2#¢Šˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª*2¢ª*¢ªªª""ªªªªªªªªªªªªªªªªÌİİİİİİİİİİİİİİİİÕİͬªªªªªªªªªªª*2¥ªªªªªªªªªªªª""ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª"C#ªªªªªª*¢ªªªªªªªªªªªªªªªªªÌÜİİİİİİİİİİİ-Òİ]̬ªªªªªªªªªªªª"S#ªªªªªªªªªª"ª*¢ªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª"3"ªªªªªªªªªªªªªªªªªªªªªªªªªªÊÌİİİİİİİİİİ"#ÍÌ¥ªªªªªªªªªªªªª"5"ªªªªªªªªª*2¢ªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªªª""¢ªªªªªªªªªªªªªªªªªªªªªª*¢ªªªªÌÌÜİİİİİİ-24¢ªZªª"ªªªªªªªªªªZ"¢ªªªªªªªªª"C#ªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆªª*2"ªªªªªªªªªªªªªªªªªªªªªªª"#ªªªªªªÊÌÌÌÌÌÌ,2#¢ªª¥*2¢ªªªªªªªªª¥"ªªªªªªªªªª"3"ªªªŠˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ%-- title: 3BUTTERF.EXE -- author: verysoftwares -- desc: third bullet hell in trilogy -- script: lua t=0--1940+100+40+80+80+40+40-40--940+90+120--1420+120+120+50+80--460+(120+60)*4 x=240/2-40-2 y=136-51-1 sin=math.sin cos=math.cos pi=math.pi ins=table.insert rem=table.remove fmt=string.format sub=string.sub bullets={} friendbullets={} fairies={} score=0 graze=0 lives=3 bossy=0 combo=0 extra=10000 particles={} function spell_particles() if #particles<=19 and t%12==0 then ins(particles,{x=math.random(0,240),y=136,id=math.random(1,3)}) end for i=#particles,1,-1 do local v=particles[i] if v.id==1 then pix(v.x,v.y,2+(t*0.5)%3) end if v.id==2 then --spr(48,v.x,v.y,0) for sx=0,7 do for sy=0,7 do if sprpix(48,sx,sy)~=0 then pix(v.x+sx,v.y+sy,2+(t*0.35)%3) end end end end if v.id==3 then --spr(49,v.x,v.y,0,1,0,0,2,2) for tx=0,1 do for ty=0,1 do for sx=0,7 do for sy=0,7 do if sprpix(49+tx+ty*16,sx,sy)~=0 then pix(v.x+tx*8+sx,v.y+ty*8+sy,2+(t*0.2)%3) end end end end end end v.x=v.x-1; v.y=v.y-1 if v.y<35-16 then rem(particles,i) end end end function update() dx=0; dy=0 local spd=1 if key(64) then spd=0.4 end if btn(0) then y=y-spd; dy=-spd end if btn(1) and dy==0 then y=y+spd; dy=spd end if btn(2) then x=x-spd; dx=-spd end if btn(3) and dx==0 then x=x+spd; dx=spd end if btn(4) and not hyper and not st then st=8; ins(friendbullets,{x=x+2,y=y+3-3,dx=0,dy=-2,id=36}) end if st then st=st-1; if st==0 then st=nil end end --[[if t%2==0 then local a=sin(t*0.05)*10+cos(t*0.08)*6 ins(bullets,{x=240/2-40+cos(t*0.03)*30,y=35/2+sin(t*0.02)*20,dx=cos(a)*0.5,dy=sin(a)*0.5,id=34}) end]] if (stage~=boss1 and stage~=boss2 and stage~=boss3 and stage~=boss4) or ((stage==boss1 or stage==boss2 or stage==boss3 or stage==boss4) and ((not phase) or phase%2==1)) then if (stage==boss1 or stage==boss2 or stage==boss3 or stage==boss4) and ph_t and (t-ph_t)*3<240-80+1 then cls(0) clip(0,35,240-80+1-(t-ph_t)*3,136-35) spell_particles() clip() rect(240-80+1-(t-ph_t)*3,35,(t-ph_t)*3,136-35,stagecolor()) else cls(stagecolor()) end end if (stage==boss1 or stage==boss2 or stage==boss3 or stage==boss4) and phase and phase%2==0 then if (stage==boss1 or stage==boss2 or stage==boss3 or stage==boss4) and ph_t and (t-ph_t)*3<240-80+1 then cls(stagecolor()) rect(240-80+1-(t-ph_t)*3,35,(t-ph_t)*3,136-35,0) clip(240-80+1-(t-ph_t)*3,35,(t-ph_t)*3,136-35) spell_particles() else cls(0) clip(0,35,240-80+1,136-35) spell_particles() end end clip() circ(240/2-40,136-51,50,13) circb(240/2-40,136-51,50,12) rect(0,0,240-80+1,35,7) --spr(1+t%60//30*2,x,y,14,3,0,0,2,2) --print("HELLO WORLD!",84,84) if stage==boss4 then for i=0,180+1 do a=-i/180*pi local c=t if i>=0 then c=9 end if i>=180-180/8*7 then c=8 end if i>=180-180/8*6 then c=7 end if i>=180-180/8*5 then c=6 end if i>=180-180/8*4 then c=5 end if i>=180-180/8*3 then c=4 end if i>=180-180/8*2 then c=3 end if i>=180-180/8*1 then c=2 end line(240/2-40,35-2,240/2-40+cos(a)*40,35-2+sin(a)*40,c) end end -- boss silhouette if stage==stage1 and t-sc_t<2000+60 then for tx=0,2 do for ty=0,3 do for x=0,7 do for y=0,7 do if sprpix(5+tx+16*ty,x,y)~=0 then pix((240-80+1)/2-12+tx*8+x,35/2-12-4+ty*8+y,0) end end end end end elseif (stage==stage1 and t-sc_t>=2000+60) or stage==boss1 then spr(5,(240-80+1)/2-12,35/2-12-4+sin((t-sc_t)*0.1)*3,0,1,0,((t-sc_t)*0.01)%5,3,4) end if stage==stage2 and t-sc_t<2665-90 then for tx=0,2 do for ty=0,3 do for x=0,7 do for y=0,7 do if sprpix(8+tx+16*ty,x,y)~=0 then pix((240-80+1)/2-12+tx*8+x,35/2-12-4+ty*8+y,0) end end end end end elseif (stage==stage2 and t-sc_t>=2665-90) or stage==boss2 then spr(8,(240-80+1)/2-12,bossy+35/2-12-4,0,1,0,0,3,4) end if stage==stage2 and t-sc_t<2665-90 then for tx=0,2 do for ty=0,3 do for x=0,7 do for y=0,7 do if sprpix(8+tx+16*ty,x,y)~=0 then pix((240-80+1)/2-12+tx*8+x,35/2-12-4+ty*8+y,0) end end end end end elseif (stage==stage2 and t-sc_t>=2665-90) or stage==boss2 then spr(8,(240-80+1)/2-12,bossy+35/2-12-4,0,1,0,0,3,4) end if stage==stage3 and t-sc_t<3190-110*2 then for tx=0,2 do for ty=0,3 do for x=0,7 do for y=0,7 do if sprpix(11+tx+16*ty,x,y)~=0 then pix((240-80+1)/2-12+tx*8+x,35/2-12-4+ty*8+y,0) end end end end end elseif (stage==stage3 and t-sc_t>=3190-110*2) or stage==boss3 then spr(11,(240-80+1)/2-12,bossy+35/2-12-4,0,1,0,0,3,4) end if stage==stage4 and not temp.final_t then for tx=0,2 do for ty=0,3 do for x=0,7 do for y=0,7 do if sprpix(69+tx+16*ty,x,y)~=0 then pix((240-80+1)/2-12+tx*8+x,35/2-12-4+ty*8+y,0) end end end end end elseif (stage==stage4 and temp.final_t) or stage==boss4 then spr(69,(240-80+1)/2-12,bossy+35/2-12-4,0,1,0,0,3,4) end if hyper then poke(0x3FF9,math.random(0,4)-2) poke(0x3FF9+1,math.random(0,4)-2) poke4(0x3FF8*2,2+math.floor((t*0.3)%2)) rect(x-16+2,0,24+8,y,2) rect(x-14+2,0,24+4,y,3) rect(x-12+2,0,24,y,4) --for i=0,16 do --rect(x-12+2+(t+i*6)%24,y-(t+i)%96,1,8,12) --end for i=#bullets,1,-1 do local b=bullets[i] if AABB(b.x-3,b.y-3,6,6,x-16+2,0,24+8,y) then rem(bullets,i) gain_score(10,b.x-3,b.y-3) --combo=combo+1 end end if (stage==boss1 or (stage==boss2 and phase~=4 and phase~=6) or stage==boss3 or stage==boss4) and bosshp and AABB((240-80+1)/2-12,35/2-12-4,24,32,x-16+2,0,24+8,y) then bosshp=bosshp-1; gain_score(1,(240-80+1)/2,35/2-12-4) end hyper=hyper-1; if hyper==0 then poke(0x3FF9,0); poke(0x3FF9+1,0); poke4(0x3FF8*2,0); hyper=nil end end for i=#friendbullets,1,-1 do local b=friendbullets[i] spr(b.id,b.x-3,b.y-3,0) if (stage==boss1 or (stage==boss2 and phase~=4 and phase~=6) or stage==boss3 or stage==boss4) and bosshp and AABB((240-80+1)/2-12,35/2-12-4,24,32,b.x-3,b.y-3,6,6) then bosshp=bosshp-30; rem(friendbullets,i); gain_score(25,b.x-3,b.y-3) end b.x=b.x+b.dx; b.y=b.y+b.dy end for i=#fairies,1,-1 do local fa=fairies[i] for sx=0,3 do for sy=0,3 do if fa.x+sx>=0 and fa.x+sx<240 and fa.y+sy>=0 and fa.y+sy<136 and pix(fa.x+sx,fa.y+sy)==4 then fa.gone=check_id rem(fairies,i) gain_score(100,fa.x+sx,fa.y+sy) for i2,b2 in ipairs(friendbullets) do if math.sqrt((fa.x+sx-b2.x)^2+(fa.y+sy-b2.y)^2)<3 then rem(friendbullets,i2); break end end if fa.ondeath then fa:ondeath() end goto removed end end end fa:update() ::removed:: end for i=#bullets,1,-1 do local b=bullets[i] b.t=b.t or 0 if b.id==34 or b.id==35 or b.id==36 or b.id==52 then spr(b.id,b.x-3,b.y-3,0) end b.x=b.x+b.dx; b.y=b.y+b.dy if b.t>60 and (b.x<=-3 or b.y<=-3 or b.x>=240-80+1+3 or b.y>=136+3) then rem(bullets,i) end b.t=b.t+1 end for i=#bigbullets,1,-1 do local b=bigbullets[i] textri(b.x-b.r,b.y-b.r, b.x-b.r+2*b.r,b.y-b.r, b.x-b.r,b.y-b.r+2*b.r, 2*8,2*8, 2*8+6,2*8, 2*8,2*8+6, false,0) textri(b.x-b.r+2*b.r,b.y-b.r, b.x-b.r+2*b.r,b.y-b.r+2*b.r, b.x-b.r,b.y-b.r+2*b.r, 2*8+6,2*8, 2*8+6,2*8+6, 2*8,2*8+6, false,0) b.x=b.x+b.dx; b.y=b.y+b.dy b.t=b.t or 0 if b.t>90 and (b.x<-b.r*2 or b.y<-b.r*6 or b.x>240+b.r*2 or b.y>136+b.r*2) then rem(bigbullets,i) end b.t=b.t+1 end for i=#friendbullets,1,-1 do local b=friendbullets[i] for sx=0,5 do for sy=0,5 do if sprpix(b.id,sx,sy)~=0 then local px=pix(b.x-3+sx,b.y-3+sy) if px==2 or px==3 then --or px==4 then for i2=#bigbullets,1,-1 do local b2=bigbullets[i2] if AABB(b.x-3+sx,b.y-3+sy,1,1,b2.x-b2.r,b2.y-b2.r,2*b2.r,2*b2.r) then b2.r=b2.r-1 rem(friendbullets,i) goto hit end end for i2=#bullets,1,-1 do local b2=bullets[i2] if math.sqrt((b.x-3+sx-b2.x)^2+(b.y-3+sy-b2.y)^2)<3 then rem(bullets,i2) rem(friendbullets,i) --sfx(1,'E-6',8,2) gain_score(10,b.x-3+sx,b.y-3+sy) combo=combo+1 goto hit end end end end end end ::hit:: end --if math.sqrt((x+2-(240/2-40))^2+(y+2-(136-51))^2)>=50-math.sqrt(4) then -- x=x-dx; y=y-dy --end -- to prevent deaths from orange/red backgrounds for sx=1,2 do for sy=1,2 do local px=pix(x+sx,y+sy) if (px==12 or px==4) and math.sqrt((x+2-(240/2-40))^2+(y+2-(136-51))^2)>=50-3 then x=x-dx; y=y-dy; goto hit2 end end end ::hit2:: for sx=1,2 do for sy=1,2 do local px=pix(x+sx,y+sy) if px~=13 then if px==1 then if not iframes and not hyper then lives=lives-1; sfx(2,'D-6',40,2) if mode~='Casual' then if not attempts[check_id] then attempts[check_id]=1 else attempts[check_id]=attempts[check_id]+1 end end if lives==0 then TIC=gameover end iframes=110; graze=0; goto hit end end if px==2 or px==3 then for i2,b2 in ipairs(bullets) do if math.sqrt((b2.x-(x+sx))^2+(b2.y-(y+sy))^2)<4 then rem(bullets,i2); break end end if not iframes and not hyper then lives=lives-1; sfx(2,'D-6',40,2) if mode~='Casual' then if not attempts[check_id] then attempts[check_id]=1 else attempts[check_id]=attempts[check_id]+1 end end if lives==0 then TIC=gameover end iframes=110; graze=0; goto hit end end end end end ::hit:: if (not iframes) or (iframes and iframes%12<6) then for sx=0,3 do for sy=0,3 do local c=5 if sx==0 or sy==0 or sx==3 or sy==3 then c=6 end pix(x+sx,y+sy,c) end end spr(32+(t*0.1)%2,x-2,y-3,1) end if iframes then iframes=iframes-1; if iframes==0 then iframes=nil end end if t%8==0 then for i=#bullets,1,-1 do local b=bullets[i] if math.sqrt((b.x-(x+2))^2+(b.y-(y+2))^2)<20 then circt=8 --gain_score(5,x+2,y+2) graze=graze+5 break end end end if circt then circb(x+2,y+2,20,5) print(graze,x+2,y+2+20+2,4) circt=circt-1; if circt==0 then circt=nil end elseif graze>0 then gain_score(graze,x+2,y+2+20+2) graze=0 end stage() rect(240-80+1,0,80-1,136,8) for sx=240-80+1,240-1 do for sy=0,35-1 do if (sx+sy)%2==0 then pix(sx,sy,7) end end end --print('3BUTTERF.EXE',240-80+1,0,4,false,2,true) local msg=fmt('%.8d',score) local tw=print(msg,0,-12,4,false,2,true) local tx=0 for c=1,#msg do local col=4 if (c*7+t*0.8)%48<12 then col=3 end print(sub(msg,c,c),240-80+1+40-tw/2+tx,35/2-6,col,false,2,true) tx=tx+print(sub(msg,c,c),0,-12,col,false,2,true) end print('Lives',240-80+1+9,35+4,4,false,1,true) for i=0,math.min(9,lives-1) do rect(240-80+1+(i+1)*9+2,35+12+3,4,4,5) spr(32+(t*0.1)%2,240-80+1+(i+1)*9,35+12,1) end if combo>200 then combo=200 end print('Special',240-80+1+9,136-48-16,4,false,1,true) local col=4 if combo==200 or hyper then col=(t*0.4)%16 end local rw if not hyper then rw=(80-18)*combo/200 else rw=(80-18)*hyper/(60*6) end rect(240-80+1+9,136-48-16+6+2,rw,4,col) if combo==200 then print('X to activate!',240-80+1+9,136-48-16+6+2+6,(t*0.4)%16,false,1,true) if btnp(5) then hyper=60*6 sfx(3,'A#6',60*6,2) combo=0 end end print('Checkpoint',240-80+1+9,136-12-8,4,false,1,true) print(check_id,240-80+1+9,136-12,4) if mode=='Hardcore' then if score>=extra then lives=lives+1 extra=extra+10000 extra_msg=160 sfx(4,'G#4',60-2,1) end if extra_msg then local tw=print('Extra life!',0,-6,4) print('Extra life!',240/2-40-tw/2,136-51-3,(t*0.4)%16) extra_msg=extra_msg-1; if extra_msg==0 then extra_msg=nil end end end if check_msg then local tw=print('Checkpoint!',0,-6,4) print('Checkpoint!',240/2-40-tw/2,136-51-3-6,(t*0.4)%16) check_msg=check_msg-1; if check_msg==0 then check_msg=nil end end --stats(1) for i=#scores,1,-1 do local sc=scores[i] print(sc[1],sc.x,sc.y,4) sc.x=sc.x+(240-80+1+40-sc.x)*0.012 sc.y=sc.y+(35/2-sc.y)*0.012 if sc.x>240-80+1+40-tw/2 and sc.y<35/2-6+10 then score=score+sc[1] rem(scores,i) end end t=t+1 end --TIC=update cycle={i=1,'Casual','Hardcore','Practice'} function mainmenu() if btnp(0) or btnp(2) then cycle.i=cycle.i-1; if cycle.i<1 then cycle.i=#cycle end end if btnp(1) or btnp(3) then cycle.i=cycle.i+1; if cycle.i>#cycle then cycle.i=1 end end if btnp(4) then mode=cycle[cycle.i] TIC=update stage=stage1 --sc_t=t-(math.floor(110*4+110*48/16+110*48/16+110*64/16+110*64/16+110*2))+1--t+1 --music(3,5,32,false,true) sc_t=t+1 --sc_t=t-(110*4+110*48/16+110*48/16+110*64/16+110*64/16+110*4)+1 --music(4,7,0,false,true) --ins(fairies,{x=240/2-40+cos(pi)*120,y=136-51+sin(pi)*120,a=pi,t=0,update=fairy_update22}) phase=nil ph_t=nil --checkpoint('B2W7',t-sc_t,t-ph_t) if mode=='Casual' then lives=1 end if mode=='Hardcore' then lives=3 end if mode=='Hacker' then mode='Casual'; lives=99 end if mode=='Practice' then TIC=practice; lives=99 end end cls(0) print('Mode select',20,20,1,false,2,false) for i,v in ipairs(cycle) do if i==cycle.i then for c=1,#('>'..v) do local ox=0 if sub('>'..v,c,c)=='i' then ox=3 end print(sub('>'..v,c,c),40-10+20+(i-1)*24+(c-1)*6*2+ox,60-10+(i-1)*24+sin(c*1.2+t*0.25)*4,2+(i-1),false,2,false) end if v=='Casual' then local tw=print('1 life, but frequent checkpoints.',0,-6,4,false,1,true) print('1 life, but frequent checkpoints.',240/2-tw/2,136-6,4,false,1,true) end if v=='Hardcore' then local tw=print('3 lives, but checkpoints are rare.',0,-6,4,false,1,true) print('3 lives, but checkpoints are rare.',240/2-tw/2,136-6,4,false,1,true) end if v=='Hacker' then local tw=print('::DD::D:D:DDD',0,-6,4,false,1,true) print('::DD::D:D:DDD',240/2-tw/2,136-6,4,false,1,true) end if v=='Practice' then local tw=print('Try a stage/boss with infinite lives.',0,-6,4,false,1,true) print('Try a stage/boss with infinite lives.',240/2-tw/2,136-6,4,false,1,true) end else print(v,40+20-10+(i-1)*24,60-10+(i-1)*24,2+(i-1),false,2,false) end end --print('Version 2a',4,136-6-4,13,false,1,true) t=t+1 end cycle2={i=1,'stage1','boss1','stage2','boss2','stage3','boss3','stage4','boss4'} function practice() if btnp(0) or btnp(2) then cycle2.i=cycle2.i-1; if cycle2.i<1 then cycle2.i=#cycle2 end end if btnp(1) or btnp(3) then cycle2.i=cycle2.i+1; if cycle2.i>#cycle2 then cycle2.i=1 end end if btnp(4) then TIC=update stage=_G[cycle2[cycle2.i]] lives=99 sc_t=t+1 phase=nil ph_t=nil end if btnp(5) then TIC=mainmenu end cls(0) print('Practice',20,20,1,false,2,false) for i,v in ipairs(cycle2) do rectb(120+30-2,30-2,64+4,64+4,12) if i==cycle2.i then for c=1,#('>'..v) do --local ox=0 --if sub('>'..v,c,c)=='i' then ox=3 end print(sub('>'..v,c,c),40-10-20+20+(i-1)*12+(c-1)*6,60-10-10+(i-1)*12+sin(c*1.2+t*0.25)*4,2+(i-1),false,1,false) end if sub(cycle2[i],1,5)=='stage' then rect(120+30,30,64,64,get_stagecolor(tonumber(sub(cycle2[i],6,6)))) end if sub(cycle2[i],1,4)=='boss' then --rect(120+30,30,60,60,get_stagecolor(tonumber(sub(cycle2[i],5,5)))) rect(120+30,30,64,64,1) local id=tonumber(sub(cycle2[i],5,5)) if id==1 then spr(5,120+30+8,30,0,2,0,0,3,4) end if id==2 then spr(8,120+30+8,30,0,2,0,0,3,4) end if id==3 then spr(11,120+30+8,30,0,2,0,0,3,4) end if id==4 then spr(69,120+30+8,30,0,2,0,0,3,4) end end else print(v,40+20-10-20+(i-1)*12,60-10-10+(i-1)*12,2+(i-1),false,1,false) end end --print('Version 2a',4,136-6-4,13,false,1,true) t=t+1 end TIC=mainmenu function stagecolor() if stage==stage1 or stage==boss1 then return 6 end if stage==stage2 or stage==boss2 then return 3 end if stage==stage3 or stage==boss3 then return 10 end if stage==stage4 or stage==boss4 then return 2 end if stage==endgame then return 12 end end function get_stagecolor(stage) if stage==1 then return 6 end if stage==2 then return 3 end if stage==3 then return 10 end if stage==4 then return 2 end if stage==endgame then return 12 end end temp={} function gameover() graypx=graypx or 0 if graypx==0 then music() end for i=graypx,math.min(graypx+400,240*136) do pix(i%240,math.floor(i/240),grayscale(pix(i%240,math.floor(i/240)))) end graypx=graypx+400 if graypx>240*136 then if stage==boss3 and phase==7 and temp.b3w7_a then local tw=print('..Seriously?',0,-6) dropshadow('..Seriously?',240/2-tw/2,136/2-3) print('..Seriously?',240/2-tw/2,136/2-3,12) else local tw=print('Game over',0,-6) dropshadow('Game over',240/2-tw/2,136/2-3) print('Game over',240/2-tw/2,136/2-3,12) end local tw=print('Press C to continue.',0,-6,12,false,1,true) dropshadow('Press C to continue.',240/2-tw/2,136/2+8,true) print('Press C to continue.',240/2-tw/2,136/2+8,12,false,1,true) end if key(03) then --reset() reset_game() TIC=update end end function reset_game(pract) bullets={} friendbullets={} bigbullets={} fairies={} scores={} graze=0 score=check_score hyper=nil check_msg=nil if mode=='Hardcore' then lives=3 phase=nil ph_t=nil sc_t=t extra=check_extra extra_msg=nil end if mode=='Casual' then lives=1 sc_t=t-check_t if check_pt then ph_t=t-check_pt else ph_t=nil end end combo=check_combo if not pract then if stage~=boss1 and stage~=boss2 and stage~=boss3 and stage~=boss4 then music(check_track,check_frame,check_row,false,false) else music(check_track,check_frame,check_row,true,false) end if stage==stage4 then firstrow=false if check_id~='S4W1' then for i,fa in ipairs(stickyfairies) do if not fa.gone or tonumber(sub(fa.gone,4,4))>=tonumber(sub(check_id,4,4)) then ins(fairies,fa) end end end end else stickyfairies={} end bosshp=nil bossy=0 temp={} graypx=nil iframes=nil circt=nil end function dropshadow(msg,tx,ty,smallfont) print(msg,tx-1,ty,0,false,1,smallfont) print(msg,tx+1,ty,0,false,1,smallfont) print(msg,tx,ty-1,0,false,1,smallfont) print(msg,tx,ty+1,0,false,1,smallfont) end function grayscale(c) if c==0 then return 0 end if c==1 then return 15 end if c==2 then return 15 end if c==3 then return 14 end if c==4 then return 13 end if c==5 then return 12 end if c==6 then return 14 end if c==7 then return 15 end if c==8 then return 15 end if c==9 then return 14 end if c==10 then return 13 end if c==11 then return 12 end if c>=12 then return c end end scores={} function gain_score(n,x,y) ins(scores,{n,x=x,y=y}) end function fairy_update1(fa) fa.a=fa.a or pi/2 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.y>20 then fa.a=fa.a-0.02; if fa.a<0 then fa.a=0 end end if fa.x>=240-80+1 then rem(fairies,find(fairies,fa)); return end if fa.t==60+(fa.id+1)*6 then for i=0,360,24 do local a=i*pi/180 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a),dy=sin(a),id=34}) end end fa.t=fa.t+1 end function find(tb,what) for i,v in ipairs(tb) do if v==what then return i end end end function fairy_update2(fa) fa.a=fa.a or pi/2 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.y>20 then fa.a=fa.a+0.02; if fa.a>pi then fa.a=pi end end if fa.x<=-8 then rem(fairies,find(fairies,fa)) end if fa.t==60+(fa.id+1)*6 then for i=0,360,24 do local a=i*pi/180 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a),dy=sin(a),id=34}) end end fa.t=fa.t+1 end function fairy_update3(fa) fa.a=fa.a or pi/4*3 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.x<=-8 then rem(fairies,find(fairies,fa)) end if fa.t==100+(fa.id+1)*6 then for i=0,360,24 do local a=i*pi/180 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a),dy=sin(a),id=34}) end end fa.t=fa.t+1 end function fairy_update4(fa) fa.a=fa.a or pi/4 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.x>=240-80+1 then rem(fairies,find(fairies,fa)) end if fa.t==100+(fa.id+1)*6 then for i=0,360,24 do local a=i*pi/180 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a),dy=sin(a),id=34}) end end fa.t=fa.t+1 end function fairy_update5(fa) if fa.t<240+120 then fa.y=fa.y+(40-fa.y)*0.05 end rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) local a=t*4.12 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) if fa.t>120+60 then a=(t+pi)*4.12 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) end if fa.t>240+120 then a=(t+pi+pi)*4.12 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) end if fa.t>(120+60)*3 then a=(t+pi+pi+pi)*4.12 ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) end if fa.t>(120+60)*4 then fa.y=fa.y+(-40-fa.y)*0.05 if fa.y<-20 then rem(fairies,find(fairies,fa)) end end fa.t=fa.t+1 end function fairy_update6(fa) fa.a=fa.a or pi+pi/6 rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.t==(80+fa.id*12) then for j=0,2 do for i=0,360,24 do local a=fa.a+i*pi/180+fa.id ins(bullets,{x=fa.x+2+j*cos(a)*2,y=fa.y+3+j*sin(a)*2,dx=cos(a),dy=sin(a),id=34}) end end end if fa.x<=-8 then rem(fairies,find(fairies,fa)) end fa.t=fa.t+1 end function fairy_update7(fa) fa.a=fa.a or -pi/6 rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.t==(80+fa.id*12) then for j=0,2 do for i=0,360,24 do local a=fa.a+i*pi/180+fa.id ins(bullets,{x=fa.x+2+j*cos(a)*2,y=fa.y+3+j*sin(a)*2,dx=cos(a),dy=sin(a),id=34}) end end end if fa.x>=240-80+1 then rem(fairies,find(fairies,fa)) end fa.t=fa.t+1 end function dialogueprint(msg) rect(0,136-35,240-80+1,35,9) rect(6,136-35+1,24,32,1) if stage==stage1 or stage==boss1 then spr(5,6,136-35+1,0,1,0,0,3,4) elseif stage==stage2 or stage==boss2 then spr(8,6,136-35+1,0,1,0,0,3,4) elseif stage==stage3 or stage==boss3 then spr(11,6,136-35+1,0,1,0,0,3,4) elseif stage==stage4 or stage==boss4 then spr(69,6,136-35+1,0,1,0,0,3,4) end local tx=12+24 local ty=136-35+6 for c=1,#msg do local char=sub(msg,c,c) if char==' ' then local nextword=string.find(msg,' ',c+1) if not nextword then nextword=#msg end --else nextword=nextword+1 end if tx+#sub(msg,c+1,nextword)*3>240-80+1-12 then ty=ty+7 tx=12+24 tx=tx-2 -- to account for space end end local col=4 if (c*7+t*0.8)%48<12 then col=3 end print(char,tx+1,ty+1,1,false,1,true) tx=tx+print(char,tx,ty,col,false,1,true) end end attempts={} function checkpoint(id,ct,pt) if id~=check_id and sub(id,4,4)~='1' then check_msg=90 end check_id=id if not attempts[check_id] then attempts[check_id]=1 else attempts[check_id]=attempts[check_id]+1 end check_score=score check_track=peek(0x13FFC) check_frame=peek(0x13FFC+1) check_row=peek(0x13FFC+2) check_t=ct check_pt=pt check_combo=combo check_extra=extra end function stage1() if t-sc_t==0 then music(0,0,0,false,false) checkpoint('S1W1',t-sc_t) for i=0,5 do ins(fairies,{x=40,y=-40-i*12,update=fairy_update1,t=0,id=i}) end end if t-sc_t==90 then for i=0,5 do ins(fairies,{x=240/2-40+(240/2-40-40),y=-40-i*12,update=fairy_update2,t=0,id=i}) end end if t-sc_t==180 then if mode=='Casual' then checkpoint('S1W2',t-sc_t) end for i=0,5 do ins(fairies,{x=240/2-40+(240/2-40-40)+i*12,y=-40-i*12,update=fairy_update3,t=0,id=i}) end end if t-sc_t==270 then for i=0,5 do ins(fairies,{x=40-i*12,y=-40-i*12,update=fairy_update4,t=0,id=i}) end end if t-sc_t==270+90+50+20+30 then if mode=='Casual' then checkpoint('S1W3',t-sc_t) end ins(fairies,{x=240/2-40,y=-40,update=fairy_update5,t=0}) end if t-sc_t==460+(120+60)*4 then if mode=='Casual' then checkpoint('S1W4',t-sc_t) end for i=0,5 do ins(fairies,{x=240-80+1+40+i*12,y=40+30+i*8,update=fairy_update6,t=0,id=i}) end end if t-sc_t==460+(120+60)*4+120 then for i=0,5 do ins(fairies,{x=-80+1+40-i*12,y=40+30+i*8,update=fairy_update7,t=0,id=i}) end end if t-sc_t==460+(120+60)*4+120+120 then if mode=='Casual' then checkpoint('S1W5',t-sc_t) end for i=0,5 do ins(fairies,{x=240-80+1+40+i*12,y=40+30+i*8,update=fairy_update6,t=0,id=i}) end for i=0,5 do ins(fairies,{x=-80+1+40-i*12,y=40+30+i*8,update=fairy_update7,t=0,id=i}) end end if t-sc_t==1420+120+50 then for i=0,5 do ins(fairies,{x=240/2-40+(240/2-40-40)+i*12,y=-40-i*12,update=fairy_update3,t=0,id=i}) end for i=0,5 do ins(fairies,{x=40-i*12,y=-40-i*12,update=fairy_update4,t=0,id=i}) end end if t-sc_t==1420+120+120+50+80 then if mode=='Casual' then checkpoint('S1W6',t-sc_t) end for i=0,5 do ins(fairies,{x=40,y=-40-i*12,update=fairy_update1,t=0,id=i}) end for i=0,5 do ins(fairies,{x=240/2-40+(240/2-40-40),y=-40-i*12,update=fairy_update2,t=0,id=i}) end end if t-sc_t>=2000+60 and t-sc_t<2000+60+120 then dialogueprint('Remember me?') end if t-sc_t>=2000+60+120 and t-sc_t<=2400 then dialogueprint('I used to be a cat, but now I\'ve grown into a lion. Mrow :3') end if peek(0x13FFC)==255 or t-sc_t==2400 then --local tw=print('End',0,-6*2,5,false,2,false) --print('End',240/2-40-tw/2,136/2,5,false,2,false) stage=boss1 sc_t=t+1 if mode=='Practice' then reset_game(true) TIC=practice end end end --phase=6 --ph_t=2400+220 function boss1() phase=phase or 1 if bosshp then for i=0,360-1 do local a=i*pi/180-pi/2 if i>=(60*10-bosshp)/(60*10)*360 then line((240-80+1)/2+cos(a)*18,35/2+2+sin(a)*18,(240-80+1)/2+cos(a)*19,35/2+2+sin(a)*19,4) end end bosshp=bosshp-1 if bosshp<=0 then bosshp=nil; phase=phase+1; ph_t=t end end if mode=='Casual' and ph_t and t-ph_t==0 then checkpoint(fmt('B1W%d',phase),t-sc_t,t-ph_t) end if t-sc_t>=0 and t-sc_t<2400-2000-60-120-40 then if t-sc_t==0 then music(1,0,0,true,false); checkpoint('B1W1',t-sc_t) end dialogueprint('I\'ll test my new powers on you!') end if t-sc_t==2400-2000-60-120-40 then bosshp=60*10 bosshp=60*10 end if t-sc_t>=2400-2000-60-120-40 and (phase==1 or phase==3 or phase==5) and ((not ph_t) or (phase~=5 and t-ph_t>80) or (phase==5 and t-ph_t>160)) and t%60==0 then local a2=pi/2--+sin(t*0.005)*0.5--math.atan2(y-35/2,x-(240-80+1)/2) if phase==3 then if not bosshp then bosshp=60*10 end a2=pi/2+sin(t/60*0.5)*0.5 end if phase==5 then if not bosshp then bosshp=60*10 end a2=math.atan2(y-35/2,x-(240-80+1)/2) end for j=0,2 do for i=0,2 do local a=a2+pi/5-pi/6+pi/6*i ins(bullets,{x=(240-80+1)/2-20+cos(a)*j*8,y=35/2-8+sin(a)*j*8,dx=cos(a),dy=sin(a),id=34}) end end for j=0,2 do for i=0,2 do local a=a2-pi/5-pi/6+pi/6*i ins(bullets,{x=(240-80+1)/2+20+cos(a)*j*8,y=35/2-8+sin(a)*j*8,dx=cos(a),dy=sin(a),id=34}) end end for j=0,2 do for i=0,2 do local a=a2-pi/6+pi/6*i ins(bullets,{x=(240-80+1)/2+cos(a)*j*8,y=35/2+sin(a)*j*8,dx=cos(a),dy=sin(a),id=34}) end end end if t-sc_t>=2400-2000-60-120-40 and (phase==1 or phase==3 or phase==5) and ((not ph_t) or (phase~=5 and t-ph_t>80) or (phase==5 and t-ph_t>160)) and t%60==30 then local a2=pi/2--+sin(t*0.005)*0.5--math.atan2(y-35/2,x-(240-80+1)/2) if phase==3 then a2=pi/2+sin(t/60*0.5)*0.5 end if phase==5 then a2=math.atan2(y-35/2,x-(240-80+1)/2) end for j=0,2 do for i=0,2 do local a=a2-pi/5-pi/6+pi/6*i ins(bullets,{x=(240-80+1)/2-20+cos(a)*j*8,y=35/2-8+sin(a)*j*8,dx=cos(a),dy=sin(a),id=34}) end end for j=0,2 do for i=0,2 do local a=a2+pi/5-pi/6+pi/6*i ins(bullets,{x=(240-80+1)/2+20+cos(a)*j*8,y=35/2-8+sin(a)*j*8,dx=cos(a),dy=sin(a),id=34}) end end for j=0,2 do for i=0,2 do local a=a2-pi/6+pi/6*i ins(bullets,{x=(240-80+1)/2+cos(a)*j*8,y=35/2+sin(a)*j*8,dx=cos(a),dy=sin(a),id=34}) end end end if phase==2 and t-ph_t>80 then if not bosshp then bosshp=60*10 end if (t-sc_t)%24==0 then for i=0,24 do local a=i*(2*pi/24) local a2=a+pi/2 ins(bullets,{x=(240-80+1)/2+cos(a)*18+cos(t*0.2)*30,y=35/2+sin(a)*18+sin(t*0.3)*10,dx=cos(a2),dy=sin(a2),id=34}) local a=-i*(2*pi/24) local a2=a-pi/2 ins(bullets,{x=(240-80+1)/2+cos(a)*18+cos(t*0.2)*30,y=35/2+sin(a)*18+sin(t*0.3)*10,dx=cos(a2),dy=sin(a2),id=34}) end end end if phase==4 and t-ph_t>80 then if not bosshp then bosshp=60*10 end if (t-sc_t)%24==0 then for i=0,24 do local a=i*(2*pi/24) local a2=a+pi/2 ins(bullets,{x=(240-80+1)/2+cos(a)*18+cos(t*0.02)*30,y=35/2+sin(a)*18+sin(t*0.3)*10,dx=cos(a2)*(math.floor(i*0.25%4)+1)*0.3,dy=sin(a2)*(math.floor(i*0.25%4)+1)*0.3,id=34}) local a=-i*(2*pi/24) local a2=a-pi/2 ins(bullets,{x=(240-80+1)/2+cos(a)*18+cos(t*0.02)*30,y=35/2+sin(a)*18+sin(t*0.3)*10,dx=cos(a2)*(math.floor(i*0.25%4)+1)*0.3,dy=sin(a2)*(math.floor(i*0.25%4)+1)*0.3,id=34}) end end end if phase==6 and t-ph_t>80 then if not bosshp then bosshp=60*10 end if (t-sc_t)%4==0 then for i=0,12 do local a=t*0.2+i*(2*pi/12) local a2=a+pi/2 ins(bullets,{x=(240-80+1)/2+cos(a)*18+cos(t*0.02)*30,y=35/2+sin(a)*18+sin(t*0.3)*10,dx=cos(a2)*0.4,dy=sin(a2)*0.4,id=34}) local a=-t*0.2-i*(2*pi/12) local a2=a-pi/2 ins(bullets,{x=(240-80+1)/2+cos(a)*18+cos(t*0.02)*30,y=35/2+sin(a)*18+sin(t*0.3)*10,dx=cos(a2)*0.4,dy=sin(a2)*0.4,id=34}) end end end if phase==7 then for i=0,8 do if #bullets>0 then rem(bullets,#bullets) end end if t-ph_t>=160 and t-ph_t<160+320 then dialogueprint('Marvellous! So much energy flowing in me.') end if t-ph_t>=160+320 and t-ph_t<160+320+280 then dialogueprint('You were pretty good, too.') end if t-ph_t>=160+320+280 then local tw=print('Stage 1 clear',0,-6) print('Stage 1 clear',240/2-40-tw/2,136-51-5,5) local msg if t-ph_t<160+320+280+30 then msg='Clear bonus: 1000' else msg='Clear bonus: ' end --tw=print(msg,0,-6) print(msg,240/2-40-86/2,136-51+5,4) if mode=='Casual' then stats(1) end if t-ph_t==160+320+280+30 then gain_score(1000,240/2-40-86/2+70,136-51+5) end vol=vol or 15 for ch=0,3 do setvol(ch,math.floor(vol)) end vol=vol-0.04 if vol<=0 then vol=nil music() sc_t=t+1 stage=stage2 phase=nil ph_t=nil --a_keys=nil if mode=='Practice' then reset_game(true) TIC=practice end end end end end function fairy_update8(fa) --fa.a=fa.a or -pi/6 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.t>=(80+fa.id*12) and fa.t<80+fa.id*12+48 and fa.t%4==0 then local a2=math.atan2(y-fa.y,x-fa.x) for i=0,4 do local a=a2+i/5*2*pi ins(bullets,{x=fa.x+2,y=fa.y+3,dx=cos(a),dy=sin(a),id=34}) end end if fa.x>240 or fa.x<-8-5*12 then rem(fairies,find(fairies,fa)) end fa.t=fa.t+1 end function fairy_update9(fa) --fa.a=fa.a or -pi/6 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if fa.t>=(100+fa.id*12) and fa.t<100+fa.id*12+12 and fa.t%6==0 then for i=0,12 do local a=i/13*2*pi+t*2.2 local a2=a if i%2==1 then a2=a+pi end ins(bullets,{x=fa.x+2+cos(a)*8,y=fa.y+3+sin(a)*8,dx=cos(a2),dy=sin(a2),id=34}) end end if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end fa.t=fa.t+1 end function fairy_update10(fa) --fa.a=fa.a or -pi/6 rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) --fa.x=fa.x+cos(fa.a) if fa.t<90 then fa.y=fa.y+(40-fa.y)*0.05 end if fa.t>=0 and fa.t<100+40+80+80+40 and fa.t%3==0 then for i=0,12 do local a=i/13*2*pi+t*2.2 local a2=a if i%2==1 then a2=a+pi end ins(bullets,{x=fa.x+2+cos(a)*8,y=fa.y+3+sin(a)*8,dx=cos(a2),dy=sin(a2),id=34}) end end if fa.t>100+40+80+80+40 then fa.y=fa.y+(-40-fa.y)*0.05 if math.abs(-40-fa.y)<1 then rem(fairies,find(fairies,fa)) end end fa.t=fa.t+1 end function fairy_update11(fa) --fa.a=fa.a or -pi/6 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) --fa.x=fa.x+cos(fa.a) fa.x=240/2-40+cos(fa.a)*fa.dist fa.y=136-51+sin(fa.a)*fa.dist fa.a=fa.a+0.02 if fa.t<100 then fa.dist=fa.dist-1 if fa.dist<50 then fa.dist=50 end end if fa.t>=0 and fa.t<100+40+80+80+40+120 and fa.t%6==4 then --for i=0,12 do --local a=i/13*2*pi+t*2.2 --local a2=a --if i%2==1 then a2=a+pi end local a=fa.a+(t-sc_t)*1.4 ins(bullets,{x=fa.x+2+cos(a)*8,y=fa.y+3+sin(a)*8,dx=cos(a)*0.3,dy=sin(a)*0.3,id=34}) --end end if fa.t>100+40+80+80+40+120 then fa.dist=fa.dist+1 if fa.dist>120 then rem(fairies,find(fairies,fa)) end end fa.t=fa.t+1 end function fairy_update12(fa) --fa.a=fa.a or -pi/6 rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) --fa.x=fa.x+cos(fa.a) if fa.t<90 then fa.y=fa.y+(40-fa.y)*0.05 end if fa.t>=0 and fa.t<100+40+80+80+40+40 and fa.t%2==0 then for i=0,12 do local a=i/13*2*pi+(t-sc_t)*4.2 local a2=a if i%2==1 then a2=a+pi end ins(bullets,{x=fa.x+2+cos(a)*8,y=fa.y+3+sin(a)*8,dx=cos(a2),dy=sin(a2),id=34}) end end if fa.t>100+40+80+80+40+40 then fa.y=fa.y+(-40-fa.y)*0.05 if math.abs(-40-fa.y)<1 then rem(fairies,find(fairies,fa)) end end fa.t=fa.t+1 end function stage2() --local tw=print('End',0,-6*2,5,false,2,false) --print('End',240/2-40-tw/2,136/2,5,false,2,false) if t-sc_t==0 then music(2,0,0,false,false) checkpoint('S2W1',t-sc_t) for i=0,9-1 do if i%2==0 then ins(fairies,{x=240/2-40+i*3,a=pi/2+pi/6,y=-40-i*12,update=fairy_update8,id=i,t=0}) else ins(fairies,{x=240/2-40-i*3,a=pi/2-pi/6,y=-40-i*12,update=fairy_update8,id=i,t=0}) end end end if t-sc_t==120+60 then for i=0,5 do ins(fairies,{x=240/2-40-20-i*3,a=pi/2-pi/6,y=-40-i*12,t=0,id=i,update=fairy_update9}) end end if t-sc_t==(120+60)*2 then for i=0,5 do ins(fairies,{x=240/2-40+20+i*3,a=pi/2+pi/6,y=-40-i*12,t=0,id=i,update=fairy_update9}) end end if t-sc_t==(120+60)*3+60 then if mode=='Casual' then checkpoint('S2W2',t-sc_t) end ins(fairies,{x=240/2-40,a=pi/2,y=-40,t=0,update=fairy_update10}) end if t-sc_t==(120+60)*3+60+100+40+80+80+40 then for i=0,5 do ins(fairies,{x=240-80+1+i*12,a=pi,y=35+6,t=0,update=fairy_update8,id=i}) end end if t-sc_t==940+90 then for i=0,5 do ins(fairies,{x=-8-i*12,a=0,y=136-20,t=0,update=fairy_update8,id=i}) end end if t-sc_t==940+90+120+60+30 then if mode=='Casual' then checkpoint('S2W3',t-sc_t) end for i=0,5 do ins(fairies,{x=240/2-40+cos(i/6*2*pi)*120,dist=120,a=i/6*2*pi,y=136-51+sin(i/6*2*pi)*120,t=0,update=fairy_update11,id=i}) end end if t-sc_t==1240+460+40-40 then if mode=='Casual' then checkpoint('S2W4',t-sc_t) end for i=0,5 do ins(fairies,{x=240/2-40-20-i*3,a=pi/2-pi/6,y=-40-i*12,t=0,id=i,update=fairy_update9}) end for i=0,5 do ins(fairies,{x=240/2-40+20+i*3,a=pi/2+pi/6,y=-40-i*12,t=0,id=i,update=fairy_update9}) end end if t-sc_t==1240+460+40+120+80-40 then if mode=='Casual' then checkpoint('S2W5',t-sc_t) end ins(fairies,{x=240/2-40,a=pi/2,y=-40,t=0,update=fairy_update10}) end if t-sc_t==1240+460+40+120+80+50-40 then for i=0,5 do ins(fairies,{x=240-80+1+i*12,a=pi,y=35+6,t=0,update=fairy_update8,id=i}) end end if t-sc_t==1240+460+40+120+80+50-40+80 then for i=0,5 do ins(fairies,{x=-8-i*12,a=0,y=35+6,t=0,update=fairy_update8,id=i}) end end --if t-sc_t==1240+460+40+120+80+50+140 then -- for i=0,5 do -- ins(fairies,{x=-8-i*12,a=0,y=136-20,t=0,update=fairy_update8,id=i}) -- end --end if t-sc_t==1940+100+40+80+80+40+40-40 then if mode=='Casual' then checkpoint('S2W6',t-sc_t) end ins(fairies,{x=240/2-40,a=pi/2,y=-40,t=0,update=fairy_update12}) end if peek(0x13FFC)==255 or t-sc_t>=2665 then --local tw=print('End',0,-6*2,5,false,2,false) --print('End',240/2-40-tw/2,136/2,5,false,2,false) end if t-sc_t>=2665+150 and t-sc_t<2665+250+220 then dialogueprint('What\'s with all the ruckus?') end if t-sc_t>=2665+150+220 then dialogueprint('I quite enjoy silence.') end if t-sc_t==2665+150+220+220 then stage=boss2 sc_t=t+1 if mode=='Practice' then reset_game(true) TIC=practice end end end function boss2() phase=phase or 1 if bosshp then if phase~=4 and phase~=6 then for i=0,360-1 do local a=i*pi/180-pi/2 if i>=(60*10-bosshp)/(60*10)*360 then line((240-80+1)/2+cos(a)*18,35/2+2+sin(a)*18,(240-80+1)/2+cos(a)*19,35/2+2+sin(a)*19,4) end end end bosshp=bosshp-1 if bosshp<=0 then bosshp=nil; phase=phase+1; ph_t=t end end if mode=='Casual' and ph_t and t-ph_t==0 then checkpoint(fmt('B2W%d',phase),t-sc_t,t-ph_t) end if phase==1 and t-sc_t==0 then music(1,0,0,true,false) checkpoint('B2W1',t-sc_t) end if phase==1 and t-sc_t>=0 and t-sc_t<220 then dialogueprint('Gah! Now there\'s loud music again!') end if phase==1 and t-sc_t>=220 and t-sc_t<220+220-40-10 then dialogueprint('It makes me wanna fight!') end if (phase==1 and t-sc_t>=220+220-40-10) or phase==3 or (phase==5 and t-ph_t>120) then if not bosshp then bosshp=60*10 end if t%2==0 then local da=1 if phase==3 then da=0.75 end if phase==5 then da=0.5 end for d=0,math.floor(phase/2) do for i=0,6 do local a=sin((t-sc_t)*0.04+i*0.02)*20-sin((t-sc_t)*0.02+i*0.02)*10 ins(bullets,{x=240/2-40+cos(((t-sc_t)+i*0.2)*0.15)*30+cos(a)*(d*2),y=35/2+sin(((t-sc_t)+i*0.2)*0.12)*10+sin(a)*(d*2),dx=cos(a)*da,dy=sin(a)*da,id=34}) end end end end if phase==2 and t-ph_t>50 then if not bosshp then bosshp=60*10 end for i=0,6 do local a=sin((t-sc_t)*0.004+i*0.02)*20-sin((t-sc_t)*0.02+i*0.02)*10 ins(bullets,{x=240/2-40+cos(((t-sc_t)+i*0.2)*0.15)*30,y=35/2+sin(((t-sc_t)+i*0.2)*0.12)*10,dx=cos(a)*0.6,dy=sin(a)*0.6,id=34}) end end if phase==4 then bossy=bossy+(-35-bossy)*0.1 end if phase==5 then if t-ph_t==0 then temp={} end bossy=bossy+(0-bossy)*0.1 end if phase==4 and t-ph_t>=50+80 then if not bosshp then bosshp=60*10 end --for i=0,6 do --local a=sin(t*0.04+i*2)*20-sin(t*0.002+i*2)*10 --ins(bullets,{x=240/2-40+cos((t+i*0.2)*0.55)*30,y=35/2+sin((t+i*0.2)*0.52)*10,dx=cos(a),dy=sin(a),id=34}) --end temp.b2w4_a=temp.b2w4_a or 0 temp.b2w4_b=temp.b2w4_b or 0 temp.b2w4_c=temp.b2w4_c or 1 if t-ph_t<210+80 then if t%2==0 then for i=0,6 do ins(bullets,{x=240/2-40-80-30-40+i*18+cos(pi/4)*temp.b2w4_a,y=35+60-40-i*18+sin(pi/4)*temp.b2w4_a,dx=0,dy=0,id=34}) end temp.b2w4_a=temp.b2w4_a+6 if t-ph_t>80+80 then for i=0,6 do ins(bullets,{x=240/2+40+80+30+40-i*18+cos(3*pi/4)*temp.b2w4_b,y=35+60-40-60-i*18+sin(3*pi/4)*temp.b2w4_b,dx=0,dy=0,id=34}) end temp.b2w4_b=temp.b2w4_b+6 end end else if not temp.b2w4_d then temp.b2w4_d={} for i,b in ipairs(bullets) do ins(temp.b2w4_d,b) end end for i=temp.b2w4_c,math.min(temp.b2w4_c+2,#temp.b2w4_d) do local b=temp.b2w4_d[i] b.dx=cos(b.x*0.08)*0.2; b.dy=sin(b.x*0.08)*0.2 end temp.b2w4_c=temp.b2w4_c+2 end end if phase==6 and t-ph_t<120 then for i=0,8 do if #bullets>0 then rem(bullets,1) end end end if phase==6 and t-ph_t>=90 then if not bosshp then bosshp=60*10 end --for i=0,6 do --local a=sin(t*0.04+i*2)*20-sin(t*0.002+i*2)*10 --ins(bullets,{x=240/2-40+cos((t+i*0.2)*0.55)*30,y=35/2+sin((t+i*0.2)*0.52)*10,dx=cos(a),dy=sin(a),id=34}) --end temp.b2w6_a=temp.b2w6_a or {} if (t-ph_t-51)%120==0 then ins(temp.b2w6_a,{t=-20,x=x,y=y,a=(t-sc_t)*0.2,d=0}) temp.warn_a=(t-sc_t)*0.2 temp.warn_t=t-ph_t end if (t-ph_t-51)%120<=8 then line(x-cos(temp.warn_a)*120,y-sin(temp.warn_a)*120,x-cos(temp.warn_a)*120+cos(temp.warn_a)*(t-temp.warn_t)*24,y-sin(temp.warn_a)*120+sin(temp.warn_a)*(t-temp.warn_t)*24,12) end if t%2==0 then for j,swipe in ipairs(temp.b2w6_a) do for i=0,2 do ins(bullets,{x=swipe.x-cos(swipe.a)*(120-swipe.d)+cos(swipe.a+pi/2)*(i-1)*28,y=swipe.y-sin(swipe.a)*(120-swipe.d)+sin(swipe.a+pi/2)*(i-1)*28,dx=0,dy=0,id=34}) ins(swipe,bullets[#bullets]) end swipe.d=swipe.d+6 end end for j,swipe in ipairs(temp.b2w6_a) do for k,b in ipairs(swipe) do if k>swipe.t then break end if b.dx==0 and b.dy==0 then b.dx=cos(b.x*0.08)*0.2; b.dy=sin(b.x*0.08)*0.2 end end swipe.t=swipe.t+1 end end if phase==6 then bossy=bossy+(-35-bossy)*0.1 end if phase==7 then if t-ph_t<100 then for i=0,2 do if #bullets>0 then rem(bullets,#bullets) end end end if t-ph_t==0 then temp={} end bossy=bossy+(0-bossy)*0.1 if t-ph_t>=100 and t-ph_t<100+280 then dialogueprint('Now, brace for my ultimate attack!!') end if t-ph_t>=100+280 then if t%2==0 and not dg_t then for d=0,16 do for i=0,6 do local a=sin((t-sc_t)*0.04+i*0.02)*20-sin((t-sc_t)*0.02+i*0.02)*10 ins(bullets,{x=240/2-40+cos(((t-sc_t)+i*0.2)*0.15)*30+cos(a)*(d*2),y=35/2+sin(((t-sc_t)+i*0.2)*0.12)*10+sin(a)*(d*2),dx=cos(a),dy=sin(a),id=34}) end end end if not dg_t then for i,b in ipairs(bullets) do if math.sqrt((b.x-x)^2+(b.y-y)^2)<=12 then dg_t=t+1 break end end end if dg_t then for i=0,96 do if #bullets>0 then rem(bullets,1) end end if t-dg_t>50 and t-dg_t<280+50 then dialogueprint('Just kidding, you won already.') end if t-dg_t>=280+50 then local tw=print('Stage 2 clear',0,-6) print('Stage 2 clear',240/2-40-tw/2,136-51-5,5) local msg if t-dg_t<280+50+30 then msg='Clear bonus: 2000' else msg='Clear bonus: ' end --tw=print(msg,0,-6) print(msg,240/2-40-86/2,136-51+5,4) if t-dg_t==280+50+30 then gain_score(2000,240/2-40-86/2+70,136-51+5) end if mode=='Casual' then stats(2) end vol=vol or 15 for ch=0,3 do setvol(ch,math.floor(vol)) end vol=vol-0.04 if vol<=0 then vol=nil music() sc_t=t+1 stage=stage3 phase=nil ph_t=nil --a_keys=nil if mode=='Practice' then reset_game(true) TIC=practice end end end end end end end function fairy_update13(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if t-sc_t<110*3 then fa.y=fa.y+(fa.tgty-fa.y)*0.05 end if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end if t-sc_t>=110*3 then if t-sc_t==110*3 then fa.a=math.atan2((35+16)-fa.y,(240/2-40)-fa.x) end fa.x=fa.x+cos(fa.a)*1.6 fa.y=fa.y+sin(fa.a)*1.6 --fa.y=fa.y+1 end fa.t=fa.t+1 end function fairy_ondeath1(fa) local a=math.atan2(y-fa.y,x-fa.x) for i=0,13 do ins(bullets,{x=fa.x+cos(i/14*2*pi)*12,y=fa.y+sin(i/14*2*pi)*12,dx=cos(a)*2,dy=sin(a)*2,id=34}) end end function fairy_update14(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.x<-8 then rem(fairies,find(fairies,fa)) end fa.x=fa.x+cos(fa.a)*0.8 fa.y=fa.y+sin(fa.a)*0.8 if (fa.id==0 or fa.id==3 or fa.id==4) and (t-sc_t)%(36)==12 then--(fa.id%2==0 and (t-sc_t)%(24*6)==0) or fa.id%2==1 and (t-sc_t)%(24*6)==24*3 then --local a=math.atan2(y-(fa.y),x-(fa.x)) local a=pi/4*3 for i=0,14 do ins(bullets,{x=fa.x+cos(i/15*2*pi)*14,y=fa.y+sin(i/15*2*pi)*14,dx=cos(a)*2,dy=sin(a)*2,id=34}) end end if (fa.id%2==0 and (peek(0x13FFC+2)==6 or peek(0x13FFC+2)==9)) or (fa.id%2==1 and (peek(0x13FFC+2)==18 or peek(0x13FFC+2)==21)) then--(t-sc_t)%110==70-50 or (t-sc_t)%110==90-50 then for j=0,7 do for i=0,5 do local a=j/8*2*pi+math.atan2(y-(fa.y),x-(fa.x)) ins(bullets,{x=fa.x+cos(a)*i*5,y=fa.y+sin(a)*i*5,dx=cos(a)*2,dy=sin(a)*2,id=34}) end end end --fa.y=fa.y+1 fa.t=fa.t+1 end function fairy_update15(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.x>=240-80+1 then rem(fairies,find(fairies,fa)) end fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if peek(0x13FFC+2)==24 or peek(0x13FFC+2)==30 or peek(0x13FFC+2)==36 then local a=math.atan2(y-fa.y,x-fa.x)+sin((t-sc_t)*0.2)*pi/6 ins(bullets,{x=fa.x,y=fa.y,dx=cos(a)*2.5,dy=sin(a)*2.5,id=34}) end fa.t=fa.t+1 end function fairy_update14b(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.x>=240-80+1 then rem(fairies,find(fairies,fa)) end fa.x=fa.x+cos(fa.a)*0.8 fa.y=fa.y+sin(fa.a)*0.8 if (fa.id==0 or fa.id==3 or fa.id==4) and (t-sc_t)%(36)==12 then--(fa.id%2==0 and (t-sc_t)%(24*6)==0) or fa.id%2==1 and (t-sc_t)%(24*6)==24*3 then --local a=math.atan2(y-(fa.y),x-(fa.x)) local a=pi/4 for i=0,14 do ins(bullets,{x=fa.x+cos(i/15*2*pi)*14,y=fa.y+sin(i/15*2*pi)*14,dx=cos(a)*2,dy=sin(a)*2,id=34}) end end if (fa.id%2==0 and (peek(0x13FFC+2)==6 or peek(0x13FFC+2)==9)) or (fa.id%2==1 and (peek(0x13FFC+2)==18 or peek(0x13FFC+2)==21)) then--(t-sc_t)%110==70-50 or (t-sc_t)%110==90-50 then for j=0,7 do for i=0,5 do local a=j/8*2*pi+math.atan2(y-(fa.y),x-(fa.x)) ins(bullets,{x=fa.x+cos(a)*i*5,y=fa.y+sin(a)*i*5,dx=cos(a)*2,dy=sin(a)*2,id=34}) end end end --fa.y=fa.y+1 fa.t=fa.t+1 end function fairy_update15b(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.x<-8 then rem(fairies,find(fairies,fa)) end fa.x=fa.x+cos(fa.a) fa.y=fa.y+sin(fa.a) if peek(0x13FFC+2)==24 or peek(0x13FFC+2)==30 or peek(0x13FFC+2)==36 then local a=math.atan2(y-fa.y,x-fa.x)+sin((t-sc_t+fa.id)*1.2)*pi/6 ins(bullets,{x=fa.x,y=fa.y,dx=cos(a)*2.5,dy=sin(a)*2.5,id=34}) end fa.t=fa.t+1 end function fairy_update16(fa) rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.x<-8 then rem(fairies,find(fairies,fa)) end if fa.t<120 then fa.y=fa.y+(25-fa.y)*0.05 end if fa.t>=110*64/16-110*4/16 then fa.y=fa.y+(-35-fa.y)*0.1 if fa.y<-25 then rem(fairies,find(fairies,fa)) end end if (t-sc_t)%1==0 then local a=(t-sc_t)*1.5 for i=0,2 do ins(bullets,{x=fa.x,y=fa.y+2,dx=cos(a+i*0.2),dy=sin(a+i*0.2),id=34}) end if fa.t>=110*32/16-110*2/16 then local a=(t-sc_t)*15.51 for i=0,7 do ins(bullets,{x=fa.x,y=fa.y,dx=cos(a+i*0.2)*2,dy=sin(a+i*0.2)*2,id=34}) end end end fa.t=fa.t+1 end function fairy_update16b(fa) rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.x<-8 then rem(fairies,find(fairies,fa)) end if fa.t<90 then fa.y=fa.y+(25-fa.y)*0.1 end if fa.t>=110*64/16-110 then fa.y=fa.y+(-35-fa.y)*0.1 if fa.y<-25 then rem(fairies,find(fairies,fa)) end end if (t-sc_t)%1==0 then local a=(t-sc_t)*(15.5+fa.t*0.001) if fa.id==0 then a=-a end for i=0,7 do ins(bullets,{x=fa.x,y=fa.y,dx=cos(a+i*0.02)*1,dy=sin(a+i*0.02)*1,id=34}) end end fa.t=fa.t+1 end function fairy_update16c(fa) rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.x<-8 then rem(fairies,find(fairies,fa)) end if fa.t<90 then fa.y=fa.y+(25-fa.y)*0.1 end if fa.t>=110*64/16-110 then fa.y=fa.y+(-35-fa.y)*0.1 if fa.y<-25 then rem(fairies,find(fairies,fa)) end end if (t-sc_t)%1==0 and fa.t>16 and fa.t<110*64/16-110 then local a=(t-sc_t)*15.202 if fa.id==0 then a=-a end for i=0,7 do ins(bullets,{x=fa.x,y=fa.y,dx=cos(a+i*0.2)*1.25,dy=sin(a+i*0.2)*1.25,id=34}) end end fa.t=fa.t+1 end function fairy_update17(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.t<110 then fa.y=fa.y+(fa.tgty-fa.y)*0.05 end if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end if fa.t>=110 then if fa.t==110 then fa.a=math.atan2((35+21)-fa.y,(240/2-40)-fa.x) end fa.x=fa.x+cos(fa.a)*1.6 fa.y=fa.y+sin(fa.a)*1.6 --fa.y=fa.y+1 end fa.t=fa.t+1 end function fairy_update17b(fa) rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.t<110 then fa.y=fa.y+(fa.tgty-fa.y)*0.05 end if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end if fa.t>=110 then if fa.t==110 then if fa.x>240/2-40 then fa.a=math.atan2((y-35)-fa.y,((240-80+1)/2+20)-fa.x) else fa.a=math.atan2((y-70)-fa.y,((240-80+1)/2-20)-fa.x) end end fa.x=fa.x+cos(fa.a)*0.8 fa.y=fa.y+sin(fa.a)*0.8 --fa.y=fa.y+1 end fa.t=fa.t+1 end function fairy_update18(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.t<110 and fa.dist>50 then fa.dist=fa.dist-1 end if fa.t>110*48/16+110*4-110*4/16 then fa.dist=fa.dist+1 if fa.dist>=99 then rem(fairies,find(fairies,fa)) end end --if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end fa.x=(240-80+1)/2+cos(fa.a)*fa.dist fa.y=136-51+sin(fa.a)*fa.dist fa.a=fa.a+0.015 local a=math.atan2(136-51-fa.y,(240-80+1)/2-fa.x)+sin((t-sc_t)*0.2+fa.id)*0.2 ins(bullets,{x=fa.x,y=fa.y,dx=cos(a),dy=sin(a),id=34}) fa.t=fa.t+1 end function fairy_update19(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) --if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end --fa.x=(240-80+1)/2+cos(fa.a)*fa.dist --fa.y=136-51+sin(fa.a)*fa.dist if fa.t<90 then fa.y=fa.y+(25-fa.y)*0.05 end if fa.t>=110*24/16+110*4-110*4/16 then fa.y=fa.y+(-35-fa.y)*0.1 if fa.y<-25 then rem(fairies,find(fairies,fa)) end end if (t-sc_t)%2==0 then local a=-(t-sc_t)*(23.4)--t*(19.1+fa.t*0.001)--math.atan2(136-51-fa.y,(240-80+1)/2-fa.x)+sin((t-sc_t)*0.2+fa.id)*0.2 ins(bullets,{x=fa.x+3,y=fa.y+3,dx=cos(a),dy=sin(a)*0.5,id=34}) end fa.t=fa.t+1 end function stage3() if t-sc_t==0 then music(3,0,0,false,false); checkpoint('S3W1',t-sc_t) end --local tw=print('End',0,-6*2,5,false,2,false) --print('End',240/2-40-tw/2,136/2,5,false,2,false) if t-sc_t==0 then for i=0,8 do ins(fairies,{a=pi+i/8*pi,x=240/2-40+cos(pi+i/8*pi)*50,y=136-51-51+sin(pi+i/8*pi)*50,tgty=136-51-51+sin(pi+i/8*pi)*50+50,t=0,update=fairy_update13,ondeath=fairy_ondeath1}) end end if t-sc_t==110 then for i=0,9 do ins(fairies,{a=pi+i/9*pi,x=240/2-40+cos(pi+i/9*pi)*60,y=136-51-51+sin(pi+i/9*pi)*60,tgty=136-51-51+sin(pi+i/9*pi)*60+50-5,t=0,update=fairy_update13,ondeath=fairy_ondeath1}) end for i=0,10 do ins(fairies,{a=pi+i/10*pi,x=240/2-40+cos(pi+i/10*pi)*70,y=136-51-51+sin(pi+i/10*pi)*70,tgty=136-51-51+sin(pi+i/10*pi)*70+50-5-5,t=0,update=fairy_update13,ondeath=fairy_ondeath1}) end end if t-sc_t==110*2 then for i=0,11 do ins(fairies,{a=pi+i/11*pi,x=240/2-40+cos(pi+i/11*pi)*80,y=136-51-51+sin(pi+i/11*pi)*80,tgty=136-51-51+sin(pi+i/11*pi)*80+50-5-5-5,t=0,update=fairy_update13,ondeath=fairy_ondeath1}) end for i=0,12 do ins(fairies,{a=pi+i/12*pi,x=240/2-40+cos(pi+i/12*pi)*90,y=136-51-51+sin(pi+i/12*pi)*90,tgty=136-51-51+sin(pi+i/12*pi)*90+50-5-5-5,t=0,update=fairy_update13,ondeath=fairy_ondeath1}) end for i=0,13 do ins(fairies,{a=pi+i/13*pi,x=240/2-40+cos(pi+i/13*pi)*100,y=136-51-51+sin(pi+i/13*pi)*100,tgty=136-51-51+sin(pi+i/13*pi)*100+50-5-5-5-5,t=0,update=fairy_update13,ondeath=fairy_ondeath1}) end end if t-sc_t==110*4 then if mode=='Casual' then checkpoint('S3W2',t-sc_t) end for i=0,5 do if i%2==0 then ins(fairies,{a=pi+pi/6,x=240-80+1-cos(pi+pi/6)*(i*16)+i%2*cos(pi/4*7)*32,y=35+35-sin(pi+pi/6)*(i*16)+i%2*sin(pi/4*7)*32,update=fairy_update14,t=0,id=i}) else ins(fairies,{a=pi+pi/6,x=240-80+1-cos(pi+pi/6)*((i-1)*16)+i%2*cos(pi/4*7-0.2)*48,y=35+35-sin(pi+pi/6)*((i-1)*16)+i%2*sin(pi/4*7-0.2)*48,update=fairy_update14,t=0,id=i}) end end end if t-sc_t==110*4+110 then for i=0,5 do ins(fairies,{a=pi+pi/6*5,x=-8-cos(pi+pi/6*5)*i*8,y=35+35-sin(pi+pi/6*5)*i*8,update=fairy_update15,t=0,id=i}) end end if t-sc_t==math.floor(110*4+110*48/16) then if mode=='Casual' then checkpoint('S3W3',t-sc_t) end for i=0,5 do if i%2==0 then ins(fairies,{a=pi+pi/6*5,x=-8-cos(pi+pi/6*5)*(i*16)+i%2*cos(pi/4*5)*32,y=35+35-sin(pi+pi/6*5)*(i*16)+i%2*sin(pi/4*5)*32,update=fairy_update14b,t=0,id=i}) else ins(fairies,{a=pi+pi/6*5,x=-8-cos(pi+pi/6*5)*((i-1)*16)+i%2*cos(pi/4*5+0.2)*48,y=35+35-sin(pi+pi/6*5)*((i-1)*16)+i%2*sin(pi/4*5+0.2)*48,update=fairy_update14b,t=0,id=i}) end end end if t-sc_t==math.floor(110*4+110*48/16)+110 then for i=0,5 do ins(fairies,{a=pi+pi/6,x=240-80+1-cos(pi+pi/6)*i*8,y=35+35-sin(pi+pi/6)*i*8,update=fairy_update15b,t=0,id=i}) end end if t-sc_t==math.floor(110*4+110*48/16+110*48/16) then if mode=='Casual' then checkpoint('S3W4',t-sc_t) end ins(fairies,{x=(240-80+1)/2,y=-35,update=fairy_update16,t=0}) end if t-sc_t==math.floor(110*4+110*48/16+110*48/16+110*64/16) then if mode=='Casual' then checkpoint('S3W5',t-sc_t) end ins(fairies,{x=(240-80+1)/2-40,y=-35,update=fairy_update16c,t=0,id=0}) ins(fairies,{x=(240-80+1)/2+40,y=-35,update=fairy_update16c,t=0,id=1}) end if peek(0x13FFC+1)==5 and peek(0x13FFC+2)==0 and not temp.s3w6_a then --t-sc_t==math.floor(110*4+110*48/16+110*48/16+110*64/16+110*64/16) then temp.s3w6_a=true if mode=='Casual' then checkpoint('S3W6',t-sc_t) end for i=0,8 do ins(fairies,{a=pi+i/8*pi,x=240/2-40+cos(pi+i/8*pi)*50,y=136-51-51+sin(pi+i/8*pi)*50,tgty=136-51-51+sin(pi+i/8*pi)*50+50,t=0,update=fairy_update17,ondeath=fairy_ondeath1}) end for i=0,9 do ins(fairies,{a=pi+i/9*pi,x=240/2-40+cos(pi+i/9*pi)*60,y=136-51-51+sin(pi+i/9*pi)*60,tgty=136-51-51+sin(pi+i/9*pi)*60+50-5,t=0,update=fairy_update17,ondeath=fairy_ondeath1}) end for i=0,10 do ins(fairies,{a=pi+i/10*pi,x=240/2-40+cos(pi+i/10*pi)*70,y=136-51-51+sin(pi+i/10*pi)*70,tgty=136-51-51+sin(pi+i/10*pi)*70+50-5-5,t=0,update=fairy_update17,ondeath=fairy_ondeath1}) end for i=0,11 do ins(fairies,{a=pi+i/11*pi,x=240/2-40+cos(pi+i/11*pi)*80,y=136-51-51+sin(pi+i/11*pi)*80,tgty=136-51-51+sin(pi+i/11*pi)*80+50-5-5-5,t=0,update=fairy_update17,ondeath=fairy_ondeath1}) end for i=0,12 do ins(fairies,{a=pi+i/12*pi,x=240/2-40+cos(pi+i/12*pi)*90,y=136-51-51+sin(pi+i/12*pi)*90,tgty=136-51-51+sin(pi+i/12*pi)*90+50-5-5-5,t=0,update=fairy_update17,ondeath=fairy_ondeath1}) end for i=0,13 do ins(fairies,{a=pi+i/13*pi,x=240/2-40+cos(pi+i/13*pi)*100,y=136-51-51+sin(pi+i/13*pi)*100,tgty=136-51-51+sin(pi+i/13*pi)*100+50-5-5-5-5,t=0,update=fairy_update17,ondeath=fairy_ondeath1}) end end if peek(0x13FFC+1)==5 and peek(0x13FFC+2)==32 and not temp.s3w7_a then --t-sc_t==math.floor(110*4+110*48/16+110*48/16+110*64/16+110*64/16+110*2) then temp.s3w7_a=true if mode=='Casual' then checkpoint('S3W7',t-sc_t) end for i=0,8 do ins(fairies,{a=pi+i/8*pi,x=240/2-40+cos(pi+i/8*pi)*50,y=136-51-51+sin(pi+i/8*pi)*50,tgty=136-51-51+sin(pi+i/8*pi)*50+50,t=0,update=fairy_update17b,ondeath=fairy_ondeath1,id=i}) end for i=0,9 do ins(fairies,{a=pi+i/9*pi,x=240/2-40+cos(pi+i/9*pi)*60,y=136-51-51+sin(pi+i/9*pi)*60,tgty=136-51-51+sin(pi+i/9*pi)*60+50-5,t=0,update=fairy_update17b,ondeath=fairy_ondeath1,id=i}) end for i=0,10 do ins(fairies,{a=pi+i/10*pi,x=240/2-40+cos(pi+i/10*pi)*70,y=136-51-51+sin(pi+i/10*pi)*70,tgty=136-51-51+sin(pi+i/10*pi)*70+50-5-5,t=0,update=fairy_update17b,ondeath=fairy_ondeath1,id=i}) end for i=0,11 do ins(fairies,{a=pi+i/11*pi,x=240/2-40+cos(pi+i/11*pi)*80,y=136-51-51+sin(pi+i/11*pi)*80,tgty=136-51-51+sin(pi+i/11*pi)*80+50-5-5-5,t=0,update=fairy_update17b,ondeath=fairy_ondeath1,id=i}) end for i=0,12 do ins(fairies,{a=pi+i/12*pi,x=240/2-40+cos(pi+i/12*pi)*90,y=136-51-51+sin(pi+i/12*pi)*90,tgty=136-51-51+sin(pi+i/12*pi)*90+50-5-5-5,t=0,update=fairy_update17b,ondeath=fairy_ondeath1,id=i}) end for i=0,13 do ins(fairies,{a=pi+i/13*pi,x=240/2-40+cos(pi+i/13*pi)*100,y=136-51-51+sin(pi+i/13*pi)*100,tgty=136-51-51+sin(pi+i/13*pi)*100+50-5-5-5-5,t=0,update=fairy_update17b,ondeath=fairy_ondeath1,id=i}) end end if t-sc_t==math.floor(110*4+110*48/16+110*48/16+110*64/16+110*64/16+110*4) then for i=0,5 do local a=pi+pi/10*i ins(fairies,{a=a,x=(240-80+1)/2+cos(a)*99,y=136-51+sin(a)*99,dist=99,update=fairy_update18,t=0,id=i}) end end if t-sc_t==math.floor(110*4+110*48/16+110*48/16+110*64/16+110*64/16+110*4+110*24/16) then ins(fairies,{x=(240-80+1)/2,y=-35,t=0,update=fairy_update19}) end if t-sc_t==math.floor(110*4+110*48/16+110*48/16+110*64/16+110*64/16+110*4+110*48/16) then --ins(fairies,{x=(240-80+1)/2+40,y=-35,t=0,update=fairy_update19}) --ins(fairies,{x=(240-80+1)/2-40,y=-35,t=0,update=fairy_update19}) end if t-sc_t==math.floor(110*4+110*48/16+110*48/16+110*64/16+110*64/16+110*4+110*48/16+110*4) then if mode=='Casual' then checkpoint('S3W8',t-sc_t) end end if t-sc_t>=3190+110 and t-sc_t<3190+110+280 then if t-sc_t==3190+110 then fairies={} end --ending() --stats(3) if t-sc_t==3190+110 then music(5,0,0,false,false) end dialogueprint('PASSWORD!!') end if t-sc_t>=3190+110+280 and t-sc_t<3190+110+280+280 then if t-sc_t==3190+110+280 then music(5,0,0,false,false) end dialogueprint('I REQUIRE A PASSWORD!!') end if t-sc_t>=3190+110+280*2 and t-sc_t<3190+110+280*3 then if t-sc_t==3190+110+280*2 then music(5,0,0,false,false) end dialogueprint('PASSWORD. PASSPORT. PASSEPARTOUT!!') end if t-sc_t==3190+110+280*3-1 then stage=boss3 sc_t=t+1 if mode=='Practice' then reset_game(true) TIC=practice end end end function ending() local tw=print('End',0,-6*2,5,false,2,false) print('End',240/2-40-tw/2,136/2,5,false,2,false) if mode=='Hardcore' then local tw=print('You\'re a truly lunatic player!',0,-6,4,false,1,true) print('You\'re a truly lunatic player!',240/2-40-tw/2,136/2+12+6,4,false,1,true) end if mode=='Casual' then end end function stats(s) --if not a_keys then a_keys={} for k,a in pairs(attempts) do ins(a_keys,k) end table.sort(a_keys,function(a,b) return attempts[a]>attempts[b] end) --end local tw=print('Most difficult attacks:',0,-6,4,false,1,true) print('Most difficult attacks:',240/2-40-tw/2,136-51+5+12,4,false,1,true) local c=0 for i,k in ipairs(a_keys) do if c>=3 or attempts[k]==1 then break end if tonumber(sub(k,2,2))==s then local tw=print(fmt('%s: %d attempts',k,attempts[k]),0,-6,4) print(fmt('%s: %d attempts',k,attempts[k]),240/2-40-tw/2,136-51+5+12+6+c*6,4) c=c+1 end end end maxbosshp=60*10 function boss3() phase=phase or 1 if bosshp then --if phase~=4 and phase~=6 then for i=0,360-1 do local a=i*pi/180-pi/2 if i>=(maxbosshp-bosshp)/(maxbosshp)*360 then line((240-80+1)/2+cos(a)*18,35/2+2+sin(a)*18,(240-80+1)/2+cos(a)*19,35/2+2+sin(a)*19,4) end end --end bosshp=bosshp-1 if bosshp<=0 then bosshp=nil; phase=phase+1; ph_t=t end end if mode=='Casual' and ph_t and t-ph_t==0 then checkpoint(fmt('B3W%d',phase),t-sc_t,t-ph_t) end if phase==1 and t-sc_t>=0 and t-sc_t<320 then if t-sc_t==0 then music(6,0,0,false,false) end dialogueprint('HOW SAD, IT LOOKS LIKE I\'M NOT GETTING A PASSWORD FROM YOU.') end if phase==1 and t-sc_t>=320 and t-sc_t<320+120 then if t-sc_t==320 then music(5,0,0,false,false) end dialogueprint('THIS MEANS I MUST PECK YOU.') end if phase==1 and t-sc_t>=320+120 then if not bosshp then bosshp=60*10 end if t-sc_t==320+120 then checkpoint('B3W1',t-sc_t) music(1,0,0,true,false) end if (t-sc_t-(320+120))%12==0 then local a=(t-sc_t)*0.12 for mx=0,14 do for my=0,9 do local px=cos(a)*(my-5)*6+cos(a+pi/2)*(mx-7)*6 local py=sin(a)*(my-5)*6+sin(a+pi/2)*(mx-7)*6 if mget(mx,my)==34 then ins(bullets,{x=240/2-40+px,y=35/2+py,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) end end end end end if phase==2 then if not bosshp then bosshp=60*10 end if t-ph_t==0 then temp.b3w2_a={} end if (t-sc_t)%30==0 then local a2=pi/2+sin((t-ph_t)*0.3)*pi/6 for i=0,24 do local a=i/25*2*pi ins(bullets,{x=240/2-40+cos(a)*14,y=35/2+sin(a)*14,dx=cos(a2),dy=sin(a2),id=34}) ins(temp.b3w2_a,bullets[#bullets]) end end for i,b in ipairs(temp.b3w2_a) do if b.t and b.t>50 and (not b.bounce or b.bounce<2) then if math.sqrt((b.x-(240/2-40))^2+(b.y-(136-51))^2)>=50 then local a=math.atan2(136-51-b.y,240/2-40-b.x) b.dx=cos(a); b.dy=sin(a) b.x=b.x+b.dx; b.y=b.y+b.dy b.bounce=b.bounce or 0 b.bounce=b.bounce+1 end end end end if phase==3 and t-ph_t>=80 then if t-ph_t==80 then temp={} end if not bosshp then bosshp=60*10 end if (t-ph_t-80)%6==0 then local row=32-1-(t-ph_t-80)/6 if row>=0 then for sx=0,24-1 do local sp=sprpix(11+row//8*16+sx//8,sx%8,row%8) if sp==13 then ins(bullets,{x=240/2-40-12*6+sx*6,y=35/2,dx=0,dy=1,id=34}) elseif sp==12 then ins(bullets,{x=240/2-40-12*6+sx*6,y=35/2,dx=0,dy=1,id=36}) end end else local row=32-1-(t-ph_t-80-32*6)/6 if row>=0 then for sx=0,24-1 do local sp=sprpix(11+row//8*16+sx//8,sx%8,row%8) if sp==13 then ins(bullets,{x=240/2-40-12*6+sx*6,y=35/2,dx=0,dy=1,id=34}) elseif sp==12 then ins(bullets,{x=240/2-40-12*6+sx*6,y=35/2,dx=0,dy=1,id=36}) end end else local row=32-1-(t-ph_t-80-64*6)/6 if row>=0 then for sx=0,24-1 do local sp=sprpix(11+row//8*16+sx//8,sx%8,row%8) if sp==13 then ins(bullets,{x=240/2-40-12*6+sx*6,y=35/2,dx=0,dy=1,id=34}) elseif sp==12 then ins(bullets,{x=240/2-40-12*6+sx*6,y=35/2,dx=0,dy=1,id=36}) end end end end end end end if phase==4 and t-ph_t<20 then for i=0,8 do if #bullets>0 then rem(bullets,#bullets) end end end if phase==4 and t-ph_t>=20 then temp.b3w4_a=temp.b3w4_a or {} local a=(t-sc_t)*(13.1)--math.atan2(y-(35/2+sin(t*0.45)*10),x-(240/2-40+cos(t*0.3)*60)) ins(bullets,{x=240/2-40,y=136-51,dx=cos(a)*0.6,dy=sin(a)*0.6,id=34}) ins(temp.b3w4_a,bullets[#bullets]) if not temp.allstop then for i,b in ipairs(bullets) do if math.sqrt((b.x-(240/2-40))^2+(b.y-(136-51))^2)>=50-3 then b.dx=0; b.dy=0 end if (b.dx~=0 or b.dy~=0) then for i2,b2 in ipairs(bullets) do if (b2.dx==0 and b2.dy==0) and b2~=b and AABB(b.x-2,b.y-2,4,4,b2.x-2,b2.y-2,4,4) then b.dx=0; b.dy=0; b2.dx=0; b2.dy=0 goto hit end end end ::hit:: end end temp.allstop=true for i,b in ipairs(bullets) do if b.dx~=0 or b.dy~=0 then temp.allstop=false; break end end if temp.allstop then if not bosshp then bosshp=60*10 end for i,b in ipairs(temp.b3w4_a) do if not b.a then b.a=math.atan2(b.y-(136-51),b.x-(240/2-40)) b.d=math.sqrt((b.y-(136-51))^2+(b.x-(240/2-40))^2) b.i=i end if b.i%2==0 then b.a=b.a+0.02 else b.a=b.a-0.02 end b.x=240/2-40+cos(b.a)*b.d b.y=136-51+sin(b.a)*b.d end end --[[for i,b in ipairs(temp.b3w4_a) do if b.t and b.t>50 and (not b.bounce or b.bounce<2) then if math.sqrt((b.x-(240/2-40))^2+(b.y-(136-51))^2)>=50 then local a=math.atan2(136-51-b.y,240/2-40-b.x) b.dx=cos(a); b.dy=sin(a) b.x=b.x+b.dx; b.y=b.y+b.dy b.bounce=b.bounce or 0 b.bounce=b.bounce+1 end end end]] end if phase==5 then if (t-ph_t)*0.75-14²d0>=0 and not bosshp then bosshp=60*15; maxbosshp=bosshp end if t-ph_t==0 then init_tris() end bullets={} cubespin(math.min((t-ph_t)*0.75-140,0)) end if phase==6 and t-ph_t<50 then for i=0,4 do if #bullets>0 then rem(bullets,1) end end end if phase==6 and t-ph_t>=50 then if t%40==0 then if not temp.b2w6_a then temp.b2w6_a={} end ins(temp.b2w6_a,{}) for i=0,4 do local a=math.atan2(y-(35/2),x-(240/2-40)) local a2=pi/6 ins(bullets,{x=240/2-40-cos(a2)*2*6+cos(a2)*i*6,y=35/2-sin(a2)*2*6+sin(a2)*i*6,dx=cos(a),dy=sin(a),id=34}) ins(temp.b2w6_a[#temp.b2w6_a],bullets[#bullets]) if i~=2 then a2=-pi/6 ins(bullets,{x=240/2-40-cos(a2)*2*6+cos(a2)*i*6,y=35/2-sin(a2)*2*6+sin(a2)*i*6,dx=cos(a),dy=sin(a),id=34}) ins(temp.b2w6_a[#temp.b2w6_a],bullets[#bullets]) a2=pi/2 ins(bullets,{x=240/2-40-cos(a2)*2*6+cos(a2)*i*6,y=35/2-sin(a2)*2*6+sin(a2)*i*6,dx=cos(a),dy=sin(a),id=34}) ins(temp.b2w6_a[#temp.b2w6_a],bullets[#bullets]) end end end if temp.b2w6_a then for i,ar in ipairs(temp.b2w6_a) do --[[ar.allstop=true for j,b in ipairs(ar) do if b.dx~=0 or b.dy~=0 then ar.allstop=false; break end end if ar.allstop then for j,b in ipairs(ar) do if not b.a then b.a=math.atan2(b.y-(136-51),b.x-(240/2-40)) b.d=math.sqrt((b.y-(136-51))^2+(b.x-(240/2-40))^2) b.i=i end if b.i%2==0 then b.a=b.a+0.02 else b.a=b.a-0.02 end b.x=240/2-40+cos(b.a)*b.d b.y=136-51+sin(b.a)*b.d end else]] for j,b in ipairs(ar) do if b.t and b.t>50 and (not b.bounce or b.bounce<1) then if math.sqrt((b.x-(240/2-40))^2+(b.y-(136-51))^2)>=50 then local a=math.atan2(136-51-b.y,240/2-40-b.x) b.dx=cos(a); b.dy=sin(a) b.x=b.x+b.dx; b.y=b.y+b.dy b.bounce=b.bounce or 0 b.bounce=b.bounce+1 end elseif b.bounce and b.bounce>=1 then if (b.dx~=0 or b.dy~=0) then for i2,b2 in ipairs(bullets) do if (b2.dx==0 and b2.dy==0) and b2~=b and AABB(b.x-2,b.y-2,4,4,b2.x-2,b2.y-2,4,4) then if not bosshp then bosshp=60*10; maxbosshp=60*10 end b.dx=0; b.dy=0; b2.dx=0; b2.dy=0 goto hit end end end if math.sqrt((b.x-(240/2-40))^2+(b.y-(136-51))^2)>=50-1 then b.dx=0; b.dy=0 end ::hit:: end end --end end end end if phase==7 then if not temp.b3w7_a then for i=0,8 do if #bullets>0 then rem(bullets,1) end end if #bullets==0 then temp.b3w7_a=true for mx=16,38 do for my=0,4 do if mget(mx,my)==34 then ins(bullets,{x=240-80+1+(mx-16)*6,y=136-51-2*6+my*6,dx=-2,dy=0,t=-90,id=34}) end end end end end if t-ph_t>=90+60 and t-ph_t<90+60+320 then if t-ph_t==90+60 then music(6,0,0,false,false) end dialogueprint('I GUESS I CAN\'T STOP YOU!') end if t-ph_t>=90+60+320 and t-ph_t<90+60+320+280 then if t-ph_t==90+60+320 then music(6,0,0,false,false) end dialogueprint('..IF YOU WANNA GO FORWARD TO YOUR DOOM!') end if t-ph_t>=90+60+320+280 and t-ph_t<90+60+320+280+180 then if t-ph_t==90+60+320+280 then music(5,0,0,false,false) end dialogueprint('SEND MY REGARDS! SKAW!!') end if t-ph_t>=90+60+320+280+180 then local tw=print('Stage 3 clear',0,-6) print('Stage 3 clear',240/2-40-tw/2,136-51-5,5) local msg if t-ph_t<90+60+320+280+180+30 then msg='Clear bonus: 3000' else msg='Clear bonus: ' end --tw=print(msg,0,-6) print(msg,240/2-40-86/2,136-51+5,4) if t-ph_t==90+60+320+280+180+30 then gain_score(3000,240/2-40-86/2+70,136-51+5) end if mode=='Casual' then stats(3) end vol=vol or 15 for ch=0,3 do setvol(ch,math.floor(vol)) end vol=vol-0.04 if vol<=0 then vol=nil music() sc_t=t+1 stage=stage4 phase=nil ph_t=nil --a_keys=nil if mode=='Practice' then reset_game(true) TIC=practice end end end end end function fairy_update20(fa) rect(fa.x,fa.y,4,4,0) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) --if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end --fa.x=(240-80+1)/2+cos(fa.a)*fa.dist --fa.y=136-51+sin(fa.a)*fa.dist if fa.t<90 then fa.y=fa.y+(fa.tgty-fa.y)*0.1 end --if fa.t>=110*24/16+110*4-110*4/16 then --fa.y=fa.y+(-35-fa.y)*0.1 --if fa.y<-25 then rem(fairies,find(fairies,fa)) end --end if peek(0x13FFC+1)<9 and peek(0x13FFC+2)==fa.launch and not fa.firstrow then fa.firstrow=true fa:ondeath() --local a=-(t-sc_t)*(23.4)--t*(19.1+fa.t*0.001)--math.atan2(136-51-fa.y,(240-80+1)/2-fa.x)+sin((t-sc_t)*0.2+fa.id)*0.2 --ins(bullets,{x=fa.x+3,y=fa.y+3,dx=cos(a),dy=sin(a)*0.5,id=34}) end if peek(0x13FFC+2)~=fa.launch then fa.firstrow=false end if peek(0x13FFC+1)==9 then fa.y=fa.y+(-35-fa.y)*0.1 if fa.y<-25 then rem(fairies,find(fairies,fa)) end end fa.t=fa.t+1 end function fairy_ondeath2(fa) local a2=math.atan2(60-(fa.y+2),240/2-40-(fa.x+2)) for j=0,4 do for i=0,2 do local a=a2+pi/5-pi/6+pi/6*i ins(bullets,{x=fa.x+2+cos(a)*j*8,y=fa.y+2+sin(a)*j*8,dx=cos(a)*1.2,dy=sin(a)*1.2,id=34}) end end for j=0,4 do for i=0,2 do local a=a2-pi/5-pi/6+pi/6*i ins(bullets,{x=fa.x+2+cos(a)*j*8,y=fa.y+2+sin(a)*j*8,dx=cos(a)*1.2,dy=sin(a)*1.2,id=34}) end end for j=0,4 do for i=0,2 do local a=a2-pi/6+pi/6*i ins(bullets,{x=fa.x+2+cos(a)*j*8,y=fa.y+2+sin(a)*j*8,dx=cos(a)*1.2,dy=sin(a)*1.2,id=34}) end end end function fairy_ondeath3(fa) local a2=math.atan2(90-(fa.y+2),240/2-40-(fa.x+2)) for j=0,4 do for i=0,2 do local a=a2+pi/5-pi/6+pi/6*i ins(bullets,{x=fa.x+2+cos(a)*j*8,y=fa.y+2+sin(a)*j*8,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) end end for j=0,4 do for i=0,2 do local a=a2-pi/5-pi/6+pi/6*i ins(bullets,{x=fa.x+2+cos(a)*j*8,y=fa.y+2+sin(a)*j*8,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) end end for j=0,4 do for i=0,2 do local a=a2-pi/6+pi/6*i ins(bullets,{x=fa.x+2+cos(a)*j*8,y=fa.y+2+sin(a)*j*8,dx=cos(a)*1.5,dy=sin(a)*1.5,id=34}) end end end function fairy_update21(fa) rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) --if fa.x>=240-80+1 or fa.x<-8 then rem(fairies,find(fairies,fa)) end --fa.x=(240-80+1)/2+cos(fa.a)*fa.dist --fa.y=136-51+sin(fa.a)*fa.dist --if fa.t>=110*24/16+110*4-110*4/16 then --fa.y=fa.y+(-35-fa.y)*0.1 --if fa.y<-25 then rem(fairies,find(fairies,fa)) end --end if not fa.tgtx then fa.tgtx=240-80+1 end if peek(0x13FFC+2)%4>0 then fa.firstrow=false end if peek(0x13FFC+2)%4==0 and not fa.firstrow then fa.firstrow=true fa.tgtx=fa.tgtx-20 end if fa.x<-8 then rem(fairies,find(fairies,fa)) end --[[if fa.x<240/2-40-40 and peek(0x13FFC+2)%16==0 and not fa.firstrow2 then fa.firstrow2=true local a2=0 for i=0,24 do local a=i/25*2*pi if i%2==0 then ins(bullets,{x=fa.x+cos(a)*12,y=fa.y+sin(a)*12,dx=cos(a2)*0.6,dy=sin(a2)*0.6,id=34}) else for j=0,3 do ins(bullets,{x=fa.x+cos(a)*(12-4+j*4),y=fa.y+sin(a)*(12-4+j*4),dx=cos(a2)*0.6,dy=sin(a2)*0.6,id=34}) end end end end]] if peek(0x13FFC+2)%16==0 and not fa.firstrow2 then fa.firstrow2=true for i=0,4 do local a=i/5*2*pi ins(bullets,{x=fa.x+cos(a)*12,y=fa.y+sin(a)*12,dx=cos(a-pi)*0.2,dy=sin(a-pi)*0.2,id=34}) ins(bullets,{x=fa.x+cos(a-pi)*8,y=fa.y+sin(a-pi)*8,dx=cos(a)*0.2,dy=sin(a)*0.2,id=34}) end end if peek(0x13FFC+2)%16~=0 then fa.firstrow2=false end fa.x=fa.x+(fa.tgtx-fa.x)*0.2 fa.t=fa.t+1 end function fairy_update22(fa) if peek(0x13FFC+1)<7 and peek(0x13FFC+2)%16==0 and not fa.firstrow then fa.firstrow=true fa.warnt=t fa.a=fa.a+2.4 fa.x=240/2-40+cos(fa.a)*120 fa.y=136-51+sin(fa.a)*120 if peek(0x13FFC+1)==5 then fa.ta=fa.a+pi+pi/6-pi/12 if peek(0x13FFC+2)==16*3 then fa.ta=math.atan2(136-51+35+10-fa.y,240/2-40-fa.x) end elseif peek(0x13FFC+1)==6 then fa.ta=math.atan2(y-fa.y,x-fa.x) end end if peek(0x13FFC+1)<7 and peek(0x13FFC+2)%16==0 then line(fa.x,fa.y,fa.x+cos(fa.ta)*(t-fa.warnt)*40,fa.y+sin(fa.ta)*(t-fa.warnt)*40,12) end if peek(0x13FFC+2)%16~=0 then fa.firstrow=false end fa.x=240/2-40+cos(fa.a)*120 fa.y=136-51+sin(fa.a)*120 rect(fa.x,fa.y,4,4,1) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if not temp.s4w3_a then temp.s4w3_a={} end if (t-sc_t)%4==0 and peek(0x13FFC+1)<7 and peek(0x13FFC+2)%16<12 then --ins(bullets,{x=fa.x+sin(fa.a+t*0.2)*6,y=fa.y+sin(fa.a+t*0.2)*6,dx=cos(fa.a+pi),dy=sin(fa.a+pi),id=34}) for i=0,4 do ins(bullets,{x=fa.x+sin(fa.a+t*0.2)*6,y=fa.y+sin(fa.a+t*0.2)*6,dx=cos(fa.ta-2*pi/8+i*pi/8)*2.2,dy=sin(fa.ta-2*pi/8+i*pi/8)*2.2,id=34,t=-90}) ins(bullets,{x=fa.x+sin(fa.a+t*0.2)*6,y=fa.y+sin(fa.a+t*0.2)*6,dx=cos(fa.ta-2*pi/8+i*pi/8)*2.2,dy=sin(fa.ta-2*pi/8+i*pi/8)*2.2,id=34,t=-90}) ins(temp.s4w3_a,bullets[#bullets]) end end if peek(0x13FFC+1)==7 and peek(0x13FFC+2)<16 then --[[if (t-sc_t)%4==0 then for j=0,9 do fa.a=j/10*2*pi fa.x=240/2-40+cos(fa.a)*120 fa.y=136-51+sin(fa.a)*120 fa.ta=math.atan2(136-51+35-fa.y,240/2-40-fa.x) for i=2,2 do ins(bullets,{x=fa.x+sin(fa.a+t*0.2)*6,y=fa.y+sin(fa.a+t*0.2)*6,dx=cos(fa.ta-2*pi/8+i*pi/8)*1,dy=sin(fa.ta-2*pi/8+i*pi/8)*1,id=34,t=-90}) ins(bullets,{x=fa.x+sin(fa.a+t*0.2)*6,y=fa.y+sin(fa.a+t*0.2)*6,dx=cos(fa.ta-2*pi/8+i*pi/8)*1,dy=sin(fa.ta-2*pi/8+i*pi/8)*1,id=34,t=-90}) ins(temp.s4w3_a,bullets[#bullets]) end end end]] if peek(0x13FFC+2)%4==0 and not fa.firstrow3 then fa.firstrow3=true fa.warnt=t if peek(0x13FFC+2)==0 then fa.a=pi+2.4/4 else fa.a=fa.a+2.4/4 end fa.x=240/2-40+cos(fa.a)*120 fa.y=136-51+sin(fa.a)*120 fa.ta=math.atan2(136-51+51-fa.y,240/2-40-fa.x) end if t%4==0 then for i=0,4 do ins(bullets,{x=fa.x+sin(fa.a+t*0.2)*6,y=fa.y+sin(fa.a+t*0.2)*6,dx=cos(fa.ta-2*pi/8+i*pi/8)*2.2,dy=sin(fa.ta-2*pi/8+i*pi/8)*2.2,id=34,t=-90}) ins(bullets,{x=fa.x+sin(fa.a+t*0.2)*6,y=fa.y+sin(fa.a+t*0.2)*6,dx=cos(fa.ta-2*pi/8+i*pi/8)*2.2,dy=sin(fa.ta-2*pi/8+i*pi/8)*2.2,id=34,t=-90}) ins(temp.s4w3_a,bullets[#bullets]) end end if peek(0x13FFC+2)%4==0 then line(fa.x,fa.y,fa.x+cos(fa.ta)*(t-fa.warnt)*40,fa.y+sin(fa.ta)*(t-fa.warnt)*40,12) end if peek(0x13FFC+2)%4~=0 then fa.firstrow3=nil end end for i,b in ipairs(temp.s4w3_a) do if not b.origx then b.origx=b.x; b.origy=b.y end b.x=b.origx+b.dx*(b.t+90)+cos(i*0.6+t*0.1)*4; b.y=b.origy+b.dy*(b.t+90)+sin(i*0.6+t*0.1)*4 end fa.t=fa.t+1 end function fairy_update23(fa) rect(fa.x,fa.y,4,4,2) spr(32+(t*0.1)%2,fa.x-2,fa.y-3,1) if fa.t<90 then fa.y=fa.y+(35-fa.y)*0.1 end --if peek(0x13FFC+1)<9 then local a=(t-sc_t)*(11.1+(t-sc_t)*0.002) for i=0,5 do ins(bullets,{x=fa.x+2,y=fa.y+2,dx=cos(a+i*0.2)*2,dy=sin(a+i*0.2),id=34}) end --end if peek(0x13FFC+1)==9 then fa.y=fa.y+(-35-fa.y)*0.1 if fa.y<-25 then rem(fairies,find(fairies,fa)) end end fa.t=fa.t+1 end stickyfairies={} function stage4() if t-sc_t==0 then music(4,3,0,false,false); checkpoint('S4W1',t-sc_t); stickyfairies={} end if peek(0x13FFC+2)%4>0 then firstrow=false end if peek(0x13FFC+1)==3 and peek(0x13FFC+2)<24 and peek(0x13FFC+2)%4==0 and not firstrow then local offx=-1 if peek(0x13FFC+2)%8==4 then offx=1 end ins(fairies,{x=240/2-40-2+offx*37-offx*8*(#stickyfairies//2),y=-6,tgty=36-6*(#stickyfairies//2),t=0,update=fairy_update20,ondeath=fairy_ondeath2,launch=24}) if #stickyfairies<12 then ins(stickyfairies,fairies[#fairies]) end end if peek(0x13FFC+1)==3 and peek(0x13FFC+2)>=32 and peek(0x13FFC+2)<32+24 and peek(0x13FFC+2)%4==0 and not firstrow then local offx=-1 if peek(0x13FFC+2)%8==4 then offx=1 end ins(fairies,{x=240/2-40-2+offx*74-offx*8*(#stickyfairies//2),y=-6,tgty=36-6*((#stickyfairies-6)//2),t=0,update=fairy_update20,ondeath=fairy_ondeath3,launch=56}) if #stickyfairies<12 then ins(stickyfairies,fairies[#fairies]) end end if peek(0x13FFC+1)==4 and peek(0x13FFC+2)==0 and check_id~='S4W2' then if mode=='Casual' then checkpoint('S4W2',t-sc_t) end end if peek(0x13FFC+1)==4 and peek(0x13FFC+2)%4==0 and not firstrow then ins(fairies,{x=240-80+1,y=136-51+sin((t-sc_t)*0.01)*40,update=fairy_update21,t=0}) end if peek(0x13FFC+1)==5 and peek(0x13FFC+2)==0 and not firstrow then if mode=='Casual' then checkpoint('S4W3',t-sc_t) end ins(fairies,{x=240/2-40+cos(pi)*120,y=136-51+sin(pi)*120,a=pi,t=0,update=fairy_update22}) end if peek(0x13FFC+1)==6 and peek(0x13FFC+2)==0 and not firstrow then if check_id=='S4W4' then ins(fairies,{x=240/2-40+cos(pi)*120,y=136-51+sin(pi)*120,a=pi,t=0,update=fairy_update22}) end if mode=='Casual' then checkpoint('S4W4',t-sc_t) end end if peek(0x13FFC+1)==7 and peek(0x13FFC+2)==0 and not firstrow then if check_id=='S4W5' then ins(fairies,{x=240/2-40+cos(pi)*120,y=136-51+sin(pi)*120,a=pi,t=0,update=fairy_update22}) end if mode=='Casual' then checkpoint('S4W5',t-sc_t) end end if peek(0x13FFC+1)==7 and peek(0x13FFC+2)==24 and not firstrow then ins(fairies,{x=240/2-40,y=-6,t=0,update=fairy_update23}) end if peek(0x13FFC+1)==9 and peek(0x13FFC+2)==28 and not firstrow then temp.final_t=t+1 end if peek(0x13FFC+2)%4==0 then firstrow=true end if temp.final_t then if t-temp.final_t>=0 and t-temp.final_t<260 then dialogueprint('So you\'ve made it this far.') end if t-temp.final_t>=260 and t-temp.final_t<260+380 then dialogueprint('I have the power to manipulate densities of objects.') end if t-temp.final_t>=260+380 and t-temp.final_t<260+380+260 then dialogueprint('No mere butterfly can defeat me!') end if t-temp.final_t==260+380+260 then stage=boss4 sc_t=t+1 if mode=='Practice' then reset_game(true) TIC=practice end end end --ending() end bigbullets={} function boss4() phase=phase or 1 if bosshp then for i=0,360-1 do local a=i*pi/180-pi/2 if i>=(maxbosshp-bosshp)/(maxbosshp)*360 then line((240-80+1)/2+cos(a)*18,35/2+2+sin(a)*18,(240-80+1)/2+cos(a)*19,35/2+2+sin(a)*19,4) end end bosshp=bosshp-1 if bosshp<=0 then bosshp=nil; phase=phase+1; ph_t=t end end if mode=='Casual' and ph_t and t-ph_t==0 then checkpoint(fmt('B4W%d',phase),t-sc_t,t-ph_t) end if phase==1 and t-sc_t==0 then checkpoint('B4W1',t-sc_t); music(7,0,0,true,false) end if phase==1 then if not bosshp then bosshp=60*10; maxbosshp=60*10 end if math.floor((t-sc_t)%(40))==0 then local a=0 local i=t while a<2*pi do ins(bullets,{x=240/2-40,y=35/2,dx=cos(a),dy=sin(a),id=34}) if (a+(t-sc_t)*3.6)%(pi/4)=50 and (not bosshp or bosshp>2*10) then if not bosshp then bosshp=60*10 end if temp.b4w2_a then for i,b in ipairs(temp.b4w2_a) do b.r=b.r+0.05 end end if not temp.b4w3_a then temp.b4w3_a={} end if math.floor((t-ph_t-50)%(70))==0 then local a=0 while a<2*pi do ins(bullets,{x=240/2-40,y=35/2,dx=cos(a),dy=sin(a),id=34}) ins(temp.b4w3_a,bullets[#bullets]) a=a+0.01 end end for i,b in ipairs(temp.b4w3_a) do if math.sqrt((b.x-(x+2))^2+(b.y-(y+2))^2)<=10 then b.dx=b.dx*0.85 b.dy=b.dy*0.85 end end end if phase==4 and t-ph_t<120 then if temp.b4w3_a then for i,b in ipairs(temp.b4w3_a) do if math.sqrt((b.x-(x+2))^2+(b.y-(y+2))^2)<=10 then b.dx=b.dx*0.85 b.dy=b.dy*0.85 end end end if temp.b4w3_a then for i=0,10 do if #temp.b4w3_a>0 then if find(bullets,temp.b4w3_a[#temp.b4w3_a]) then rem(bullets,find(bullets,temp.b4w3_a[#temp.b4w3_a])); end rem(temp.b4w3_a,#temp.b4w3_a) end end --for i,b in ipairs(temp.b4w3_a) do -- if math.sqrt((b.x-(x+2))^2+(b.y-(y+2))^2)<=10 then -- b.dx=b.dx*0.9 -- b.dy=b.dy*0.9 -- end --end end end if phase==4 and t-ph_t>=60 then if not bosshp then bosshp=60*10 end if (t-ph_t)%24==0 then ins(bigbullets,{x=240-80+20,y=35/2+10+sin((t-ph_t)*0.3)*40,r=18,dx=cos(pi-pi/6)*2,dy=sin(pi-pi/6)*2}) end end if phase==5 and (not bosshp or bosshp>60) then if not bosshp then bosshp=60*10 end if not temp.b4w5_a then temp.b4w5_a={} end if math.floor((t-ph_t-60)%(30))==0 and bosshp>60*2 then local a=0 while a<2*pi do ins(bullets,{x=240/2-40,y=35/2,dx=cos(a),dy=sin(a),id=34}) if (a+(t-ph_t)*3.6)%(pi/6)1 and i<=6 then b.rr=temp.b4w6_a[1].r+10 b.a=b.a+0.02 else b.rr=temp.b4w6_a[1].r+10+10*2 b.a=b.a-0.02 end else b.r=b.r+0.08 b.cy=b.cy+(136-51-b.cy)*0.04 b.y=b.cy end end end if phase==7 then if #bigbullets>0 then rem(bigbullets,#bigbullets) end if t-ph_t>=0 and t-ph_t<280 then dialogueprint('..I-Impossible!') end if t-ph_t>=280 then local tw=print('Stage 4 clear',0,-6) print('Stage 4 clear',240/2-40-tw/2,136-51-5,5) local msg if t-ph_t<280+30 then msg='Clear bonus: 4000' else msg='Clear bonus: ' end --tw=print(msg,0,-6) print(msg,240/2-40-86/2,136-51+5,4) if t-ph_t==280+30 then gain_score(4000,240/2-40-86/2+70,136-51+5) end if mode=='Casual' then stats(4) end vol=vol or 15 for ch=0,3 do setvol(ch,math.floor(vol)) end vol=vol-0.04 if vol<=0 then vol=nil music() sc_t=t+1 stage=endgame phase=nil ph_t=nil --a_keys=nil if mode=='Practice' then reset_game(true) TIC=practice end end end end end function endgame() ending() end stage=stage1 stage=boss2 sc_t=0 phase=4 ph_t=t --music(2,0,0,false,true) -- basic AABB collision. function AABB(x1,y1,w1,h1, x2,y2,w2,h2) return (x1 < x2 + w2 and x1 + w1 > x2 and y1 < y2 + h2 and y1 + h1 > y2) end -- from 1THRUSTR.EXE function sprpix(sprno,px,py) local byte= peek(0x4000 + 32*sprno + py*4 + px/2) if px%2==1 then byte=(byte&0xf0)>>4 else byte=byte&0x0f end return byte end -- from Sunray Valley function setvol(ch,vol) -- channel `ch` 0..3 -- volume `vol` 0..15 local val=peek(0xFF9C+18*ch+1) poke(0xFF9C+18*ch+1, val&(0x0f|vol<<4)) end -- from photos into photos tan=math.tan sw=128+90+120 sh=128+90+120 function point(x,y,z) return {x=x,y=y,z=z} end function mat4x4() return {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0}, } end function init_tris() triangles = { --cube meizing --south face {point(0,0,0), point(0,1,0), point(1,1,0)}, {point(0,0,0), point(1,0,0), point(1,1,0)}, --east face {point(1,0,0), point(1,1,0), point(1,1,1)}, {point(1,0,0), point(1,0,1), point(1,1,1)}, --north face {point(1,0,1), point(1,1,1), point(0,1,1)}, {point(1,0,1), point(0,0,1), point(0,1,1)}, --west face {point(0,0,1), point(0,1,1), point(0,1,0)}, {point(0,0,1), point(0,0,0), point(0,1,0)}, --top face {point(0,1,0), point(0,1,1), point(1,1,1)}, {point(0,1,0), point(1,1,0), point(1,1,1)}, --bottom face {point(1,0,1), point(0,0,1), point(0,0,0)}, {point(1,0,1), point(1,0,0), point(0,0,0)}, } for i,tr in ipairs(triangles) do for j,p in ipairs(tr) do p.x=p.x-0.5; p.y=p.y-0.5; p.z=p.z-0.5 end end --projection matrix projmat = mat4x4() --rendering limits near=0.1 --near.. far=1000 --far.. --..wherever you are fov=90 aspect=sh/sw fovrad=1/tan(fov*0.5 / 180*pi) projmat[1][1]=aspect*fovrad projmat[2][2]=fovrad projmat[3][3]=far/(far-near) projmat[4][3]=(-far*near)/(far-near) projmat[3][4]=1 projmat[4][4]=0 end function cubespin(ty) a=(t-sc_t)*0.7 / 180*pi --rotation matrices matrotZ=mat4x4() matrotZ[1][1]=cos(a) matrotZ[1][2]=sin(a) matrotZ[2][1]=-sin(a) matrotZ[2][2]=cos(a) matrotZ[3][3]=1 matrotZ[4][4]=1 matrotX=mat4x4() matrotX[1][1]=1 matrotX[2][2]=cos(a*0.5) matrotX[2][3]=sin(a*0.5) matrotX[3][2]=-sin(a*0.5) matrotX[3][3]=cos(a*0.5) matrotX[4][4]=1 for i,tr in ipairs(triangles) do --projecting from 3D space to 2D space --making x,y meaningful in tri_project tri_rotZ=emptytriangle() vec_mat_mult(tr[1],tri_rotZ[1],matrotZ) vec_mat_mult(tr[2],tri_rotZ[2],matrotZ) vec_mat_mult(tr[3],tri_rotZ[3],matrotZ) tri_rotZX=emptytriangle() vec_mat_mult(tri_rotZ[1],tri_rotZX[1],matrotX) vec_mat_mult(tri_rotZ[2],tri_rotZX[2],matrotX) vec_mat_mult(tri_rotZ[3],tri_rotZX[3],matrotX) --offset points for visibility tri_rotZX[1].z=tri_rotZX[1].z+2.5 tri_rotZX[2].z=tri_rotZX[2].z+2.5 tri_rotZX[3].z=tri_rotZX[3].z+2.5 tri_project=emptytriangle() vec_mat_mult(tri_rotZX[1],tri_project[1],projmat) vec_mat_mult(tri_rotZX[2],tri_project[2],projmat) vec_mat_mult(tri_rotZX[3],tri_project[3],projmat) --scale from -1..1 to screen size --to 0..2 tri_project[1].x=tri_project[1].x+1; tri_project[1].y=tri_project[1].y+1 tri_project[2].x=tri_project[2].x+1; tri_project[2].y=tri_project[2].y+1 tri_project[3].x=tri_project[3].x+1; tri_project[3].y=tri_project[3].y+1 --to 0..1 and sw,sh tri_project[1].x=tri_project[1].x*0.5*sw-90; tri_project[1].y=tri_project[1].y*0.5*sh-90+ty; tri_project[2].x=tri_project[2].x*0.5*sw-90; tri_project[2].y=tri_project[2].y*0.5*sh-90+ty; tri_project[3].x=tri_project[3].x*0.5*sw-90; tri_project[3].y=tri_project[3].y*0.5*sh-90+ty; --rasterize wireframe_tri(tri_project[1].x, tri_project[1].y, tri_project[2].x, tri_project[2].y, tri_project[3].x, tri_project[3].y, 15) end end --input vector, output/result vector, matrix function vec_mat_mult(i, o, m) o.x = i.x*m[1][1] + i.y*m[2][1] + i.z*m[3][1] + m[4][1] o.y = i.x*m[1][2] + i.y*m[2][2] + i.z*m[3][2] + m[4][2] o.z = i.x*m[1][3] + i.y*m[2][3] + i.z*m[3][3] + m[4][3] w = i.x*m[1][4] + i.y*m[2][4] + i.z*m[3][4] + m[4][4] if not (w==0) then o.x=o.x/w; o.y=o.y/w; o.z=o.z/w end end function emptytriangle() return {{},{},{}} end function wireframe_tri(x1,y1,x2,y2,x3,y3,c) local len=math.sqrt((x2-x1)^2+(y2-y1)^2) local a=math.atan2(y2-y1,x2-x1) local drawn=false for i,b in ipairs(bullets) do if b.l1==x2 and b.l2==y2 and b.l3==x1 and b.l4==y1 then drawn=true; break end end if not drawn then for step=0,len,6 do local id=34 if step%18<12 then id=36 end ins(bullets,{l1=x1,l2=y1,l3=x2,l4=y2,x=x1+cos(a)*step,y=y1+sin(a)*step,dx=0,dy=0,id=id}) end end local len=math.sqrt((x3-x2)^2+(y3-y2)^2) local a=math.atan2(y3-y2,x3-x2) local drawn=false for i,b in ipairs(bullets) do if b.l1==x3 and b.l2==y3 and b.l3==x2 and b.l4==y2 then drawn=true; break end end if not drawn then for step=0,len,6 do local id=34 if step%18<12 then id=36 end ins(bullets,{l1=x2,l2=y2,l3=x3,l4=y3,x=x2+cos(a)*step,y=y2+sin(a)*step,dx=0,dy=0,id=id}) end end --line(x1,y1,x2,y2,c) --line(x2,y2,x3,y3,c) --line(x3,y3,x1,y1,c) end