function check_hitstop() { if global.hitstop > 0 return true; else return false; } /// @desc 优雅地检测该实例的sprite当前动画是否到达最后一帧 function animation_end() { if animation_spd == 0 return false; return (image_index + animation_spd >= image_number); } /// @desc 优雅地将该实例的sprite替换为给定值,并将sprite_index归零 /// @param {Asset.GMSprite} _sprite 将要替换为的sprite function set_sprite(_sprite) { if sprite_index != _sprite { sprite_index = _sprite; image_index = 0; } } function camera_snap() { oCamera.x = oCamera.follow.x; oCamera.y = oCamera.follow.y; } /// @desc 触发屏幕震动 /// @param {Real} _magnitude 以像素计算的震动强度 // @param {Real} _frames 以帧计算的持续时间 function screen_shake(_magnitude)//, _duration) { // 只有当新的震动比当前的更强时才覆盖 with(oCamera) { if _magnitude > shake_magnitude { shake_magnitude = _magnitude; //shake_duration = _duration; } } } function player_add_INK(_amount) { if global.playerINK + _amount > global.save_data.player.maxINK global.playerINK = global.save_data.player.maxINK; else global.playerINK += _amount; oUI.flash_timer = 10; oUI.flash_duration = 10; } function player_add_HP(_amount) { if global.playerHP + _amount > global.save_data.player.maxHP global.playerHP = global.save_data.player.maxHP; else global.playerHP += _amount; }