@@ -21,6 +21,8 @@ const FACE := [
" ▀▀██▄▄▄▄▄▄▄▄██▀▀ " ,
]
const NOISE : = " █▓▒░# % @&01 "
# своя випадковість для прикрас: кадри й таймери залежать від швидкості машини, а randf() гри — ні (бот у CI й під Wine грає однаково)
static var rng : = RandomNumberGenerator . new ( )
static func calm ( g : Main ) - > bool :
return g . cfg . get ( " calm " , false )
@@ -59,7 +61,7 @@ static func tick(g: Main, delta: float) -> void:
# рамка тремтить, коли от-от відстежать (не заважаючи трусінню від помилок)
g . shake_t = maxf ( 0.0 , g . shake_t - delta )
if g . shake_t < = 0.0 :
g . ui . position = Vector2 ( randf_range ( - 2.5 , 2.5 ) , randf_range ( - 1.2 , 1.2 ) ) * k * g . threat_v if g . threat_v > 0.7 and randf( ) < 0.12 else Vector2 . ZERO
g . ui . position = Vector2 ( rng . randf_range( - 2.5 , 2.5 ) , rng . randf_range ( - 1.2 , 1.2 ) ) * k * g . threat_v if g . threat_v > 0.7 and rng . randf( ) < 0.12 else Vector2 . ZERO
# візуалізація зламу: які цифри щойно знайдено
if g . crack != null :
if g . crack [ " code " ] != g . cv_code :
@@ -78,19 +80,19 @@ static func tick(g: Main, delta: float) -> void:
var o = g . get_node_or_null ( n )
if o :
o . queue_redraw ( )
if g . call_face != null and is_instance_valid ( g . call_face ) and not calm ( g ) and randf( ) < 0.35 :
if g . call_face != null and is_instance_valid ( g . call_face ) and not calm ( g ) and rng . randf( ) < 0.35 :
g . call_face . text = glitch_lines ( FACE , 0.06 )
g . call_face . position . x = randf_range ( - 3 , 3 ) if randf( ) < 0.3 else 0.0
g . call_face . position . x = rng . randf_range( - 3 , 3 ) if rng . randf( ) < 0.3 else 0.0
static func glitch_lines ( lines : Array , amount : float ) - > String :
var res : = PackedStringArray ( )
for ln in lines :
var s : String = ln
for i in s . length ( ) :
if s [ i ] != " " and randf( ) < amount :
s [ i ] = NOISE [ randi( ) % NOISE . length ( ) ]
if randf( ) < amount * 2 :
s = s . substr ( 1 ) + " " if randf( ) < 0.5 else " " + s . left ( s . length ( ) - 1 )
if s [ i ] != " " and rng . randf( ) < amount :
s [ i ] = NOISE [ rng . randi( ) % NOISE . length ( ) ]
if rng . randf( ) < amount * 2 :
s = s . substr ( 1 ) + " " if rng . randf( ) < 0.5 else " " + s . left ( s . length ( ) - 1 )
res . append ( s )
return " \n " . join ( res )
@@ -226,13 +228,13 @@ static func map_node_fx(g: Main, c: Control) -> void:
var p : Vector2 = g . _mp ( g . map_pos [ e [ 0 ] ] )
var r : float = 12.0 * g . map_scale
var a : = 1.0 - f
var j : = Vector2 ( randf_range ( 2 , 6 ) * a , 0 )
var j : = Vector2 ( rng . randf_range( 2 , 6 ) * a , 0 )
c . draw_circle ( p - j , r , Color ( 1 , 0 , 0.35 , 0.45 * a ) )
c . draw_circle ( p + j , r , Color ( 0 , 1 , 1 , 0.45 * a ) )
var sc : = Color ( 1 , 0.25 , 0.25 , 0.7 * a ) if e [ 2 ] == " burn " else Color ( 0.8 , 1 , 0.85 , 0.7 * a )
for s in 6 :
c . draw_rect ( Rect2 ( p + Vector2 ( randf_range ( - r * 2.2 , 0 ) , randf_range ( - r * 1.6 , r * 1.6 ) ) , Vector2 ( randf_range ( r , r * 3 ) , randf_range ( 1 , 3 ) ) ) , sc )
if randf( ) < 0.5 or f > 0.5 :
c . draw_rect ( Rect2 ( p + Vector2 ( rng . randf_range( - r * 2.2 , 0 ) , rng . randf_range ( - r * 1.6 , r * 1.6 ) ) , Vector2 ( rng . randf_range( r , r * 3 ) , rng . randf_range ( 1 , 3 ) ) ) , sc )
if rng . randf( ) < 0.5 or f > 0.5 :
c . draw_circle ( p , r * 1.05 , Color ( 0 , 0 , 0 , 0.75 * a ) )
# ── ASCII-емблема сервера: симетричний "логотип" 7× 4 з хешу назви ──
@@ -372,7 +374,7 @@ static func _city(gr: Array, lit: float, flicker := false) -> void:
var win : = xx % 2 == 1 and yy % 2 == 1 and xx < bw - 1 and yy < bh - 1
if win :
var on : bool = ( abs ( hash ( gx * 31 + gy * 17 ) ) % 1000 ) / 1000.0 < lit
if flicker and on and randf( ) < 0.05 :
if flicker and on and rng . randf( ) < 0.05 :
on = false
_put ( gr , gx , gy , " █ " if on else " · " , Color ( " #ffdd66 " ) if on else Color ( 0.3 , 0.4 , 0.35 ) )
else :
@@ -395,7 +397,7 @@ static func _scene(id: String, t: float) -> Array:
" end_silence " : # ботоферма замовкає, місто гасне
_city ( gr , 1.0 - p )
for r in 6 :
var on : bool = randf( ) < 0.6 and p < 0.55 + r * 0.05
var on : bool = rng . randf( ) < 0.6 and p < 0.55 + r * 0.05
_put ( gr , W - 9 , 2 + r * 2 , " [ " + ( " ■ " if on else " □ " ) + " ■■] " , Color ( " #ff5555 " ) if on else Color ( 0.3 , 0.3 , 0.3 ) )
if p > = 1.0 :
_put ( gr , 4 , 3 , " _ " if int ( t * 2 ) % 2 == 0 else " " , Color ( " #33ff66 " ) )
@@ -449,7 +451,7 @@ static func _scene(id: String, t: float) -> Array:
var gone : bool = ( abs ( hash ( xx * 11 + i * 7 ) ) % 100 ) / 100.0 * 0.6 + ( fig . size ( ) - i ) / float ( fig . size ( ) ) * 0.4 < p
if s [ xx ] != " " and not gone :
_put ( gr , ( W - s . length ( ) ) / 2 + xx , fy + i , s [ xx ] , Color ( 0.75 , 0.85 , 0.8 ) )
elif s [ xx ] != " " and p < 1.0 and randf( ) < 0.3 :
elif s [ xx ] != " " and p < 1.0 and rng . randf( ) < 0.3 :
_put ( gr , ( W - s . length ( ) ) / 2 + xx , fy + i , " ░ " , Color ( 0.4 , 0.5 , 0.45 ) )
" end_zero " : # обличчя глітчить, гасне, як старий телевізор, і вранці місто світиться
if t < 2.0 :