Advertisement
jewalky

Untitled

Mar 21st, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.88 KB | None | 0 0
  1. #include "zcommon.acs"
  2.  
  3. // 90 x 45
  4. str spheredesc=
  5. "                                  ####### #  ##########                                                                      \
  6.                    ##       #  ###   #################            ## #              #            ##                         \
  7.                    ######   # #######     ############                          #    ######################## ####  #       \
  8. ### ##############################   ## #   #####      ###         ### #### #################################################\
  9.      ### #   ########################                          #####  #############################################  #      \
  10.                 ##########################                # #    # ###########################################      #       \
  11.                   #####################  ##                 ##################  ##############################              \
  12.                   ###################                     #####  ## ###     ##  ###########################                 \
  13.                    ################                        ##     #  # ######## ######################## #   ##             \
  14.                      ############                         ######### ###  #### ##########################                    \
  15.                         ####                            #######################   ######################                    \
  16.                          ###  #                         ##################  ######     ####   #### #                        \
  17.                               ###                       ######################         ##      # ##                         \
  18.                                  ########                ######################         ##              #                   \
  19.                                   ##########                     #############                 # #  ##                      \
  20.                                   ##############                 ###########                     #  ## #   ####             \
  21.                                   ###############                 #########                                     #           \
  22.                                    #############                  ##########  #                          ###   #            \
  23.                                      ###########                  ########   #                         ##########           \
  24.                                      ########                      ######                            ##############         \
  25.                                      ######                         ####                              ####  ######          \
  26.                                     #####                                                                     ####        # \
  27.                                     ###                                                                         #        #  \
  28.                                    ###                                                                                      \
  29.                                      #                                                                                      \
  30.                                                                                                                             \
  31.                                        #                                       ##               ##          #               \
  32.                                    ######                ########################################################## ##      \
  33.          ###########       #######               ######################################################################     \
  34.                         #########             ########################################################################### # \
  35. #############################################################################################################################";
  36.  
  37. function int dabs(int v)
  38. {
  39.     if (v < 0) return -v;
  40.     return v;
  41. }
  42.  
  43. int s1ang = 0;
  44. int s1vv = 0;
  45. script 1 OPEN
  46. {
  47.     int ssize = 128;
  48.     int ssizeF = ssize<<16;
  49.    
  50.     int baseX = GetActorx(1);
  51.     int baseY = GetActorY(1);
  52.     int baseZ = GetActorZ(1);
  53.  
  54.     s1ang += 0.001;
  55.     s1vv++;
  56.     s1vv %= 45;
  57.  
  58.     for (int i = 0; i < 90; i++)
  59.     {
  60.         int angi = 1.0*i/90;
  61.         angi += s1ang;
  62.         int Xp = cos(angi);
  63.         int Yp = sin(angi);
  64.        
  65.         for (int j = 0; j < 45; j++)
  66.         {
  67.             int angj = 0.5*j/45+0.25;
  68.            
  69.             //
  70.             /*if (dabs(s1vv-j) > 10)
  71.                 continue;*/
  72.            
  73.             int pw = cos(angj);
  74.             int Zp = sin(angj);
  75.            
  76.             int xc = FixedMul(Xp, FixedMul(ssizeF, pw));
  77.             int yc = FixedMul(Yp, FixedMul(ssizeF, pw));
  78.             int zc = Zp * ssize;
  79.            
  80.             int chrw = 127;
  81.             int chrh = 31;
  82.             //int chrw = 90;
  83.             //int chrh = 45;
  84.            
  85.             int chridx = (j * chrh / 45) * chrw;
  86.             chridx += (i * chrw / 90);
  87.             int len = strlen(spheredesc);
  88.             //printbold(d:len);
  89.            
  90.             int alphadiv = 1;
  91.             if (dabs(s1vv-j) > 2)
  92.                 alphadiv = 2;
  93.            
  94.             //int chridx = ((j / 6) * 28) + ((i / 3) % 28);
  95.             int chr = GetChar(spheredesc, chridx);
  96.             if (chr != ' ')
  97.             {
  98.                 SpawnParticle(0xFFFF00, true, 1, 32, baseX+xc, baseY+yc, baseZ+zc, 0, 0, 0, 0, 0, 0, 255/alphadiv, 0);
  99.                 //else SpawnParticle(0xFF0000, true, 1, 2, baseX+xc, baseY+yc, baseZ+zc, 0, 0, 0, 0, 0, 0, 255, 0);
  100.             }
  101.             else
  102.             {
  103.                 SpawnParticle(0x0000FF, true, 1, 32, baseX+xc, baseY+yc, baseZ+zc, 0, 0, 0, 0, 0, 0, 64/alphadiv, 0);
  104.             }
  105.         }
  106.     }
  107.    
  108.     Delay(1);
  109.     restart;
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement