SHARE
TWEET

Untitled

a guest Aug 12th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. #region Characters
  3.  
  4. var _tsurf_color = c_white;
  5.  
  6. if (dialogue_index < dialogue_count - 1) {
  7.    
  8.     var _soffr = round(seat_offset);
  9.     for (var i = _soffr - 1; i < _soffr + 2; i++) {
  10.         var _index = (i + seat_count) % seat_count;
  11.         var _char = characters[? seat[_index]];
  12.         var _spr = _char[? "sprite"];
  13.         var _swidth = sprite_get_width(_spr);
  14.         var _sheight = sprite_get_height(_spr);
  15.         draw_sprite_ext(
  16.             _spr, 0,
  17.             i * seat_width - seat_offset * seat_width - lengthdir_x(seat_len, seat_dir + seat_angle) + seat_width / 2 + (room_width - seat_width) / 2 + cam_offx
  18.             - _swidth / 2 + room_width / 2,
  19.             -lengthdir_y(seat_len, seat_dir + seat_angle) + room_height / 2 + cam_offy
  20.             - _sheight / 2 + room_height / 2,
  21.             1, 1,
  22.             seat_angle,
  23.             c_white, 1
  24.         );
  25.     }
  26.    
  27.     var _dial = dialogue[| dialogue_index];
  28.     var _char = characters[? _dial[? "name"]];
  29.    
  30.     if (_char != undefined) {
  31.         draw_set_font(text_font);
  32.        
  33.         var _y = room_height * .79 - text_height - text_name_padding;
  34.        
  35.         if (dialogue_state == 2) {
  36.             var _h = nsd_bullet_height;
  37.             _y = room_height - _h * 2 - _h * ds_list_size(nsd_bullets);
  38.         }
  39.  
  40.         var _full_name = _char[? "full_name"];
  41.         draw_rect(
  42.             0, _y - text_name_padding - 1,
  43.             text_padding * 2 + string_width(_full_name),
  44.             _y + text_height + text_name_padding,
  45.             $100005, .6
  46.         );
  47.         draw_text(text_padding, _y, _full_name);
  48.         if (_dial[? "status"] == "self") _tsurf_color = $f18746;
  49.     }
  50. }
  51.  
  52. #endregion;
  53.  
  54. #region Bullets
  55.  
  56. if (dialogue_state == 2) {
  57.     draw_set_font(text_font);
  58.     var _size = ds_list_size(nsd_bullets);
  59.     var _h = nsd_bullet_height;
  60.     var _sw = sprite_get_width(spr_dr_bullet);
  61.     for (var i = 0; i < _size; i++) {
  62.         var _bullet = nsd_bullets[| i];
  63.         var _str = _bullet[? "name"];
  64.         var _w = string_width(_str);
  65.         var _ihover = nsd_bullet_selected == i;
  66.        
  67.         var _x = 4 + _ihover * 4 + min((nsd_timer - (((_size - i + 2) % _size) * 1.4 + 1) * nsd_bullet_out_time) / nsd_bullet_out_time, 0) * _w;
  68.         var _y = room_height - 4 - ((_size - i + 2) % _size) * _h - text_padding;
  69.        
  70.         draw_sprite(spr_dr_bullet, 0, _x, _y); 
  71.         draw_sprite_ext(
  72.             spr_dr_bullet, 1, _x + 4, _y,
  73.             (_w) / _sw, 1, 0, c_white, 1
  74.         );
  75.         draw_sprite(spr_dr_bullet, 2, _x + _w + 4, _y);
  76.         draw_text_col(_x + 4, _y + 2, _str, _ihover ? $25C8ff : $ffffff);
  77.     }
  78. }
  79.  
  80. #endregion;
  81.  
  82. #region Text Background and Text Surface Variables
  83.  
  84. var _tsx = text_padding;
  85. var _tsy = room_height * .8;
  86. var _tsang = 0;
  87. var _tssiz = 1;
  88.  
  89. if (_dial[? "status"] == "event") { #region Event Background
  90.    
  91.     var _last = text_list[| ds_list_size(text_list) - 1];
  92.     _tsx = (1 - event_timer / event_time) * room_width * .5 + room_width * .125;
  93.     var _sin = sin((event_timer / event_time) * pi);
  94.     draw_set_alpha(min(_sin * 2.3, 1));
  95.     _tsy = (room_height - _last[? "y"] - text_height) / 2;
  96.    
  97.     draw_rect(0, room_height * .5 - _sin * text_height, room_width, room_height * .5 + _sin * text_height, $100205, .6);
  98.    
  99. #endregion;
  100. } else if (dialogue_state == 2) {   #region NSD Text Variables
  101.    
  102.     _tsx   =  lerp(nsd_start_x,    nsd_end_x, 1 - event_timer / event_time) - min(string_width(_dial[? "text"]), room_width - text_padding * 2) / 2;
  103.     _tsy   =  lerp(nsd_start_y,    nsd_end_y, 1 - event_timer / event_time);
  104.     _tsang = (lerp(nsd_start_ang,  nsd_start_ang + angle_difference(nsd_start_ang, nsd_end_ang), 1 - event_timer / event_time) + 360) % 360;
  105.     _tssiz =  lerp(nsd_start_size, nsd_end_size, 1 - event_timer / event_time);
  106.  
  107. #endregion;
  108. } else {                            #region Default Text Background    
  109.    
  110.     draw_rect(0, room_height * .79, room_width, room_height, $100205, .6);
  111.    
  112. #endregion;
  113. }
  114.  
  115. #endregion;
  116.  
  117. #region Text Surface
  118.  
  119. var _floating = dialogue_state == 2 && _dial[? "status"] != "event";
  120. var _len = 0;
  121. var _size = ds_list_size(text_list);
  122. draw_set_font(_dial[? "status"] == "nsd" ? nsd_font : text_font);
  123. text_surf = surface_clear_set(text_surf, room_width - text_padding * 2, room_height * .2, c_black, 0);
  124. for (var i = 0; i < _size; i++) {
  125.     var _text = text_list[| i];
  126.     var _str  = _text[? "text"];
  127.     var _ilen = string_length(_str);
  128.    
  129.     if (_len + _ilen > text_length) {
  130.         _str = string_copy(_str, 0, text_length - _len);
  131.         _size = 0; // to break early, but after iteration
  132.     }
  133.     _len += _ilen;
  134.    
  135.     var _col = _text[? "bulletpoint"] != undefined ? $21c1f2 : _tsurf_color;
  136.     var _tx = _text[? "x"];
  137.     var _ty = _text[? "y"];
  138.     if (_floating) draw_rect(_tx, _ty, _tx + string_width(_str), _ty + nsd_height, c_black, .7);
  139.     draw_text_col(_tx + _floating, _ty + _floating, _str, _col);
  140. }                                                                                    
  141. surface_reset_target();
  142. draw_set_color($ffffff);
  143. draw_set_alpha(1);
  144. draw_set_halign(fa_left);
  145.  
  146. draw_surface_ext(
  147.     text_surf,
  148.     _tsx, _tsy,
  149.     _tssiz, _tssiz,
  150.     _tsang, c_white,
  151.     _floating ? min(sin((1 - event_timer / event_time) * pi) * 62, 1) : 1
  152. );
  153.  
  154. #endregion;
  155.  
  156. #region Cursor
  157.  
  158. // var _text_hover = text_list[| nsd_hover];
  159.  
  160. var _spr = dialogue_state == 2 ? spr_dr_nsd_cursor : spr_dr_cursor
  161. var _offx = sprite_get_xoffset(_spr);
  162. var _offy = sprite_get_yoffset(_spr);
  163. cursor_surf = surface_clear_set(cursor_surf, 32, 32, c_black, 0);
  164. draw_sprite_ext(_spr, 0, _offx, _offy, 1, 1, 360 - (nsd_hover_timer / nsd_hover_time) * 45, c_white, 1);
  165. if (dialogue_state == 2) draw_sprite_ext(_spr, 1, _offx, _offy, 1, 1, ((timer / room_speed) % 1) * 90 * (1 - (nsd_hover_timer / nsd_hover_time)), c_white, 1);
  166. surface_reset_target();
  167. draw_surface_ext(
  168.     cursor_surf,
  169.     (nsd_shoot_timer > 0 ? nsd_shoot_x : mouse_x + cursor_offx) - _offx - (nsd_hover_timer / nsd_hover_time) * 4,
  170.     (nsd_shoot_timer > 0 ? nsd_shoot_y : mouse_y + cursor_offy) - _offy - (nsd_hover_timer / nsd_hover_time) * 4,
  171.     1 + (nsd_hover_timer / nsd_hover_time) * .2,
  172.     1 + (nsd_hover_timer / nsd_hover_time) * .2,
  173.     0,
  174.     merge_color($25C8ff, $0050ff, (nsd_hover_timer / nsd_hover_time)),
  175.     1
  176. );
  177.  
  178. #endregion;
  179.  
  180. #region Hit Bubble
  181.  
  182. var _max = room_speed * .7;
  183. if (nsd_hit_timer >= 0 && nsd_hit_timer < _max) {
  184.    
  185.     var _vcount = 64;
  186.     var _width = nsd_hit_timer * .9 + 15;
  187.     var _rad = nsd_hit_timer * 1.2;
  188.    
  189.     draw_primitive_begin(pr_trianglestrip);
  190.    
  191.     for (var i = 0; i <= _vcount; i++) {
  192.        
  193.         var _ldx = lengthdir_x(1, (i / _vcount) * 360);
  194.         var _ldy = lengthdir_y(1, (i / _vcount) * 360);
  195.        
  196.         draw_vertex_color(
  197.             nsd_shoot_x + _ldx * (_rad),
  198.             nsd_shoot_y + _ldy * (_rad),
  199.             $f713f3,
  200.             .7 - (nsd_hit_timer + 18) / _max
  201.         );
  202.        
  203.         draw_vertex_color(
  204.             nsd_shoot_x + _ldx * (_rad + _width),
  205.             nsd_shoot_y + _ldy * (_rad + _width),
  206.             $a569f4,
  207.             .7 - nsd_hit_timer / _max
  208.         );
  209.     }
  210.    
  211.     draw_primitive_end();
  212. }
  213.  
  214. #endregion;
  215.  
  216. #region Hit Counter Window
  217.  
  218. var _min = room_speed * .5;
  219. if (nsd_hit_timer > _min && nsd_hit_timer < _min + room_speed * 2) {
  220.     draw_sprite(
  221.         spr_dr_counter_tonystr, 0,
  222.         340 - min((nsd_hit_timer - _min) / (room_speed * .2), 1) * 340 -
  223.         ((nsd_hit_timer - _min) / (room_speed)) * 16 -
  224.         clamp((nsd_hit_timer - _min - room_speed * 1.3) / (room_speed * .3), 0, 1) * 340,
  225.         sin((nsd_hit_timer / (room_speed * .045)) * pi) * 1.4
  226.     ); 
  227. }
  228.  
  229. #endregion;
  230.  
  231. #region Counter
  232.  
  233. if (nsd_shoot_timer > 0) {
  234.    
  235.     var _frac = nsd_shoot_timer / nsd_shoot_time;
  236.     var _swidth = sprite_get_width(spr_dr_counter);
  237.     var _x = nsd_shoot_x;
  238.     var _y = nsd_shoot_y;
  239.    
  240.     shader_set(shd_dr_counter);
  241.     var _tex = sprite_get_texture(spr_dr_counter, 0);
  242.     shader_set_uniform_f_array(nsd_uni_uvs, texture_get_uvs(_tex));
  243.     shader_set_uniform_f(nsd_uni_offx, (1 - _frac) * _swidth * texture_get_texel_width(_tex));
  244.     draw_sprite_ext(
  245.         spr_dr_counter, 0,
  246.         _x, _y, // - sprite_get_height(spr_dr_counter) / 2,
  247.         1, 2.8, 340,
  248.         c_white, 1
  249.     );
  250.     shader_reset();
  251. }
  252.  
  253. #endregion;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top